sub query :Local :Args(1) {
my( $self, $c, $jobid ) = @_;
my $ua = LWP::UserAgent->new();
- my $resp = $ua->get( $STEMWEB_BASE_URL . "/jobstatus/$jobid" );
+ my $resp = $ua->get( $STEMWEB_BASE_URL . "/algorithms/jobstatus/$jobid" );
if( $resp->is_success ) {
# Process it
my $response = decode_utf8( $resp->content );
# TODO: Maybe get Stemweb to pass back the tradition ID...
my $m = $c->model('Directory');
my @traditions;
+ ## STUPID HACK: unless we load the possible tradition owners
+ ## within scope of the scan, they will not exist when the affected
+ ## tradition is saved.
+ my @users;
$m->scan( sub{ push( @traditions, $_[0] )
if $_[0]->$_isa('Text::Tradition')
&& $_[0]->has_stemweb_jobid
&& $_[0]->stemweb_jobid eq $answer->{job_id};
+ push( @users, $_[0] ) if $_[0]->$_isa('Text::Tradition::User');
} );
if( @traditions == 1 ) {
my $tradition = shift @traditions;
name => $_->identifier,
directed => _json_bool( !$_->is_undirected ),
svg => $_->as_svg() } }
- $stemmata;
+ @$stemmata;
$c->stash->{'result'} = {
'status' => 'success',
'stemmata' => \@steminfo };
position: relative;
top: 15px;
}
-#run_stexaminer, #run_relater, #open_stemma_add, #open_stemma_edit, #open_stemweb_ui {
+#run_stexaminer, #run_relater, #open_stemma_add, #open_stemma_edit, #open_stemweb_ui, #query_stemweb_ui {
height: 32px;
}
#stemma_pager {
#new_file_label {
float: left;
padding-right: 8px;
-}
\ No newline at end of file
+}
if( editable ) {
if( selectedTextInfo.stemweb_jobid == 0 ) {
$('#open_stemweb_ui').show();
+ $('#query_stemweb_ui').hide();
} else {
$('#query_stemweb_ui').show();
+ $('#open_stemweb_ui').hide();
}
}
if( idx > -1 ) {
// Look for a status message, either success, running, or notfound.
if( data.status === 'success' ) {
// Add the new stemmata to the textinfo and tell the user.
+ selectedTextInfo.stemweb_jobid = 0;
if( data.stemmata.length > 0 ) {
stemmata = stemmata.concat( data.stemmata );
if( selectedStemmaID == -1 ) {
// We have a stemma for the first time; load the first one.
- load_stemma( 0 );
+ load_stemma( 0, true );
}
alert( 'You have one or more new stemmata!' );
} else {
// Job ID is in data.jobid. TODO do something with it.
$(evt.target).button("enable");
$('#stemma-edit-dialog').dialog('close');
+ // Reload the current stemma to rejigger the buttons
+ load_stemma( selectedStemmaID, true );
}, 'json' );
},
Cancel: function() {
$dir->store( $t3 );
my $t4 = Text::Tradition->new( input => 'Self', file => 't/data/collatecorr.xml' );
$t4->public( 1 );
+$t4->set_stemweb_jobid( '16' );
$user->add_tradition( $t4 );
$dir->store( $t4 );
$dir->store( $user );