| Pangloss documentation | Contained in the Pangloss distribution. |
Pangloss::Segment::AddConcept - add concept.
$pipe->add_segment( Pangloss::Segment::AddConcept->new )
This class inherits its interface from Pipeline::Segment.
On dispatch(), if the request has an 'add_concept' argument, attempts to add the concept and return the resulting view or error.
Steve Purkis <spurkis@quiup.com>
| Pangloss documentation | Contained in the Pangloss distribution. |
package Pangloss::Segment::AddConcept; use Pangloss::Concept; use base qw( Pipeline::Segment ); our $VERSION = ((require Pangloss::Version), $Pangloss::VERSION)[1]; our $REVISION = (split(/ /, ' $Revision: 1.8 $ '))[2]; sub dispatch { my $self = shift; my $request = $self->store->get('OpenFrame::Request') || return; my $app = $self->store->get('Pangloss::Application') || return; my $concept = $self->store->get('Pangloss::Concept') || return; my $view = $self->store->get('Pangloss::Application::View'); my $args = $request->arguments; if ($args->{add_concept}) { $self->emit( "adding concept " . $concept->name ); return $app->concept_editor->add( $concept, $view ); } } 1; __END__ #------------------------------------------------------------------------------