<documentation>CollectionSpace "cs_replicating" life cycle definition.</documentation>
<lifecycle name="cs_replicating" defaultInitial="project">
<transitions>
+
+ <!-- State: Project -->
+
<!-- Transitions TO the "project" state -->
<transition name="unreplicate" destinationState="project">
<description>Unreplicate the document back to project state.</description>
</transition>
+ <transition name="undeprecate" destinationState="project">
+ <description>Undeprecate the document to the project state.</description>
+ </transition>
<transition name="undelete" destinationState="project">
<description>Undelete the document to the project state.</description>
</transition>
+
- <!-- Transitions FROM "project" state TO the "replicated" and the "deleted" states -->
+ <!-- Transitions FROM "project" state -->
<transition name="replicate" destinationState="replicated">
<description>Replicate a document from the project state</description>
</transition>
+ <transition name="deprecate" destinationState="deprecated">
+ <description>Soft-delete the document from the project state</description>
+ </transition>
<transition name="delete" destinationState="deleted">
<description>Soft-delete the document from the project state</description>
</transition>
Notice the convention used in the transition names below. {transition-verb)_{lifecycle-state} -e.g., delete_replicated, replicate_deleted
This convention is critical to the code here: org.collectionspace.services.client.AuthorityClient.AuthorityItemDocumentModelHandler
-->
+
+ <!-- State: replicated_deleted -->
<!-- Transitions TO "replicated_deleted" state -->
- <transition name="delete_replicated" destinationState="replicated_deleted">
- <description>Delete the replicated document from the "replicated" state</description>
- </transition>
<transition name="replicate_deleted" destinationState="replicated_deleted">
<description>Replicate the deleted document from the "deleted" state.</description>
</transition>
+ <transition name="delete_replicated" destinationState="replicated_deleted">
+ <description>Delete the replicated document from the "replicated" state</description>
+ </transition>
<!-- Transitions FROM "replicated_deleted" state -->
+ <transition name="unreplicate_deleted" destinationState="deleted">
+ <description>Unreplicate the deleted document.</description>
+ </transition>
<transition name="undelete_replicated" destinationState="replicated">
<description>Undelete the replicated document from replicated_deleted state</description>
</transition>
- <transition name="unreplicate_deleted" destinationState="deleted">
- <description>Unreplicate the deleted document.</description>
+
+ <!-- State: replicated_deprecated -->
+
+ <!-- Transitions TO "replicated_deprecated" state -->
+ <transition name="replicate_deprecated" destinationState="replicated_deprecated">
+ <description>Replicate the deprecated document from the "deprecated" state.</description>
+ </transition>
+ <transition name="deprecate_replicated" destinationState="replicated_deprecated">
+ <description>Deprecate the replicated document from the "replicated" state</description>
+ </transition>
+
+ <!-- Transitions FROM "replicated_deprecated" state -->
+ <transition name="unreplicate_deprecated" destinationState="deprecated">
+ <description>Unreplicate the deprecated document.</description>
+ </transition>
+ <transition name="undeprecate_replicated" destinationState="replicated">
+ <description>Undelete the replicated document from replicated_deleted state</description>
+ </transition>
+
+ <!-- State: deprecated_deleted -->
+
+ <!-- Transitions TO "deprecated_deleted" state -->
+ <transition name="deprecate_deleted" destinationState="deprecated_deleted">
+ <description>Deprecate the deleted document from the "deleted" state</description>
+ </transition>
+ <transition name="delete_deprecated" destinationState="deprecated_deleted">
+ <description>Delete the deprecated document from the "deprecated" state.</description>
</transition>
+ <!-- Transitions FROM "deprecated_deleted" state -->
+ <transition name="undeprecate_deleted" destinationState="deleted">
+ <description>Undelete the replicated document from deprecated_deleted state</description>
+ </transition>
+ <transition name="undelete_deprecated" destinationState="deprecated">
+ <description>Undelete the deprecated document.</description>
+ </transition>
+
+ <!-- State: replicated_deprecated_deleted -->
+
+ <!-- Transitions TO "replicated_deprecated_deleted" state -->
+ <transition name="replicate_deprecated_deleted" destinationState="replicated_deprecated_deleted">
+ <description>Delete the deprecated document from the "deprecated" state.</description>
+ </transition>
+ <transition name="deprecate_replicated_deleted" destinationState="replicated_deprecated_deleted">
+ <description>Deprecate the deleted document from the "deleted" state</description>
+ </transition>
+ <transition name="delete_replicated_deprecated" destinationState="replicated_deprecated_deleted">
+ <description>Delete the deprecated document from the "deprecated" state.</description>
+ </transition>
+
+ <!-- Transitions FROM "replicated_deprecated_deleted" state -->
+ <transition name="unreplicate_deprecated_deleted" destinationState="deprecated_deleted">
+ <description>Undelete the deprecated document.</description>
+ </transition>
+ <transition name="undeprecate_replicated_deleted" destinationState="replicated_deleted">
+ <description>Undelete the replicated document from deprecated_deleted state</description>
+ </transition>
+ <transition name="undelete_replicated_deprecated" destinationState="replicated_deprecated">
+ <description>Undelete the deprecated document.</description>
+ </transition>
</transitions>
<states>
<state name="project" description="Default state" initial="true">
<transitions>
- <transition>delete</transition>
- <!-- To "deleted" state -->
- <transition>replicate</transition>
- <!-- To "replicated" state -->
+ <transition>replicate</transition> <!-- To "replicated" state -->
+ <transition>deprecate</transition> <!-- To "deprecated" state -->
+ <transition>delete</transition> <!-- To "deleted" state -->
</transitions>
</state>
- <state name="replicated" description="Replicated state">
- <transition>unreplicate</transition>
- <!-- To "project" state -->
- <transition>delete_replicated</transition>
- <!-- To "replicated_deleted" state -->
- </state>
<state name="deleted" description="Document is deleted">
<transitions>
- <transition>undelete</transition>
- <!-- To "project" state -->
- <transition>replicate_deleted</transition>
- <!-- To "replicated_deleted" state -->
+ <transition>replicate_deleted</transition> <!-- To "replicated_deleted" state -->
+ <transition>deprecate_deleted</transition> <!-- To "deprecated_deleted" state -->
+ <transition>undelete</transition> <!-- To "project" state -->
+ </transitions>
+ </state>
+ <state name="replicated" description="Replicated state">
+ <transitions>
+ <transition>unreplicate</transition> <!-- To "project" state -->
+ <transition>deprecate_replicated</transition> <!-- To "replicated_deprecated" state -->
+ <transition>delete_replicated</transition> <!-- To "replicated_deleted" state -->
</transitions>
</state>
<state name="replicated_deleted" description="Document is replicated and deleted">
<transitions>
- <transition>unreplicate_deleted</transition>
- <!-- To "deleted" state -->
- <transition>undelete_replicated</transition>
- <!-- To "replicated" state -->
+ <transition>unreplicate_deleted</transition> <!-- To "deleted" state -->
+ <transition>deprecate_replicated_deleted</transition> <!-- To "replicated_deprecated_deleted state -->
+ <transition>undelete_replicated</transition> <!-- To "replicated" state -->
+ </transitions>
+ </state>
+ <state name="replicated_deprecated" description="Document is replicated and deprecated">
+ <transitions>
+ <transition>unreplicate_deprecated</transition> <!-- To "deprecated" state -->
+ <transition>undeprecate_replicated</transition> <!-- To "replicated" state -->
+ <transition>delete_replicated_deprecated</transition> <!-- To "replicated_deprecated_deleted state -->
+ </transitions>
+ </state>
+ <state name="replicated_deprecated_deleted" description="Document is replicated, deprecated, and deleted">
+ <transitions>
+ <transition>unreplicate_deprecated_deleted</transition> <!-- To "deprecated_deleted" state -->
+ <transition>undeprecate_replicated_deleted</transition> <!-- To "replicated_deleted" state -->
+ <transition>undelete_replicated_deprecated</transition> <!-- To "replicated_deprecated" state -->
+ </transitions>
+ </state>
+ <state name="deprecated" description="Document is deprecated">
+ <transitions>
+ <transition>replicate_deprecated</transition> <!-- To "replicated_deprecated" state -->
+ <transition>undeprecate</transition> <!-- To "project" state -->
+ <transition>delete_deprecated</transition> <!-- To "deprecated_deleted" state -->
+ </transitions>
+ </state>
+ <state name="deprecated_deleted" description="Document is deprecated and deleted">
+ <transitions>
+ <transition>replicate_deprecated_deleted</transition> <!-- To "replicated_deprecated_deleted state -->
+ <transition>undeprecate_deleted</transition> <!-- To "deleted" state -->
+ <transition>undelete_deprecated</transition> <!-- To "deprecated" state -->
</transitions>
</state>
</states>
*/
public static final String WORKFLOWSTATE_XML_ELEMENT_NAME = COLLECTIONSPACE_CORE_WORKFLOWSTATE;
+ public static final String WORKFLOWTRANSITION_TO = "to"; // Use for Nuxeo lifecycle event handling
+
// common to all Nuxeo document lifecycle policies
public static final String WORKFLOWSTATE_PROJECT = "project";
public static final String WORKFLOWSTATE_DELETED = "deleted";
+
// part of the "cs_replicating" Nuxeo document lifecycle policy
+ public static final String WORKFLOWSTATE_DEPRECATED = "deprecated";
+ public static final String WORKFLOWSTATE_DEPRECATED_DELETED = "deprecated_deleted";
public static final String WORKFLOWSTATE_REPLICATED = "replicated";
public static final String WORKFLOWSTATE_REPLICATED_DELETED = "replicated_deleted";
+ public static final String WORKFLOWSTATE_REPLICATED_DEPRECATED = "replicated_deprecated";
+ public static final String WORKFLOWSTATE_REPLICATED_DEPRECATED_DELETED = "replicated_deprecated_deleted";
+
// part of the "cs_locking" Nuxeo document lifecycle policy
public static final String WORKFLOWSTATE_LOCKED = "locked";
public static final String WORKFLOWSTATE_LOCKED_DELETED = "locked_deleted";
/*
- * Nuxeo document workflow transition verbs
+ * Nuxeo document workflow transition verbs FOR "cs_replicating" Nuxeo document lifecycle policy
*/
- public static final String WORKFLOWTRANSITION_DELETE = "delete";
- public static final String WORKFLOWTRANSITION_UNDELETE = "undelete";
- public static final String WORKFLOWTRANSITION_LOCK = "lock";
- public static final String WORKFLOWTRANSITION_UNLOCK = "unlock";
public static final String WORKFLOWTRANSITION_REPLICATE = "replicate";
+ public static final String WORKFLOWTRANSITION_DEPRECATE = "deprecate";
+ public static final String WORKFLOWTRANSITION_DELETE = "delete"; // Also used for default lifecycle
+
+ public static final String WORKFLOWTRANSITION_REPLICATE_DELETED = "replicate_deleted";
+ public static final String WORKFLOWTRANSITION_DEPRECATE_DELETED = "deprecate_deleted";
+ public static final String WORKFLOWTRANSITION_UNDELETE = "undelete"; // Also used for default lifecycle
+
public static final String WORKFLOWTRANSITION_UNREPLICATE = "unreplicate";
-
- public static final String WORKFLOWTRANSITION_TO = "to";
+ public static final String WORKFLOWTRANSITION_DEPRECATE_REPLICATED = "deprecate_replicated";
+ public static final String WORKFLOWTRANSITION_DELETE_REPLICATED = "delete_replicated";
+
+ public static final String WORKFLOWTRANSITION_UNREPLICATE_DELETED = "unreplicate_deleted";
+ public static final String WORKFLOWTRANSITION_DEPRECATE_REPLICATED_DELETED = "deprecate_replicated_deleted";
+ public static final String WORKFLOWTRANSITION_UNDELETE_REPLICATED = "undelete_replicated";
+
+ public static final String WORKFLOWTRANSITION_UNREPLICATE_DEPRECATED = "unreplicate_deprecated";
+ public static final String WORKFLOWTRANSITION_UNDEPRECATE_REPLICATED = "undeprecate_replicated";
+ public static final String WORKFLOWTRANSITION_DELETE_REPLICATED_DEPRECATED = "delete_replicated_deprecated";
+
+ public static final String WORKFLOWTRANSITION_UNREPLICATE_DEPRECATED_DELETED = "unreplicate_deprecated_deleted";
+ public static final String WORKFLOWTRANSITION_UNDEPRECATE_REPLICATED_DELETED = "undeprecate_replicated_deleted";
+ public static final String WORKFLOWTRANSITION_UNDELETE_REPLICATED_DEPRECATED = "undelete_replicated_deprecated";
+
+ public static final String WORKFLOWTRANSITION_REPLICATE_DEPRECATED = "replicate_deprecated";
+ public static final String WORKFLOWTRANSITION_UNDEPRECATE = "undeprecate";
+ public static final String WORKFLOWTRANSITION_DELETE_DEPRECATED = "delete_deprecated";
+
+ public static final String WORKFLOWTRANSITION_REPLICATE_DEPRECATED_DELETED = "replicate_deprecated_deleted";
+ public static final String WORKFLOWTRANSITION_UNDEPRECATE_DELETED = "undeprecate_deleted";
+ public static final String WORKFLOWTRANSITION_UNDELETE_DEPRECATED = "undelete_deprecated";
+
+ public static final String WORKFLOWTRANSITION_LOCK = "lock";
+ public static final String WORKFLOWTRANSITION_UNLOCK = "unlock";
+
//
// DocumentHandler workflow-related passed in context properties
//
import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;
import org.collectionspace.services.lifecycle.Lifecycle;
import org.collectionspace.services.lifecycle.TransitionDef;
+import org.collectionspace.services.nuxeo.util.NuxeoUtils;
import org.collectionspace.services.workflow.WorkflowCommon;
-
import org.dom4j.DocumentException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
protected TransitionDef getTransitionDef(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx, String transition) {
TransitionDef result = null;
- try {
- Lifecycle lifecycle = ctx.getDocumentHandler().getLifecycle();
- List<TransitionDef> transitionDefList = lifecycle.getTransitionDefList().getTransitionDef();
- Iterator<TransitionDef> iter = transitionDefList.iterator();
- boolean found = false;
- while (iter.hasNext() && found == false) {
- TransitionDef transitionDef = iter.next();
- if (transitionDef.getName().equalsIgnoreCase(transition)) {
- result = transitionDef;
- found = true;
- }
- }
+ Lifecycle lifecycle;
+ try {
+ lifecycle = ctx.getDocumentHandler().getLifecycle();
+ result = NuxeoUtils.getTransitionDef(lifecycle, transition);
} catch (Exception e) {
- logger.error("Exception trying to retreive life cycle information for: " + ctx.getDocumentType());
+ logger.error("Failed to get transition definition.", e);
}
return result;
*/
package org.collectionspace.services.common;
-import java.lang.reflect.Method;
import java.util.Map;
import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
import org.collectionspace.services.common.storage.StorageClient;
//import org.jboss.resteasy.core.ResourceMethod;
import org.jboss.resteasy.spi.HttpRequest;
-import org.jboss.resteasy.spi.metadata.ResourceMethod;
/**
* The Interface CollectionSpaceResource.
* their current state. Without this mapping, REST API clients would need to calculate this on their own and use the longer forms like:
* "delete_replicated", "undelete_replicated", "lock_deleted", "unlock_deleted", etc.
*/
- String getQualifiedTransitionName(DocumentWrapper<DocumentModel> wrapDoc, TransitionDef transitionDef) {
+ public static String getQualifiedTransitionName(DocumentWrapper<DocumentModel> wrapDoc, TransitionDef transitionDef) {
String result = null;
String currentTransitionName = result = transitionDef.getName(); // begin with result set to the current name
protected String oldRefNameOnUpdate = null; // FIXME: REM - We should have setters and getters for these
protected String newRefNameOnUpdate = null; // FIXME: two fields.
- /*
- * Map Nuxeo's life cycle object to our JAX-B based life cycle object
- */
- private Lifecycle createCollectionSpaceLifecycle(org.nuxeo.ecm.core.lifecycle.LifeCycle nuxeoLifecyle) {
- Lifecycle result = null;
-
- if (nuxeoLifecyle != null) {
- //
- // Copy the life cycle's name
- result = new Lifecycle();
- result.setName(nuxeoLifecyle.getName());
-
- // We currently support only one initial state, so take the first one from Nuxeo
- Collection<String> initialStateNames = nuxeoLifecyle.getInitialStateNames();
- result.setDefaultInitial(initialStateNames.iterator().next());
-
- // Next, we copy the state and corresponding transition lists
- StateList stateList = new StateList();
- List<State> states = stateList.getState();
- Collection<org.nuxeo.ecm.core.lifecycle.LifeCycleState> nuxeoStates = nuxeoLifecyle.getStates();
- for (org.nuxeo.ecm.core.lifecycle.LifeCycleState nuxeoState : nuxeoStates) {
- State tempState = new State();
- tempState.setDescription(nuxeoState.getDescription());
- tempState.setInitial(nuxeoState.isInitial());
- tempState.setName(nuxeoState.getName());
- // Now get the list of transitions
- TransitionList transitionList = new TransitionList();
- List<String> transitions = transitionList.getTransition();
- Collection<String> nuxeoTransitions = nuxeoState.getAllowedStateTransitions();
- for (String nuxeoTransition : nuxeoTransitions) {
- transitions.add(nuxeoTransition);
- }
- tempState.setTransitionList(transitionList);
- states.add(tempState);
- }
- result.setStateList(stateList);
-
- // Finally, we create the transition definitions
- TransitionDefList transitionDefList = new TransitionDefList();
- List<TransitionDef> transitionDefs = transitionDefList.getTransitionDef();
- Collection<org.nuxeo.ecm.core.lifecycle.LifeCycleTransition> nuxeoTransitionDefs = nuxeoLifecyle.getTransitions();
- for (org.nuxeo.ecm.core.lifecycle.LifeCycleTransition nuxeoTransitionDef : nuxeoTransitionDefs) {
- TransitionDef tempTransitionDef = new TransitionDef();
- tempTransitionDef.setDescription(nuxeoTransitionDef.getDescription());
- tempTransitionDef.setDestinationState(nuxeoTransitionDef.getDestinationStateName());
- tempTransitionDef.setName(nuxeoTransitionDef.getName());
- transitionDefs.add(tempTransitionDef);
- }
- result.setTransitionDefList(transitionDefList);
- }
-
- return result;
- }
/*
* Returns the the life cycle definition of the related Nuxeo document type for this handler.
* @see org.collectionspace.services.common.document.DocumentHandler#getLifecycle(java.lang.String)
*/
@Override
- public Lifecycle getLifecycle(String docTypeName) {
- Lifecycle result = null;
-
- try {
- LifeCycleService lifeCycleService = null;
- try {
- lifeCycleService = NXCore.getLifeCycleService();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- String lifeCycleName = lifeCycleService.getLifeCycleNameFor(docTypeName);
- org.nuxeo.ecm.core.lifecycle.LifeCycle nuxeoLifecyle = lifeCycleService.getLifeCycleByName(lifeCycleName);
-
- result = createCollectionSpaceLifecycle(nuxeoLifecyle);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- logger.error("Could not retreive life cycle information for Nuxeo doctype: " + docTypeName, e);
- }
-
- return result;
+ public Lifecycle getLifecycle(String docTypeName) {
+ return NuxeoUtils.getLifecycle(docTypeName);
}
/*
import java.io.IOException;
import java.io.File;
import java.lang.reflect.Field;
+import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthorityItemSpecifier;
import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.Specifier;
import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.SpecifierForm;
+import org.collectionspace.services.lifecycle.Lifecycle;
+import org.collectionspace.services.lifecycle.State;
+import org.collectionspace.services.lifecycle.StateList;
+import org.collectionspace.services.lifecycle.TransitionDef;
+import org.collectionspace.services.lifecycle.TransitionDefList;
+import org.collectionspace.services.lifecycle.TransitionList;
import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentException;
import org.collectionspace.services.nuxeo.client.java.CoreSessionInterface;
import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentFilter;
import org.dom4j.Document;
import org.dom4j.io.SAXReader;
import org.mortbay.log.Log;
+import org.nuxeo.ecm.core.NXCore;
import org.nuxeo.ecm.core.api.DocumentModel;
import org.nuxeo.ecm.core.api.DocumentModelList;
import org.nuxeo.ecm.core.api.ClientException;
import org.nuxeo.ecm.core.io.impl.DocumentPipeImpl;
import org.nuxeo.ecm.core.io.impl.plugins.SingleDocumentReader;
import org.nuxeo.ecm.core.io.impl.plugins.XMLDocumentWriter;
+import org.nuxeo.ecm.core.lifecycle.LifeCycleService;
import org.nuxeo.ecm.core.schema.SchemaManager;
import org.nuxeo.ecm.core.storage.StorageBlob;
import org.nuxeo.ecm.core.storage.binary.Binary;
return result;
}
+ static public Lifecycle getLifecycle(String docTypeName) {
+ Lifecycle result = null;
+
+ try {
+ LifeCycleService lifeCycleService = null;
+ try {
+ lifeCycleService = NXCore.getLifeCycleService();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ String lifeCycleName = lifeCycleService.getLifeCycleNameFor(docTypeName);
+ org.nuxeo.ecm.core.lifecycle.LifeCycle nuxeoLifecyle = lifeCycleService.getLifeCycleByName(lifeCycleName);
+
+ result = createCollectionSpaceLifecycle(nuxeoLifecyle);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ logger.error("Could not retreive life cycle information for Nuxeo doctype: " + docTypeName, e);
+ }
+
+ return result;
+ }
+
+ static public TransitionDef getTransitionDef(Lifecycle lifecycle, String transition) {
+ TransitionDef result = null;
+
+ try {
+ List<TransitionDef> transitionDefList = lifecycle.getTransitionDefList().getTransitionDef();
+ Iterator<TransitionDef> iter = transitionDefList.iterator();
+ boolean found = false;
+ while (iter.hasNext() && found == false) {
+ TransitionDef transitionDef = iter.next();
+ if (transitionDef.getName().equalsIgnoreCase(transition)) {
+ result = transitionDef;
+ found = true;
+ }
+ }
+ } catch (Exception e) {
+ logger.error(String.format("Exception trying to retreive lifecycle transition def from '%s' for transition '%s'.",
+ lifecycle.getName(), transition));
+ }
+
+ return result;
+ }
+
+
+ /*
+ * Map Nuxeo's life cycle object to our JAX-B based life cycle object
+ */
+ static private Lifecycle createCollectionSpaceLifecycle(org.nuxeo.ecm.core.lifecycle.LifeCycle nuxeoLifecyle) {
+ Lifecycle result = null;
+
+ if (nuxeoLifecyle != null) {
+ //
+ // Copy the life cycle's name
+ result = new Lifecycle();
+ result.setName(nuxeoLifecyle.getName());
+
+ // We currently support only one initial state, so take the first one from Nuxeo
+ Collection<String> initialStateNames = nuxeoLifecyle.getInitialStateNames();
+ result.setDefaultInitial(initialStateNames.iterator().next());
+
+ // Next, we copy the state and corresponding transition lists
+ StateList stateList = new StateList();
+ List<State> states = stateList.getState();
+ Collection<org.nuxeo.ecm.core.lifecycle.LifeCycleState> nuxeoStates = nuxeoLifecyle.getStates();
+ for (org.nuxeo.ecm.core.lifecycle.LifeCycleState nuxeoState : nuxeoStates) {
+ State tempState = new State();
+ tempState.setDescription(nuxeoState.getDescription());
+ tempState.setInitial(nuxeoState.isInitial());
+ tempState.setName(nuxeoState.getName());
+ // Now get the list of transitions
+ TransitionList transitionList = new TransitionList();
+ List<String> transitions = transitionList.getTransition();
+ Collection<String> nuxeoTransitions = nuxeoState.getAllowedStateTransitions();
+ for (String nuxeoTransition : nuxeoTransitions) {
+ transitions.add(nuxeoTransition);
+ }
+ tempState.setTransitionList(transitionList);
+ states.add(tempState);
+ }
+ result.setStateList(stateList);
+
+ // Finally, we create the transition definitions
+ TransitionDefList transitionDefList = new TransitionDefList();
+ List<TransitionDef> transitionDefs = transitionDefList.getTransitionDef();
+ Collection<org.nuxeo.ecm.core.lifecycle.LifeCycleTransition> nuxeoTransitionDefs = nuxeoLifecyle.getTransitions();
+ for (org.nuxeo.ecm.core.lifecycle.LifeCycleTransition nuxeoTransitionDef : nuxeoTransitionDefs) {
+ TransitionDef tempTransitionDef = new TransitionDef();
+ tempTransitionDef.setDescription(nuxeoTransitionDef.getDescription());
+ tempTransitionDef.setDestinationState(nuxeoTransitionDef.getDestinationStateName());
+ tempTransitionDef.setName(nuxeoTransitionDef.getName());
+ transitionDefs.add(tempTransitionDef);
+ }
+ result.setTransitionDefList(transitionDefList);
+ }
+
+ return result;
+ }
+
static public Thread deleteFileOfBlobAsync(Blob blob) {
Thread result = null;