You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/17 12:29:29 UTC
[25/50] [abbrv] incubator-taverna-server git commit: Merge branch
'2.5-branch' into taverna-3
Merge branch '2.5-branch' into taverna-3
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/commit/ad1aa3b5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/tree/ad1aa3b5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/diff/ad1aa3b5
Branch: refs/heads/master
Commit: ad1aa3b580edd9023ab0519875c2a07673d97ce4
Parents: b1bea56 d285a5f
Author: Donal Fellows <do...@manchester.ac.uk>
Authored: Sun May 11 18:35:58 2014 +0100
Committer: Donal Fellows <do...@manchester.ac.uk>
Committed: Sun May 11 18:35:58 2014 +0100
----------------------------------------------------------------------
.gitignore | 3 +
.opf.yml | 12 +
CITATION | 18 +
LICENCE | 504 +++++++
LICENCE.txt | 504 -------
README.md | 12 +-
install.docx | Bin 163930 -> 173172 bytes
install.pdf | Bin 9017083 -> 7797358 bytes
pom.xml | 157 +-
release-notes.txt | 83 +-
server-distribution/pom.xml | 6 +-
server-port-description/.gitignore | 1 +
server-port-description/pom.xml | 26 +-
.../server/port_description/AbsentValue.java | 2 +-
.../server/port_description/AbstractPort.java | 4 +-
.../AbstractPortDescription.java | 2 +-
.../server/port_description/AbstractValue.java | 2 +-
.../server/port_description/ErrorValue.java | 2 +-
.../port_description/InputDescription.java | 4 +-
.../server/port_description/LeafValue.java | 2 +-
.../server/port_description/ListValue.java | 4 +-
.../server/port_description/Namespaces.java | 2 +-
.../port_description/OutputDescription.java | 6 +-
.../server/port_description/package-info.java | 2 +-
.../port_description/utils/IntAdapter.java | 2 +-
server-rmidaemon/pom.xml | 64 +
.../org/taverna/server/rmidaemon/Registry.java | 72 +
.../taverna/server/rmidaemon/package-info.java | 5 +
server-runinterface/.gitignore | 1 +
server-runinterface/pom.xml | 30 +-
.../remote/IllegalStateTransitionException.java | 2 +-
.../remote/ImplementationException.java | 3 +-
.../localworker/remote/RemoteDirectory.java | 14 +-
.../remote/RemoteDirectoryEntry.java | 10 +-
.../server/localworker/remote/RemoteFile.java | 16 +-
.../server/localworker/remote/RemoteInput.java | 39 +-
.../localworker/remote/RemoteListener.java | 18 +-
.../localworker/remote/RemoteRunFactory.java | 16 +-
.../remote/RemoteSecurityContext.java | 19 +-
.../localworker/remote/RemoteSingleRun.java | 73 +-
.../server/localworker/remote/RemoteStatus.java | 2 +-
.../remote/StillWorkingOnItException.java | 3 +-
.../server/localworker/remote/package-info.java | 2 +-
.../localworker/server/UsageRecordReceiver.java | 2 +-
.../server/localworker/server/package-info.java | 2 +-
server-unix-forker/pom.xml | 29 +-
.../org/taverna/server/unixforker/Forker.java | 15 +-
server-usagerecord/.gitignore | 1 +
server-usagerecord/pom.xml | 37 +-
.../main/java/org/ogf/usage/JobUsageRecord.java | 13 +-
server-webapp/.gitignore | 1 +
server-webapp/.springBeans | 59 +
server-webapp/pom.xml | 276 ++--
.../resources/datanucleus_log4j.properties | 4 +
.../org/taverna/server/master/ContentTypes.java | 50 -
.../master/ContentsDescriptorBuilder.java | 46 +-
.../taverna/server/master/DirectoryREST.java | 65 +-
.../server/master/FileConcatenation.java | 68 +
.../org/taverna/server/master/InputREST.java | 140 +-
.../taverna/server/master/InteractionFeed.java | 107 ++
.../server/master/ListenerPropertyREST.java | 26 +-
.../taverna/server/master/ListenersREST.java | 29 +-
.../taverna/server/master/ManagementModel.java | 61 -
.../taverna/server/master/ManagementState.java | 18 +-
.../java/org/taverna/server/master/RunREST.java | 263 +++-
.../taverna/server/master/RunSecurityREST.java | 97 +-
.../server/master/SingleListenerREST.java | 35 +-
.../taverna/server/master/TavernaServer.java | 1365 +++++++++++++++++-
.../server/master/TavernaServerImpl.java | 1046 --------------
.../server/master/TavernaServerSupport.java | 297 +++-
.../org/taverna/server/master/admin/Admin.java | 681 ++++++---
.../taverna/server/master/admin/AdminBean.java | 319 +++-
.../server/master/admin/package-info.java | 2 +-
.../taverna/server/master/api/ContentTypes.java | 50 +
.../server/master/api/DirectoryBean.java | 16 +
.../org/taverna/server/master/api/FeedBean.java | 13 +
.../taverna/server/master/api/InputBean.java | 21 +
.../server/master/api/ListenerPropertyBean.java | 15 +
.../server/master/api/ListenersBean.java | 13 +
.../server/master/api/ManagementModel.java | 61 +
.../server/master/api/OneListenerBean.java | 14 +
.../org/taverna/server/master/api/RunBean.java | 17 +
.../taverna/server/master/api/SecurityBean.java | 14 +
.../taverna/server/master/api/SupportAware.java | 21 +
.../server/master/api/TavernaServerBean.java | 101 ++
.../taverna/server/master/api/package-info.java | 6 +
.../server/master/common/Capability.java | 22 +
.../server/master/common/Credential.java | 7 +-
.../server/master/common/DirEntryReference.java | 2 +-
.../server/master/common/InputDescription.java | 10 +-
.../server/master/common/Namespaces.java | 6 +-
.../server/master/common/Permission.java | 2 +-
.../org/taverna/server/master/common/Roles.java | 6 +-
.../server/master/common/RunReference.java | 2 +-
.../taverna/server/master/common/Status.java | 2 +-
.../org/taverna/server/master/common/Trust.java | 3 +-
.../org/taverna/server/master/common/Uri.java | 327 ++++-
.../server/master/common/VersionedElement.java | 24 +-
.../taverna/server/master/common/Workflow.java | 94 +-
.../server/master/common/package-info.java | 2 +-
.../server/master/common/version/Version.java | 43 +
.../taverna/server/master/defaults/Default.java | 99 ++
.../server/master/defaults/package-info.java | 5 +
.../exceptions/BadInputPortNameException.java | 3 +-
.../exceptions/BadPropertyValueException.java | 2 +-
.../exceptions/BadStateChangeException.java | 2 +-
.../exceptions/FilesystemAccessException.java | 2 +-
.../exceptions/GeneralFailureException.java | 3 +-
.../exceptions/InvalidCredentialException.java | 3 +-
.../master/exceptions/NoCreateException.java | 2 +-
.../exceptions/NoCredentialException.java | 3 +-
.../master/exceptions/NoDestroyException.java | 2 +-
.../exceptions/NoDirectoryEntryException.java | 3 +-
.../master/exceptions/NoListenerException.java | 2 +-
.../master/exceptions/NoUpdateException.java | 2 +-
.../master/exceptions/NotOwnerException.java | 3 +-
.../master/exceptions/OverloadedException.java | 2 +-
.../master/exceptions/UnknownRunException.java | 6 +-
.../server/master/exceptions/package-info.java | 2 +-
.../taverna/server/master/facade/Facade.java | 28 +-
.../server/master/facade/package-info.java | 2 +-
.../factories/ConfigurableRunFactory.java | 12 +-
.../master/factories/ListenerFactory.java | 2 +-
.../server/master/factories/RunFactory.java | 2 +-
.../server/master/factories/package-info.java | 2 +-
.../identity/AuthorityDerivedIDMapper.java | 12 +-
.../master/identity/CompositeIDMapper.java | 2 +-
.../master/identity/ConstantIDMapper.java | 2 +-
.../server/master/identity/NameIDMapper.java | 2 +-
.../identity/StrippedDownAuthProvider.java | 278 ++++
.../taverna/server/master/identity/User.java | 29 +-
.../server/master/identity/UserStore.java | 206 +--
.../server/master/identity/UserStoreAPI.java | 91 ++
.../identity/WorkflowInternalAuthProvider.java | 304 ++++
.../server/master/identity/package-info.java | 2 +-
.../interaction/InteractionFeedSupport.java | 150 +-
.../server/master/interaction/package-info.java | 2 +-
.../server/master/interfaces/Database.java | 14 -
.../server/master/interfaces/Directory.java | 2 +-
.../master/interfaces/DirectoryEntry.java | 2 +-
.../taverna/server/master/interfaces/File.java | 5 +-
.../taverna/server/master/interfaces/Input.java | 29 +-
.../server/master/interfaces/Listener.java | 2 +-
.../master/interfaces/LocalIdentityMapper.java | 2 +-
.../master/interfaces/MessageDispatcher.java | 17 +-
.../server/master/interfaces/Policy.java | 33 +-
.../server/master/interfaces/RunStore.java | 2 +-
.../interfaces/SecurityContextFactory.java | 5 +-
.../server/master/interfaces/TavernaRun.java | 38 +-
.../interfaces/TavernaSecurityContext.java | 2 +-
.../master/interfaces/UriBuilderFactory.java | 43 +
.../server/master/interfaces/package-info.java | 2 +-
.../localworker/AbstractRemoteRunFactory.java | 263 ++--
.../master/localworker/CompletionNotifier.java | 39 -
.../server/master/localworker/ConfigBean.java | 37 -
.../master/localworker/ForkRunFactory.java | 187 +--
.../localworker/IdAwareForkRunFactory.java | 227 +--
.../master/localworker/LocalWorkerFactory.java | 31 +
.../localworker/LocalWorkerManagementState.java | 263 ----
.../master/localworker/LocalWorkerState.java | 263 ++--
.../master/localworker/PersistedState.java | 257 ++++
.../server/master/localworker/PolicyImpl.java | 122 --
.../master/localworker/RemoteRunDelegate.java | 894 ------------
.../master/localworker/RunConnection.java | 205 ---
.../server/master/localworker/RunDBSupport.java | 80 -
.../server/master/localworker/RunDatabase.java | 209 ---
.../master/localworker/RunDatabaseDAO.java | 259 ----
.../localworker/SecurityContextDelegate.java | 621 --------
.../SecurityContextDelegateImpl.java | 276 ----
.../localworker/SecurityContextFactory.java | 129 --
.../SimpleFormattedCompletionNotifier.java | 55 -
.../server/master/localworker/package-info.java | 2 +-
.../master/notification/EmailDispatcher.java | 7 +-
.../master/notification/JabberDispatcher.java | 12 +-
.../master/notification/NotificationEngine.java | 51 +-
.../notification/RateLimitedDispatcher.java | 4 +-
.../master/notification/SMSDispatcher.java | 47 +-
.../master/notification/TwitterDispatcher.java | 22 +-
.../master/notification/atom/AbstractEvent.java | 95 --
.../master/notification/atom/AtomFeed.java | 94 +-
.../master/notification/atom/EntryWriter.java | 29 -
.../server/master/notification/atom/Event.java | 110 ++
.../master/notification/atom/EventDAO.java | 90 +-
.../master/notification/atom/FeedWriter.java | 27 -
.../notification/atom/TerminationEvent.java | 79 -
.../master/notification/atom/package-info.java | 2 +-
.../master/notification/package-info.java | 2 +-
.../org/taverna/server/master/package-info.java | 2 +-
.../server/master/rest/ContentTypes.java | 28 +
.../server/master/rest/DirectoryContents.java | 11 +-
.../taverna/server/master/rest/FileSegment.java | 2 +-
.../server/master/rest/InteractionFeedREST.java | 24 +-
.../server/master/rest/ListenerDefinition.java | 2 +-
.../master/rest/MakeOrUpdateDirEntry.java | 2 +-
.../master/rest/TavernaServerDirectoryREST.java | 75 +-
.../master/rest/TavernaServerInputREST.java | 136 +-
.../master/rest/TavernaServerListenersREST.java | 123 +-
.../server/master/rest/TavernaServerREST.java | 287 ++--
.../master/rest/TavernaServerRunREST.java | 469 ++++--
.../master/rest/TavernaServerSecurityREST.java | 298 ++--
.../rest/handler/AccessDeniedHandler.java | 2 +-
.../rest/handler/BadInputPortNameHandler.java | 2 +-
.../rest/handler/BadPropertyValueHandler.java | 6 +-
.../rest/handler/BadStateChangeHandler.java | 6 +-
.../master/rest/handler/EntryHandler.java | 131 ++
.../server/master/rest/handler/FeedHandler.java | 66 +
.../rest/handler/FileConcatenationHandler.java | 61 +
.../master/rest/handler/FileMessageHandler.java | 4 +-
.../master/rest/handler/FileSegmentHandler.java | 2 +-
.../rest/handler/FilesystemAccessHandler.java | 2 +-
.../rest/handler/GeneralFailureHandler.java | 2 +-
.../server/master/rest/handler/HandlerCore.java | 6 +-
.../rest/handler/IllegalArgumentHandler.java | 2 +-
.../handler/ImplementationProblemHandler.java | 2 +-
.../rest/handler/InputStreamMessageHandler.java | 10 +-
.../rest/handler/InvalidCredentialHandler.java | 6 +-
.../rest/handler/JAXBExceptionHandler.java | 6 +-
.../rest/handler/NegotiationFailedHandler.java | 2 +-
.../master/rest/handler/NoCreateHandler.java | 2 +-
.../rest/handler/NoCredentialHandler.java | 2 +-
.../master/rest/handler/NoDestroyHandler.java | 2 +-
.../rest/handler/NoDirectoryEntryHandler.java | 2 +-
.../master/rest/handler/NoListenerHandler.java | 6 +-
.../master/rest/handler/NoUpdateHandler.java | 2 +-
.../master/rest/handler/NotOwnerHandler.java | 2 +-
.../master/rest/handler/OverloadedHandler.java | 2 +-
.../master/rest/handler/PermissionHandler.java | 2 +-
.../rest/handler/T2FlowDocumentHandler.java | 25 +-
.../master/rest/handler/URIListHandler.java | 4 +-
.../master/rest/handler/UnknownRunHandler.java | 2 +-
.../master/rest/handler/ZipStreamHandler.java | 4 +-
.../master/rest/handler/package-info.java | 2 +-
.../server/master/rest/package-info.java | 2 +-
.../taverna/server/master/soap/DirEntry.java | 100 ++
.../server/master/soap/FileContents.java | 7 +-
.../server/master/soap/PermissionList.java | 2 +-
.../server/master/soap/TavernaServerSOAP.java | 510 +++++--
.../server/master/soap/ZippedDirectory.java | 6 +-
.../server/master/soap/package-info.java | 2 +-
.../server/master/usage/UsageRecord.java | 3 +-
.../master/usage/UsageRecordRecorder.java | 13 +-
.../server/master/usage/package-info.java | 2 +-
.../server/master/utils/CallTimeLogger.java | 87 ++
.../server/master/utils/CallTimingFilter.java | 65 +
.../server/master/utils/CapabilityLister.java | 44 +
.../master/utils/CertificateChainFetcher.java | 187 +++
.../server/master/utils/Contextualizer.java | 35 +-
.../taverna/server/master/utils/DerbyUtils.java | 55 +
.../server/master/utils/FilenameUtils.java | 2 +-
.../server/master/utils/InvocationCounter.java | 2 +-
.../taverna/server/master/utils/JCECheck.java | 2 +-
.../taverna/server/master/utils/JDOSupport.java | 50 +-
.../master/utils/LoggingDerbyAdapter.java | 138 ++
.../taverna/server/master/utils/RestUtils.java | 32 +
.../master/utils/RuntimeExceptionWrapper.java | 2 +-
.../server/master/utils/UsernamePrincipal.java | 2 +-
.../master/utils/WebappAwareDataSource.java | 11 +-
.../taverna/server/master/utils/X500Utils.java | 7 +-
.../server/master/utils/package-info.java | 2 +-
.../master/worker/CompletionNotifier.java | 45 +
.../server/master/worker/FactoryBean.java | 26 +
.../server/master/worker/PasswordIssuer.java | 57 +
.../server/master/worker/PolicyImpl.java | 158 ++
.../server/master/worker/PolicyLimits.java | 43 +
.../server/master/worker/RemoteRunDelegate.java | 967 +++++++++++++
.../server/master/worker/RunConnection.java | 239 +++
.../server/master/worker/RunDBSupport.java | 83 ++
.../server/master/worker/RunDatabase.java | 311 ++++
.../server/master/worker/RunDatabaseDAO.java | 306 ++++
.../master/worker/RunFactoryConfiguration.java | 395 +++++
.../master/worker/SecurityContextDelegate.java | 649 +++++++++
.../worker/SecurityContextDelegateImpl.java | 298 ++++
.../master/worker/SecurityContextFactory.java | 154 ++
.../SimpleFormattedCompletionNotifier.java | 64 +
.../worker/VelocityCompletionNotifier.java | 105 ++
.../server/master/worker/WorkerModel.java | 203 +++
.../server/master/worker/package-info.java | 10 +
.../main/replacementscripts/executeworkflow.sh | 11 +-
server-webapp/src/main/resources/admin.html | 19 +-
.../src/main/resources/capabilities.properties | 38 +
.../src/main/resources/log4j.properties | 65 +-
.../src/main/resources/static/admin.js | 57 +-
.../src/main/resources/version.properties | 6 +-
server-webapp/src/main/resources/welcome.html | 38 +-
.../src/main/webapp/META-INF/persistence.xml | 7 +-
server-webapp/src/main/webapp/WEB-INF/beans.xml | 215 ++-
.../src/main/webapp/WEB-INF/insecure.xml | 61 +-
...orker.VelocityCompletionNotifier_email.vtmpl | 15 +
....worker.VelocityCompletionNotifier_sms.vtmpl | 1 +
...ker.VelocityCompletionNotifier_twitter.vtmpl | 1 +
.../src/main/webapp/WEB-INF/partsecure.xml | 36 +
.../src/main/webapp/WEB-INF/providers.xml | 22 +-
.../src/main/webapp/WEB-INF/secure.xml | 69 +-
.../webapp/WEB-INF/tavernaserver.properties | 5 +
server-webapp/src/main/webapp/WEB-INF/web.xml | 33 +-
.../src/main/webapp/WEB-INF/webappBeans.xml | 76 +-
.../src/main/webapp/WEB-INF/windows.xml | 79 -
server-webapp/src/misc/xsd/persistence_1_0.xsd | 305 ++++
.../taverna/server/master/JaxbSanityTest.java | 28 +-
.../server/master/TavernaServerImplTest.java | 22 +-
.../master/WorkflowSerializationTest.java | 15 +-
.../taverna/server/master/mocks/ExampleRun.java | 113 +-
.../taverna/server/master/mocks/MockPolicy.java | 12 +-
.../master/mocks/SimpleListenerFactory.java | 4 +-
.../mocks/SimpleNonpersistentRunStore.java | 9 +-
.../server/master/mocks/SimpleServerPolicy.java | 26 +-
.../src/test/resources/log4j.properties | 4 +
server-worker/pom.xml | 16 +-
.../server/localworker/api/Constants.java | 141 ++
.../server/localworker/api/RunAccounting.java | 22 +
.../taverna/server/localworker/api/Worker.java | 135 ++
.../server/localworker/api/WorkerFactory.java | 18 +
.../localworker/impl/DirectoryDelegate.java | 19 +-
.../server/localworker/impl/FileDelegate.java | 37 +-
.../server/localworker/impl/LocalWorker.java | 134 +-
.../server/localworker/impl/RunAccounting.java | 22 -
.../localworker/impl/SecurityConstants.java | 58 -
.../localworker/impl/TavernaRunManager.java | 101 +-
.../taverna/server/localworker/impl/Worker.java | 126 --
.../server/localworker/impl/WorkerCore.java | 732 ++++++----
.../server/localworker/impl/WorkerFactory.java | 17 -
.../impl/utils/FilenameVerifier.java | 6 +-
.../localworker/impl/utils/TimingOutTask.java | 40 +
.../localworker/impl/LocalWorkerTest.java | 31 +-
usage.docx | Bin 176537 -> 205350 bytes
usage.pdf | Bin 15668640 -> 14213122 bytes
326 files changed, 15992 insertions(+), 8753 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 69a73e8,89f0fc5..1e38f26
--- a/pom.xml
+++ b/pom.xml
@@@ -146,15 -148,17 +148,26 @@@
<releases />
</repository>
<repository>
+ <id>mygrid-snapshot-repository</id>
+ <name>myGrid Snapshot Repository</name>
+ <url>http://build.mygrid.org.uk/maven/snapshot-repository</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases />
+ </repository>
+ <repository>
+ <id>mygrid-snapshots</id>
+ <name>myGrid Snapshot Respository</name>
+ <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ <repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
@@@ -507,6 -544,6 +553,7 @@@
<module>server-unix-forker</module>
<module>server-usagerecord</module>
<module>server-port-description</module>
+ <module>server-execution-delegate</module>
+ <module>server-rmidaemon</module>
</modules>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-distribution/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-port-description/pom.xml
----------------------------------------------------------------------
diff --cc server-port-description/pom.xml
index f30e755,c699175..44a9d50
--- a/server-port-description/pom.xml
+++ b/server-port-description/pom.xml
@@@ -3,15 -3,13 +3,13 @@@
<parent>
<artifactId>server</artifactId>
<groupId>uk.org.taverna.server</groupId>
- <version>2.5.4</version>
+ <version>3.0-SNAPSHOT</version>
</parent>
<artifactId>server-port-description</artifactId>
- <name>Taverna Server Port Descriptor Types</name>
+ <name>Workflow Port Descriptor Types</name>
<description>The structural types used to describe ports on workflows, as exported by Taverna Server.</description>
<scm>
- <connection>scm:svn:http://taverna.googlecode.com/svn/taverna/products/uk.org.taverna.server/branches/2.4-release/server-port-description</connection>
- <developerConnection>scm:svn:https://taverna.googlecode.com/svn/taverna/products/uk.org.taverna.server/branches/2.4-release/server-port-description</developerConnection>
- <url>http://code.google.com/p/taverna/source/browse/taverna/products/uk.org.taverna.server/branches/2.4-release/server-port-description</url>
+ <url>${scmBrowseRoot}/server-port-description</url>
</scm>
<properties>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-rmidaemon/pom.xml
----------------------------------------------------------------------
diff --cc server-rmidaemon/pom.xml
index 0000000,1903f74..c2282b0
mode 000000,100644..100644
--- a/server-rmidaemon/pom.xml
+++ b/server-rmidaemon/pom.xml
@@@ -1,0 -1,64 +1,64 @@@
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>uk.org.taverna.server</groupId>
+ <artifactId>server</artifactId>
- <version>2.5.4</version>
++ <version>3.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>server-rmidaemon</artifactId>
+ <name>RMI registry daemon</name>
+ <description>Customised RMI registry that supports restricting to localhost.</description>
+ <scm>
+ <url>${scmBrowseRoot}/server-rmidaemon</url>
+ </scm>
+
+ <properties>
+ <project.build.sourceEncoding>US-ASCII</project.build.sourceEncoding>
+ <mainClass>org.taverna.server.rmidaemon.Registry</mainClass>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <encoding>US-ASCII</encoding>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ <archive>
+ <manifest>
+ <mainClass>${mainClass}</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-runinterface/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-runinterface/src/main/java/org/taverna/server/localworker/remote/RemoteRunFactory.java
----------------------------------------------------------------------
diff --cc server-runinterface/src/main/java/org/taverna/server/localworker/remote/RemoteRunFactory.java
index 3df8347,fb3af6d..eec4ab5
--- a/server-runinterface/src/main/java/org/taverna/server/localworker/remote/RemoteRunFactory.java
+++ b/server-runinterface/src/main/java/org/taverna/server/localworker/remote/RemoteRunFactory.java
@@@ -37,8 -37,8 +37,8 @@@ public interface RemoteRunFactory exten
* @throws RemoteException
* If anything goes wrong with the communication.
*/
- @NonNull
- RemoteSingleRun make(@NonNull byte[] workflow, @NonNull String creator,
+ @Nonnull
- RemoteSingleRun make(@Nonnull String workflow, @Nonnull String creator,
++ RemoteSingleRun make(@Nonnull byte[] workflow, @Nonnull String creator,
@Nullable UsageRecordReceiver usageRecordReceiver,
@Nullable UUID masterID) throws RemoteException;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-unix-forker/pom.xml
----------------------------------------------------------------------
diff --cc server-unix-forker/pom.xml
index 44552a0,0823b9f..cdbce7b
--- a/server-unix-forker/pom.xml
+++ b/server-unix-forker/pom.xml
@@@ -4,14 -4,11 +4,11 @@@
<parent>
<artifactId>server</artifactId>
<groupId>uk.org.taverna.server</groupId>
- <version>2.5.4</version>
+ <version>3.0-SNAPSHOT</version>
</parent>
<artifactId>server-unix-forker</artifactId>
- <name>Taverna Forking Invoker for Unix</name>
<scm>
- <connection>scm:svn:http://taverna.googlecode.com/svn/taverna/products/uk.org.taverna.server/branches/2.4-release/server-unix-forker</connection>
- <developerConnection>scm:svn:https://taverna.googlecode.com/svn/taverna/products/uk.org.taverna.server/branches/2.4-release/server-unix-forker</developerConnection>
- <url>http://code.google.com/p/taverna/source/browse/taverna/products/uk.org.taverna.server/branches/2.4-release/server-unix-forker</url>
+ <url>${scmBrowseRoot}/server-unix-forker</url>
</scm>
<properties>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-usagerecord/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/pom.xml
----------------------------------------------------------------------
diff --cc server-webapp/pom.xml
index 9b3d896,f5d7584..f56b9c5
--- a/server-webapp/pom.xml
+++ b/server-webapp/pom.xml
@@@ -17,21 -15,17 +15,19 @@@
</scm>
<properties>
- <version.cxf>2.5.2</version.cxf>
- <version.spring>3.0.7.RELEASE</version.spring>
- <version.spring-security>3.0.7.RELEASE</version.spring-security>
+ <version.cxf>2.7.7</version.cxf>
+ <version.spring>3.2.5.RELEASE</version.spring>
+ <version.spring-security>3.1.4.RELEASE</version.spring-security>
<version.asm>3.3.1</version.asm>
<version.smack>3.2.1</version.smack>
- <<<<<<< HEAD
- <version.commandline>2.5.0</version.commandline>
+ <!--<version.commandline>3.0.1-SNAPSHOT</version.commandline>-->
+ <version.commandline>3.0.0</version.commandline>
- =======
- <version.commandline>2.4.1i-1.0.2</version.commandline>
- >>>>>>> 2.4.1i-branch
+ <edition.commandline>enterprise</edition.commandline>
<version.jdoapi>3.0.1</version.jdoapi>
<forker.module>server-unix-forker</forker.module>
<util.dir>${project.build.directory}/${project.build.finalName}/WEB-INF/classes/util</util.dir>
+ <scufl2.version>0.9.2</scufl2.version>
+ <cmdline.dir>${util.dir}/taverna-commandline-${edition.commandline}-${version.commandline}</cmdline.dir>
</properties>
<dependencies>
@@@ -273,27 -274,21 +276,43 @@@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>1.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-extension-providers</artifactId>
+ <version>${version.cxf}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jettison</groupId>
+ <artifactId>jettison</artifactId>
+ <version>1.3.4</version>
+ <scope>runtime</scope>
+ </dependency>
++ <dependency>
+ <groupId>uk.org.taverna.scufl2</groupId>
+ <artifactId>scufl2-api</artifactId>
+ <version>${scufl2.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>uk.org.taverna.scufl2</groupId>
+ <artifactId>scufl2-t2flow</artifactId>
+ <version>${scufl2.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>uk.org.taverna.scufl2</groupId>
+ <artifactId>scufl2-rdfxml</artifactId>
+ <version>${scufl2.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <version>1.4.1</version>
+ </dependency>
</dependencies>
<dependencyManagement>
@@@ -550,11 -557,11 +581,12 @@@
<configuration>
<artifactItems>
<artifactItem>
- <groupId>net.sf.taverna.t2</groupId>
- <artifactId>taverna-commandline</artifactId>
+ <groupId>net.sf.taverna.t2.taverna-commandline</groupId>
+ <artifactId>taverna-commandline-${edition.commandline}</artifactId>
<version>${version.commandline}</version>
+ <classifier>bin</classifier>
<type>zip</type>
+ <classifier>bin</classifier>
<outputDirectory>${util.dir}</outputDirectory>
</artifactItem>
</artifactItems>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/ContentsDescriptorBuilder.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/ContentsDescriptorBuilder.java
index aea5129,f778e3a..ab43827
--- a/server-webapp/src/main/java/org/taverna/server/master/ContentsDescriptorBuilder.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/ContentsDescriptorBuilder.java
@@@ -12,11 -14,12 +12,11 @@@ import static org.taverna.server.master
import static org.taverna.server.master.common.Uri.secure;
import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
+import java.io.IOException;
- import java.net.URI;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.List;
+ import java.util.Set;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
@@@ -286,37 -380,4 +287,4 @@@ public class ContentsDescriptorBuilder
}
return desc;
}
-
- /**
- * How to manufacture URIs to workflow runs.
- *
- * @author Donal Fellows
- */
- public interface UriBuilderFactory {
- /**
- * Given a run, get a factory for RESTful URIs to resources associated
- * with it.
- *
- * @param run
- * The run in question.
- * @return The {@link URI} factory.
- */
- UriBuilder getRunUriBuilder(TavernaRun run);
-
- /**
- * @return a URI factory that is preconfigured to point to the base of
- * the webapp.
- */
- UriBuilder getBaseUriBuilder();
-
- /**
- * Resolves a URI with respect to the base URI of the factory.
- *
- * @param uri
- * The URI to resolve, or <tt>null</tt>.
- * @return The resolved URI, or <tt>null</tt> if <b>uri</b> is
- * <tt>null</tt>.
- */
- String resolve(String uri);
- }
--}
++}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/DirectoryREST.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/DirectoryREST.java
index 2098f9d,3284e57..116014b
--- a/server-webapp/src/main/java/org/taverna/server/master/DirectoryREST.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/DirectoryREST.java
@@@ -345,73 -369,4 +369,62 @@@ class DirectoryREST implements TavernaS
else
return noContent().build();
}
+
+ @Override
+ @CallCounted
+ public Response setFileContentsFromURL(List<PathSegment> filePath,
+ List<URI> referenceList, UriInfo ui)
+ throws NoDirectoryEntryException, NoUpdateException,
+ FilesystemAccessException {
+ support.permitUpdate(run);
+ Directory d;
+ String name;
+ if (filePath == null || filePath.size() == 0)
+ throw new FilesystemAccessException(
+ "Cannot create a file that is not in a directory.");
+
+ List<PathSegment> dirPath = new ArrayList<PathSegment>(filePath);
+ name = dirPath.remove(dirPath.size() - 1).getPath();
+ DirectoryEntry de = fileUtils.getDirEntry(run, dirPath);
+ if (!(de instanceof Directory)) {
+ throw new FilesystemAccessException(
+ "Cannot create a file that is not in a directory.");
+ }
+ d = (Directory) de;
+
+ File f = null;
+ boolean isNew = false;
+ for (DirectoryEntry e : d.getContents()) {
+ if (e.getName().equals(name)) {
+ if (e instanceof File) {
+ f = (File) e;
+ break;
+ }
+ throw new FilesystemAccessException(
+ "Cannot create a file that is not in a directory.");
+ }
+ }
+
+ if (referenceList.isEmpty() || referenceList.size() > 1)
+ return status(422).entity("URI list must have single URI in it")
+ .build();
+ ;
+
+ if (f == null) {
+ f = d.makeEmptyFile(support.getPrincipal(), name);
+ isNew = true;
+ }
+ try {
+ support.copyDataToFile(referenceList.get(0), f);
+ } catch (MalformedURLException ex) {
+ throw new NoUpdateException("failed to parse URI", ex);
+ } catch (IOException ex) {
+ throw new FilesystemAccessException("failed to transfer data from URI", ex);
+ }
+
+ if (isNew)
+ return created(ui.getAbsolutePath()).build();
+ else
+ return noContent().build();
+ }
}
-
- /**
- * Description of properties supported by {@link DirectoryREST}.
- *
- * @author Donal Fellows
- */
- interface DirectoryBean extends SupportAware {
- void setFileUtils(FilenameUtils fileUtils);
-
- DirectoryREST connect(TavernaRun run);
- }
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/RunREST.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/RunREST.java
index 1af76d3,a0c65b3..8b948d3
--- a/server-webapp/src/main/java/org/taverna/server/master/RunREST.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/RunREST.java
@@@ -10,23 -12,24 +12,25 @@@ import static javax.ws.rs.core.Response
import static javax.ws.rs.core.Response.status;
import static org.joda.time.format.ISODateTimeFormat.dateTime;
import static org.joda.time.format.ISODateTimeFormat.dateTimeParser;
- import static org.taverna.server.master.TavernaServerImpl.log;
+ import static org.taverna.server.master.TavernaServer.log;
+ import static org.taverna.server.master.common.Roles.SELF;
+ import static org.taverna.server.master.common.Roles.USER;
import static org.taverna.server.master.common.Status.Initialized;
import static org.taverna.server.master.common.Status.Operating;
+ import static org.taverna.server.master.utils.RestUtils.opt;
- import java.net.MalformedURLException;
- import java.net.URI;
import java.util.Date;
+ import javax.annotation.security.RolesAllowed;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
+ import javax.xml.bind.JAXBException;
- import org.apache.abdera.model.Entry;
- import org.apache.abdera.model.Feed;
import org.joda.time.DateTime;
+ import org.ogf.usage.JobUsageRecord;
import org.springframework.beans.factory.annotation.Required;
- import org.taverna.server.master.TavernaServerImpl.SupportAware;
+ import org.taverna.server.master.api.RunBean;
+import org.taverna.server.master.common.ProfileList;
import org.taverna.server.master.common.Status;
import org.taverna.server.master.common.Workflow;
import org.taverna.server.master.exceptions.BadStateChangeException;
@@@ -161,19 -177,8 +178,21 @@@ abstract class RunREST implements Taver
@Override
@CallCounted
+ public String getMainProfileName() {
+ String name = run.getWorkflow().getMainProfileName();
+ return (name == null ? "" : name);
+ }
+
+ @Override
+ @CallCounted
+ public ProfileList getProfiles() {
+ return support.getProfileDescriptor(run.getWorkflow());
+ }
+
+ @Override
+ @CallCounted
+ @PerfLogged
+ @RolesAllowed({ USER, SELF })
public DirectoryREST getWorkingDirectory() {
return makeDirectoryInterface().connect(run);
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/TavernaServerSupport.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/TavernaServerSupport.java
index 75dc3b8,c9a8dae..5c6d938
--- a/server-webapp/src/main/java/org/taverna/server/master/TavernaServerSupport.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/TavernaServerSupport.java
@@@ -34,11 -45,16 +45,17 @@@ import org.springframework.jmx.export.a
import org.springframework.jmx.export.annotation.ManagedMetric;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.security.core.Authentication;
+ import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
+ import org.taverna.server.master.api.ManagementModel;
+ import org.taverna.server.master.api.TavernaServerBean;
+ import org.taverna.server.master.common.Capability;
import org.taverna.server.master.common.Permission;
+import org.taverna.server.master.common.ProfileList;
+ import org.taverna.server.master.common.VersionedElement;
import org.taverna.server.master.common.Workflow;
+ import org.taverna.server.master.common.version.Version;
import org.taverna.server.master.exceptions.FilesystemAccessException;
import org.taverna.server.master.exceptions.NoCreateException;
import org.taverna.server.master.exceptions.NoDestroyException;
@@@ -58,12 -79,6 +80,8 @@@ import org.taverna.server.master.utils.
import org.taverna.server.master.utils.InvocationCounter;
import org.taverna.server.master.utils.UsernamePrincipal;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
- import edu.umd.cs.findbugs.annotations.NonNull;
- import edu.umd.cs.findbugs.annotations.Nullable;
- import edu.umd.cs.findbugs.annotations.SuppressWarnings;
-
/**
* Web application support utilities.
*
@@@ -697,22 -866,17 +870,24 @@@ public class TavernaServerSupport
if (len < 0)
break;
total += len;
- log.debug("read " + len + " bytes from source stream (total: "
- + total + ") bound for " + name);
+ if (log.isDebugEnabled())
+ log.debug("read " + len
+ + " bytes from source stream (total: " + total
+ + ") bound for " + name);
- if (len == buffer.length)
- file.appendContents(buffer);
- else {
+ if (len == buffer.length) {
+ if (first)
+ file.setContents(buffer);
+ else
+ file.appendContents(buffer);
+ } else {
byte[] newBuf = new byte[len];
System.arraycopy(buffer, 0, newBuf, 0, len);
- file.appendContents(newBuf);
+ if (first)
+ file.setContents(newBuf);
+ else
+ file.appendContents(newBuf);
}
+ first = false;
}
} catch (IOException exn) {
throw new FilesystemAccessException("failed to transfer bytes", exn);
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/common/Workflow.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/common/Workflow.java
index eab032d,9aa3669..ba6a68c
--- a/server-webapp/src/main/java/org/taverna/server/master/common/Workflow.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/common/Workflow.java
@@@ -1,7 -1,7 +1,7 @@@
/*
- * Copyright (C) 2010-2011 The University of Manchester
+ * Copyright (C) 2010-2012 The University of Manchester
*
- * See the file "LICENSE.txt" for license terms.
+ * See the file "LICENSE" for license terms.
*/
package org.taverna.server.master.common;
@@@ -37,25 -33,15 +37,27 @@@ import javax.xml.bind.annotation.XmlAny
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.taverna.server.master.rest.handler.Scufl2DocumentHandler;
+import org.taverna.server.master.rest.handler.T2FlowDocumentHandler;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+import uk.org.taverna.scufl2.api.common.NamedSet;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.io.ReaderException;
+import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+import uk.org.taverna.scufl2.api.io.WriterException;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+ import org.w3c.dom.Node;
+ import org.w3c.dom.NodeList;
/**
- * Encapsulation of a T2flow document.
+ * Encapsulation of a T2flow or Scufl2 document.
*
- * @author dkf
+ * @author Donal K. Fellows
*/
@XmlRootElement(name = "workflow")
@XmlType(name = "Workflow")
@@@ -251,18 -85,13 +253,15 @@@ public class Workflow implements Serial
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
try {
- int len = in.readInt();
- byte[] bytes = new byte[len];
- in.readFully(bytes);
- try (Reader r = new InputStreamReader(new InflaterInputStream(
- new ByteArrayInputStream(bytes)), ENCODING)) {
- this.content = ((Workflow) unmarshaller.unmarshal(r)).content;
- }
+ ByteArrayInputStream bytes = readbytes(in);
- if (bytes != null) {
- Reader r = new InputStreamReader(bytes, ENCODING);
- Workflow w = (Workflow) unmarshaller.unmarshal(r);
- r.close();
- this.content = w.content;
- }
++ if (bytes != null)
++ try (Reader r = new InputStreamReader(bytes, ENCODING)) {
++ content = ((Workflow) unmarshaller.unmarshal(r)).content;
++ }
+ bytes = readbytes(in);
- if (bytes != null) {
- this.bundle = io.readBundle(bytes, SCUFL2);
- }
- this.isBundleFirst = in.readBoolean();
++ if (bytes != null)
++ bundle = io.readBundle(bytes, SCUFL2);
++ isBundleFirst = in.readBoolean();
return;
} catch (JAXBException e) {
throw new IOException("failed to unmarshal", e);
@@@ -273,55 -100,72 +272,96 @@@
}
}
+ private byte[] getAsT2Flow() throws IOException, JAXBException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ OutputStreamWriter w = new OutputStreamWriter(baos, ENCODING);
+ marshaller.marshal(this, w);
+ w.close();
+ return baos.toByteArray();
+ }
+
+ private byte[] getAsScufl2() throws IOException, WriterException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ io.writeBundle(bundle, baos, SCUFL2);
+ baos.close();
+ return baos.toByteArray();
+ }
+
@Override
public void writeExternal(ObjectOutput out) throws IOException {
- if (content != null)
- try {
- writebytes(out, getAsT2Flow());
- } catch (JAXBException e) {
- throw new IOException("failed to marshal t2flow", e);
- }
- else
- writebytes(out, null);
- if (bundle != null)
- try {
- writebytes(out, getAsScufl2());
- } catch (WriterException e) {
- throw new IOException("failed to marshal scufl2", e);
- }
- else
- writebytes(out, null);
+ try {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- try (OutputStreamWriter w = new OutputStreamWriter(
- new DeflaterOutputStream(baos), ENCODING)) {
- marshaller.marshal(this, w);
- }
- byte[] bytes = baos.toByteArray();
- out.writeInt(bytes.length);
- out.write(bytes);
++ writebytes(out, (content != null) ? getAsT2Flow() : null);
+ } catch (JAXBException e) {
- throw new IOException("failed to marshal", e);
++ throw new IOException("failed to marshal t2flow", e);
+ }
++ try {
++ writebytes(out, (bundle != null) ? getAsScufl2() : null);
++ } catch (WriterException e) {
++ throw new IOException("failed to marshal scufl2", e);
++ }
+ out.writeBoolean(isBundleFirst);
+ }
+
+ private ByteArrayInputStream readbytes(ObjectInput in) throws IOException {
+ int len = in.readInt();
+ if (len > 0) {
+ byte[] bytes = new byte[len];
+ in.readFully(bytes);
+ return new ByteArrayInputStream(bytes);
+ }
+ return null;
+ }
+
+ private void writebytes(ObjectOutput out, byte[] data) throws IOException {
+ out.writeInt(data == null ? 0 : data.length);
+ if (data != null && data.length > 0)
+ out.write(data);
}
+
+ /**
+ * Make up for the lack of an integrated XPath engine.
+ *
+ * @param name
+ * The element names to look up from the root of the contained
+ * document.
+ * @return The looked up element, or <tt>null</tt> if it doesn't exist.
+ */
+ private Element getEl(String... name) {
- Element el = null;
- for (Element e : content)
- if (e.getNamespaceURI().equals(T2FLOW)
- && e.getLocalName().equals(name[0])) {
- el = e;
- break;
- }
++ Element el = content;
+ boolean skip = true;
+ for (String n : name) {
+ if (skip) {
+ skip = false;
+ continue;
+ }
+ if (el == null)
+ return null;
- NodeList nl = el.getElementsByTagNameNS(T2FLOW, n);
++ NodeList nl = el.getElementsByTagNameNS(T2FLOW_NS, n);
+ if (nl.getLength() == 0)
+ return null;
+ Node node = nl.item(0);
+ if (node instanceof Element)
+ el = (Element) node;
+ else
+ return null;
+ }
+ return el;
+ }
+
+ /**
+ * @return The content of the embedded
+ * <tt><workflow><dataflow><name></tt> element.
+ */
+ @XmlTransient
+ public String getName() {
+ return getEl("workflow", "dataflow", "name").getTextContent();
+ }
+
+ /**
+ * @return The embedded <tt><workflow></tt> element.
+ */
+ @XmlTransient
+ public Element getWorkflowRoot() {
+ return getEl("workflow");
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/localworker/AbstractRemoteRunFactory.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/localworker/AbstractRemoteRunFactory.java
index 379cbdb,4394b4b..d2c9c91
--- a/server-webapp/src/main/java/org/taverna/server/master/localworker/AbstractRemoteRunFactory.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/localworker/AbstractRemoteRunFactory.java
@@@ -54,11 -50,14 +50,16 @@@ import org.taverna.server.master.intera
import org.taverna.server.master.interfaces.Listener;
import org.taverna.server.master.interfaces.SecurityContextFactory;
import org.taverna.server.master.interfaces.TavernaRun;
+ import org.taverna.server.master.interfaces.UriBuilderFactory;
+ import org.taverna.server.master.notification.atom.EventDAO;
import org.taverna.server.master.usage.UsageRecordRecorder;
import org.taverna.server.master.utils.UsernamePrincipal;
+ import org.taverna.server.master.worker.FactoryBean;
+ import org.taverna.server.master.worker.RemoteRunDelegate;
+ import org.taverna.server.master.worker.RunFactoryConfiguration;
+import uk.org.taverna.scufl2.api.io.WriterException;
+
/**
* Bridge to remote runs via RMI.
*
@@@ -441,26 -374,10 +376,16 @@@ public abstract class AbstractRemoteRun
* @throws JAXBException
* If serialization fails.
*/
- protected String serializeWorkflow(Workflow workflow) throws JAXBException {
- return workflow.marshal();
+ protected byte[] serializeWorkflow(Workflow workflow) throws JAXBException {
+ try {
+ return workflow.getScufl2Bytes();
+ } catch (IOException e) {
+ throw new JAXBException("problem converting to scufl2", e);
+ } catch (WriterException e) {
+ throw new JAXBException("problem converting to scufl2", e);
+ }
}
- @Override
- public boolean isAllowingRunsToStart() {
- try {
- return state.getOperatingLimit() > getOperatingCount();
- } catch (Exception e) {
- log.info("failed to get operating run count", e);
- return false;
- }
- }
-
/**
* Make a Remote object that can act as a consumer for usage records.
*
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/localworker/ForkRunFactory.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/localworker/ForkRunFactory.java
index 0ebdad2,0449471..dccfeac
--- a/server-webapp/src/main/java/org/taverna/server/master/localworker/ForkRunFactory.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/localworker/ForkRunFactory.java
@@@ -461,8 -345,8 +345,8 @@@ public class ForkRunFactory extends Abs
* @throws RemoteException
* If anything fails (communications error, etc.)
*/
- private RemoteSingleRun getRealRun(@NonNull UsernamePrincipal creator,
- @NonNull byte[] wf, UUID id) throws RemoteException {
+ private RemoteSingleRun getRealRun(@Nonnull UsernamePrincipal creator,
- @Nonnull String wf, UUID id) throws RemoteException {
++ @Nonnull byte[] wf, UUID id) throws RemoteException {
String globaluser = "Unknown Person";
if (creator != null)
globaluser = creator.getName();
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/localworker/IdAwareForkRunFactory.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/localworker/IdAwareForkRunFactory.java
index 88e136b,6edf128..1115f25
--- a/server-webapp/src/main/java/org/taverna/server/master/localworker/IdAwareForkRunFactory.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/localworker/IdAwareForkRunFactory.java
@@@ -431,8 -271,8 +271,8 @@@ public class IdAwareForkRunFactory exte
* @throws RemoteException
* If anything fails (communications error, etc.)
*/
- private RemoteSingleRun getRealRun(@NonNull UsernamePrincipal creator,
- @NonNull String username, @NonNull byte[] wf, UUID id)
+ private RemoteSingleRun getRealRun(@Nonnull UsernamePrincipal creator,
- @Nonnull String username, @Nonnull String wf, UUID id)
++ @Nonnull String username, @Nonnull byte[] wf, UUID id)
throws RemoteException {
String globaluser = "Unknown Person";
if (creator != null)
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerDirectoryREST.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerREST.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerREST.java
index c18cfd8,1e9f4a2..62158bb
--- a/server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerREST.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerREST.java
@@@ -5,8 -5,20 +5,21 @@@
*/
package org.taverna.server.master.rest;
+ import static org.taverna.server.master.common.Namespaces.SERVER;
import static org.taverna.server.master.common.Roles.USER;
+ import static org.taverna.server.master.rest.ContentTypes.JSON;
+ import static org.taverna.server.master.rest.ContentTypes.URI_LIST;
+ import static org.taverna.server.master.rest.ContentTypes.XML;
+ import static org.taverna.server.master.rest.TavernaServerREST.PathNames.POL;
+ import static org.taverna.server.master.rest.TavernaServerREST.PathNames.POL_CAPABILITIES;
+ import static org.taverna.server.master.rest.TavernaServerREST.PathNames.POL_NOTIFIERS;
+ import static org.taverna.server.master.rest.TavernaServerREST.PathNames.POL_OP_LIMIT;
+ import static org.taverna.server.master.rest.TavernaServerREST.PathNames.POL_PERM_LIST;
+ import static org.taverna.server.master.rest.TavernaServerREST.PathNames.POL_PERM_WF;
+ import static org.taverna.server.master.rest.TavernaServerREST.PathNames.POL_RUN_LIMIT;
+ import static org.taverna.server.master.rest.TavernaServerREST.PathNames.ROOT;
+ import static org.taverna.server.master.rest.TavernaServerREST.PathNames.RUNS;
+import static org.taverna.server.master.rest.handler.Scufl2DocumentHandler.SCUFL2;
import static org.taverna.server.master.rest.handler.T2FlowDocumentHandler.T2FLOW;
import java.net.URI;
@@@ -25,15 -39,14 +40,16 @@@ import javax.ws.rs.core.Context
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
- import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchemaType;
- import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+ import org.apache.abdera.model.Entry;
+ import org.apache.abdera.model.Feed;
import org.apache.cxf.jaxrs.model.wadl.Description;
+ import org.taverna.server.master.common.Capability;
import org.taverna.server.master.common.RunReference;
import org.taverna.server.master.common.Uri;
import org.taverna.server.master.common.VersionedElement;
@@@ -42,13 -56,10 +59,10 @@@ import org.taverna.server.master.except
import org.taverna.server.master.exceptions.NoUpdateException;
import org.taverna.server.master.exceptions.UnknownRunException;
import org.taverna.server.master.interfaces.TavernaRun;
- import org.taverna.server.master.notification.atom.AbstractEvent;
import org.taverna.server.master.soap.TavernaServerSOAP;
- import edu.umd.cs.findbugs.annotations.NonNull;
-
/**
- * The REST service interface to Taverna 2.5.4 Server.
+ * The REST service interface to Taverna 3 Server.
*
* @author Donal Fellows
* @see TavernaServerSOAP
@@@ -97,13 -116,14 +119,14 @@@ public interface TavernaServerREST
* If the POST failed.
*/
@POST
- @Path("runs")
- @Consumes({ T2FLOW, SCUFL2, "application/xml" })
+ @Path(RUNS)
- @Consumes({ T2FLOW, XML })
++ @Consumes({ T2FLOW, SCUFL2, XML })
@RolesAllowed(USER)
- @Description("Accepts (or not) a request to create a new run executing the given workflow.")
- @NonNull
- Response submitWorkflow(@NonNull Workflow workflow,
- @NonNull @Context UriInfo ui) throws NoUpdateException;
+ @Description("Accepts (or not) a request to create a new run executing "
+ + "the given workflow.")
+ @Nonnull
+ Response submitWorkflow(@Nonnull Workflow workflow,
+ @Nonnull @Context UriInfo ui) throws NoUpdateException;
/**
* Accepts (or not) a request to create a new run executing the workflow at
@@@ -116,17 -136,27 +139,26 @@@
* @return A response to the POST describing what was created.
* @throws NoUpdateException
* If the POST failed.
- * @throws NoCreateException
- * If the workflow couldn't be read into the server or the
- * engine rejects it.
+ * @throw NoCreateException If the workflow couldn't be read into the server
+ * or the engine rejects it.
*/
@POST
- @Path("runs")
- @Consumes("application/xml")
+ @Path(RUNS)
+ @Consumes(URI_LIST)
@RolesAllowed(USER)
- @Description("Accepts a wrapped URL to a workflow to download and run. The URL must be hosted on a publicly-accessible service.")
- @NonNull
- Response submitWorkflowByURL(@NonNull WorkflowReference workflowReference,
- @NonNull @Context UriInfo ui) throws NoUpdateException;
+ @Description("Accepts a URL to a workflow to download and run. The URL "
+ + "must be hosted on a publicly-accessible service.")
+ @Nonnull
+ Response submitWorkflowByURL(@Nonnull List<URI> referenceList,
+ @Nonnull @Context UriInfo ui) throws NoCreateException,
+ NoUpdateException;
+
+ /** Get an outline of the operations supported. */
+ @OPTIONS
+ @Path(RUNS)
+ @Description("Produces the description of the operations on the "
+ + "collection of runs.")
+ Response runsOptions();
/**
* @return A description of the policies supported by this server.
@@@ -488,50 -581,9 +583,22 @@@
*/
@GET
@Path("{id}")
- @Produces({ "application/xml", "application/json",
- "application/atom+xml;type=entry" })
+ @Produces("application/atom+xml;type=entry")
@Description("Get a particular Atom event.")
- @NonNull
- AbstractEvent getEvent(@NonNull @PathParam("id") String id);
- }
-
- /**
- * A description of an collection of events.
- *
- * @author Donal Fellows
- */
- @XmlType(name = "Events")
- public static abstract class Events extends VersionedElement {
- /**
- * @return The owner of the events in question.
- */
- @XmlAttribute
- public abstract String getOwner();
-
- /**
- * @return The actual list of events.
- */
- @XmlElement
- public abstract List<AbstractEvent> getEvents();
-
- /**
- * @param id
- * The identifier of a particular event.
- * @return The details about that event.
- */
- public abstract AbstractEvent getEvent(String id);
+ @Nonnull
+ Entry getEvent(@Nonnull @PathParam("id") String id);
}
+
+ /**
+ * A reference to a workflow hosted on some public HTTP server.
+ *
+ * @author Donal Fellows
+ */
+ @XmlRootElement(name = "workflowurl")
+ @XmlType(name = "WorkflowReference")
+ public static class WorkflowReference {
+ @XmlValue
+ @XmlSchemaType(name = "anyURI")
+ public URI url;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerRunREST.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerRunREST.java
index 335b05c,536c455..2b328fd
--- a/server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerRunREST.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerRunREST.java
@@@ -8,8 -8,30 +8,32 @@@ package org.taverna.server.master.rest
import static javax.ws.rs.core.UriBuilder.fromUri;
import static org.joda.time.format.ISODateTimeFormat.basicDateTime;
import static org.taverna.server.master.common.Roles.USER;
+import static org.taverna.server.master.rest.handler.Scufl2DocumentHandler.SCUFL2;
import static org.taverna.server.master.interaction.InteractionFeedSupport.FEED_URL_DIR;
+ import static org.taverna.server.master.rest.ContentTypes.JSON;
+ import static org.taverna.server.master.rest.ContentTypes.ROBUNDLE;
+ import static org.taverna.server.master.rest.ContentTypes.TEXT;
+ import static org.taverna.server.master.rest.ContentTypes.XML;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.DIR;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.GENERATE_PROVENANCE;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.IN;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.LISTEN;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.LOG;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.NAME;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.OUT;
++import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.PROFILE;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.ROOT;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.RUNBUNDLE;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.SEC;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.STATUS;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.STDERR;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.STDOUT;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.T_CREATE;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.T_EXPIRE;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.T_FINISH;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.T_START;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.USAGE;
+ import static org.taverna.server.master.rest.TavernaServerRunREST.PathNames.WF;
import static org.taverna.server.master.rest.handler.T2FlowDocumentHandler.T2FLOW;
import java.net.URI;
@@@ -93,39 -124,50 +127,84 @@@ public interface TavernaServerRunREST
* @return The workflow document.
*/
@GET
- @Path("workflow")
- @Produces({ T2FLOW, SCUFL2, "application/xml", "application/json" })
+ @Path(WF)
- @Produces({ T2FLOW, XML, JSON })
++ @Produces({ T2FLOW, SCUFL2, XML, JSON })
@Description("Gives the workflow document used to create the workflow run.")
- @NonNull
+ @Nonnull
public Workflow getWorkflow();
+ /** Get an outline of the operations supported. */
+ @OPTIONS
+ @Path(WF)
+ @Description("Produces the description of the run workflow.")
+ Response workflowOptions();
+
+ /** Get the workflow name. */
+ @GET
+ @Path(NAME)
+ @Produces(TEXT)
+ @Description("Gives the descriptive name of the workflow run.")
+ @Nonnull
+ public String getName();
+
+ /**
+ * Set the workflow name.
+ *
+ * @throws NoUpdateException
+ * If the user is not permitted to change the workflow.
+ */
+ @PUT
+ @Path(NAME)
+ @Consumes(TEXT)
+ @Produces(TEXT)
+ @Description("Set the descriptive name of the workflow run. Note that "
+ + "this value may be arbitrarily truncated by the implementation.")
+ @Nonnull
+ public String setName(String name) throws NoUpdateException;
+
+ /** Produce the workflow name HTTP operations. */
+ @OPTIONS
+ @Path(NAME)
+ @Description("Produces the description of the operations on the run's "
+ + "descriptive name.")
+ @Nonnull
+ Response nameOptions();
+
/**
+ * Produces the name of the workflow's main profile.
+ *
+ * @return The main profile name, or the empty string if there is no such
+ * profile.
+ */
+ @GET
- @Path("profile")
- @Produces("text/plain")
++ @Path(PROFILE)
++ @Produces(TEXT)
+ @Description("Gives the name of the workflow's main profile, or the empty string if none is defined.")
- @NonNull
++ @Nonnull
+ String getMainProfileName();
+
+ /**
+ * Get a description of the profiles supported by the workflow document used
+ * to create this run.
+ *
+ * @return A description of the supported profiles.
+ */
+ @GET
- @Path("profile")
- @Produces({ "application/xml", "application/json" })
++ @Path(PROFILE)
++ @Produces({ XML, JSON })
+ @Description("Describes what profiles exist on the workflow.")
- @NonNull
++ @Nonnull
+ ProfileList getProfiles();
+
++ /** Produce the workflow profile HTTP operations. */
++ @OPTIONS
++ @Path(PROFILE)
++ @Description("Produces the description of the operations on the run's "
++ + "profile.")
++ @Nonnull
++ Response profileOptions();
++
+ /**
* Returns a resource that represents the workflow run's security
* properties. These may only be accessed by the owner.
*
@@@ -346,6 -433,155 +470,156 @@@
InteractionFeedREST getInteractionFeed();
/**
+ * @return The stdout for the workflow run, or empty string if the run has
+ * not yet started.
+ * @throws NoListenerException
+ */
+ @GET
+ @Path(STDOUT)
+ @Description("Return the stdout for the workflow run.")
+ @Produces(TEXT)
+ @Nonnull
+ String getStdout() throws NoListenerException;
+
+ /** Get an outline of the operations supported. */
+ @OPTIONS
+ @Path(STDOUT)
+ @Description("Return the stdout for the workflow run.")
+ Response stdoutOptions();
+
+ /**
+ * @return The stderr for the workflow run, or empty string if the run has
+ * not yet started.
+ * @throws NoListenerException
+ */
+ @GET
+ @Path(STDERR)
+ @Description("Return the stderr for the workflow run.")
+ @Produces(TEXT)
+ @Nonnull
+ String getStderr() throws NoListenerException;
+
+ /** Get an outline of the operations supported. */
+ @OPTIONS
+ @Path(STDERR)
+ @Description("Return the stderr for the workflow run.")
+ Response stderrOptions();
+
+ /**
+ * @return The usage record for the workflow run, wrapped in a Response, or
+ * "empty content" if the run has not yet finished.
+ * @throws NoListenerException
+ * @throws JAXBException
+ */
+ @GET
+ @Path(USAGE)
+ @Description("Return the usage record for the workflow run.")
+ @Produces(XML)
+ @Nonnull
+ Response getUsage() throws NoListenerException, JAXBException;
+
+ /** Get an outline of the operations supported. */
+ @OPTIONS
+ @Path(USAGE)
+ @Description("Return the usage record for the workflow run.")
+ Response usageOptions();
+
+ /**
+ * @return The log for the workflow run, or empty string if the run has not
+ * yet started.
+ */
+ @GET
+ @Path(LOG)
+ @Description("Return the log for the workflow run.")
+ @Produces(TEXT)
+ @Nonnull
+ Response getLogContents();
+
+ /** Get an outline of the operations supported. */
+ @OPTIONS
+ @Path(LOG)
+ @Description("Return the log for the workflow run.")
+ Response logOptions();
+
+ /**
+ * @return The log for the workflow run, or empty string if the run has not
+ * yet started.
+ */
+ @GET
+ @Path(RUNBUNDLE)
+ @Description("Return the run bundle for the workflow run.")
+ @Produces(ROBUNDLE)
+ @Nonnull
+ Response getRunBundle();
+
+ /** Get an outline of the operations supported. */
+ @OPTIONS
+ @Path(RUNBUNDLE)
+ @Description("Return the run bundle for the workflow run.")
+ Response runBundleOptions();
+
+ /**
+ * @return Whether to create the run bundle for the workflow run. Only
+ * usefully set-able before the start of the run.
+ */
+ @GET
+ @Path(GENERATE_PROVENANCE)
+ @Description("Whether to create the run bundle for the workflow run.")
+ @Produces(TEXT)
+ @Nonnull
+ boolean getGenerateProvenance();
+
+ /**
+ * @param provenanceFlag
+ * Whether to create the run bundle for the workflow run. Only
+ * usefully set-able before the start of the run.
+ * @return What it was actually set to.
+ * @throws NoUpdateException
+ */
+ @PUT
+ @Path(GENERATE_PROVENANCE)
+ @Description("Whether to create the run bundle for the workflow run.")
+ @Consumes(TEXT)
+ @Produces(TEXT)
+ @Nonnull
+ boolean setGenerateProvenance(boolean provenanceFlag) throws NoUpdateException;
+
+ /** Get an outline of the operations supported. */
+ @OPTIONS
+ @Path(GENERATE_PROVENANCE)
+ @Description("Whether to create the run bundle for the workflow run.")
+ Response generateProvenanceOptions();
+
+ /**
+ * Factored out path names used in the {@link TavernaServerRunREST}
+ * interface and related places.
+ *
+ * @author Donal Fellows
+ */
+ interface PathNames {
+ public static final String ROOT = "/";
+ public static final String WF = "workflow";
+ public static final String DIR = "wd";
+ public static final String NAME = "name";
+ public static final String T_EXPIRE = "expiry";
+ public static final String T_CREATE = "createTime";
+ public static final String T_START = "startTime";
+ public static final String T_FINISH = "finishTime";
+ public static final String STATUS = "status";
+ public static final String IN = "input";
+ public static final String OUT = "output";
++ public static final String PROFILE = "profile";
+ public static final String LISTEN = "listeners";
+ public static final String SEC = "security";
+ public static final String STDOUT = "stdout";
+ public static final String STDERR = "stderr";
+ public static final String USAGE = "usage";
+ public static final String LOG = "log";
+ public static final String RUNBUNDLE = "run-bundle";
+ public static final String GENERATE_PROVENANCE = "generate-provenance";
+ }
+
+ /**
* The description of where everything is in a RESTful view of a workflow
* run. Done with JAXB.
*
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/rest/handler/T2FlowDocumentHandler.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/rest/handler/T2FlowDocumentHandler.java
index 56419dc,78ee822..4227d80
--- a/server-webapp/src/main/java/org/taverna/server/master/rest/handler/T2FlowDocumentHandler.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/rest/handler/T2FlowDocumentHandler.java
@@@ -44,10 -43,10 +42,10 @@@ public class T2FlowDocumentHandler impl
private static final MediaType T2FLOW_TYPE = new MediaType("application",
"vnd.taverna.t2flow+xml");
public static final String T2FLOW = "application/vnd.taverna.t2flow+xml";
- private static final String T2FLOW_ROOTNAME = "workflow";
- private static final String T2FLOW_NS = "http://taverna.sf.net/2008/xml/t2flow";
+ public static final String T2FLOW_ROOTNAME = "workflow";
+ public static final String T2FLOW_NS = "http://taverna.sf.net/2008/xml/t2flow";
- private DocumentBuilder db;
- private Transformer transformer;
+ private DocumentBuilderFactory db;
+ private TransformerFactory transformer;
public T2FlowDocumentHandler() throws ParserConfigurationException,
TransformerConfigurationException {
@@@ -73,11 -70,14 +69,13 @@@
throws IOException, WebApplicationException {
Document doc;
try {
- doc = db.parse(entityStream);
+ doc = db.newDocumentBuilder().parse(entityStream);
} catch (SAXException e) {
throw new WebApplicationException(e, 403);
+ } catch (ParserConfigurationException e) {
+ throw new WebApplicationException(e);
}
- Workflow workflow = new Workflow();
- workflow.content = new Element[] { doc.getDocumentElement() };
+ Workflow workflow = new Workflow(doc.getDocumentElement());
if (doc.getDocumentElement().getNamespaceURI().equals(T2FLOW_NS)
&& doc.getDocumentElement().getNodeName()
.equals(T2FLOW_ROOTNAME))
@@@ -108,9 -108,12 +106,12 @@@
OutputStream entityStream) throws IOException,
WebApplicationException {
try {
- transformer.transform(new DOMSource(workflow.getT2flowWorkflow()),
+ transformer.newTransformer().transform(
- new DOMSource(workflow.content[0]),
++ new DOMSource(workflow.getT2flowWorkflow()),
new StreamResult(entityStream));
} catch (TransformerException e) {
+ if (e.getCause() != null && e.getCause() instanceof IOException)
+ throw (IOException) e.getCause();
throw new WebApplicationException(e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/rest/handler/URIListHandler.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/java/org/taverna/server/master/soap/TavernaServerSOAP.java
----------------------------------------------------------------------
diff --cc server-webapp/src/main/java/org/taverna/server/master/soap/TavernaServerSOAP.java
index d593149,72aca5e..69bca0f
--- a/server-webapp/src/main/java/org/taverna/server/master/soap/TavernaServerSOAP.java
+++ b/server-webapp/src/main/java/org/taverna/server/master/soap/TavernaServerSOAP.java
@@@ -9,21 -9,22 +9,25 @@@ import static org.taverna.server.master
import static org.taverna.server.master.common.Roles.USER;
import java.net.URI;
+import java.net.URL;
import java.util.Date;
+ import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
+ import javax.xml.bind.annotation.XmlElement;
import org.apache.cxf.annotations.WSDLDocumentation;
+ import org.ogf.usage.JobUsageRecord;
+ import org.taverna.server.master.common.Capability;
import org.taverna.server.master.common.Credential;
+import org.taverna.server.master.common.DirEntryReference;
import org.taverna.server.master.common.InputDescription;
import org.taverna.server.master.common.Permission;
+import org.taverna.server.master.common.ProfileList;
import org.taverna.server.master.common.RunReference;
import org.taverna.server.master.common.Status;
import org.taverna.server.master.common.Trust;
@@@ -63,37 -66,8 +69,38 @@@ public interface TavernaServerSOAP
*/
@WebResult(name = "Run")
@WSDLDocumentation("Make a run for a particular workflow.")
- RunReference submitWorkflow(@WebParam(name = "workflow") Workflow workflow)
- throws NoUpdateException, NoCreateException;
+ RunReference submitWorkflow(
+ @WebParam(name = "workflow") @XmlElement(required = true) Workflow workflow)
++ throws NoUpdateException, NoCreateException;
+
+ /**
+ * Make a run for a particular workflow.
+ *
+ * @param workflow
+ * The workflow to instantiate.
+ * @return Annotated handle for created run.
+ * @throws NoUpdateException
+ * @throws NoCreateException
+ */
+ @WebResult(name = "Run")
+ @WSDLDocumentation("Make a run for a particular workflow.")
+ RunReference submitWorkflowMTOM(
- @WebParam(name = "workflow") WrappedWorkflow workflow)
++ @WebParam(name = "workflow") @XmlElement(required = true) WrappedWorkflow workflow)
+ throws NoUpdateException;
+
+ /**
+ * Make a run for a workflow at a particular URL.
+ *
+ * @param workflowURL
+ * The public URL of the workflow to instantiate.
+ * @return Annotated handle for created run.
+ * @throws NoUpdateException
+ * @throws NoCreateException
+ */
+ @WebResult(name = "Run")
+ @WSDLDocumentation("Make a run for a workflow at a particular public URL.")
+ RunReference submitWorkflowReference(
- @WebParam(name = "reference") URL workflowURL)
++ @WebParam(name = "reference") @XmlElement(required = true) URL workflowURL)
throws NoUpdateException, NoCreateException;
/**
@@@ -183,39 -179,44 +212,77 @@@
throws UnknownRunException;
/**
+ * Get the workflow document used to create the given run.
+ *
+ * @param runName
+ * The handle of the run.
+ * @return The workflow document.
+ * @throws UnknownRunException
+ * If the server doesn't know about the run or if the user is
+ * not permitted to see it.
+ */
+ @WebResult(name = "CreationWorkflow")
+ @WSDLDocumentation("Get the workflow document used to create the given run.")
+ WrappedWorkflow getRunWorkflowMTOM(
+ @WebParam(name = "runName") String runName)
+ throws UnknownRunException;
+
+ /**
+ * Get a description of the profiles supported by the workflow document used
+ * to create the given run.
+ *
+ * @param runName
+ * The handle of the run.
+ * @return A description of the supported profiles.
+ * @throws UnknownRunException
+ * If the server doesn't know about the run or if the user is
+ * not permitted to see it.
+ */
+ @WebResult(name = "Profiles")
+ @WSDLDocumentation("Get a description of the profiles supported by the workflow document used to create the given run.")
+ ProfileList getRunWorkflowProfiles(
+ @WebParam(name = "runName") String runName)
+ throws UnknownRunException;
+
+ /**
+ * Get the descriptive name of the workflow run. The descriptive name
+ * carries no deep information.
+ *
+ * @param runName
+ * The handle of the run.
+ * @return The descriptive name of the run.
+ * @throws UnknownRunException
+ * If the server doesn't know about the run or if the user is
+ * not permitted to see it.
+ */
+ @WebResult(name = "DescriptiveName")
+ @WSDLDocumentation("Get the descriptive name of the workflow run. Carries no deep information.")
+ String getRunDescriptiveName(
+ @WebParam(name = "runName") @XmlElement(required = true) String runName)
+ throws UnknownRunException;
+
+ /**
+ * Set the descriptive name of the workflow run. The descriptive name
+ * carries no deep information.
+ *
+ * @param runName
+ * The handle of the run.
+ * @param descriptiveName
+ * The new descriptive name to set. Note that the implementation
+ * is allowed to arbitrarily truncate this value.
+ * @throws UnknownRunException
+ * If the server doesn't know about the run or if the user is
+ * not permitted to see it.
+ * @throws NoUpdateException
+ * If the user is not permitted to update this run.
+ */
+ @WSDLDocumentation("Set the descriptive name of the workflow run. Carries no deep information.")
+ void setRunDescriptiveName(
+ @WebParam(name = "runName") @XmlElement(required = true) String runName,
+ @WebParam(name = "descriptiveName") @XmlElement(required = true) String descriptiveName)
+ throws UnknownRunException, NoUpdateException;
+
+ /**
* Get the description of the inputs to the workflow run.
*
* @param runName
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/replacementscripts/executeworkflow.sh
----------------------------------------------------------------------
diff --cc server-webapp/src/main/replacementscripts/executeworkflow.sh
index a2cf39f,23b2ebe..e698aa1
--- a/server-webapp/src/main/replacementscripts/executeworkflow.sh
+++ b/server-webapp/src/main/replacementscripts/executeworkflow.sh
@@@ -8,7 -8,7 +8,7 @@@ permsize=-XX:MaxPermSize=140
## Parse the command line to extract the pieces to move around to before or
## after the JAR filename...
--pre=
++pre=-Djava.awt.headless=true
post=
for arg
do
@@@ -48,18 -48,24 +48,21 @@@ RUNID_PROP
if test x != "x$TAVERNA_RUN_ID"; then
RUNID_PROP="-Dtaverna.runid=$TAVERNA_RUN_ID"
fi
--INTERACTION_PROPS=
++INTERACTION_PROPS=-Dtaverna.interaction.ignore_requests=true
if test x != "x$INTERACTION_HOST"; then
-- INTERACTION_PROPS="-Dtaverna.interaction.host=$INTERACTION_HOST"
++ INTERACTION_PROPS="$INTERACTION_PROPS -Dtaverna.interaction.host=$INTERACTION_HOST"
INTERACTION_PROPS="$INTERACTION_PROPS -Dtaverna.interaction.port=$INTERACTION_PORT"
INTERACTION_PROPS="$INTERACTION_PROPS -Dtaverna.interaction.webdav_path=$INTERACTION_WEBDAV"
INTERACTION_PROPS="$INTERACTION_PROPS -Dtaverna.interaction.feed_path=$INTERACTION_FEED"
fi
+ MainClass=net.sf.taverna.t2.commandline.CommandLineLauncher
+
+ echo "pid:$$"
exec "$javabin" $memlimit $permsize \
- "-Draven.profile=file://$taverna_home/conf/current-profile.xml" \
- "-Dtaverna.startup=$taverna_home" $RAVEN_APPHOME_PROP $RUNID_PROP \
- $INTERACTION_PROPS $pre \
- -Djava.system.class.loader=net.sf.taverna.raven.prelauncher.BootstrapClassLoader \
- -Draven.launcher.app.main=$MainClass \
- -Draven.launcher.show_splashscreen=false \
- -Djava.awt.headless=true -Dtaverna.interaction.ignore_requests=true \
- -jar "$taverna_home/lib/"prelauncher-*.jar \
- "$@"
+ "-Dlog4j.configuration=file://$taverna_home/conf/log4j.properties " \
+ "-Djava.util.logging.config.file=$taverna_home/conf/logging.properties " \
+ "-Dtaverna.app.startup=$taverna_home" \
+ $APPHOME_PROP $RUNID_PROP $INTERACTION_PROPS $pre \
+ -jar "$taverna_home/lib/taverna-command-line-0.1.1.jar" \
+ ${1+"$@"}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/resources/welcome.html
----------------------------------------------------------------------
diff --cc server-webapp/src/main/resources/welcome.html
index 8ff7e14,81b3b06..f80da4a
--- a/server-webapp/src/main/resources/welcome.html
+++ b/server-webapp/src/main/resources/welcome.html
@@@ -2,19 -2,12 +2,19 @@@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
- <title>Taverna Server 3</title>
+ <title>Taverna Server %{VERSION}</title>
</head>
<body>
- <h1>Taverna Server 3</h1>
+ <h1>Taverna Server %{VERSION}</h1>
+<div style="text-align;center">
+ <p>
+ <i>Note that this is a pre-release version. Significant known
+ issues remain open and it is not guaranteed that the service API
+ will be stable.</i>
+ </p>
+</div>
<p>For a full list of operations, see the <a
- href="SERVICE_URI/services">service listing</a> generated by Apache
+ href="%{BASEURL}/services">service listing</a> generated by Apache
CXF, which indicates where to access the WSDL and WADL descriptions of
the T2Server interface.</p>
<p>What follows below is a simple guide to using the server. It does
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/webapp/WEB-INF/providers.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/main/webapp/WEB-INF/webappBeans.xml
----------------------------------------------------------------------
diff --cc server-webapp/src/main/webapp/WEB-INF/webappBeans.xml
index 7bc603c,9d2af65..1b979b4
--- a/server-webapp/src/main/webapp/WEB-INF/webappBeans.xml
+++ b/server-webapp/src/main/webapp/WEB-INF/webappBeans.xml
@@@ -92,9 -92,10 +92,11 @@@
<ref bean="MessagingProvider.InputStream" />
<ref bean="MessagingProvider.T2flow" />
<ref bean="MessagingProvider.Permission" />
- <ref bean="MessagingProvider.ZipStream"/>
+ <ref bean="MessagingProvider.URIList" />
+ <ref bean="MessagingProvider.ZipStream" />
<ref bean="jsonProvider" />
+ <ref bean="atomEntryHandler" />
+ <ref bean="atomFeedHandler" />
</jaxrs:providers>
<jaxrs:outInterceptors>
<ref bean="Interceptor.FlushThreadLocalCache" />
@@@ -143,17 -145,19 +146,27 @@@
<bean id="root_facade" class="org.taverna.server.master.facade.Facade">
<property name="file" value="/welcome.html" />
- <property name="pattern" value="SERVICE_URI/" />
+ <property name="contextualizer" ref="contextualizer" />
</bean>
+ <bean class="org.taverna.server.master.common.Uri.Rewriter"
+ autowire="byType" id="URI-Rewriter-Thunk">
+ <property name="suppressSecurity" value="${suppressRewriteEngine}" />
+ <property name="rewriteTarget" value="${default.webapp}" />
+ </bean>
+ <security:authentication-manager>
+ <security:authentication-provider ref="workflowInternalAuthProvder" />
+ <security:authentication-provider ref="authProvider" />
+ </security:authentication-manager>
+
+ <bean id="WSDLHeadOptionsInterceptor"
+ class="org.taverna.server.master.utils.WSDLHeadOptionsInterceptor" />
+ <cxf:bus>
+ <cxf:inInterceptors>
+ <ref bean="WSDLHeadOptionsInterceptor" />
+ </cxf:inInterceptors>
+ </cxf:bus>
+
<aop:aspectj-autoproxy proxy-target-class="true" />
<security:global-method-security
jsr250-annotations="enabled" />
http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/test/java/org/taverna/server/master/JaxbSanityTest.java
----------------------------------------------------------------------
diff --cc server-webapp/src/test/java/org/taverna/server/master/JaxbSanityTest.java
index dd4d3b9,3b6f75d..79c026b
--- a/server-webapp/src/test/java/org/taverna/server/master/JaxbSanityTest.java
+++ b/server-webapp/src/test/java/org/taverna/server/master/JaxbSanityTest.java
@@@ -243,11 -245,21 +246,26 @@@ public class JaxbSanityTest
}
@Test
+ public void testJAXBForProfileList() throws Exception {
+ testJAXB(ProfileList.class);
+ }
+
+ @Test
+ public void testJAXBForDirEntry() throws Exception {
+ testJAXB(DirEntry.class);
+ }
+
+ @Test
+ public void testJAXBForCapability() throws Exception {
+ testJAXB(Capability.class);
+ }
+
+ @Test
+ public void testJAXBForCapabilityList() throws Exception {
+ testJAXB(CapabilityList.class);
+ }
+
+ @Test
public void testJAXBForEverythingREST() throws Exception {
testJAXB(DirEntryReference.class, InputDescription.class,
RunReference.class, Workflow.class, Status.class,
@@@ -264,16 -276,16 +282,16 @@@
TavernaServerSecurityREST.Descriptor.class,
TavernaServerSecurityREST.PermissionDescription.class,
TavernaServerSecurityREST.PermissionsDescription.class,
- ProfileList.class);
- Capability.class, CapabilityList.class);
++ ProfileList.class, Capability.class, CapabilityList.class);
}
@Test
public void testJAXBForEverythingSOAP() throws Exception {
- testJAXB(DirEntryReference.class, FileContents.class,
- InputDescription.class, Permission.class, PermissionList.class,
+ testJAXB(DirEntry.class, FileContents.class, InputDescription.class,
+ Permission.class, PermissionList.class,
PermissionList.SinglePermissionMapping.class,
RunReference.class, Status.class, Trust.class, Uri.class,
- Workflow.class);
- Workflow.class, Capability.class);
++ ProfileList.class, Workflow.class, Capability.class);
}
@Test