{
String postUrl = rj.getPostUrl();
doHttpReq(Stage.SUBMIT, rj, postUrl);
+ wsInfo.invalidate();
}
/**
{
System.err.println("Debug RestJob: Posting Job");
doPost((RestJob) job);
- } catch (Exception ex)
+ }
+ catch (NoValidInputDataException erex)
+ {
+ job.setSubjobComplete(true);
+ job.setSubmitted(true);
+ ((RestJob)job).statMessage="<br>It looks like there was a problem with the data sent to the service :<br>"+erex.getMessage()+"\n";
+ ((RestJob)job).error=true;
+
+ }
+ catch (Exception ex)
{
job.setSubjobComplete(true);
job.setAllowedServerExceptions(-1);
*/
if (true)
{
- wsInfo.setViewResultsImmediatly(false);
+ // preserver current jalview behaviour
+ wsInfo.setViewResultsImmediatly(true);
}
else
{
else
{
// tell the user nothing was returned.
+ wsInfo.setStatus(wsInfo.STATE_STOPPED_ERROR);
+ wsInfo.setFinishedNoResults();
}
}
AlignmentI destal;
ColumnSelection destcs;
String alTitle = restClient.service.details.Action + " using "
- + restClient.service.details.Name + " on "
- + " whatever you clicked on." + "(set " + als + ")";
+ + restClient.service.details.Name + " on "+restClient.viewTitle;
switch (action)
{
case newAlignment:
* i++) { af.addSortByOrderMenuItem( WebServiceName + ((String)
* names.get(i)) + " Ordering", (AlignmentOrder) alorders.get(i)); } } }
*/
+ // TODO: modify this and previous alignment's title if many alignments have been returned.
Desktop.addInternalFrame(destaf, alTitle, AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
break;
case newView:
-
+ // TODO: determine title for view
break;
case currentView:
break;
*/
public boolean isValid()
{
+ ArrayList<String> _warnings=new ArrayList<String>();
+ boolean validt=true;
if (jobs != null)
{
for (RestJob rj : (RestJob[]) jobs)
{
// invalid input for this job
System.err.println("Job " + rj.getJobnum()
- + " has invalid input.");
- return false;
+ + " has invalid input. ( "+rj.getStatus()+")");
+ if (rj.hasStatus() && !_warnings.contains(rj.getStatus()))
+ {
+ _warnings.add(rj.getStatus());
+ }
+ validt=false;
+ }
+ }
+ }
+ if (!validt)
+ {
+ warnings = "";
+ for (String st : _warnings) {
+ if (warnings.length()>0) { warnings+="\n";
}
+ warnings += st;
+
}
- return true;
}
+ return validt;
+ }
+
+ protected String warnings;
+ public boolean hasWarnings()
+ {
// TODO Auto-generated method stub
- return false;
+ return warnings!=null && warnings.length()>0;
+ }
+
+ /**
+ * get any informative messages about why the job thread couldn't start.
+ * @return
+ */
+ public String getWarnings()
+ {
+ return isValid() ? "Job can be started. No warnings." : hasWarnings() ? warnings : "";
}
}