Re-design the ServiceStatus JSP page
[jabaws.git] / webservices / compbio / ws / server / WSUtil.java
index e6dd02d..07d005d 100644 (file)
@@ -111,6 +111,7 @@ public final class WSUtil {
                reportUsage(confExec, logger);\r
                return jobId;\r
        }\r
+       \r
 \r
        static <T> void reportUsage(ConfiguredExecutable<T> confExec, Logger logger) {\r
                if (GAUtils.IS_GA_ENABLED) {\r
@@ -128,13 +129,31 @@ public final class WSUtil {
                        throw LimitExceededException.newLimitExceeded(limit, sequences);\r
                }\r
                log.debug("Method: " + method + " with task: " + confExec.getTaskId());\r
-\r
                compbio.runner.Util.writeInput(sequences, confExec);\r
                AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
                String jobId = engine.submitJob(confExec);\r
                reportUsage(confExec, log);\r
                return jobId;\r
        }\r
+       \r
+       // Same as analize but Alifold takes clustal input not fasta\r
+       // An if condition in the above method might be a better solution but \r
+       // you need a way of finding out the type of confExec at runtime\r
+       \r
+       public static <T> String fold(List<FastaSequence> sequences,\r
+                       ConfiguredExecutable<T> confExec, Logger log, String method,\r
+                       Limit<T> limit) throws JobSubmissionException {\r
+               if (limit != null && limit.isExceeded(sequences)) {\r
+                       throw LimitExceededException.newLimitExceeded(limit, sequences);\r
+               }\r
+               log.debug("Method: " + method + " with task: " + confExec.getTaskId());\r
+               // This line is different from the above method\r
+               compbio.runner.Util.writeClustalInput(sequences, confExec, '-');\r
+               AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
+               String jobId = engine.submitJob(confExec);\r
+               reportUsage(confExec, log);\r
+               return jobId;\r
+       }\r
 \r
        /*\r
         * TODO Rewrite using purely CommandBuilder. This is breaking encapsulation\r
@@ -191,9 +210,11 @@ public final class WSUtil {
                AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
                ConfiguredExecutable<T> aacon = (ConfiguredExecutable<T>) asyncEngine.getResults(jobId);\r
                ScoreManager mas = aacon.getResults();\r
+               \r
                log.trace(jobId + " getConservation : " + mas);\r
                return mas;\r
        }\r
+       \r
 \r
        /*\r
         * UNUSED\r