import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;
import org.collectionspace.services.config.ClientType;
import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.lifecycle.TransitionDef;
import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;
import org.collectionspace.services.relation.RelationResource;
import org.collectionspace.services.relation.RelationsCommonList;
import org.collectionspace.services.relation.RelationshipType;
+import org.collectionspace.services.workflow.WorkflowCommon;
import org.jboss.resteasy.util.HttpResponseCodes;
import org.nuxeo.ecm.core.api.DocumentModel;
import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
}
@PUT
- @Path("{csid}/items/{itemcsid}" + WorkflowClient.SERVICE_PATH)
- public byte[] updateWorkflow(
+ @Path("{csid}/items/{itemcsid}" + WorkflowClient.SERVICE_PATH + "/{transition}")
+ public byte[] updateItemWorkflowWithTransition(
@PathParam("csid") String csid,
@PathParam("itemcsid") String itemcsid,
- String xmlPayload) {
+ @PathParam("transition") String transition) {
PoxPayloadOut result = null;
try {
+ PoxPayloadIn input = new PoxPayloadIn(WorkflowClient.SERVICE_PAYLOAD_NAME, new WorkflowCommon(),
+ WorkflowClient.SERVICE_COMMONPART_NAME);
+
ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx = createServiceContext(getItemServiceName());
String parentWorkspaceName = parentCtx.getRepositoryWorkspaceName();
- PoxPayloadIn workflowUpdate = new PoxPayloadIn(xmlPayload);
- MultipartServiceContext ctx = (MultipartServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME, workflowUpdate);
+ TransitionDef transitionDef = getTransitionDef(parentCtx, transition);
+ MultipartServiceContext ctx = (MultipartServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME, input);
+ ctx.setProperty(WorkflowClient.TRANSITION_ID, transitionDef);
WorkflowDocumentModelHandler handler = createWorkflowDocumentHandler(ctx);
ctx.setRespositoryWorkspaceName(parentWorkspaceName); //find the document in the parent's workspace
getRepositoryClient(ctx).update(ctx, itemcsid, handler);
<!-- begin collectionobject service meta-data -->
<tenant:serviceBindings id="CollectionObjects" name="CollectionObjects" type="object" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/collectionobjects/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin blob service meta-data -->
<!-- This should likely be type="object" -->
<tenant:serviceBindings id="Blobs" name="Blobs" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/blobs/*/workflow/</service:uriPath>
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.blob.nuxeo.BlobDocumentModelHandler</service:documentHandler>
<service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
<!-- begin intake service meta-data -->
<tenant:serviceBindings id="Intakes" name="Intakes" type="procedure" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/intakes/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin loanin service meta-data -->
<tenant:serviceBindings id="Loansin" name="Loansin" type="procedure" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/loansin/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin loanout service meta-data -->
<tenant:serviceBindings id="Loansout" name="Loansout" type="procedure" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/loansout/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin objectexit service meta-data -->
<tenant:serviceBindings id="ObjectExit" name="ObjectExit" type="procedure" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/objectexit/*/workflow/</service:uriPath>
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.objectexit.nuxeo.ObjectExitDocumentModelHandler</service:documentHandler>
<service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
<!-- begin batch service meta-data -->
<tenant:serviceBindings id="Batch" name="Batch" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/batch/*/workflow/</service:uriPath>
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.batch.nuxeo.BatchDocumentModelHandler</service:documentHandler>
<service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
<!-- begin group service meta-data -->
<tenant:serviceBindings id="Groups" name="Groups" type="procedure" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/groups/*/workflow/</service:uriPath>
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.group.nuxeo.GroupDocumentModelHandler</service:documentHandler>
<service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
<!-- begin imports service meta-data -->
<tenant:serviceBindings id="Imports" name="Imports" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/imports/*/workflow/</service:uriPath>
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.imports.nuxeo.ImportsDocumentModelHandler</service:documentHandler>
<service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
<!-- begin media service meta-data -->
<!-- This should likely be type="object" -->
<tenant:serviceBindings id="Media" name="Media" type="procedure" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/media/*/workflow/</service:uriPath>
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.media.nuxeo.MediaDocumentModelHandler</service:documentHandler>
<service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
<!-- begin movement service meta-data -->
<tenant:serviceBindings id="Movements" name="Movements" type="procedure" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/movements/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin report service meta-data -->
<tenant:serviceBindings id="Reports" name="Reports" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/reports/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin vocabulary service meta-data -->
<tenant:serviceBindings id="Vocabularies" name="Vocabularies" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/vocabularies/*/workflow/</service:uriPath>
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/vocabularies/*/items/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.vocabulary.nuxeo.VocabularyDocumentModelHandler</service:documentHandler>
Repository workspace so we have to configure that.
-->
<tenant:serviceBindings id="Vocabularyitems" name="Vocabularyitems" type="authority" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/vocabularyitems/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin orgauthority service meta-data -->
<tenant:serviceBindings id="Orgauthorities" name="Orgauthorities" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/orgauthorities/*/workflow/</service:uriPath>
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/orgauthorities/*/items/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin personauthority service meta-data -->
<tenant:serviceBindings id="Personauthorities" name="Personauthorities" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/personauthorities/*/workflow/</service:uriPath>
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/personauthorities/*/items/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin locationauthority service meta-data -->
<tenant:serviceBindings id="Locationauthorities" name="Locationauthorities" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/locationauthorities/*/workflow/</service:uriPath>
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/locationauthorities/*/items/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- end location service meta-data -->
<!-- begin placeauthority service meta-data -->
<tenant:serviceBindings id="Placeauthorities" name="Placeauthorities" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/placeauthorities/*/workflow/</service:uriPath>
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/placeauthorities/*/items/*/workflow/</service:uriPath>
<!-- other URI paths using which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- end place service meta-data -->
<!-- begin taxonomyauthority service meta-data -->
<tenant:serviceBindings id="Taxonomyauthority" name="Taxonomyauthority" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/taxonomyauthority/*/workflow/</service:uriPath>
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/taxonomyauthority/*/items/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin conceptauthority service meta-data -->
<tenant:serviceBindings id="Conceptauthorities" name="Conceptauthorities" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/conceptauthorities/*/workflow/</service:uriPath>
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/conceptauthorities/*/items/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin acquisition service meta-data -->
<tenant:serviceBindings id="Acquisitions" name="Acquisitions" type="procedure" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/acquisitions/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<!--
<service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
<!-- begin relation service meta-data -->
<tenant:serviceBindings id="Relations" name="Relations" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/relations/*/workflow/</service:uriPath>
<!-- other URI paths through which this service could be accessed -->
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.relation.nuxeo.RelationDocumentModelHandler</service:documentHandler>
<!-- begin dimension service meta-data -->
<tenant:serviceBindings id="Dimensions" name="Dimensions" type="utility" version="0.1">
<!-- other URI paths through which this service could be accessed -->
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/dimensions/*/workflow/</service:uriPath>
+ <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/dimensions/workflow/</service:uriPath>
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.dimension.nuxeo.DimensionDocumentModelHandler</service:documentHandler>
<service:object xmlns:service="http://collectionspace.org/services/config/service" name="Dimension" version="0.1">
<!-- begin note service meta-data -->
<tenant:serviceBindings id="Notes" name="Notes" type="utility" version="0.1">
- <service:uriPath xmlns:service="http://collectionspace.org/services/config/service">/notes/*/workflow/</service:uriPath>
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.note.nuxeo.NoteDocumentModelHandler</service:documentHandler>
<service:object xmlns:service="http://collectionspace.org/services/config/service" name="CSNote" version="0.1">