From 811d87613be055939e2d1b6e286588fd19ea11ce Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Wed, 15 Dec 2010 22:15:47 +0000 Subject: [PATCH] CSPACE-2702: Using DocumentModel.getName() instead of: NuxeoUtils.extractId(docModel.getPathAsString()) to get CSID --- .../nuxeo/CollectionObjectDocumentModelHandler.java | 2 +- .../common/vocabulary/RefNameServiceUtils.java | 2 +- .../nuxeo/AuthorityDocumentModelHandler.java | 2 +- .../nuxeo/AuthorityItemDocumentModelHandler.java | 2 +- .../services/nuxeo/client/java/DocHandlerBase.java | 2 +- .../nuxeo/client/java/DocumentModelHandler.java | 8 ++++++++ .../nuxeo/client/java/RepositoryJavaClientImpl.java | 2 +- .../services/nuxeo/util/NuxeoUtils.java | 11 ++++++++++- .../contact/nuxeo/ContactDocumentModelHandler.java | 2 +- .../nuxeo/DimensionDocumentModelHandler.java | 2 +- .../intake/nuxeo/IntakeDocumentModelHandler.java | 2 +- .../loanout/nuxeo/LoanoutDocumentModelHandler.java | 2 +- .../nuxeo/LocationAuthorityDocumentModelHandler.java | 2 +- .../location/nuxeo/LocationDocumentModelHandler.java | 2 +- .../movement/nuxeo/MovementDocumentModelHandler.java | 2 +- .../services/note/nuxeo/NoteDocumentModelHandler.java | 2 +- .../nuxeo/OrgAuthorityDocumentModelHandler.java | 2 +- .../nuxeo/OrganizationDocumentModelHandler.java | 2 +- .../nuxeo/PersonAuthorityDocumentModelHandler.java | 2 +- .../person/nuxeo/PersonDocumentModelHandler.java | 4 ++-- .../relation/nuxeo/RelationDocumentModelHandler.java | 2 +- .../report/nuxeo/ReportDocumentModelHandler.java | 2 +- .../nuxeo/VocabularyDocumentModelHandler.java | 2 +- .../nuxeo/VocabularyItemDocumentModelHandler.java | 2 +- 24 files changed, 41 insertions(+), 24 deletions(-) diff --git a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectDocumentModelHandler.java b/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectDocumentModelHandler.java index 71ea71ed9..4eba07447 100644 --- a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectDocumentModelHandler.java +++ b/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectDocumentModelHandler.java @@ -155,7 +155,7 @@ public class CollectionObjectDocumentModelHandler CollectionObjectListItemJAXBSchema.RESPONSIBLE_DEPARTMENTS); coListItem.setResponsibleDepartment(DocumentUtils.getFirstString(respDepts)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); coListItem.setUri(getServiceContextPath() + id); coListItem.setCsid(id); } catch (ClassCastException cce) { diff --git a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java index 3fa013e37..77d0d9841 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java @@ -155,7 +155,7 @@ public class RefNameServiceUtils { while (iter.hasNext()) { DocumentModel docModel = iter.next(); AuthorityRefDocList.AuthorityRefDocItem ilistItem = new AuthorityRefDocList.AuthorityRefDocItem(); - String csid = NuxeoUtils.extractId(docModel.getPathAsString()); + String csid = NuxeoUtils.getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); String docType = docModel.getDocumentType().getName(); ServiceBindingType sb = queriedServiceBindings.get(docType); if (sb == null) { diff --git a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java index 666631a6d..f910a13a1 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java +++ b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java @@ -121,7 +121,7 @@ public abstract class AuthorityDocumentModelHandler // Add the CSID to the common part if (partMeta.getLabel().equalsIgnoreCase(authorityCommonSchemaName)) { - String csid = NuxeoUtils.extractId(docModel.getPathAsString()); + String csid = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); unQObjectProperties.put("csid", csid); } diff --git a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java index 8a648a25f..6421c54db 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java +++ b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java @@ -149,7 +149,7 @@ public abstract class AuthorityItemDocumentModelHandler // Add the CSID to the common part if (partMeta.getLabel().equalsIgnoreCase(authorityItemCommonSchemaName)) { - String csid = NuxeoUtils.extractId(docModel.getPathAsString()); + String csid = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); unQObjectProperties.put("csid", csid); } diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java index 24e5bba32..ceea5aa8a 100755 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java @@ -150,7 +150,7 @@ public abstract class DocHandlerBase extends RemoteDocumentModelHandlerIm Iterator iter = wrapDoc.getWrappedObject().iterator(); while(iter.hasNext()){ DocumentModel docModel = iter.next(); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = NuxeoUtils.getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); Object item = createItemForCommonList(docModel, label, id); list.add(item); } diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocumentModelHandler.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocumentModelHandler.java index c6475100a..977605cdc 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocumentModelHandler.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocumentModelHandler.java @@ -32,6 +32,7 @@ import org.collectionspace.services.common.document.DocumentFilter; import org.collectionspace.services.common.document.DocumentWrapper; import org.collectionspace.services.common.document.DocumentHandler.Action; import org.collectionspace.services.nuxeo.client.*; +import org.collectionspace.services.nuxeo.util.NuxeoUtils; import org.collectionspace.services.common.profile.Profiler; import org.nuxeo.ecm.core.api.DocumentModel; @@ -60,6 +61,13 @@ public abstract class DocumentModelHandler public final static String COLLECTIONSPACE_CORE_CREATED_AT = "createdAt"; public final static String COLLECTIONSPACE_CORE_UPDATED_AT = "updatedAt"; + /* + * We're using the "name" field of Nuxeo's DocumentModel to store + * the CSID. + */ + public String getCsid(DocumentModel docModel) { + return NuxeoUtils.getCsid(docModel); + } /** * getRepositorySession returns Nuxeo Repository Session * @return diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java index 00f61d937..0ac1ca20c 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java @@ -399,7 +399,7 @@ public class RepositoryJavaClientImpl implements RepositoryClient { try { DocumentWrapper wrapDoc = findDoc(ctx, whereClause); DocumentModel docModel = wrapDoc.getWrappedObject(); - csid = NuxeoUtils.extractId(docModel.getPathAsString()); + csid = NuxeoUtils.getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); } catch (DocumentNotFoundException dnfe) { throw dnfe; } catch (IllegalArgumentException iae) { diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java index 2d8cbd30e..bce2cb43b 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java @@ -211,12 +211,21 @@ public class NuxeoUtils { "/" + id); } + /* + * We're using the "name" field of Nuxeo's DocumentModel to store + * the CSID. + */ + public static String getCsid(DocumentModel docModel) { + return docModel.getName(); + } + /** * extractId extracts id from given path string * @param pathString * @return */ - public static String extractId(String pathString) { + @Deprecated + public static String xextractId(String pathString) { if (pathString == null) { throw new IllegalArgumentException("empty pathString"); } diff --git a/services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactDocumentModelHandler.java b/services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactDocumentModelHandler.java index 65b022850..c4c5dc406 100644 --- a/services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactDocumentModelHandler.java +++ b/services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactDocumentModelHandler.java @@ -194,7 +194,7 @@ public class ContactDocumentModelHandler // See CSPACE-1018 clistItem.setAddressPlace((String) docModel.getProperty(getServiceContext().getCommonPartLabel(), ContactJAXBSchema.ADDRESS_PLACE)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); clistItem.setUri(getServiceContextPath() + id); clistItem.setCsid(id); list.add(clistItem); diff --git a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionDocumentModelHandler.java b/services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionDocumentModelHandler.java index eb6d52e8f..abb61f38e 100644 --- a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionDocumentModelHandler.java +++ b/services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionDocumentModelHandler.java @@ -118,7 +118,7 @@ public class DimensionDocumentModelHandler DimensionListItem ilistItem = new DimensionListItem(); ilistItem.setDimension((String) docModel.getProperty(getServiceContext().getCommonPartLabel(), DimensionJAXBSchema.DIMENSION)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri(getServiceContextPath() + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeDocumentModelHandler.java b/services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeDocumentModelHandler.java index 8cb9468bc..6abd060cd 100644 --- a/services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeDocumentModelHandler.java +++ b/services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeDocumentModelHandler.java @@ -134,7 +134,7 @@ public class IntakeDocumentModelHandler IntakeJAXBSchema.DEPOSITOR)); ilistItem.setCurrentOwner((String) docModel.getProperty(label, IntakeJAXBSchema.CURRENT_OWNER)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri(getServiceContextPath() + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/loanout/service/src/main/java/org/collectionspace/services/loanout/nuxeo/LoanoutDocumentModelHandler.java b/services/loanout/service/src/main/java/org/collectionspace/services/loanout/nuxeo/LoanoutDocumentModelHandler.java index d609c23a4..fa9daec83 100644 --- a/services/loanout/service/src/main/java/org/collectionspace/services/loanout/nuxeo/LoanoutDocumentModelHandler.java +++ b/services/loanout/service/src/main/java/org/collectionspace/services/loanout/nuxeo/LoanoutDocumentModelHandler.java @@ -144,7 +144,7 @@ public class LoanoutDocumentModelHandler LoanoutJAXBSchema.BORROWER)); ilistItem.setLoanReturnDate((String) docModel.getProperty(label, LoanoutJAXBSchema.LOAN_RETURN_DATE)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri(getServiceContextPath() + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/location/service/src/main/java/org/collectionspace/services/location/nuxeo/LocationAuthorityDocumentModelHandler.java b/services/location/service/src/main/java/org/collectionspace/services/location/nuxeo/LocationAuthorityDocumentModelHandler.java index 2a92aca65..5caaf628d 100644 --- a/services/location/service/src/main/java/org/collectionspace/services/location/nuxeo/LocationAuthorityDocumentModelHandler.java +++ b/services/location/service/src/main/java/org/collectionspace/services/location/nuxeo/LocationAuthorityDocumentModelHandler.java @@ -84,7 +84,7 @@ public class LocationAuthorityDocumentModelHandler AuthorityJAXBSchema.SHORT_IDENTIFIER)); ilistItem.setVocabType((String) docModel.getProperty(label, AuthorityJAXBSchema.VOCAB_TYPE)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri(getServiceContextPath() + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/location/service/src/main/java/org/collectionspace/services/location/nuxeo/LocationDocumentModelHandler.java b/services/location/service/src/main/java/org/collectionspace/services/location/nuxeo/LocationDocumentModelHandler.java index 72c7f2085..d8d00d943 100644 --- a/services/location/service/src/main/java/org/collectionspace/services/location/nuxeo/LocationDocumentModelHandler.java +++ b/services/location/service/src/main/java/org/collectionspace/services/location/nuxeo/LocationDocumentModelHandler.java @@ -161,7 +161,7 @@ public class LocationDocumentModelHandler AuthorityItemJAXBSchema.SHORT_IDENTIFIER)); ilistItem.setRefName((String) docModel.getProperty(commonPartLabel, AuthorityItemJAXBSchema.REF_NAME)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri("/locationauthorities/" + inAuthority + "/items/" + id); ilistItem.setCsid(id); diff --git a/services/movement/service/src/main/java/org/collectionspace/services/movement/nuxeo/MovementDocumentModelHandler.java b/services/movement/service/src/main/java/org/collectionspace/services/movement/nuxeo/MovementDocumentModelHandler.java index 07f225ee8..4bb538d31 100644 --- a/services/movement/service/src/main/java/org/collectionspace/services/movement/nuxeo/MovementDocumentModelHandler.java +++ b/services/movement/service/src/main/java/org/collectionspace/services/movement/nuxeo/MovementDocumentModelHandler.java @@ -149,7 +149,7 @@ public class MovementDocumentModelHandler GregorianCalendar gcal = (GregorianCalendar) docModel.getProperty(label, MovementJAXBSchema.LOCATION_DATE); ilistItem.setLocationDate(DateTimeFormatUtils.formatAsISO8601Timestamp(gcal)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri(getServiceContextPath() + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/note/service/src/main/java/org/collectionspace/services/note/nuxeo/NoteDocumentModelHandler.java b/services/note/service/src/main/java/org/collectionspace/services/note/nuxeo/NoteDocumentModelHandler.java index 53043b598..df5dd994e 100644 --- a/services/note/service/src/main/java/org/collectionspace/services/note/nuxeo/NoteDocumentModelHandler.java +++ b/services/note/service/src/main/java/org/collectionspace/services/note/nuxeo/NoteDocumentModelHandler.java @@ -146,7 +146,7 @@ public class NoteDocumentModelHandler NoteListItem clistItem = new NoteListItem(); clistItem.setContent((String) docModel.getProperty(getServiceContext().getCommonPartLabel(), NoteJAXBSchema.CONTENT)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); clistItem.setUri(getServiceContextPath() + id); clistItem.setCsid(id); list.add(clistItem); diff --git a/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityDocumentModelHandler.java b/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityDocumentModelHandler.java index 1867894e0..849ccd916 100644 --- a/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityDocumentModelHandler.java +++ b/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityDocumentModelHandler.java @@ -80,7 +80,7 @@ public class OrgAuthorityDocumentModelHandler AuthorityJAXBSchema.SHORT_IDENTIFIER)); ilistItem.setVocabType((String) docModel.getProperty(label, AuthorityJAXBSchema.VOCAB_TYPE)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri(getServiceContextPath() + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationDocumentModelHandler.java b/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationDocumentModelHandler.java index 5b660abff..12af615c6 100644 --- a/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationDocumentModelHandler.java +++ b/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationDocumentModelHandler.java @@ -168,7 +168,7 @@ public class OrganizationDocumentModelHandler OrganizationJAXBSchema.SHORT_IDENTIFIER)); ilistItem.setRefName((String) docModel.getProperty(commonPartLabel, OrganizationJAXBSchema.REF_NAME)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri("/orgauthorities/" + this.inAuthority + "/items/" + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityDocumentModelHandler.java b/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityDocumentModelHandler.java index 24821da18..be7e69928 100644 --- a/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityDocumentModelHandler.java +++ b/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityDocumentModelHandler.java @@ -81,7 +81,7 @@ public class PersonAuthorityDocumentModelHandler AuthorityJAXBSchema.SHORT_IDENTIFIER)); ilistItem.setVocabType((String) docModel.getProperty(label, AuthorityJAXBSchema.VOCAB_TYPE)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri(getServiceContextPath() + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonDocumentModelHandler.java b/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonDocumentModelHandler.java index a9914df60..71c08872f 100644 --- a/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonDocumentModelHandler.java +++ b/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonDocumentModelHandler.java @@ -196,7 +196,7 @@ public class PersonDocumentModelHandler // Add the CSID to the common part if (partMeta.getLabel().equalsIgnoreCase(COMMON_PART_LABEL)) { - String csid = NuxeoUtils.extractId(docModel.getPathAsString()); + String csid = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); unQObjectProperties.put("csid", csid); } @@ -225,7 +225,7 @@ public class PersonDocumentModelHandler PersonJAXBSchema.SHORT_IDENTIFIER)); ilistItem.setRefName((String) docModel.getProperty(commonPartLabel, PersonJAXBSchema.REF_NAME)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri("/personauthorities/" + inAuthority + "/items/" + id); ilistItem.setCsid(id); diff --git a/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java b/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java index b9ebb4e6c..ff86a50cc 100644 --- a/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java +++ b/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java @@ -161,7 +161,7 @@ public class RelationDocumentModelHandler DocumentModel docModel, String serviceContextPath) throws Exception { RelationListItem relationListItem = new RelationListItem(); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); relationListItem.setCsid(id); // // Subject diff --git a/services/report/service/src/main/java/org/collectionspace/services/report/nuxeo/ReportDocumentModelHandler.java b/services/report/service/src/main/java/org/collectionspace/services/report/nuxeo/ReportDocumentModelHandler.java index 9077fc0ba..1518bc8a8 100644 --- a/services/report/service/src/main/java/org/collectionspace/services/report/nuxeo/ReportDocumentModelHandler.java +++ b/services/report/service/src/main/java/org/collectionspace/services/report/nuxeo/ReportDocumentModelHandler.java @@ -136,7 +136,7 @@ public class ReportDocumentModelHandler ReportJAXBSchema.FOR_SINGLE_DOC)); ilistItem.setForDocType((String) docModel.getProperty(label, ReportJAXBSchema.FOR_DOC_TYPE)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri(getServiceContextPath() + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyDocumentModelHandler.java b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyDocumentModelHandler.java index cbb6af7b0..b5609dc02 100644 --- a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyDocumentModelHandler.java +++ b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyDocumentModelHandler.java @@ -81,7 +81,7 @@ public class VocabularyDocumentModelHandler AuthorityJAXBSchema.SHORT_IDENTIFIER)); ilistItem.setVocabType((String) docModel.getProperty(label, AuthorityJAXBSchema.VOCAB_TYPE)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri(getServiceContextPath() + id); ilistItem.setCsid(id); list.add(ilistItem); diff --git a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java index e54078efb..eb8828dbe 100644 --- a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java +++ b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java @@ -76,7 +76,7 @@ public class VocabularyItemDocumentModelHandler AuthorityItemJAXBSchema.SHORT_IDENTIFIER)); ilistItem.setRefName((String) docModel.getProperty(commonPartLabel, AuthorityItemJAXBSchema.REF_NAME)); - String id = NuxeoUtils.extractId(docModel.getPathAsString()); + String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString()); ilistItem.setUri("/vocabularies/" + inAuthority + "/items/" + id); ilistItem.setCsid(id); list.add(ilistItem); -- 2.47.3