use new stemma util interface; configure correct IDP server. Fixes #31
[scpubgit/stemmaweb.git] / lib / stemmaweb / Controller / Stexaminer.pm
index 535bd29..ff4f69b 100644 (file)
@@ -9,6 +9,17 @@ use Text::Tradition::Stemma;
 
 BEGIN { extends 'Catalyst::Controller' }
 
+has idp_solver_url => (
+       is => 'ro',
+       isa => 'Str',
+       predicate => 'has_idp_solver_url',
+       );
+
+has idp_calcdsn => (
+       is => 'ro',
+       isa => 'Str',
+       predicate => 'has_idp_calcdsn',
+       );
 
 =head1 NAME
 
@@ -44,7 +55,11 @@ sub index :Path :Args(2) {
        my $ok = _check_permission( $c, $tradition );
        return unless $ok;
        
-       if( $tradition->stemma_count ) {
+       if( $stemid eq 'help' ) {
+               # Just show the 'Help/About' popup.
+               $c->stash->{template} = 'stexaminer_help.tt';
+               $c->stash->{text_id} = $textid;
+       } elsif( $tradition->stemma_count ) {
                my $stemma = $tradition->stemma( $stemid );
                my $svgstr = $stemma->as_svg();
                $svgstr =~ s/\n/ /g;
@@ -68,8 +83,12 @@ sub index :Path :Args(2) {
                } elsif( $ignore_sort eq 'orthographic' ) {
                        $analysis_options{'merge_types'} = 'orthographic';
                }
+               if( $self->has_idp_solver_url ) {
+                       $analysis_options{'solver_url'} = $self->idp_solver_url;
+               } elsif( $self->has_idp_calcdsn ) {
+                       $analysis_options{'calcdsn'} = $self->idp_calcdsn;
+               }
 
-               # Do the deed
                my $t = run_analysis( $tradition, %analysis_options );
                # Stringify the reading groups
                foreach my $loc ( @{$t->{'variants'}} ) {