From: remillet Date: Sat, 30 Apr 2016 03:52:13 +0000 (-0700) Subject: CSPACE-6937-A: Updating naming from SAS to Replicating for workflow states. Also... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=499fad1b5d98053b38bbe192b91d0d8834cf9a48;p=tmp%2Fjakarta-migration.git CSPACE-6937-A: Updating naming from SAS to Replicating for workflow states. Also some more Nuxeo login/logout fixes as well as test framework fixes. --- diff --git a/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/default-life-cycle-contrib.xml b/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/default-life-cycle-contrib.xml index 5c3f95e90..fc2f23925 100644 --- a/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/default-life-cycle-contrib.xml +++ b/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/default-life-cycle-contrib.xml @@ -1,155 +1,164 @@ - - - default - - + + + default + + + + + + CollectionSpace core default life cycle definition. + + + + Move document to trash (temporary delete) + + + Undelete the document. + + + + + + delete + + + + + undelete + + + + + + + + + CollectionSpace "locking" life cycle definition. + + + + Lock document + + + Move document to trash (temporary delete) + + + Undelete the document. + + + + + + delete + lock + + + + + + + + undelete + + + + + - - - CollectionSpace core default life cycle definition. - - - - Move document to trash (temporary delete) - - - Undelete the document. - - - - - - delete - - - - - undelete - - - - - - - - - CollectionSpace "locking" life cycle definition. - - - - Lock document - - - Move document to trash (temporary delete) - - - Undelete the document. - - - - - - delete - lock - - - - - - - - undelete - - - - - - - - - CollectionSpace "SAS" life cycle definition. - - - - - Unlock the document back to project state. - - - Undelete the document to the project state. - - - - - Lock a document from the project state - - - Soft-delete the document from the project state - + + CollectionSpace "cs_replicating" life cycle definition. + + + + + Unreplicate the document back to project state. + + + Undelete the document to the project state. + + + + + Replicate a document from the project state + + + Soft-delete the document from the project state + + + + + + + Delete the replicated document from the "replicated" state + + + Replicate the deleted document from the "deleted" state. + + + + + Undelete the replicated document from replicated_deleted state + + + Unreplicate the deleted document. + + + + + + + + delete + + replicate + + + + + unreplicate + + delete_replicated + + + + + undelete + + replicate_deleted + + + + + + unreplicate_deleted + + undelete_replicated + + + + + + - - - - - Delete the locked document from the "locked" state - - - Lock the deleted document from the "deleted" state. - - - - - Undelete the locked document from locked_deleted state - - - Unlock the deleted document. - - - - - - - - delete - lock - - - - unlock - delete_locked - - - - undelete - lock_deleted - - - - - unlock_deleted - undelete_locked - - - - - - diff --git a/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/AbstractUpdateObjectLocationValues.java b/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/AbstractUpdateObjectLocationValues.java index 7cc6ba3d7..b984f2e8c 100644 --- a/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/AbstractUpdateObjectLocationValues.java +++ b/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/AbstractUpdateObjectLocationValues.java @@ -324,7 +324,7 @@ public abstract class AbstractUpdateObjectLocationValues implements EventListene /** * Identifies whether a document is an active document; currently, whether - * it is not in the 'deleted' workflow state. + * it is not in a 'deleted' workflow state. * * @param docModel * @return true if the document is an active document; false if it is not. diff --git a/3rdparty/nuxeo/nuxeo-platform-listener/updaterelationsondelete/src/main/java/org/collectionspace/services/listener/UpdateRelationsOnDelete.java b/3rdparty/nuxeo/nuxeo-platform-listener/updaterelationsondelete/src/main/java/org/collectionspace/services/listener/UpdateRelationsOnDelete.java index efae17ebe..302be9020 100644 --- a/3rdparty/nuxeo/nuxeo-platform-listener/updaterelationsondelete/src/main/java/org/collectionspace/services/listener/UpdateRelationsOnDelete.java +++ b/3rdparty/nuxeo/nuxeo-platform-listener/updaterelationsondelete/src/main/java/org/collectionspace/services/listener/UpdateRelationsOnDelete.java @@ -73,6 +73,8 @@ public class UpdateRelationsOnDelete implements EventListener { workflowStatesToFilter.add(WorkflowClient.WORKFLOWSTATE_DELETED); workflowStatesToFilter.add(WorkflowClient.WORKFLOWSTATE_LOCKED); workflowStatesToFilter.add(WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED); + workflowStatesToFilter.add(WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED); + LifeCycleFilter workflowStateFilter = new LifeCycleFilter(null, workflowStatesToFilter); // Perform the filtered query diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java index 6d99b8d32..81e0bd860 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java @@ -340,11 +340,11 @@ public abstract class AuthorityResource } } - protected boolean supportsSync(String tenantId, String serviceName) { + protected boolean supportsReplicating(String tenantId, String serviceName) { boolean result = false; ServiceBindingType sb = getTenantBindingsReader().getServiceBinding(tenantId, getServiceName()); - result = sb.isSupportsSynchronization(); + result = sb.isSupportsReplicating(); return result; } @@ -372,7 +372,7 @@ public abstract class AuthorityResource /* * Make sure this authority service supports synchronization */ - if (supportsSync(ctx.getTenantId(), ctx.getServiceName()) == false) { + if (supportsReplicating(ctx.getTenantId(), ctx.getServiceName()) == false) { throw new DocumentException(Response.Status.FORBIDDEN.getStatusCode()); } AuthorityDocumentModelHandler handler = (AuthorityDocumentModelHandler)createDocumentHandler(ctx); diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java index d7ee444e4..d56218d32 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java @@ -369,10 +369,10 @@ public abstract class AuthorityDocumentModelHandler itemIdentifier, parentIdentifier)); } // - // Since we're creating an item that was sourced from the SAS, we need to lock it. + // Since we're creating an item that was sourced from the replication server, we need to replicate it locally. // authorityResource.updateItemWorkflowWithTransition(ctx, parentIdentifier, itemIdentifier, - WorkflowClient.WORKFLOWTRANSITION_LOCK, AuthorityServiceUtils.DONT_UPDATE_REV); + WorkflowClient.WORKFLOWTRANSITION_REPLICATE, AuthorityServiceUtils.DONT_UPDATE_REV); // don't update the rev number of the new replicated item (use the rev number of the sourced item) } /** diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java index 3e1f19200..fdcf0c5d5 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java @@ -24,18 +24,14 @@ package org.collectionspace.services.common.vocabulary.nuxeo; import org.collectionspace.services.client.AuthorityClient; -import org.collectionspace.services.client.CollectionSpaceClient; import org.collectionspace.services.client.IQueryManager; import org.collectionspace.services.client.PoxPayloadIn; import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.client.workflow.WorkflowClient; -import org.collectionspace.services.common.ResourceMap; import org.collectionspace.services.common.ServiceMain; import org.collectionspace.services.common.UriTemplateRegistry; import org.collectionspace.services.common.api.RefName; -import org.collectionspace.services.common.api.RefNameUtils; import org.collectionspace.services.common.api.Tools; -import org.collectionspace.services.common.api.RefNameUtils.AuthorityInfo; import org.collectionspace.services.common.authorityref.AuthorityRefDocList; import org.collectionspace.services.common.context.MultipartServiceContext; import org.collectionspace.services.common.context.ServiceContext; @@ -51,7 +47,6 @@ import org.collectionspace.services.common.vocabulary.AuthorityResource; import org.collectionspace.services.common.vocabulary.AuthorityServiceUtils; import org.collectionspace.services.common.vocabulary.RefNameServiceUtils; 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.config.service.ListResultField; import org.collectionspace.services.config.service.ObjectPartType; @@ -62,6 +57,7 @@ import org.collectionspace.services.nuxeo.client.java.RepositoryClientImpl; import org.collectionspace.services.nuxeo.util.NuxeoUtils; import org.collectionspace.services.relation.RelationsCommonList; import org.collectionspace.services.vocabulary.VocabularyItemJAXBSchema; + import org.nuxeo.ecm.core.api.ClientException; import org.nuxeo.ecm.core.api.DocumentModel; import org.nuxeo.ecm.core.api.model.PropertyException; @@ -69,10 +65,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.UriInfo; - import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -503,61 +496,62 @@ public abstract class AuthorityItemDocumentModelHandler } /** - * We need to move the local item to the SAS workflow state. This might involve multiple transitions. + * We need to change the local item's state to one that maps to the replication server's workflow + * state. This might involve making multiple transitions. * * WIKI: - * See table at https://wiki.collectionspace.org/pages/viewpage.action?pageId=162496564 + * See table at https://wiki.collectionspace.org/pages/viewpage.action?pageId=162496564 * */ private List getTransitionList(String sasWorkflowState, String localItemWorkflowState) throws DocumentException { List result = new ArrayList(); // - // The first set of conditions maps a SAS "project" state to a local state of "locked" + // The first set of conditions maps a replication-server "project" state to a local client state of "replicated" // if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT)) { - result.add(WorkflowClient.WORKFLOWTRANSITION_LOCK); + result.add(WorkflowClient.WORKFLOWTRANSITION_REPLICATE); } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED)) { result.add(WorkflowClient.WORKFLOWTRANSITION_UNDELETE); - result.add(WorkflowClient.WORKFLOWTRANSITION_LOCK); - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED)) { + result.add(WorkflowClient.WORKFLOWTRANSITION_REPLICATE); + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED)) { // Do nothing. We're good with this state - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED)) { + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED)) { result.add(WorkflowClient.WORKFLOWTRANSITION_UNDELETE); // - // The second set of conditions maps a SAS "deleted" state to a local state of "deleted" + // The second set of conditions maps a replication-server "deleted" state to a local client state of "deleted" // } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT)) { - result.add(WorkflowClient.WORKFLOWTRANSITION_LOCK); + result.add(WorkflowClient.WORKFLOWTRANSITION_REPLICATE); result.add(WorkflowClient.WORKFLOWTRANSITION_DELETE); } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED)) { - result.add(WorkflowClient.WORKFLOWTRANSITION_LOCK); - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED)) { + result.add(WorkflowClient.WORKFLOWTRANSITION_REPLICATE); + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED)) { result.add(WorkflowClient.WORKFLOWTRANSITION_DELETE); - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED)) { + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED)) { // Do nothing. We're good with this state // - // The third set of conditions maps a SAS "locked" state to a local state of "locked" + // The third set of conditions maps a replication-server "replicated" state to a local state of "replicated" // - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT)) { - result.add(WorkflowClient.WORKFLOWTRANSITION_LOCK); - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED)) { + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT)) { + result.add(WorkflowClient.WORKFLOWTRANSITION_REPLICATE); + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED)) { result.add(WorkflowClient.WORKFLOWTRANSITION_UNDELETE); - result.add(WorkflowClient.WORKFLOWTRANSITION_LOCK); - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED)) { + result.add(WorkflowClient.WORKFLOWTRANSITION_REPLICATE); + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED)) { // Do nothing. We're good with this state - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED)) { + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED)) { result.add(WorkflowClient.WORKFLOWTRANSITION_UNDELETE); // - // The last set of conditions maps a SAS "locked_deleted" state to a local state of "deleted" + // The last set of conditions maps a replication-server "replicated_deleted" state to a local client state of "deleted" // - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT)) { - result.add(WorkflowClient.WORKFLOWTRANSITION_LOCK); + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_PROJECT)) { + result.add(WorkflowClient.WORKFLOWTRANSITION_REPLICATE); result.add(WorkflowClient.WORKFLOWTRANSITION_DELETE); - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED)) { - result.add(WorkflowClient.WORKFLOWTRANSITION_LOCK); - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED)) { + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_DELETED)) { + result.add(WorkflowClient.WORKFLOWTRANSITION_REPLICATE); + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED)) { result.add(WorkflowClient.WORKFLOWTRANSITION_DELETE); - } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED)) { + } else if (sasWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED) && localItemWorkflowState.equals(WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED)) { // Do nothing. We're good with this state } else { // diff --git a/services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java b/services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java index 2059a59d5..564f00478 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java +++ b/services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java @@ -100,6 +100,7 @@ public abstract class AuthorityClientImpl allSASResourceItemIdsCreated = new HashMap(); /* itemURN, parentURN */; @@ -315,7 +315,7 @@ public abstract class AbstractAuthorityServiceTest } } + /** + * Helps to filter for queries that either want to include or exclude documents in deleted workflow states. + * + * @param queryParams + * @return + */ private static String buildWorkflowWhereClause(MultivaluedMap queryParams) { String result = null; @@ -516,11 +522,11 @@ public abstract class AbstractServiceContextImpl String includeOnlyDeleted = queryParams.getFirst(WorkflowClient.WORKFLOW_QUERY_ONLY_DELETED); if (includeDeleted != null && includeDeleted.equalsIgnoreCase(Boolean.FALSE.toString())) { - result = String.format("(ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s')", - WorkflowClient.WORKFLOWSTATE_DELETED, WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED); + result = String.format("(ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s')", + WorkflowClient.WORKFLOWSTATE_DELETED, WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED, WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED); } else if (includeOnlyDeleted != null && includeOnlyDeleted.equalsIgnoreCase(Boolean.TRUE.toString())) { - result = String.format("(ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s')", - WorkflowClient.WORKFLOWSTATE_PROJECT, WorkflowClient.WORKFLOWSTATE_LOCKED); + result = String.format("(ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s')", + WorkflowClient.WORKFLOWSTATE_PROJECT, WorkflowClient.WORKFLOWSTATE_LOCKED, WorkflowClient.WORKFLOWSTATE_REPLICATED); } return result; diff --git a/services/common/src/main/java/org/collectionspace/services/common/security/SecurityInterceptor.java b/services/common/src/main/java/org/collectionspace/services/common/security/SecurityInterceptor.java index 421eccb9c..083ab4006 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/security/SecurityInterceptor.java +++ b/services/common/src/main/java/org/collectionspace/services/common/security/SecurityInterceptor.java @@ -121,7 +121,7 @@ public class SecurityInterceptor implements PreProcessInterceptor, PostProcessIn if (isAnonymousRequest(request, resourceMethodInvoker) == true) { // We don't need to check credentials for anonymous requests. Just login to Nuxeo and // exit - nuxeoPreProcess(request, resourceMethodInvoker); + nuxeoPreProcess(request, resourceMethodInvoker); // We login to Nuxeo only after we've checked authorization return result; } @@ -198,7 +198,7 @@ public class SecurityInterceptor implements PreProcessInterceptor, PostProcessIn // // Login to Nuxeo // - nuxeoPreProcess(request, resourceMethodInvoker); + nuxeoPreProcess(request, resourceMethodInvoker); // We login to Nuxeo only after we've checked authorization // // We've passed all the checks. Now just log the results @@ -392,7 +392,9 @@ public class SecurityInterceptor implements PreProcessInterceptor, PostProcessIn String.format("Framework logins: ", frameworkLogins); } } else { - logger.warn(ERROR_NUXEO_LOGOUT); + if (frameworkLogins > 0) { + logger.warn(ERROR_NUXEO_LOGOUT); // If we get here, it means our login/logout bookkeeping has failed. + } } if (frameworkLogins == 0) { diff --git a/services/common/src/main/java/org/collectionspace/services/common/workflow/service/nuxeo/WorkflowDocumentModelHandler.java b/services/common/src/main/java/org/collectionspace/services/common/workflow/service/nuxeo/WorkflowDocumentModelHandler.java index f7cfdaa9f..d9d805962 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/workflow/service/nuxeo/WorkflowDocumentModelHandler.java +++ b/services/common/src/main/java/org/collectionspace/services/common/workflow/service/nuxeo/WorkflowDocumentModelHandler.java @@ -129,13 +129,13 @@ public class WorkflowDocumentModelHandler } /* - * Maps the transition name to handle existing states like "locked" and "deleted". This allows us to do things like lock "deleted" - * records, delete "locked" records, etc. For example, this code maps the transition name "delete" to "delete_locked" on records in the "locked" state. - * As another example, it would map "undelete" to "undelete_locked" for locked records and just "undelete" for records in any other state. + * Maps the transition name to handle existing states like "replicated" and "deleted". This allows us to do things like replicate "deleted" + * records, delete "replicated" records, etc. For example, this code maps the transition name "delete" to "delete_replicated" on records in the "replicated" state. + * As another example, it would map "undelete" to "undelete_replicated" for replicated records and just "undelete" for records in any other state. * - * Essentially, this mapping allows REST API clients to use the "delete", "undelete", "lock", "unlock", etc transitions on records no matter what + * Essentially, this mapping allows REST API clients to use the "delete", "undelete", "replicate", "unreplicate", etc transitions on records no matter what * their current state. Without this mapping, REST API clients would need to calculate this on their own and use the longer forms like: - * "delete_locked", "undelete_locked", "lock_deleted", "unlocked_deleted", etc. + * "delete_replicated", "undelete_replicated", "lock_deleted", "unlock_deleted", etc. */ String getQualifiedTransitionName(DocumentWrapper wrapDoc, TransitionDef transitionDef) { String result = null; diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryClientImpl.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryClientImpl.java index 305807e38..2529c99ec 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryClientImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryClientImpl.java @@ -125,8 +125,7 @@ public class RepositoryClientImpl implements RepositoryClient ctx, - DocumentModel docModel) throws DocumentNotFoundException, ClientException { + public void assertWorkflowState(ServiceContext ctx, DocumentModel docModel) throws DocumentNotFoundException, ClientException { MultivaluedMap queryParams = ctx.getQueryParams(); if (queryParams != null) { // @@ -135,7 +134,7 @@ public class RepositoryClientImpl implements RepositoryClient - +