From 4b6ae75b05fb5154005bf49487db9e7b5096cfaf Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Fri, 31 Aug 2012 00:23:36 -0700 Subject: [PATCH] CSPACE-5488: Added code to put a refname in the CollectionSpace_Core schema for all records/resources. --- .../schemas/collectionspace_core.xsd | 1 + .../client/CollectionSpaceClient.java | 1 + .../services/common/api/RefName.java | 26 +++++++++---------- .../nuxeo/client/java/DocHandlerBase.java | 24 +++++++++++------ .../client/java/DocumentModelHandler.java | 9 +++++++ 5 files changed, 40 insertions(+), 21 deletions(-) diff --git a/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionspace_core.xsd b/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionspace_core.xsd index 3a557f64e..7c9389798 100644 --- a/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionspace_core.xsd +++ b/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionspace_core.xsd @@ -17,6 +17,7 @@ + diff --git a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java index a1eb74d2e..940983708 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java +++ b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java @@ -39,6 +39,7 @@ public interface CollectionSpaceClient extends RemoteDocumentModelHandlerImpl extends RemoteDocumentModelHandlerImpl extends RemoteDocumentModelHandlerImpl wrapDoc) throws Exception { - String classname = getDocHandlerParams().getAbstractCommonListClassname(); CommonList commonList = new CommonList(); String markRtSbj = null; RepositoryInstance repoSession = null; @@ -194,13 +200,14 @@ public abstract class DocHandlerBase extends RemoteDocumentModelHandlerImpl extends RemoteDocumentModelHandlerImpl // documentModel.setProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA, CollectionSpaceClient.COLLECTIONSPACE_CORE_URI, getUri(documentModel)); + // + // Add the resource's refname + // + String csid = documentModel.getName(); + String refname = RefName.Authority.buildAuthority(ctx.getTenantName(), ctx.getServiceName(), + csid, "" /*authorityDisplayName*/).toString(); + documentModel.setProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA, + CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME, refname); // // Add the CSID to the DublinCore title so we can see the CSID in the default // Nuxeo webapp. -- 2.47.3