diff --git a/.gitignore b/.gitignore index 9a2a6fa2..eb3b41fa 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,98 @@ portal/src/main/webapp/lib/plupload portal/src/main/webapp/lib/extjs bin *.iml +# Created by https://www.toptal.com/developers/gitignore/api/maven +# Edit at https://www.toptal.com/developers/gitignore?templates=maven + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +# Eclipse m2e generated files +# Eclipse Core +.project +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# End of https://www.toptal.com/developers/gitignore/api/maven + +# Created by https://www.toptal.com/developers/gitignore/api/eclipse +# Edit at https://www.toptal.com/developers/gitignore?templates=eclipse + +### Eclipse ### +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### Eclipse Patch ### +# Spring Boot Tooling +.sts4-cache/ + +# End of https://www.toptal.com/developers/gitignore/api/eclipse + diff --git a/.project b/.project index d8a10892..2321df16 100644 --- a/.project +++ b/.project @@ -14,4 +14,15 @@ org.eclipse.m2e.core.maven2Nature + + + 1683829391599 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/.vscode/settings.json b/.vscode/settings.json index e0f15db2..99312c2e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "java.configuration.updateBuildConfiguration": "automatic" -} \ No newline at end of file + "java.configuration.updateBuildConfiguration": "automatic", + "java.compile.nullAnalysis.mode": "automatic" +} diff --git a/core/.project b/core/.project index 665fd9ea..5663219d 100644 --- a/core/.project +++ b/core/.project @@ -14,4 +14,15 @@ org.eclipse.m2e.core.maven2Nature + + + 1683829391604 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/core/pom.xml.versionsBackup b/core/pom.xml.versionsBackup deleted file mode 100644 index 13ca4ff6..00000000 --- a/core/pom.xml.versionsBackup +++ /dev/null @@ -1,101 +0,0 @@ - - - 4.0.0 - edu.isi.wings - wings-core - 4.2.6 - Wings Core - pom - Wings project for the IKCAP group - http://www.wings-workflows.org - - USC/Information Sciences Institute - http://www.isi.edu - - - - 4.2.5 - 1.8 - 1.8 - - - - - varunr - Varun Ratnakar - varunr@isi.edu - http://www.isi.edu/~varunr - ISI - http://www.isi.edu - - Researcher - Developer - - 0 - - - dgarijo - Daniel Garijo - dgarijo@fi.upm.es - UPM - http://mayor2.dia.fi.upm.es/oeg-upm/ - - Researcher - Developer - - 1 - - - moody - Joshua Moody - moody@isi.edu - ISI - http://www.isi.edu - - Researcher - Developer - - -8 - - - cfritz - Christian Fritz - cfritz@isi.edu - http://www.cs.toronto.edu/~fritz/ - ISI - http://www.isi.edu - - Post Doc - Researcher - Developer - - -8 - - - jihie - Jihie Kim - jihie@isi.edu - http://www.isi.edu/~jihie/ - ISI - http://www.isi.edu - - Professor Computer Science - Researcher - Developer - - -8 - - - - - - github - GitHub OWNER Apache Maven Packages - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/wings - - - - diff --git a/docker-compose.yml b/docker-compose.yml index 3edf03cb..cf3eb261 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,10 @@ -version: '3' +version: "3" services: wings: image: "ikcap/wings:latest" + build: + context: . + dockerfile: wings-docker/docker/default/Dockerfile environment: WINGS_MODE: dind volumes: diff --git a/engines/oodt/wmservices/src/main/java/org/apache/oodt/cas/wmservices/resources/WorkflowResource.java b/engines/oodt/wmservices/src/main/java/org/apache/oodt/cas/wmservices/resources/WorkflowResource.java index 32d6aac6..4a3c4c08 100644 --- a/engines/oodt/wmservices/src/main/java/org/apache/oodt/cas/wmservices/resources/WorkflowResource.java +++ b/engines/oodt/wmservices/src/main/java/org/apache/oodt/cas/wmservices/resources/WorkflowResource.java @@ -48,7 +48,7 @@ /** * Jax-RS server functions for adding/deleting workflows - * + * * @author vratnakar */ public class WorkflowResource extends Resource { @@ -63,7 +63,7 @@ public WorkflowResource() { /** * Add Packaged Repository Workflow - * + * * @param workflowID * id of the workflow * @param workflowXML @@ -93,7 +93,7 @@ public boolean addPackagedRepositoryWorkflow( /** * Delete Packaged Repository Workflow - * + * * @param workflowID * id of the workflow to delete * @return true if deletion successful diff --git a/planner/.classpath b/planner/.classpath index 16d4af0d..94fadc55 100644 --- a/planner/.classpath +++ b/planner/.classpath @@ -9,8 +9,9 @@ - + + @@ -28,7 +29,29 @@ - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/planner/.project b/planner/.project index 80220c1d..c59db190 100644 --- a/planner/.project +++ b/planner/.project @@ -33,4 +33,15 @@ org.eclipse.m2e.core.maven2Nature org.eclipse.wst.common.project.facet.core.nature + + + 1683829391606 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/planner/.settings/org.eclipse.jdt.core.prefs b/planner/.settings/org.eclipse.jdt.core.prefs index cac0df4d..26aef1a5 100644 --- a/planner/.settings/org.eclipse.jdt.core.prefs +++ b/planner/.settings/org.eclipse.jdt.core.prefs @@ -7,5 +7,6 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.processAnnotations=enabled org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 diff --git a/planner/pom.xml b/planner/pom.xml index cdafd6ea..d2337291 100644 --- a/planner/pom.xml +++ b/planner/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 wings-planner Wings Planner @@ -55,15 +56,6 @@ - - - github - Github - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/ontapi - - - - diff --git a/planner/pom.xml.versionsBackup b/planner/pom.xml.versionsBackup deleted file mode 100644 index 18eea3bc..00000000 --- a/planner/pom.xml.versionsBackup +++ /dev/null @@ -1,142 +0,0 @@ - - - 4.0.0 - wings-planner - Wings Planner - jar - Wings project for the IKCAP group - - - edu.isi.wings - wings-core - 4.2.6 - ../core/pom.xml - - - - 0.1.53 - 1.2.4 - 0.8.11 - 2.2.4 - 4.5 - 1.7.25 - 2.3.0 - 10.10.1.1 - 2.4 - 1.0.9 - 1.10 - - UTF-8 - UTF-8 - 1.8 - 1.8 - - - - - - src/main/resources - - - src/test/resources - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.16 - - false - 1 - - - - - - - - github - Github - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/ontapi - - - - - - - - - junit - junit - ${junit.version} - test - - - - - org.slf4j - slf4j-log4j12 - ${slf4j-log4j.version} - - - - - javax.xml.bind - jaxb-api - ${jaxb.version} - - - - - edu.isi.kcap - ontapi - 1.2.4 - - - - - com.google.code.gson - gson - ${gson.version} - - - - - - - - org.gridkit.lab - nanocloud - ${nanocloud.version} - - - - - urbanophile - java-getopt - ${java-getopt.version} - - - - - commons-configuration - commons-configuration - ${commons-configuration.version} - - - - - commons-io - commons-io - ${commons-io.version} - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index ade41583..0f924f1c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,5 @@ - 4.0.0 @@ -14,7 +15,7 @@ 5.4.2 core/pom.xml - + UTF-8 @@ -25,15 +26,7 @@ GitHub OWNER Apache Maven Packages https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/wings - - - - - github - Github - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/ontapi - - + core @@ -43,4 +36,4 @@ - + \ No newline at end of file diff --git a/pom.xml.versionsBackup b/pom.xml.versionsBackup deleted file mode 100644 index 1b867eb9..00000000 --- a/pom.xml.versionsBackup +++ /dev/null @@ -1,46 +0,0 @@ - - 4.0.0 - - wings - Wings - http://www.wings-workflows.org - Wings project for the IKCAP group - pom - - - edu.isi.wings - wings-core - 4.2.6 - core/pom.xml - - - - UTF-8 - - - - - github - GitHub OWNER Apache Maven Packages - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/wings - - - - - - github - Github - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/ontapi - - - - - core - planner - portal - - - - - diff --git a/portal.properties b/portal.properties index dace1762..07ca0d91 100644 --- a/portal.properties +++ b/portal.properties @@ -8,7 +8,7 @@ server = http://localhost:8080; graphviz = /usr/bin/dot; light-reasoner = false; - ontology = + ontology = { data = http://www.wings-workflows.org/ontology/data.owl; component = http://www.wings-workflows.org/ontology/component.owl; @@ -16,16 +16,16 @@ execution = http://www.wings-workflows.org/ontology/execution.owl; } - execution = + execution = { - engine = + engine = { name = Local; implementation = edu.isi.wings.execution.engine.api.impl.local.LocalExecutionEngine; type = BOTH; } - engine = + engine = { name = Distributed; implementation = edu.isi.wings.execution.engine.api.impl.distributed.DistributedExecutionEngine; @@ -44,8 +44,8 @@ password = "password"; } triple-store = { - publish = http://ontosoft.isi.edu:3030/provenance/data; - query = http://ontosoft.isi.edu:3030/provenance/sparql; + publish = https://endpoint.mint.isi.edu/provenance/data; + query = https://endpoint.mint.isi.edu/provenance/sparql; domains-directory = /opt/wings/storage/default; } } diff --git a/portal/.classpath b/portal/.classpath index e4f3f86f..c2153bf1 100644 --- a/portal/.classpath +++ b/portal/.classpath @@ -9,6 +9,7 @@ + @@ -21,12 +22,29 @@ - - + + + + + + - + + + + + + + + + + + + + + diff --git a/portal/.project b/portal/.project index 5c338bfc..51da256b 100644 --- a/portal/.project +++ b/portal/.project @@ -34,4 +34,15 @@ org.eclipse.wst.common.project.facet.core.nature org.eclipse.wst.jsdt.core.jsNature + + + 1683829391608 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/portal/.settings/org.eclipse.jdt.core.prefs b/portal/.settings/org.eclipse.jdt.core.prefs index fbf1aacf..7fdcd9c8 100644 --- a/portal/.settings/org.eclipse.jdt.core.prefs +++ b/portal/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,12 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -11,6 +14,11 @@ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.processAnnotations=enabled +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/portal/pom.xml b/portal/pom.xml index d73d40e1..2228f7c4 100644 --- a/portal/pom.xml +++ b/portal/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 wings-portal Wings Portal @@ -16,23 +17,15 @@ - 1.2.4 + 1.2.6 2.5 4.5.2 2.27 2.8.6 1.1.0.Final - 1.3.3 + 1.3.3 - - - github - Github - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/WINGS-OPMW-Mapper - - - @@ -63,7 +56,7 @@ - edu.isi.wings + edu.isi.kcap.wings wings-opmm ${wings-opmm.version} @@ -175,9 +168,9 @@ - org.apache.maven.plugins - maven-war-plugin - 3.3.1 + org.apache.maven.plugins + maven-war-plugin + 3.3.1 diff --git a/portal/pom.xml.versionsBackup b/portal/pom.xml.versionsBackup deleted file mode 100644 index 9d921cd5..00000000 --- a/portal/pom.xml.versionsBackup +++ /dev/null @@ -1,212 +0,0 @@ - - - 4.0.0 - wings-portal - Wings Portal - war - Wings portal web application - - - edu.isi.wings - wings-core - 4.2.6 - ../core/pom.xml - - - - - 1.2.4 - 2.5 - 4.5.2 - 2.27 - 2.8.6 - 1.1.0.Final - 1.3.3 - - - - - github - Github - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/WINGS-OPMW-Mapper - - - - - - - edu.isi.wings - wings-planner - ${project.parent.version} - - - - - - - - - - - edu.isi.wings - wings-opmm - ${wings-opmm.version} - - - - - commons-fileupload - commons-fileupload - ${commons-fileupload.version} - - - - - org.glassfish.jersey.containers - jersey-container-servlet - ${jersey.version} - - - org.glassfish.jersey.inject - jersey-hk2 - ${jersey.version} - - - javax.activation - activation - 1.1.1 - - - - javax.validation - validation-api - ${javax.validation.version} - - - - org.glassfish.jersey.media - jersey-media-multipart - ${jersey.version} - - - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey.version} - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson.version} - - - - - - - - org.apache.tika - tika-core - 1.22 - - - - - javax.servlet - servlet-api - ${servlet-api.version} - provided - - - org.apache.tomcat - tomcat-catalina - 7.0.55 - provided - - - - - org.apache.httpcomponents - httpclient - ${httpclient.version} - - - org.apache.httpcomponents - httpmime - ${httpclient.version} - - - org.asynchttpclient - async-http-client - 2.7.0 - - - - - - - - org.codehaus.mojo - tomcat-maven-plugin - 1.1 - - 9090 - /wings-portal - - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.7 - - - generate-sources - generate-sources - - - - - - - run - - - - clean - clean - - - - - - - run - - - - - - - - \ No newline at end of file diff --git a/portal/src/main/java/edu/isi/wings/portal/controllers/RunController.java b/portal/src/main/java/edu/isi/wings/portal/controllers/RunController.java index 4067455d..f74d8284 100644 --- a/portal/src/main/java/edu/isi/wings/portal/controllers/RunController.java +++ b/portal/src/main/java/edu/isi/wings/portal/controllers/RunController.java @@ -17,39 +17,25 @@ package edu.isi.wings.portal.controllers; - import java.io.*; -import java.net.HttpURLConnection; -import java.net.URL; +import java.net.MalformedURLException; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import java.util.regex.Pattern; - import javax.servlet.ServletContext; import javax.ws.rs.core.Response; -import edu.isi.wings.opmm.Catalog; import edu.isi.wings.portal.classes.config.Publisher; -import edu.isi.wings.portal.classes.config.ServerDetails; import edu.isi.wings.portal.classes.util.ComponentExecutingThread; import edu.isi.wings.portal.classes.util.PlanningAPIBindings; import edu.isi.wings.portal.classes.util.PlanningAndExecutingThread; import edu.isi.wings.portal.classes.util.TemplateBindings; import org.apache.commons.io.FileUtils; -import org.apache.http.HttpResponse; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.methods.HttpPut; import org.apache.http.cookie.Cookie; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; - -import edu.isi.wings.opmm.WorkflowExecutionExport; -import edu.isi.wings.opmm.WorkflowTemplateExport; import edu.isi.kcap.ontapi.KBTriple; +import edu.isi.kcap.wings.opmm.WorkflowExecutionExport; import edu.isi.wings.catalog.component.ComponentFactory; import edu.isi.wings.catalog.data.DataFactory; import edu.isi.wings.catalog.resource.ResourceFactory; @@ -57,7 +43,6 @@ import edu.isi.wings.common.UuidGen; import edu.isi.wings.execution.engine.api.PlanExecutionEngine; import edu.isi.wings.execution.engine.classes.RuntimeInfo; -import edu.isi.wings.execution.engine.classes.RuntimeInfo.Status; import edu.isi.wings.execution.engine.classes.RuntimePlan; import edu.isi.wings.execution.engine.classes.RuntimeStep; import edu.isi.wings.execution.tools.api.ExecutionMonitorAPI; @@ -92,28 +77,32 @@ public class RunController { public static HashMap apiBindings = new HashMap(); public RunController(Config config) { + if (config == null) + System.out.println("Config is null"); this.config = config; this.json = JsonHandler.createRunGson(); this.props = config.getProperties(); this.dataUrl = config.getUserDomainUrl() + "/data"; this.templateUrl = config.getUserDomainUrl() + "/workflows"; - + if (executor == null) { - //System.out.println("Parallel:" + config.getPlannerConfig().getParallelism()); + // System.out.println("Parallel:" + config.getPlannerConfig().getParallelism()); executor = Executors.newFixedThreadPool(config.getPlannerConfig().getParallelism()); } } - + public void end() { } /** * Get the run list json. + * * @param pattern optional, a pattern to filter - * @param status optional, a pattern to filter complete runs - * @param start optional, start offset (for paging) (set to -1 to ignore) - * @param limit optional, number of runs to return (for paging) (set to -1 to ignore) + * @param status optional, a pattern to filter complete runs + * @param start optional, start offset (for paging) (set to -1 to ignore) + * @param limit optional, number of runs to return (for paging) (set to -1 to + * ignore) * @return */ public String getRunListJSON(String pattern, String status, int start, int limit) { @@ -122,12 +111,11 @@ public String getRunListJSON(String pattern, String status, int start, int limit boolean fasterQuery = numberOfRuns > 1000; result.put("success", true); result.put("results", numberOfRuns); - result.put("rows", this.getRunList(pattern, status, start, limit, fasterQuery)); + result.put("rows", this.getRunList(pattern, status, start, limit, fasterQuery)); return json.toJson(result); } - - public String getRunListSimpleJSON(String pattern, String status, int start, int limit, Date started_after) { + public String getRunListSimpleJSON(String pattern, String status, int start, int limit, Date started_after) { HashMap result = new HashMap(); result.put("success", true); result.put("results", this.getNumberOfRuns(pattern, status, started_after)); @@ -135,7 +123,7 @@ public String getRunListSimpleJSON(String pattern, String status, int start, in return json.toJson(result); } - public ArrayList> getRunListSimple(String pattern, String status, + public ArrayList> getRunListSimple(String pattern, String status, int start, int limit, Date started_after) { ExecutionMonitorAPI monitor = config.getDomainExecutionMonitor(); ArrayList> list = new ArrayList>(); @@ -149,18 +137,17 @@ public ArrayList> getRunListSimple(String pattern, Strin return list; } - - public ArrayList> getRunList(String pattern, String status, int start, int limit, + public ArrayList> getRunList(String pattern, String status, int start, int limit, boolean fasterQuery) { ExecutionMonitorAPI monitor = config.getDomainExecutionMonitor(); ArrayList> list = new ArrayList>(); for (RuntimePlan exe : monitor.getRunList(pattern, status, start, limit, fasterQuery)) { HashMap map = new HashMap(); - + map.put("runtimeInfo", exe.getRuntimeInfo()); map.put("template_id", exe.getOriginalTemplateID()); map.put("id", exe.getID()); - + if (exe.getQueue() != null) { int numtotal = exe.getQueue().getAllSteps().size(); int numdone = exe.getQueue().getFinishedSteps().size(); @@ -178,7 +165,7 @@ public ArrayList> getRunList(String pattern, String stat } return list; } - + public int getNumberOfRuns(String pattern, String status, Date started_after) { ExecutionMonitorAPI monitor = config.getDomainExecutionMonitor(); return monitor.getNumberOfRuns(pattern, status, started_after); @@ -222,7 +209,7 @@ public String getRunJSON(String runid) { return json.toJson(returnmap); } - + public String getRunPlanJSON(String runid) { ExecutionMonitorAPI monitor = config.getDomainExecutionMonitor(); RuntimePlan planexe = monitor.getRunDetails(runid); @@ -231,35 +218,36 @@ public String getRunPlanJSON(String runid) { private String getPublishedURL(String runid) { Publisher publisher = config.getPublisher(); - if(publisher == null) + if (publisher == null) return null; /* TODO: Return already published url for the run id if possible */ /* - Mapper opmm = new Mapper(); - String tstoreurl = publisher.getTstorePublishUrl(); - String puburl = publisher.getUrl(); - opmm.setPublishExportPrefix(puburl); - - String rname = runid.substring(runid.indexOf('#') + 1); - String runurl = opmm.getRunUrl(rname); - - // Check if run already published - if (graphExists(tstoreurl, runurl)) - return runurl;*/ + * Mapper opmm = new Mapper(); + * String tstoreurl = publisher.getTstorePublishUrl(); + * String puburl = publisher.getUrl(); + * opmm.setPublishExportPrefix(puburl); + * + * String rname = runid.substring(runid.indexOf('#') + 1); + * String runurl = opmm.getRunUrl(rname); + * + * // Check if run already published + * if (graphExists(tstoreurl, runurl)) + * return runurl; + */ return null; } private Map getShortConstraints(Template tpl) { Map varbindings = new HashMap(); - for(Variable v : tpl.getVariables()) { + for (Variable v : tpl.getVariables()) { List constraints = new ArrayList(); - if(v.isParameterVariable()) + if (v.isParameterVariable()) continue; - for(KBTriple t : tpl.getConstraintEngine().getConstraints(v.getID())) { + for (KBTriple t : tpl.getConstraintEngine().getConstraints(v.getID())) { Map cons = new HashMap(); - if(t.getPredicate().getName().equals("hasDataBinding")) + if (t.getPredicate().getName().equals("hasDataBinding")) continue; cons.put("p", t.getPredicate().getName()); cons.put("o", t.getObject()); @@ -269,27 +257,27 @@ private Map getShortConstraints(Template tpl) { } return varbindings; } - + public String deleteRuns(String rjson, ServletContext context) { HashMap ret = new HashMap(); ret.put("success", false); JsonElement listel = new JsonParser().parse(rjson); if (listel == null) return json.toJson(ret); - - if(listel.isJsonObject()) { + + if (listel.isJsonObject()) { return this.deleteRun(rjson, context); } - + ExecutionMonitorAPI monitor = config.getDomainExecutionMonitor(); - + JsonArray list = listel.getAsJsonArray(); - for(int i=0; i expandAndRunTemplate(TemplateBindings template_bindings, ServletContext context) { // Create a runid String ex_prefix = props.getProperty("domain.executions.dir.url"); String template_id = template_bindings.getTemplateId(); - + PlanningAPIBindings apis = null; - if(apiBindings.containsKey(ex_prefix)) { + if (apiBindings.containsKey(ex_prefix)) { apis = apiBindings.get(ex_prefix); - } - else { + } else { apis = new PlanningAPIBindings(props); apiBindings.put(ex_prefix, apis); } - + // Submit the planning and execution thread try { - PlanningAndExecutingThread thread = new PlanningAndExecutingThread(ex_prefix, template_id, + PlanningAndExecutingThread thread = new PlanningAndExecutingThread(ex_prefix, template_id, this.config, config.getPlannerConfig().getMaxQueueSize(), template_bindings, apis, executor, context); executor.submit(thread).get(); - + // Return the runids return thread.getRunids(); - } - catch(Exception e) { + } catch (Exception e) { e.printStackTrace(); return null; } } - - public Future runComponent(String cid, HashMap role_bindings, + + public Future runComponent(String cid, HashMap role_bindings, String callbackUrl, Cookie[] callbackCookies, ServletContext context) { PlanningAPIBindings apis = null; String exPrefix = props.getProperty("domain.executions.dir.url"); - if(apiBindings.containsKey(exPrefix)) { + if (apiBindings.containsKey(exPrefix)) { apis = apiBindings.get(exPrefix); - } - else { + } else { apis = new PlanningAPIBindings(props); apiBindings.put(exPrefix, apis); } - + // Submit the planning and execution thread - return executor.submit(new ComponentExecutingThread(cid, this.config, role_bindings, apis, callbackUrl, callbackCookies)); + return executor + .submit(new ComponentExecutingThread(cid, this.config, role_bindings, apis, callbackUrl, callbackCookies)); } - + public static void invalidateCachedAPIs() { apiBindings.clear(); } public String runExpandedTemplate(String origtplid, String templatejson, - String consjson, String seedjson, String seedconsjson, String callbackUrl, + String consjson, String seedjson, String seedconsjson, String callbackUrl, ServletContext context) { Gson json = JsonHandler.createTemplateGson(); @@ -397,11 +382,11 @@ public String runExpandedTemplate(String origtplid, String templatejson, return createPlan(origtplid, context, xtpl, seedtpl, callbackUrl); } - private String createPlan(String origtplid, + private String createPlan(String origtplid, ServletContext context, Template xtpl, Template seedtpl, String callbackUrl) { String requestid = UuidGen.generateAUuid(""); WorkflowGenerationAPI wg = new WorkflowGenerationKB(props, - DataFactory.getReasoningAPI(props), DataFactory.getCreationAPI(props), + DataFactory.getReasoningAPI(props), DataFactory.getCreationAPI(props), ComponentFactory.getReasoningAPI(props), ComponentFactory.getCreationAPI(props), ResourceFactory.getAPI(props), requestid); @@ -416,7 +401,7 @@ private String createPlan(String origtplid, if (!seedtpl.saveAs(seedid)) return ""; - if(plan.save()) { + if (plan.save()) { RuntimePlan rplan = new RuntimePlan(plan); rplan.setExpandedTemplateID(xtpl.getID()); rplan.setOriginalTemplateID(origtplid); @@ -429,18 +414,17 @@ private String createPlan(String origtplid, return ""; } - - public Response reRunPlan(String run_id, ServletContext context){ + public Response reRunPlan(String run_id, ServletContext context) { ExecutionMonitorAPI monitor = config.getDomainExecutionMonitor(); RuntimePlan plan = monitor.getRunDetails(run_id); - + TemplateCreationAPI tc = TemplateFactory.getCreationAPI(props); String orig_tp_id = plan.getOriginalTemplateID(); Template xtpl = tc.getTemplate(plan.getExpandedTemplateID()); Template seedtpl = tc.getTemplate(plan.getSeededTemplateID()); String callbackUrl = plan.getCallbackUrl(); tc.end(); - + if (createPlan(orig_tp_id, context, xtpl, seedtpl, callbackUrl) == "") return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Internal error").build(); return Response.status(Response.Status.CREATED).entity("CREATED").build(); @@ -457,334 +441,46 @@ public void runExecutionPlan(RuntimePlan rplan, ServletContext context) { context.setAttribute("engine_" + rplan.getID(), engine); } -// public String publishRunList(String pattern) { -// ArrayList> runs = this.getRunList(pattern); -// ArrayList> returnJson = new ArrayList<>(); -// Iterator> i = runs.iterator(); -// -// ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(10); -// List futures = new ArrayList(); -// -// while (i.hasNext()){ -// String id = (String) i.next().get("id"); -// futures.add(executor.submit(new Callable() { -// public String call() { -// try { -// return publishRun(id); -// } catch (Exception e) { -// return ""; -// } -// } -// })); -// -// } -// for(Future f: futures) { -// HashMap element = new HashMap<>(); -// try { -// String jsonReturn = (String) f.get(); -// Map map = new Gson().fromJson(jsonReturn, Map.class); -// if (map.containsKey("url")) -// element.put("url", map.get("url")); -// returnJson.add(element); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -// return json.toJson(returnJson); -// } - - private String urlToString(URL url) { - try { - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - boolean redirect = false; - - // normally, 3xx is redirect - int status = conn.getResponseCode(); - if (status != HttpURLConnection.HTTP_OK) { - if (status == HttpURLConnection.HTTP_MOVED_TEMP - || status == HttpURLConnection.HTTP_MOVED_PERM - || status == HttpURLConnection.HTTP_SEE_OTHER) - redirect = true; - } - - if (redirect) { - // get redirect url from "location" header field - String newUrl = conn.getHeaderField("Location"); - - // open the new connnection again - conn = (HttpURLConnection) new URL(newUrl).openConnection(); - } - - BufferedReader in = new BufferedReader( - new InputStreamReader(conn.getInputStream())); - String inputLine; - StringBuffer html = new StringBuffer(); - - while ((inputLine = in.readLine()) != null) { - html.append(inputLine); - } - in.close(); - return html.toString(); - } - catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - - public String publishRun(String runid) { - HashMap retmap = new HashMap(); - ExecutionMonitorAPI monitor = config.getDomainExecutionMonitor(); - RuntimePlan plan = monitor.getRunDetails(runid); - if (plan.getRuntimeInfo().getStatus() != Status.SUCCESS) { - retmap.put("error", "Can only publish successfully completed runs"); - } else try { - //Mapper opmm = new Mapper(); - - Publisher publisher = config.getPublisher(); - - ServerDetails publishUrl = publisher.getUploadServer(); - String tstoreurl = publisher.getTstorePublishUrl(); - String tstorequery = publisher.getTstoreQueryUrl(); - String exportName = publisher.getExportName(); - String exportUrl = publisher.getUrl(); - - String uploadURL = publishUrl.getUrl(); - String uploadUsername = publishUrl.getUsername(); - String uploadDirectory = publishUrl.getDirectory(); - String uploadPassword = publishUrl.getPassword(); - long uploadMaxSize = publishUrl.getMaxUploadSize(); - //opmm.setPublishExportPrefix(puburl); - - String rname = runid.substring(runid.indexOf('#') + 1); - //String runurl = opmm.getRunUrl(rname); - - // Fetch expanded template (to get data binding ids) - TemplateCreationAPI tc = TemplateFactory.getCreationAPI(props); - Template xtpl = tc.getTemplate(plan.getExpandedTemplateID()); - tc.end(); - - HashMap varBindings = new HashMap(); - for (Variable var : xtpl.getVariables()) { - varBindings.put(var.getID(), var.getBinding().getID()); - } - - // Create a temporary directory to upload/move - File _tmpdir = File.createTempFile("temp", ""); - File tempdir = new File(_tmpdir.getParent() + "/" + rname); - FileUtils.deleteQuietly(tempdir); - if (!_tmpdir.delete() || !tempdir.mkdirs()) - throw new Exception("Cannot create temp directory"); - - - File datadir = new File(tempdir.getAbsolutePath() + "/data"); - File codedir = new File(tempdir.getAbsolutePath() + "/code"); - datadir.mkdirs(); - codedir.mkdirs(); - - /* - String tupurl = upurl + "/" + tempdir.getName(); - String dataurl = tupurl + "/data"; - String codeurl = tupurl + "/code"; - String cdir = props.getProperty("lib.domain.code.storage"); - String ddir = props.getProperty("lib.domain.data.storage"); - */ - - FileUtils.deleteQuietly(tempdir); - - //Create the temporal directory to store data, components, workflow and exection - tempdir.mkdirs(); - File dcontdir = new File(tempdir.getAbsolutePath() + "/ont/data"); - File acontdir = new File(tempdir.getAbsolutePath() + "/ont/components"); - File wflowdir = new File(tempdir.getAbsolutePath() + "/ont/workflows"); - File execsdir = new File(tempdir.getAbsolutePath() + "/ont/executions"); - - File run_exportdir = new File(tempdir.getAbsolutePath() + "/export/run"); - File tpl_exportdir = new File(tempdir.getAbsolutePath() + "/export/template"); - dcontdir.mkdirs(); - acontdir.mkdirs(); - wflowdir.mkdirs(); - execsdir.mkdirs(); - run_exportdir.mkdirs(); - tpl_exportdir.mkdirs(); - - // Merge both concrete and abstract component libraries from WINGS - String aclib = props.getProperty("lib.concrete.url"); - String abslib = props.getProperty("lib.abstract.url"); - //String workflow_lib = props.getProperty("lib.domain.workflow.url"); - - String aclibdata = urlToString(new URL(aclib)); - String abslibdata = urlToString(new URL(abslib)); - //String workflow_lib_data = urlToString(new URL(workflow_lib)); - - abslibdata = abslibdata.replaceFirst("<\\?xml.+?>", ""); - abslibdata = Pattern.compile("", Pattern.DOTALL).matcher(abslibdata).replaceFirst(""); - abslibdata = abslibdata.replaceFirst("<\\/rdf:RDF>", ""); - aclibdata = aclibdata.replaceFirst("<\\/rdf:RDF>", ""); - - String rplandata = urlToString(new URL(runid)); - - //write aclibfie and rplanfile - aclibdata += abslibdata + "\n"; - File aclibfile = new File(acontdir.getAbsolutePath() + "/library.owl"); - File rplanfile = new File(execsdir.getAbsolutePath() + "/" + - plan.getName() + ".owl"); - FileUtils.write(aclibfile, aclibdata); - FileUtils.write(rplanfile, rplandata); - - //workflow file? - URL otplurl = new URL(plan.getOriginalTemplateID()); - File otplfile = new File(wflowdir.getAbsolutePath() + "/" + - otplurl.getRef() + ".owl"); - String otpldata = urlToString(otplurl); - FileUtils.write(otplfile, otpldata); - - Catalog catalog = new Catalog(config.getDomainId(), exportName, - publisher.getDomainsDir(), aclibfile.getAbsolutePath()); - - WorkflowExecutionExport exp = new WorkflowExecutionExport( - rplanfile.getAbsolutePath(), catalog, exportUrl, exportName, tstorequery, config.getDomainId()); - exp.setUploadURL(uploadURL); - exp.setUploadUsername(uploadUsername); - exp.setUploadPassword(uploadPassword); - exp.setUploadMaxSize(uploadMaxSize); - exp.setUploadDirectory(uploadDirectory); - String serialization = "TURTLE"; - - //publish the catalog - String domainPath = catalog.exportCatalog(null, serialization); - File domainFile = new File(domainPath); - this.publishFile(tstoreurl, catalog.getDomainGraphURI(), domainFile.getAbsolutePath()); - - //execution - String executionFilePath = run_exportdir + File.separator + "execution"; - String graphUri = exp.exportAsOPMW(executionFilePath, serialization); - if (!exp.isExecPublished()) { - this.publishFile(tstoreurl, graphUri, executionFilePath); - - //expandedTemplate - String expandedTemplateFilePath = run_exportdir + File.separator + "expandedTemplate"; - String expandedTemplateGraphUri = exp.getConcreteTemplateExport().exportAsOPMW(expandedTemplateFilePath, serialization); - if (!exp.getConcreteTemplateExport().isTemplatePublished()) - this.publishFile(tstoreurl, expandedTemplateGraphUri, expandedTemplateFilePath); - - //abstract - WorkflowTemplateExport abstractTemplateExport = exp.getConcreteTemplateExport().getAbstractTemplateExport(); - if (abstractTemplateExport != null) { - String abstractFilePath = run_exportdir + File.separator + "abstract"; - String abstractGraphUri = abstractTemplateExport.exportAsOPMW(abstractFilePath, serialization); - if (!abstractTemplateExport.isTemplatePublished()) - this.publishFile(tstoreurl, abstractGraphUri, abstractFilePath); - } - } - - - retmap.put("url", exp.getTransformedExecutionURI()); - - } catch (Exception e) { - e.printStackTrace(); - retmap.put("error", e.getMessage()); - } - return json.toJson(retmap); - } - - - /* - private void uploadDirectory(ServerDetails server, File tempdir) { - if(server.getHost() != null) { - Machine m = new Machine(server.getHost()); - m.setHostName(server.getHost()); - m.setUserId(server.getHostUserId()); - m.setUserKey(server.getPrivateKey()); - HashMap filemap = new HashMap(); - String srvdir = server.getDirectory(); - for(File f : FileUtils.listFiles(tempdir, null, true)) { - String fpath = f.getAbsolutePath(); - String srvpath = fpath.replace(tempdir.getParent(), srvdir); - filemap.put(fpath, srvpath); - } - GridkitCloud.uploadFiles(m, filemap); - } - else { - try { - FileUtils.copyDirectoryToDirectory(tempdir, new File(server.getDirectory())); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - */ - /** - * Upload triples to a rdf store - * @param tstoreurl: triple store url. e.g., http://ontosoft.isi.edu:3030/provenance/data - * @param graphurl: graph url. - * @param filepath + * Publish a run to the Tstore + * + * @param runid + * @return + * @throws MalformedURLException */ - private void publishFile(String tstoreurl, String graphurl, String filepath) { - System.out.println("Publishing the filepath " + filepath + " on graph " + graphurl); - try { - CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPut putRequest = new HttpPut(tstoreurl + "?graph=" + graphurl); - - //Todo: move it to configuration - int timeoutSeconds = 10; - int CONNECTION_TIMEOUT_MS = timeoutSeconds * 1000; - RequestConfig requestConfig = RequestConfig.custom() - .setConnectionRequestTimeout(CONNECTION_TIMEOUT_MS) - .setConnectTimeout(CONNECTION_TIMEOUT_MS) - .setSocketTimeout(CONNECTION_TIMEOUT_MS) - .build(); - putRequest.setConfig(requestConfig); - - File file = new File(filepath); - String content = FileUtils.readFileToString(file); - if (content != null) { - StringEntity input = new StringEntity(content); - input.setContentType("text/turtle"); - putRequest.setEntity(input); - HttpResponse response = httpClient.execute(putRequest); - int statusCode = response.getStatusLine().getStatusCode(); - if (statusCode > 299) { - System.err.println("Unable to upload the domain " + statusCode); - System.err.println(response.getStatusLine().getReasonPhrase()); - } else { - System.err.println("Success uploading the domain " + statusCode); - System.err.println(response.getStatusLine().getReasonPhrase()); - } - } - else { - System.err.println("File content is null " + filepath); - } - } catch (IOException e) { - e.printStackTrace(); - } + public String publishRun(String runid) throws MalformedURLException, IOException { + PublisherRunController pc = new PublisherRunController(config, props, runid); + pc.setPublishTriples(true); + WorkflowExecutionExport exp = pc.generateProvenance(runid, null); + HashMap response = pc.publish(exp); + return json.toJson(response); } - /* - private boolean graphExists(String tstoreurl, String graphurl) { - try { - CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpGet getRequest = new HttpGet(tstoreurl + "?graph=" + graphurl); - - int timeoutSeconds = 5; - int CONNECTION_TIMEOUT_MS = timeoutSeconds * 1000; - RequestConfig requestConfig = RequestConfig.custom() - .setConnectionRequestTimeout(CONNECTION_TIMEOUT_MS) - .setConnectTimeout(CONNECTION_TIMEOUT_MS) - .setSocketTimeout(CONNECTION_TIMEOUT_MS) - .build(); - getRequest.setConfig(requestConfig); - - HttpResponse response = httpClient.execute(getRequest); - if(response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) - return true; - return false; - } catch (IOException e) { - e.printStackTrace(); - return false; + /** + * Get provenance for a run + * + * @param + * @return + * @return + * @throws IOException + */ + public String getProvenance(String runid, String format) throws IOException { + System.out.println("Starting provenance export"); + PublisherRunController pc = new PublisherRunController(config, props, runid); + pc.setPublishTriples(true); + WorkflowExecutionExport exp = pc.generateProvenance(runid, null); + System.out.println("Generate provenance"); + HashMap response = pc.publish(exp); + System.out.println("Publish"); + String executionPath = pc.executionFilePath; + File executionFile = new File(executionPath); + System.out.println("file ok" + executionFile.getAbsolutePath()); + if (executionFile.exists()) { + String execution = FileUtils.readFileToString(executionFile); + System.out.println("read file ok"); + response.put("execution", execution); } + System.out.println("End provenance export"); + return json.toJson(response); } - */ } diff --git a/portal/src/main/java/edu/isi/wings/portal/resources/RunResource.java b/portal/src/main/java/edu/isi/wings/portal/resources/RunResource.java index afb3c2c8..116b28b1 100644 --- a/portal/src/main/java/edu/isi/wings/portal/resources/RunResource.java +++ b/portal/src/main/java/edu/isi/wings/portal/resources/RunResource.java @@ -1,5 +1,7 @@ package edu.isi.wings.portal.resources; +import java.io.IOException; +import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Date; @@ -9,16 +11,27 @@ import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.Gson; import edu.isi.wings.portal.classes.util.TemplateBindings; import edu.isi.wings.portal.controllers.RunController; +class ErrorMessage { + // constructor + public ErrorMessage(String message) { + this.message = message; + } + + public String message; +} + @Path("{user}/{domain}/executions") public class RunResource extends WingsResource { RunController rc; @@ -26,102 +39,97 @@ public class RunResource extends WingsResource { @PostConstruct public void init() { super.init(); - if(this.hasPermissions() && !this.isPage("intro")) + if (this.hasPermissions() && !this.isPage("intro")) this.rc = new RunController(config); } - + @PreDestroy public void destroy() { - if(this.rc != null) { + if (this.rc != null) { this.rc.end(); } } - + @GET @Produces(MediaType.TEXT_HTML) public String getHTML( @QueryParam("run_id") final String run_id) { - if(this.rc != null) { + if (this.rc != null) { request.setAttribute("controller", this.rc); request.setAttribute("run_id", run_id); return this.callViewer("RunViewer"); } return null; } - + @GET @Path("intro") public void getIntroduction() { this.loadIntroduction("ManageRuns"); } - + @GET @Path("getRunList") @Produces(MediaType.APPLICATION_JSON) public String getRunList( - @QueryParam("pattern") final String pattern, - @QueryParam("status") final String status, - @QueryParam("start") int start, - @QueryParam("limit") int limit - ) { - if(this.rc != null) + @QueryParam("pattern") final String pattern, + @QueryParam("status") final String status, + @QueryParam("start") int start, + @QueryParam("limit") int limit) { + if (this.rc != null) return this.rc.getRunListJSON(pattern, status, start, limit); return null; } - @GET @Path("getRunListSimple") @Produces(MediaType.APPLICATION_JSON) public String getRunListSimple( - @QueryParam("pattern") final String pattern, - @QueryParam("status") final String status, - @QueryParam("start") int start, - @QueryParam("limit") int limit, - @QueryParam("started_after") final long started_after - ) { - if(this.rc != null) { + @QueryParam("pattern") final String pattern, + @QueryParam("status") final String status, + @QueryParam("start") int start, + @QueryParam("limit") int limit, + @QueryParam("started_after") final long started_after) { + if (this.rc != null) { Date startdate = null; - if(started_after != 0) - startdate = new Date(started_after*1000); + if (started_after != 0) + startdate = new Date(started_after * 1000); return this.rc.getRunListSimpleJSON(pattern, status, start, limit, startdate); } return null; } - @POST @Path("getRunDetails") @Produces(MediaType.APPLICATION_JSON) public String getRunDetails( @FormParam("run_id") String run_id) { - if(this.rc != null) + if (this.rc != null) return this.rc.getRunJSON(run_id); return null; } - + @POST @Path("getRunPlan") @Produces(MediaType.APPLICATION_JSON) public String getRunPlan( @FormParam("run_id") String run_id) { - if(this.rc != null) + if (this.rc != null) return this.rc.getRunPlanJSON(run_id); return null; } - + @POST @Path("expandAndRunWorkflow") @Produces(MediaType.APPLICATION_JSON) public ArrayList expandAndRunWorkflow( @JsonProperty("template_bindings") final TemplateBindings tbindings) { - if(this.rc != null) { + if (this.rc != null) { return rc.expandAndRunTemplate(tbindings, this.context); } return null; } - @POST @Path("runWorkflow") @Produces(MediaType.TEXT_PLAIN) @@ -131,61 +139,89 @@ public String runWorkflow( @FormParam("constraints_json") String constraints_json, @FormParam("seed_json") String seed_json, @FormParam("seed_constraints_json") String seed_constraints_json) { - if(this.rc != null) + if (this.rc != null) return rc.runExpandedTemplate(template_id, json, constraints_json, seed_json, seed_constraints_json, null, this.context); return null; } - + @POST @Path("reRunWorkflow") @Produces("application/json") public Response reRunWorkflow( - @FormParam("run_id") String run_id) { - if(this.rc != null){ - return rc.reRunPlan(run_id, this.context); + @FormParam("run_id") String run_id) { + if (this.rc != null) { + return rc.reRunPlan(run_id, this.context); } return null; } - + @POST @Path("deleteRun") @Produces(MediaType.TEXT_PLAIN) public String deleteRun(@FormParam("json") String json) { - if(this.rc != null) + if (this.rc != null) return rc.deleteRun(json, context); return null; } - + @POST @Path("deleteRuns") @Produces(MediaType.TEXT_PLAIN) public String deleteRuns(@FormParam("json") String json) { - if(this.rc != null) + if (this.rc != null) return rc.deleteRuns(json, context); return null; } - + @POST @Path("stopRun") @Produces(MediaType.TEXT_PLAIN) public String stopRun( @FormParam("run_id") String run_id) { - if(this.rc != null) + if (this.rc != null) return this.rc.stopRun(run_id, context) + ""; return "false"; } - + @POST @Path("publishRun") @Produces(MediaType.TEXT_PLAIN) public String publishRun( - @FormParam("run_id") String run_id) { - if(this.rc != null) + @FormParam("run_id") String run_id) throws MalformedURLException, IOException { + if (this.rc != null) return this.rc.publishRun(run_id); return null; } + @POST + @Path("provenance") + @Produces(MediaType.TEXT_PLAIN) + public String getProvenance( + @FormParam("format") String format, + @FormParam("run_id") String run_id) { + try { + return this.rc.getProvenance(run_id, format); + } catch (Exception e) { + try { + // Create Json error response + Gson gson = new Gson(); + ErrorMessage error = new ErrorMessage(e.getMessage()); + String jsonData = gson.toJson(error); + + // Prepare the response + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + response.setStatus(500); + // Send the response + response.getWriter().print(jsonData.toString()); + response.getWriter().flush(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + return null; + }; } \ No newline at end of file diff --git a/portal/src/main/webapp/js/gui/RunBrowser.js b/portal/src/main/webapp/js/gui/RunBrowser.js index bb45c189..3127942f 100644 --- a/portal/src/main/webapp/js/gui/RunBrowser.js +++ b/portal/src/main/webapp/js/gui/RunBrowser.js @@ -16,447 +16,521 @@ */ function RunBrowser(guid, runid, op_url, data_url, template_url, can_publish) { - this.guid = guid; - this.runid = runid; - this.op_url = op_url; - this.data_url = data_url; - this.template_url = template_url; - this.can_publish = can_publish; - - this.tabPanel; - this.runList; - this.tBrowser = this.setupTemplateBrowser(); + this.guid = guid; + this.runid = runid; + this.op_url = op_url; + this.data_url = data_url; + this.template_url = template_url; + this.can_publish = can_publish; + + this.tabPanel; + this.runList; + this.tBrowser = this.setupTemplateBrowser(); } PAGESIZE = 500; -RunBrowser.prototype.setupTemplateBrowser = function() { - return new TemplateBrowser(this.guid, - { - hide_selector: true, hide_form: true, hide_intro: true, - hide_documentation: true, hide_title: true - }, - null, false, false, this.template_url); +RunBrowser.prototype.setupTemplateBrowser = function () { + return new TemplateBrowser( + this.guid, + { + hide_selector: true, + hide_form: true, + hide_intro: true, + hide_documentation: true, + hide_title: true, + }, + null, + false, + false, + this.template_url + ); }; -RunBrowser.prototype.formatRunListItem = function(value, meta, record, rowind, colind, store, view) { - var d = record.data; - var tid = getLocalName(d.template_id); - if(!tid) - tid = getLocalName(d.id).replace(/^(.+?)\-[0-9a-f]+\-[0-9a-f]+.*$/, '$1'); - var rstat = d.status; - - var icon = 'icon-spin6 fa animate-spin fa-grey' - if(rstat == 'SUCCESS') - icon = 'icon-select-alt fa-big fa-green'; - else if(rstat == 'FAILURE') - icon = 'icon-cancel-alt fa-big fa-red'; - - var tmpl = "" + - "
" + - "
{1}
" + - "
Run ID:{2}
" + - "
"; - return Ext.String.format(tmpl, rstat, tid, getLocalName(d.id)); +RunBrowser.prototype.formatRunListItem = function ( + value, + meta, + record, + rowind, + colind, + store, + view +) { + var d = record.data; + var tid = getLocalName(d.template_id); + if (!tid) + tid = getLocalName(d.id).replace(/^(.+?)\-[0-9a-f]+\-[0-9a-f]+.*$/, "$1"); + var rstat = d.status; + + var icon = "icon-spin6 fa animate-spin fa-grey"; + if (rstat == "SUCCESS") icon = "icon-select-alt fa-big fa-green"; + else if (rstat == "FAILURE") icon = "icon-cancel-alt fa-big fa-red"; + + var tmpl = + "" + + "
" + + "
{1}
" + + "
Run ID:{2}
" + + "
"; + return Ext.String.format(tmpl, rstat, tid, getLocalName(d.id)); }; -RunBrowser.prototype.formatProgressBar = function(value, meta, record, rowind, colind, store, view) { - var d = record.data; - var tmpl = ""; - tmpl += "
"; - tmpl += "
"; - tmpl += "
"; - tmpl += "
"; - tmpl += " 
"; - if (d.status == "FAILURE") - tmpl += "
Failed: {8}
"; - else if (d.status == "RUNNING") - tmpl += "
Running: {9}
"; - else if (d.status == "SUCCESS") - tmpl += "
Completed
"; - else if (d.status == "QUEUED") - tmpl += "
Queued
"; - var w = 190; - if (d.status == "SUCCESS") - d.percent_done = 100; - return Ext.String.format(tmpl, w, 10, - Math.round(w * (d.percent_done + d.percent_failed + d.percent_running) / 100), - Math.round(w * (d.percent_done + d.percent_running) / 100), - Math.round(w * d.percent_done / 100), - "#F66", "#999", "#6E6", - d.failed_jobs, d.running_jobs); +RunBrowser.prototype.formatProgressBar = function ( + value, + meta, + record, + rowind, + colind, + store, + view +) { + var d = record.data; + var tmpl = ""; + tmpl += "
"; + tmpl += "
"; + tmpl += "
"; + tmpl += "
"; + tmpl += " 
"; + if (d.status == "FAILURE") tmpl += "
Failed: {8}
"; + else if (d.status == "RUNNING") + tmpl += "
Running: {9}
"; + else if (d.status == "SUCCESS") + tmpl += "
Completed
"; + else if (d.status == "QUEUED") tmpl += "
Queued
"; + var w = 190; + if (d.status == "SUCCESS") d.percent_done = 100; + return Ext.String.format( + tmpl, + w, + 10, + Math.round( + (w * (d.percent_done + d.percent_failed + d.percent_running)) / 100 + ), + Math.round((w * (d.percent_done + d.percent_running)) / 100), + Math.round((w * d.percent_done) / 100), + "#F66", + "#999", + "#6E6", + d.failed_jobs, + d.running_jobs + ); }; -RunBrowser.prototype.formatBinding = function(b, meta, record, runid) { - var str = ""; - var This = this; - if (b.type == 'literal') - str += "" + b.value + ""; - else if (b.size != -1 && b.location) { - var href = This.data_url + "/fetch?data_id=" + escape(b.id); - str += "" + getLocalName(b.id) - + " "; - str += "("; - str += This.formatSize(b.size); - str += ")"; - } else - str += "Not available"; - return str; +RunBrowser.prototype.formatBinding = function (b, meta, record, runid) { + var str = ""; + var This = this; + if (b.type == "literal") str += "" + b.value + ""; + else if (b.size != -1 && b.location) { + var href = This.data_url + "/fetch?data_id=" + escape(b.id); + str += + "" + getLocalName(b.id) + " "; + str += "("; + str += This.formatSize(b.size); + str += ")"; + } else str += "Not available"; + return str; }; -RunBrowser.prototype.formatSave = function(b, meta, record, runid) { - var str = ""; - if (record.data.type != "Input") { - str += "Save"; - } - return str; +RunBrowser.prototype.formatSave = function (b, meta, record, runid) { + var str = ""; + if (record.data.type != "Input") { + str += "Save"; + } + return str; }; -RunBrowser.prototype.formatSize = function(bytes, precision) { - if (!precision) - precision = 2; - var units = [ - 'B', 'KB', 'MB', 'GB', 'TB' - ]; +RunBrowser.prototype.formatSize = function (bytes, precision) { + if (!precision) precision = 2; + var units = ["B", "KB", "MB", "GB", "TB"]; - bytes = Math.max(bytes, 0); - var pow = Math.floor((bytes ? Math.log(bytes) : 0) / Math.log(1024)); - pow = Math.min(pow, units.length - 1); + bytes = Math.max(bytes, 0); + var pow = Math.floor((bytes ? Math.log(bytes) : 0) / Math.log(1024)); + pow = Math.min(pow, units.length - 1); - bytes /= Math.pow(1024, pow); + bytes /= Math.pow(1024, pow); - return Math.round(bytes, precision) + ' ' + units[pow]; + return Math.round(bytes, precision) + " " + units[pow]; }; -RunBrowser.prototype.getIODataGrid = function(data, runid) { - var This = this; - var bindings = this.getVariableBindingData(data); - console.log(bindings); - - if (!Ext.ModelManager.isRegistered('workflowRunDetails')) - Ext.define('workflowRunDetails', { - extend : 'Ext.data.Model', - fields : [ - 'v', 'type', 'b' - ] - }); - - var wRunDStore = new Ext.data.Store({ - model : 'workflowRunDetails', - proxy : { - type : 'memory', - reader : { - type : 'json' - } - }, - sorters : [ - 'v' - ], - groupField : 'type', - data : bindings - }); - This.tabPanel.bindings = bindings; - - var groupingFeature = Ext.create('Ext.grid.feature.Grouping', { - groupHeaderTpl : '{name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})' - }); - - var grid = new Ext.grid.GridPanel({ - store : wRunDStore, - columns : [ - Ext.create('Ext.grid.RowNumberer', { - width : 30, - dataIndex : 'x' - }), { - header : 'Variable', - dataIndex : 'v', - width : 200, - sortable : true, - menuDisabled : true - }, { - header : 'Binding', - dataIndex : 'b', - flex : 1, - menuDisabled : true, - renderer : function(v, m, r) { - return This.formatBinding(v, m, r, runid); - } - }, { - header : 'Save', - flex : 1, - menuDisabled : true, - renderer : function(v, m, r) { - return This.formatSave(v, m, r, runid); - } - }, { - header : 'Data', - hidden : true, - dataIndex : 'type', - menuDisabled : true - } - ], - - listeners: { - cellclick: function(table, td, ci, rec, tr, ri, e, eopts) { - if(ci != 3) return; - var clicked_item = e.getTarget(); - // Listen for a click on the "Save" link - if(clicked_item.tagName == "A") { - var b = rec.data.b; - This.registerData(b, runid); - } - } - }, - - // autoExpandColumn: 'binding', - monitorResize : true, - features : [ - groupingFeature - ], - viewConfig : { - trackOver : false - }, - bodyCls : 'multi-line-grid', - border : false - }); - - return grid; -}; +RunBrowser.prototype.getIODataGrid = function (data, runid) { + var This = this; + var bindings = this.getVariableBindingData(data); + console.log(bindings); -RunBrowser.prototype.getVariableBindingData = function(data) { - var exec = data.execution; - - // Get information about the file bindings - var filedata = {}; - var steps = exec.plan.steps; - for(var i=0; i 1 ? "s" : ""]})', + }); -RunBrowser.prototype.reRun = function(rec) { - var This = this; - var url = this.op_url + '/reRunWorkflow'; - var msgTarget = this.runList.getEl(); - msgTarget.mask('Creating the new workflow...', 'x-mask-loading'); - Ext.Ajax.request({ - url : url, - params : { - run_id : rec.data.id, + var grid = new Ext.grid.GridPanel({ + store: wRunDStore, + columns: [ + Ext.create("Ext.grid.RowNumberer", { + width: 30, + dataIndex: "x", + }), + { + header: "Variable", + dataIndex: "v", + width: 200, + sortable: true, + menuDisabled: true, + }, + { + header: "Binding", + dataIndex: "b", + flex: 1, + menuDisabled: true, + renderer: function (v, m, r) { + return This.formatBinding(v, m, r, runid); }, - success : function(response) { - msgTarget.unmask(); - This.runList.getStore().load(); + }, + { + header: "Save", + flex: 1, + menuDisabled: true, + renderer: function (v, m, r) { + return This.formatSave(v, m, r, runid); }, - failure : function(response) { - _console(response.responseText); + }, + { + header: "Data", + hidden: true, + dataIndex: "type", + menuDisabled: true, + }, + ], + + listeners: { + cellclick: function (table, td, ci, rec, tr, ri, e, eopts) { + if (ci != 3) return; + var clicked_item = e.getTarget(); + // Listen for a click on the "Save" link + if (clicked_item.tagName == "A") { + var b = rec.data.b; + This.registerData(b, runid); } - }); + }, + }, + + // autoExpandColumn: 'binding', + monitorResize: true, + features: [groupingFeature], + viewConfig: { + trackOver: false, + }, + bodyCls: "multi-line-grid", + border: false, + }); + + return grid; }; -RunBrowser.prototype.registerData = function(b, runid) { - var This = this; - var dsname = getLocalName(b.id); - var dsns = getNamespace(b.id); - Ext.Msg.prompt("Save data..", "Name this dataset for your Data Catalog:", function(btn, text) { - if (btn == 'ok' && text) { - var newname = getRDFID(text); - var url = This.data_url + '/registerData'; - var msgTarget = This.tabPanel.getEl(); - msgTarget.mask('Saving and Registering Data...', 'x-mask-loading'); - Ext.Ajax.request({ - url : url, - params : { - data_id : b.id, - newname : newname, - metadata_json : Ext.encode(b.metadata) - }, - success : function(response) { - msgTarget.unmask(); - if (response.responseText == "OK") { - // Everything ok - } - else { - showError(response.responseText); - _console(response.responseText); - } - }, - failure : function(response) { - _console(response.responseText); - } - }); - } - }, window, false, dsname); - return false; +RunBrowser.prototype.getVariableBindingData = function (data) { + var exec = data.execution; + + // Get information about the file bindings + var filedata = {}; + var steps = exec.plan.steps; + for (var i = 0; i < steps.length; i++) { + var step = steps[i]; + for (var j = 0; j < step.inputFiles.length; j++) { + var file = step.inputFiles[j]; + for (var key in file.metadata) file.metadata[key] = [file.metadata[key]]; + filedata[file.id] = file; + } + for (var j = 0; j < step.outputFiles.length; j++) { + var file = step.outputFiles[j]; + for (var key in file.metadata) file.metadata[key] = [file.metadata[key]]; + filedata[file.id] = file; + } + } + + // Map variable bindings to files + var bindingmaps = {}; + var variables = [] + .concat(data.variables.input) + .concat(data.variables.output) + .concat(data.variables.intermediate); + + for (var i = 0; i < variables.length; i++) { + var v = variables[i]; + var binding = filedata[v.id] ? filedata[v.id] : v.binding; + if (v.binding.id) binding.id = v.binding.id; + bindingmaps[binding.id] = binding; + } + + var vmaps = {}; + var varmap = function (variables, type) { + for (var i = 0; i < variables.length; i++) { + var v = variables[i]; + var binding = v.binding.id + ? bindingmaps[v.binding.id] + : filedata[v.id] + ? filedata[v.id] + : v.binding; + if (v.binding.id) binding.id = v.binding.id; + vmaps[v.id] = { v: getLocalName(v.id), b: binding, type: type }; + } + }; + // Get mappings of variables to bindings + varmap(data.variables.input, "Input"); + varmap(data.variables.output, "Output"); + varmap(data.variables.intermediate, "Intermediate"); + + // Get variable constraints + for (var vid in data.constraints) { + if (vmaps[vid] && vmaps[vid].b) { + var constraints = data.constraints[vid]; + var b = vmaps[vid].b; + if (!b.metadata) b.metadata = {}; + for (var i = 0; i < constraints.length; i++) { + var cons = constraints[i]; + var pred = cons.p; + if (!b.metadata[pred]) b.metadata[pred] = []; + if ( + b.metadata[pred].push && + (pred == "type" || b.metadata[pred].length == 0) + ) + b.metadata[pred].push(cons.o.isLiteral ? cons.o.value : cons.o.id); + } + vmaps[vid].b = b; + } + } + + // Create binding data + var bindings = []; + for (var vid in vmaps) bindings.push(vmaps[vid]); + + return bindings; }; -RunBrowser.prototype.publishRun = function(runid, tabPanel) { - var msgTarget = tabPanel.getEl(); - msgTarget.mask('Publishing RDF ...', 'x-mask-loading'); - var url = this.op_url + '/publishRun'; - Ext.Ajax.request({ - url : url, - params : { - run_id : runid - }, - success : function(response) { - msgTarget.unmask(); - var resp = Ext.decode(response.responseText); - if(resp.url) { - var url = resp.url; - var win = new Ext.Window({ - title : 'Pubby', - width : '70%', - height : '70%', - plain : true, - maximizable : true, - html : "" - + "" - }); - win.show(); - } - if(resp.error) - showError(resp.error); - }, - failure : function(response) { - msgTarget.unmask(); - _console(response.responseText); - } - }); +RunBrowser.prototype.stopRun = function (rec) { + var This = this; + var url = this.op_url + "/stopRun"; + var msgTarget = this.runList.getEl(); + msgTarget.mask("Stopping...", "x-mask-loading"); + Ext.Ajax.request({ + url: url, + params: { + run_id: rec.data.id, + }, + success: function (response) { + msgTarget.unmask(); + This.runList.getStore().load(); + }, + failure: function (response) { + _console(response.responseText); + }, + }); }; +RunBrowser.prototype.reRun = function (rec) { + var This = this; + var url = this.op_url + "/reRunWorkflow"; + var msgTarget = this.runList.getEl(); + msgTarget.mask("Creating the new workflow...", "x-mask-loading"); + Ext.Ajax.request({ + url: url, + params: { + run_id: rec.data.id, + }, + success: function (response) { + msgTarget.unmask(); + This.runList.getStore().load(); + }, + failure: function (response) { + _console(response.responseText); + }, + }); +}; -RunBrowser.prototype.prePublishList = function() { - var This = this; - Ext.Msg.prompt("Publishing executions" , "Please, enter a pattern", function(btn, text) { - if (btn == 'ok' && text) - This.publishList(text); - else{ - showError('Please enter a pattern'); - return; - } - }); +RunBrowser.prototype.registerData = function (b, runid) { + var This = this; + var dsname = getLocalName(b.id); + var dsns = getNamespace(b.id); + Ext.Msg.prompt( + "Save data..", + "Name this dataset for your Data Catalog:", + function (btn, text) { + if (btn == "ok" && text) { + var newname = getRDFID(text); + var url = This.data_url + "/registerData"; + var msgTarget = This.tabPanel.getEl(); + msgTarget.mask("Saving and Registering Data...", "x-mask-loading"); + Ext.Ajax.request({ + url: url, + params: { + data_id: b.id, + newname: newname, + metadata_json: Ext.encode(b.metadata), + }, + success: function (response) { + msgTarget.unmask(); + if (response.responseText == "OK") { + // Everything ok + } else { + showError(response.responseText); + _console(response.responseText); + } + }, + failure: function (response) { + _console(response.responseText); + }, + }); + } + }, + window, + false, + dsname + ); + return false; }; -RunBrowser.prototype.publishList = function(pattern) { - var msgTarget = this.tabPanel.getEl(); - msgTarget.mask('Publishing RDF ...', 'x-mask-loading'); - var url = this.op_url + '/publishList'; - Ext.Ajax.request({ - url: url, - params: { - pattern: pattern - }, - success: function (response) { - msgTarget.unmask(); - var resp = Ext.decode(response.responseText); - if (resp.error) - showError(resp.error); - }, - failure: function (response) { - msgTarget.unmask(); - _console(response.responseText); - } - }); -} +RunBrowser.prototype.getProvenance = function (runid, tabPanel) { + var msgTarget = tabPanel.getEl(); + msgTarget.mask("Publishing RDF ...", "x-mask-loading"); + var url = this.op_url + "/provenance"; + Ext.Ajax.request({ + url: url, + params: { + run_id: runid, + }, + success: function (response) { + msgTarget.unmask(); + var resp = Ext.decode(response.responseText); + if (resp.url) { + var url = resp.url; + var win = new Ext.Window({ + title: "Pubby", + width: "70%", + height: "70%", + plain: true, + maximizable: true, + html: + "" + + "", + }); + win.show(); + } + if (resp.error) showError(resp.error); + }, + failure: function (response) { + msgTarget.unmask(); + _console(response.responseText); + }, + }); +}; + +RunBrowser.prototype.publishRun = function (runid, tabPanel) { + var msgTarget = tabPanel.getEl(); + msgTarget.mask("Publishing RDF ...", "x-mask-loading"); + var url = this.op_url + "/publishRun"; + Ext.Ajax.request({ + url: url, + params: { + run_id: runid, + }, + success: function (response) { + msgTarget.unmask(); + var resp = Ext.decode(response.responseText); + if (resp.url) { + var url = resp.url; + var win = new Ext.Window({ + title: "Pubby", + width: "70%", + height: "70%", + plain: true, + maximizable: true, + html: + "" + + "", + }); + win.show(); + } + if (resp.error) showError(resp.error); + }, + failure: function (response) { + msgTarget.unmask(); + _console(response.responseText); + }, + }); +}; +RunBrowser.prototype.prePublishList = function () { + var This = this; + Ext.Msg.prompt( + "Publishing executions", + "Please, enter a pattern", + function (btn, text) { + if (btn == "ok" && text) This.publishList(text); + else { + showError("Please enter a pattern"); + return; + } + } + ); +}; +RunBrowser.prototype.publishList = function (pattern) { + var msgTarget = this.tabPanel.getEl(); + msgTarget.mask("Publishing RDF ...", "x-mask-loading"); + var url = this.op_url + "/publishList"; + Ext.Ajax.request({ + url: url, + params: { + pattern: pattern, + }, + success: function (response) { + msgTarget.unmask(); + var resp = Ext.decode(response.responseText); + if (resp.error) showError(resp.error); + }, + failure: function (response) { + msgTarget.unmask(); + _console(response.responseText); + }, + }); +}; -RunBrowser.prototype.getRunDetailsPanel = function(data, runid) { - var This = this; - var tbar = null; - /*var tbar = []; +RunBrowser.prototype.getRunDetailsPanel = function (data, runid) { + var This = this; + var tbar = null; + /*var tbar = []; tbar.push({ text : 'Get HTML', iconCls : 'icon-docs fa fa-blue', @@ -464,587 +538,624 @@ RunBrowser.prototype.getRunDetailsPanel = function(data, runid) { This.getRunReport(runid, this.up('panel'), 'HTML'); } });*/ - - if(this.can_publish && data.execution.runtimeInfo.status == "SUCCESS") { - if(!tbar) - tbar = []; - - if(data.published_url) { - var url = data.published_url; - tbar.push({ - text: 'View Published RDF', - iconCls: 'icon-network fa fa-blue', - handler: function() { - var me = this; - var win = new Ext.Window({ - title : 'Pubby', - width : '70%', - height : '70%', - plain : true, - maximizable : true, - html : "" - + "" - }); - win.show(); - } - }); - } - else { - tbar.push({ - text: 'Publish RDF', - iconCls: 'icon-network fa fa-blue', - handler: function() { - var me = this; - Ext.MessageBox.confirm("Confirm", - "This might take a while to publish. Please don't close this browser window while upload is going on. Are you sure you want to Continue ?", - function(b) { - if(b == "yes") { - var panel = me.up('panel'); - var tab = panel.up('panel'); - This.publishRun(runid, panel); - tab.getLoader().load(); - } - }); - } - }); - } - } - - var tabPanel = Ext.create('Ext.tab.Panel', { - plain: true, - margin: 5, - tbar: tbar, - items: [] - }); - - var exec = data.execution; - var tid = exec.seededTemplateId; - var xtid = exec.expandedTemplateId; - - var dataPanel = this.getRunDataPanel(data, runid); - var logPanel = this.getRunLogPanel(exec); - var tPanel = this.getTemplatePanel(tid, 'Template'); - var xtPanel = this.getTemplatePanel(xtid, 'Executable Workflow'); - - tabPanel.add(dataPanel); - tabPanel.add(logPanel); - tabPanel.add(tPanel); - tabPanel.add(xtPanel); - - tabPanel.dataPanel = dataPanel; - tabPanel.logPanel = logPanel; - tabPanel.tPanel = tPanel; - tabPanel.xtPanel = xtPanel; - - tabPanel.setActiveTab(0); - - var loadxfn = function() { - xtPanel.getLoader().on("load", function(event, response) { - var xdata = Ext.decode(response.responseText); - tpl = xdata.template; - // Layout if current layout data missing - for(var i=0; iURL: " + + url + + "" + + "", + }); + win.show(); + }, + }); + } else { + tbar.push({ + text: "Get provenance", + iconCls: "icon-network fa fa-blue", + handler: function () { + var me = this; + Ext.MessageBox.confirm( + "Confirm", + "This might take a while to publish. Please don't close this browser window while upload is going on. Are you sure you want to Continue ?", + function (b) { + if (b == "yes") { + var panel = me.up("panel"); + var tab = panel.up("panel"); + This.getProvenance(runid, panel); + tab.getLoader().load(); + } + } + ); + }, + }); + tbar.push({ + text: "Publish RDF", + iconCls: "icon-network fa fa-blue", + handler: function () { + var me = this; + Ext.MessageBox.confirm( + "Confirm", + "This might take a while to publish. Please don't close this browser window while upload is going on. Are you sure you want to Continue ?", + function (b) { + if (b == "yes") { + var panel = me.up("panel"); + var tab = panel.up("panel"); + This.publishRun(runid, panel); + tab.getLoader().load(); + } + } + ); + }, + }); + } + } + + var tabPanel = Ext.create("Ext.tab.Panel", { + plain: true, + margin: 5, + tbar: tbar, + items: [], + }); + + var exec = data.execution; + var tid = exec.seededTemplateId; + var xtid = exec.expandedTemplateId; + + var dataPanel = this.getRunDataPanel(data, runid); + var logPanel = this.getRunLogPanel(exec); + var tPanel = this.getTemplatePanel(tid, "Template"); + var xtPanel = this.getTemplatePanel(xtid, "Executable Workflow"); + + tabPanel.add(dataPanel); + tabPanel.add(logPanel); + tabPanel.add(tPanel); + tabPanel.add(xtPanel); + + tabPanel.dataPanel = dataPanel; + tabPanel.logPanel = logPanel; + tabPanel.tPanel = tPanel; + tabPanel.xtPanel = xtPanel; + + tabPanel.setActiveTab(0); + + var loadxfn = function () { + xtPanel.getLoader().on("load", function (event, response) { + var xdata = Ext.decode(response.responseText); + tpl = xdata.template; + // Layout if current layout data missing + for (var i = 0; i < tpl.Variables.length; i++) { + var variable = tpl.Variables[i]; + if (!variable.comment) { + xtPanel.graph.editor.layout(); + break; + } + } + This.setGraphRuntimeInfo(xtPanel.graph, data); + }); + xtPanel.getLoader().load({ method: "get" }); + xtPanel.un("activate", loadxfn); + }; + xtPanel.on("activate", loadxfn); + + // Seeded Workflow + var loadtfn = function () { + tPanel.getLoader().on("load", function (event, response) { + tPanel.graph.editor.layout(); + }); + tPanel.getLoader().load({ method: "get" }); + tPanel.un("activate", loadtfn); + }; + tPanel.on("activate", loadtfn); + + return tabPanel; }; -RunBrowser.prototype.getTemplatePanel = function(xtid, name) { - return this.tBrowser.createViewerPanel(xtid, name); +RunBrowser.prototype.setGraphRuntimeInfo = function (graph, data) { + if (!graph || !graph.editor || !graph.editor.template) return; + + // Set node runtime infos + var tpl = graph.editor.template; + for (var i = 0; i < data.execution.queue.steps.length; i++) { + var step = data.execution.queue.steps[i]; + var node = tpl.nodes[step.id]; + if (node != null) { + node.setRuntimeInfo(step.runtimeInfo); + } + } }; -RunBrowser.prototype.getRunLog = function(exec) { - var log = ""; - - exec.queue.steps.sort(function (a, b) { - if(a.runtimeInfo.startTime != b.runtimeInfo.startTime) { - return a.runtimeInfo.startTime > b.runtimeInfo.startTime ? 1 : -1; - } - else if(a.runtimeInfo.endTime == null) - return 1; - else if(b.runtimeInfo.endTime == null) - return -1; - else return a.runtimeInfo.endTime > b.runtimeInfo.endTime ? 1 - : a.runtimeInfo.endTime < b.runtimeInfo.endTime ? -1 : 0; - }); - for(var i=0; i b.runtimeInfo.startTime ? 1 : -1; + } else if (a.runtimeInfo.endTime == null) return 1; + else if (b.runtimeInfo.endTime == null) return -1; + else + return a.runtimeInfo.endTime > b.runtimeInfo.endTime + ? 1 + : a.runtimeInfo.endTime < b.runtimeInfo.endTime + ? -1 + : 0; + }); + for (var i = 0; i < exec.queue.steps.length; i++) { + var step = exec.queue.steps[i]; + if ( + step.runtimeInfo.status != "WAITING" && + step.runtimeInfo.status != "QUEUED" + ) { + log += "=====================================\n"; + log += "[ JOB: " + getLocalName(step.id) + " ]"; + log += + "\n[ STARTED: " + new Date(step.runtimeInfo.startTime * 1000) + " ]"; + if (step.runtimeInfo.endTime) { + log += "\n[ ENDED: " + new Date(step.runtimeInfo.endTime * 1000) + " ]"; + } + log += "\n[ STATUS: " + step.runtimeInfo.status + " ]\n"; + log += "=====================================\n"; + log += step.runtimeInfo.log + "\n"; + } + } + log += exec.runtimeInfo.log; + return log; }; -RunBrowser.prototype.getRunDataPanel = function(data, runid) { - var me = this; - var dataPanel = new Ext.Panel({ - title : 'Data', - layout : 'fit', - border : false, - iconCls : 'icon-file-alt fa-title fa-blue' - }); - dataPanel.grid = this.getIODataGrid(data, runid) - dataPanel.add(dataPanel.grid); - return dataPanel; +RunBrowser.prototype.getRunLogPanel = function (exec) { + var log = this.getRunLog(exec); + + return new Ext.Panel({ + title: "Run Log", + layout: "border", + border: false, + iconCls: "icon-run fa-title fa-blue", + items: { + region: "center", + border: false, + xtype: "textarea", + readOnly: true, + value: log, + style: "font-size:12px;font-family:monospace;", + }, + autoScroll: true, + }); }; -RunBrowser.prototype.refreshOpenRunTabs = function(grid, wRunStore) { - var selectedTab = this.tabPanel.getActiveTab(); - - var items = this.tabPanel.items.items; - for ( var i = 0; i < items.length; i++) { - var tab = items[i]; - if (tab && tab.runid) { - var rec = wRunStore.getById(tab.runid); - if(!rec) { - // Item removed from store, remove tab - this.tabPanel.remove(tab); - continue; - } - if (rec.data.status != tab.status || rec.data.status == 'RUNNING') { - tab.getLoader().load(); - tab.status = rec.data.status; - } - } - } - if (selectedTab && selectedTab.runid) - this.selectRunInList(selectedTab.runid); +RunBrowser.prototype.getRunDataPanel = function (data, runid) { + var me = this; + var dataPanel = new Ext.Panel({ + title: "Data", + layout: "fit", + border: false, + iconCls: "icon-file-alt fa-title fa-blue", + }); + dataPanel.grid = this.getIODataGrid(data, runid); + dataPanel.add(dataPanel.grid); + return dataPanel; }; -RunBrowser.prototype.openRunDetails = function(runid, status) { - var tabName = getLocalName(runid); - - // Check if tab is already open - var items = this.tabPanel.items.items; - for ( var i = 0; i < items.length; i++) { - var tab = items[i]; - if (tab && tab.title.replace(/^\**/, '') == tabName) { - this.tabPanel.setActiveTab(tab); - tab.status = status; - return null; - } - } - - // Create a new tab - var tab = new Ext.Panel({ - layout : 'fit', - closable : true, - iconCls : 'icon-run fa-title fa-brown', - border: false, - title : tabName, - items : [] - }); - tab.runid = runid; - tab.status = status; - - // Add tab to tab panel - this.tabPanel.add(tab); - this.tabPanel.setActiveTab(tab); - - // Set loader - var This = this; - var url = this.op_url + "/getRunDetails"; - Ext.apply(tab, { - loader : { - loadMask : true, - url : url, - params : { - run_id : runid - }, - renderer : function(loader, response, req) { - var rundata = Ext.decode(response.responseText); - if (rundata) { - if(tab.initialized) { - // If already initialized, only update content - var bindings = This.getVariableBindingData(rundata); - var log = This.getRunLog(rundata.execution); - var graph = tab.content.xtPanel.graph; - - tab.content.dataPanel.grid.getStore().loadData(bindings); - tab.content.logPanel.items.items[0].setValue(log); - This.setGraphRuntimeInfo(graph, rundata); - } - else { - // Create new content - tab.content = This.getRunDetailsPanel(rundata, runid); - tab.add(tab.content); - // tab.doLayout(false,true); - tab.initialized = true; - } - } - else { - tab.getEl().update('No Run Details', false); - } - } - } - }); - tab.getLoader().load(); +RunBrowser.prototype.refreshOpenRunTabs = function (grid, wRunStore) { + var selectedTab = this.tabPanel.getActiveTab(); + + var items = this.tabPanel.items.items; + for (var i = 0; i < items.length; i++) { + var tab = items[i]; + if (tab && tab.runid) { + var rec = wRunStore.getById(tab.runid); + if (!rec) { + // Item removed from store, remove tab + this.tabPanel.remove(tab); + continue; + } + if (rec.data.status != tab.status || rec.data.status == "RUNNING") { + tab.getLoader().load(); + tab.status = rec.data.status; + } + } + } + if (selectedTab && selectedTab.runid) this.selectRunInList(selectedTab.runid); +}; + +RunBrowser.prototype.openRunDetails = function (runid, status) { + var tabName = getLocalName(runid); + + // Check if tab is already open + var items = this.tabPanel.items.items; + for (var i = 0; i < items.length; i++) { + var tab = items[i]; + if (tab && tab.title.replace(/^\**/, "") == tabName) { + this.tabPanel.setActiveTab(tab); + tab.status = status; + return null; + } + } + + // Create a new tab + var tab = new Ext.Panel({ + layout: "fit", + closable: true, + iconCls: "icon-run fa-title fa-brown", + border: false, + title: tabName, + items: [], + }); + tab.runid = runid; + tab.status = status; + + // Add tab to tab panel + this.tabPanel.add(tab); + this.tabPanel.setActiveTab(tab); + + // Set loader + var This = this; + var url = this.op_url + "/getRunDetails"; + Ext.apply(tab, { + loader: { + loadMask: true, + url: url, + params: { + run_id: runid, + }, + renderer: function (loader, response, req) { + var rundata = Ext.decode(response.responseText); + if (rundata) { + if (tab.initialized) { + // If already initialized, only update content + var bindings = This.getVariableBindingData(rundata); + var log = This.getRunLog(rundata.execution); + var graph = tab.content.xtPanel.graph; + + tab.content.dataPanel.grid.getStore().loadData(bindings); + tab.content.logPanel.items.items[0].setValue(log); + This.setGraphRuntimeInfo(graph, rundata); + } else { + // Create new content + tab.content = This.getRunDetailsPanel(rundata, runid); + tab.add(tab.content); + // tab.doLayout(false,true); + tab.initialized = true; + } + } else { + tab.getEl().update("No Run Details", false); + } + }, + }, + }); + tab.getLoader().load(); }; -RunBrowser.prototype.getRunList = function() { - var This = this; - var fields = [ - 'id', 'template_id', - { - name: 'status', - mapping: 'runtimeInfo["status"]' - }, - { - name : 'startTime', - type: 'date', - dateFormat:'timestamp', - mapping : 'runtimeInfo["startTime"]' - }, - { - name : 'endTime', - type: 'date', - dateFormat:'timestamp', - mapping : 'runtimeInfo["endTime"]' - }, - 'running_jobs', 'failed_jobs', - 'percent_done', 'percent_running', 'percent_failed' - ]; - - /*if (!Ext.ModelManager.isRegistered('workflowRuns')) +RunBrowser.prototype.getRunList = function () { + var This = this; + var fields = [ + "id", + "template_id", + { + name: "status", + mapping: 'runtimeInfo["status"]', + }, + { + name: "startTime", + type: "date", + dateFormat: "timestamp", + mapping: 'runtimeInfo["startTime"]', + }, + { + name: "endTime", + type: "date", + dateFormat: "timestamp", + mapping: 'runtimeInfo["endTime"]', + }, + "running_jobs", + "failed_jobs", + "percent_done", + "percent_running", + "percent_failed", + ]; + + /*if (!Ext.ModelManager.isRegistered('workflowRuns')) Ext.define('workflowRuns', { extend : 'Ext.data.Model', fields : fields });*/ - var wRunStore = new Ext.data.Store({ - fields : fields, - proxy : { - type : 'ajax', - simpleSortMode : true, - batchActions : true, - timeout : 60000, // Timeout of 60 seconds - api : { - read : this.op_url + "/getRunList", - destroy : this.op_url + "/deleteRuns" - }, - reader : { - type : 'json', - root: 'rows', - totalProperty: 'results', - idProperty : 'id' - }, - writer : { - type : 'json', - encode : true, - root: 'json', - writeAllFields : false - }, - }, - pageSize: PAGESIZE, - sorters : [ - { - property : 'startTime', - direction : 'DESC' - } - ], - autoSync : true - }); - - var This = this; - var grid = new Ext.grid.GridPanel({ - columns : [ - { - header : 'Template', - dataIndex : 'id', - flex : 1, - renderer : This.formatRunListItem, - sortable : true, - menuDisabled : true - }, { - header : 'Progress', - dataIndex : 'percent_done', - sortable : true, - width : 200, - renderer : This.formatProgressBar, - menuDisabled : true - }, { - header : 'Start Time', - dataIndex : 'startTime', - sortable : true, - xtype : 'datecolumn', - format : 'g:i:s a, M d, Y', - width : 150, - menuDisabled : true - }, { - header : 'End Time', - dataIndex : 'endTime', - sortable : true, - xtype : 'datecolumn', - format : 'g:i:s a, M d, Y', - width : 150, - menuDisabled : true - } - ], - title : 'My Runs', - multiSelect: true, - allowDeselect: true, - // autoExpandColumn: 'title', - bodyCls : 'multi-line-grid', - border : false, - split : true, - tbar : [ - { - text : 'Delete', - iconCls : 'icon-del fa fa-red', - disabled : true, - id : 'delButton', - handler : function() { - var recs = grid.getSelectionModel().getSelection(); - if (recs && recs.length) { - wRunStore.remove(recs); - This.tabPanel.remove(This.tabPanel.getActiveTab()); - } - } - }, - { - text : 'Re-run', - iconCls : 'icon-reload fa fa-green', - disabled : false, - id : 'rerunButton', - handler : function() { - var recs = grid.getSelectionModel().getSelection(); - if (recs && recs.length) { - This.reRun(recs[0]); - } - } - }, - { - text : 'Stop', - iconCls : 'icon-cancel fa fa-red', - id : 'stopButton', - disabled : true, - handler : function() { - var recs = grid.getSelectionModel().getSelection(); - if (recs && recs.length) { - This.stopRun(recs[0]); - } - } - }, '-', - { - xtype: 'textfield', - id: 'searchText', - }, - { - text: 'Search', - handler : function() { - wRunStore.load({ - start: 0, - limit: PAGESIZE, - params: { - pattern: grid.down('#searchText').value - } - }); - } - }, - '-', - { - xtype : 'tbfill' - }, '-', { - text : 'Reload', - iconCls : 'icon-reload fa fa-green', - handler : function() { - wRunStore.load({ - start: 0, - limit: PAGESIZE, - params: { - pattern: grid.down('#searchText').value - } - }); - } - } - ], - store : wRunStore, - dockedItems: [{ - xtype: 'pagingtoolbar', - store: wRunStore, // same store GridPanel is using - dock: 'bottom', - displayInfo: true - }], - }); - - grid.getSelectionModel().on("focuschange", function(item, oldrec, rec, opts) { - if(rec) { - This.openRunDetails(rec.data.id, rec.data.status); - grid.down('#delButton').setDisabled(false); - if(rec.data.status == 'RUNNING') - grid.down('#stopButton').setDisabled(false); - else - grid.down('#stopButton').setDisabled(true); - // Ext.EventManager.stopEvent(event); - } - }, this); - - if (this.runid) { - var fn = function() { - This.selectRunInList(This.runid); - wRunStore.un('load', fn); - }; - wRunStore.on('load', fn); - } - - wRunStore.on('load', function() { - This.refreshOpenRunTabs(grid, wRunStore); - }); - - var gridListRefresh = { - run : function() { - wRunStore.load({ - start: 0, - limit: PAGESIZE, - params: { - pattern: grid.down('#searchText').value - } - }); - }, - interval : 120000 - // 120 seconds - }; - - // Disabling automatic refresh - // Ext.TaskManager.start(gridListRefresh); - gridListRefresh.run(); - - return grid; + var wRunStore = new Ext.data.Store({ + fields: fields, + proxy: { + type: "ajax", + simpleSortMode: true, + batchActions: true, + timeout: 60000, // Timeout of 60 seconds + api: { + read: this.op_url + "/getRunList", + destroy: this.op_url + "/deleteRuns", + }, + reader: { + type: "json", + root: "rows", + totalProperty: "results", + idProperty: "id", + }, + writer: { + type: "json", + encode: true, + root: "json", + writeAllFields: false, + }, + }, + pageSize: PAGESIZE, + sorters: [ + { + property: "startTime", + direction: "DESC", + }, + ], + autoSync: true, + }); + + var This = this; + var grid = new Ext.grid.GridPanel({ + columns: [ + { + header: "Template", + dataIndex: "id", + flex: 1, + renderer: This.formatRunListItem, + sortable: true, + menuDisabled: true, + }, + { + header: "Progress", + dataIndex: "percent_done", + sortable: true, + width: 200, + renderer: This.formatProgressBar, + menuDisabled: true, + }, + { + header: "Start Time", + dataIndex: "startTime", + sortable: true, + xtype: "datecolumn", + format: "g:i:s a, M d, Y", + width: 150, + menuDisabled: true, + }, + { + header: "End Time", + dataIndex: "endTime", + sortable: true, + xtype: "datecolumn", + format: "g:i:s a, M d, Y", + width: 150, + menuDisabled: true, + }, + ], + title: "My Runs", + multiSelect: true, + allowDeselect: true, + // autoExpandColumn: 'title', + bodyCls: "multi-line-grid", + border: false, + split: true, + tbar: [ + { + text: "Delete", + iconCls: "icon-del fa fa-red", + disabled: true, + id: "delButton", + handler: function () { + var recs = grid.getSelectionModel().getSelection(); + if (recs && recs.length) { + wRunStore.remove(recs); + This.tabPanel.remove(This.tabPanel.getActiveTab()); + } + }, + }, + { + text: "Re-run", + iconCls: "icon-reload fa fa-green", + disabled: false, + id: "rerunButton", + handler: function () { + var recs = grid.getSelectionModel().getSelection(); + if (recs && recs.length) { + This.reRun(recs[0]); + } + }, + }, + { + text: "Stop", + iconCls: "icon-cancel fa fa-red", + id: "stopButton", + disabled: true, + handler: function () { + var recs = grid.getSelectionModel().getSelection(); + if (recs && recs.length) { + This.stopRun(recs[0]); + } + }, + }, + "-", + { + xtype: "textfield", + id: "searchText", + }, + { + text: "Search", + handler: function () { + wRunStore.load({ + start: 0, + limit: PAGESIZE, + params: { + pattern: grid.down("#searchText").value, + }, + }); + }, + }, + "-", + { + xtype: "tbfill", + }, + "-", + { + text: "Reload", + iconCls: "icon-reload fa fa-green", + handler: function () { + wRunStore.load({ + start: 0, + limit: PAGESIZE, + params: { + pattern: grid.down("#searchText").value, + }, + }); + }, + }, + ], + store: wRunStore, + dockedItems: [ + { + xtype: "pagingtoolbar", + store: wRunStore, // same store GridPanel is using + dock: "bottom", + displayInfo: true, + }, + ], + }); + + grid.getSelectionModel().on( + "focuschange", + function (item, oldrec, rec, opts) { + if (rec) { + This.openRunDetails(rec.data.id, rec.data.status); + grid.down("#delButton").setDisabled(false); + if (rec.data.status == "RUNNING") + grid.down("#stopButton").setDisabled(false); + else grid.down("#stopButton").setDisabled(true); + // Ext.EventManager.stopEvent(event); + } + }, + this + ); + + if (this.runid) { + var fn = function () { + This.selectRunInList(This.runid); + wRunStore.un("load", fn); + }; + wRunStore.on("load", fn); + } + + wRunStore.on("load", function () { + This.refreshOpenRunTabs(grid, wRunStore); + }); + + var gridListRefresh = { + run: function () { + wRunStore.load({ + start: 0, + limit: PAGESIZE, + params: { + pattern: grid.down("#searchText").value, + }, + }); + }, + interval: 120000, + // 120 seconds + }; + + // Disabling automatic refresh + // Ext.TaskManager.start(gridListRefresh); + gridListRefresh.run(); + + return grid; }; -RunBrowser.prototype.selectRunInList = function(runid) { - var This = this; - if(!runid) - this.runList.getSelectionModel().deselectAll(); - this.runList.getStore().each(function(rec) { - if (rec.data.id == runid) - This.runList.getSelectionModel().setLastFocused(rec); - /* +RunBrowser.prototype.selectRunInList = function (runid) { + var This = this; + if (!runid) this.runList.getSelectionModel().deselectAll(); + this.runList.getStore().each(function (rec) { + if (rec.data.id == runid) + This.runList.getSelectionModel().setLastFocused(rec); + /* This.runList.getSelectionModel().select([ rec ]);*/ - }); + }); }; -RunBrowser.prototype.initialize = function() { - var This = this; - // Add the result tabPanel in the center - This.tabPanel = new Ext.TabPanel({ - region : 'center', - margins : '0 5 5 5', - enableTabScroll : true, - resizeTabs : true, - plain: true, - border: true, - // minTabWidth: 175, - // tabWidth: 175, - items : [ - { - layout : 'fit', - title : 'Run Manager', - autoLoad : { - url : This.op_url + '/intro' - } - } - ] - }); - - This.runList = This.getRunList(); - Ext.apply(This.runList, { - region : 'north', - margins: 5, - border: true, - height : '40%', - split : true - }); - - This.tabPanel.on('tabchange', function(tp, tab) { - This.selectRunInList(tab.runid); - }); - - var mainpanel = new Ext.Viewport({ - layout : 'border', - items: [ - getPortalHeader(), - { - xtype:'panel', - region:'center', - layout:'border', - border: false, - items : [ This.runList, This.tabPanel ] - } - ] - }); - if (!This.runid) - This.tabPanel.setActiveTab(0); - return mainpanel; +RunBrowser.prototype.initialize = function () { + var This = this; + // Add the result tabPanel in the center + This.tabPanel = new Ext.TabPanel({ + region: "center", + margins: "0 5 5 5", + enableTabScroll: true, + resizeTabs: true, + plain: true, + border: true, + // minTabWidth: 175, + // tabWidth: 175, + items: [ + { + layout: "fit", + title: "Run Manager", + autoLoad: { + url: This.op_url + "/intro", + }, + }, + ], + }); + + This.runList = This.getRunList(); + Ext.apply(This.runList, { + region: "north", + margins: 5, + border: true, + height: "40%", + split: true, + }); + + This.tabPanel.on("tabchange", function (tp, tab) { + This.selectRunInList(tab.runid); + }); + + var mainpanel = new Ext.Viewport({ + layout: "border", + items: [ + getPortalHeader(), + { + xtype: "panel", + region: "center", + layout: "border", + border: false, + items: [This.runList, This.tabPanel], + }, + ], + }); + if (!This.runid) This.tabPanel.setActiveTab(0); + return mainpanel; }; diff --git a/wings-docker/config/default/portal.properties b/wings-docker/config/default/portal.properties index dace1762..6793ac50 100644 --- a/wings-docker/config/default/portal.properties +++ b/wings-docker/config/default/portal.properties @@ -8,7 +8,7 @@ server = http://localhost:8080; graphviz = /usr/bin/dot; light-reasoner = false; - ontology = + ontology = { data = http://www.wings-workflows.org/ontology/data.owl; component = http://www.wings-workflows.org/ontology/component.owl; @@ -16,16 +16,16 @@ execution = http://www.wings-workflows.org/ontology/execution.owl; } - execution = + execution = { - engine = + engine = { name = Local; implementation = edu.isi.wings.execution.engine.api.impl.local.LocalExecutionEngine; type = BOTH; } - engine = + engine = { name = Distributed; implementation = edu.isi.wings.execution.engine.api.impl.distributed.DistributedExecutionEngine; @@ -44,8 +44,8 @@ password = "password"; } triple-store = { - publish = http://ontosoft.isi.edu:3030/provenance/data; - query = http://ontosoft.isi.edu:3030/provenance/sparql; + publish = https://provenance/data; + query = http://localhost:3030/provenance/sparql; domains-directory = /opt/wings/storage/default; } } diff --git a/wings-docker/config/default/settings.xml b/wings-docker/config/default/settings.xml deleted file mode 100644 index 19fca2ba..00000000 --- a/wings-docker/config/default/settings.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - github - - - - - github - - - central - https://repo1.maven.org/maven2 - - - WINGS-OPMW-Mapper - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/WINGS-OPMW-Mapper - - true - - - - ontapi - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/ontapi - - true - - - - - - - - - github - mosoriob - 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 - - -