\r
!-- ========================= POST a person ===================================================== -->\r
\r
- <testGroup ID="postPerson" autoDeletePOSTS="false">\r
+ <testGroup ID="postPerson" autoDeletePOSTS="true">\r
<test ID="PersonAuth1" auth="admin@collectionspace.org">\r
<method>POST</method>\r
<uri>/cspace-services/personauthorities/</uri>\r
this.inAuthority = inAuthority;
}
- // Laramie20110510 CSPACE-3932
- public static final String HACK_VOCABULARIES = "vocabularies"; //TODO: get rid of these.
- //public static final String HACK_ORGANIZATIONS = "Organizations"; //TODO: get rid of these.
- public static final String HACK_ORGAUTHORITIES = "orgauthorities"; //TODO: get rid of these.
- public static final String HACK_PERSONAUTHORITIES = "personauthorities"; //TODO: get rid of these.
- public static final String HACK_LOCATIONAUTHORITIES = "locationauthorities"; //TODO: get rid of these.
- private final static Map<String,String> hackMap = new HashMap<String,String>();
- static {
- hackMap.put("persons", HACK_PERSONAUTHORITIES);
- hackMap.put("organizations", HACK_ORGAUTHORITIES);
- hackMap.put("vocabularies", HACK_VOCABULARIES);
- hackMap.put("locations", HACK_LOCATIONAUTHORITIES);
+ /** Subclasses may override this to customize the URI segment. */
+ public String getAuthorityServicePath(){
+ return getServiceContext().getServiceName().toLowerCase(); // Laramie20110510 CSPACE-3932
}
+
@Override
public String getUri(DocumentModel docModel) {
// Laramie20110510 CSPACE-3932
- String serviceContextName = getServiceContext().getServiceName().toLowerCase();
- String displayContextPath = hackMap.get(serviceContextName);
- if (Tools.isEmpty(displayContextPath)){
- displayContextPath = serviceContextName;
- }
- return "/"+displayContextPath+'/'+inAuthority+'/'+ AuthorityClient.ITEMS+'/'+getCsid(docModel);
+ String authorityServicePath = getAuthorityServicePath();
+ return "/"+authorityServicePath+'/'+inAuthority+'/'+ AuthorityClient.ITEMS+'/'+getCsid(docModel);
}
-
public String getAuthorityRefNameBase(){
return this.authorityRefNameBase;
}
import java.util.Map;
import org.collectionspace.services.LocationJAXBSchema;
+import org.collectionspace.services.client.LocationAuthorityClient;
import org.collectionspace.services.common.document.DocumentFilter;
import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.service.ObjectPartType;
public LocationDocumentModelHandler() {
super(COMMON_PART_LABEL);
}
+
+ @Override
+ public String getAuthorityServicePath(){
+ return LocationAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
+ }
/* (non-Javadoc)
* @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
AuthorityResourceWithContacts<OrgauthoritiesCommon, OrgauthoritiesCommonList, OrganizationsCommon,
OrganizationDocumentModelHandler> {
- private final static String orgAuthorityServiceName = "orgauthorities";
+ private final static String orgAuthorityServiceName = OrgAuthorityClient.SERVICE_NAME;
private final static String ORGAUTHORITIES_COMMON = "orgauthorities_common";
private final static String organizationServiceName = "organizations";
import java.util.List;
import java.util.Map;
+import org.collectionspace.services.client.OrgAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
import org.collectionspace.services.OrganizationJAXBSchema;
import org.collectionspace.services.common.document.DocumentWrapper;
public OrganizationDocumentModelHandler() {
super(COMMON_PART_LABEL);
}
+
+ @Override
+ public String getAuthorityServicePath(){
+ return OrgAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
+ }
/* (non-Javadoc)
* @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
import java.util.List;
import java.util.Map;
+import org.collectionspace.services.client.PersonAuthorityClient;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
import org.collectionspace.services.PersonJAXBSchema;
import org.collectionspace.services.common.document.DocumentWrapper;
public PersonDocumentModelHandler() {
super(COMMON_PART_LABEL);
}
+
+ @Override
+ public String getAuthorityServicePath(){
+ return PersonAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
+ }
/* (non-Javadoc)
* @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
String itemDocType = itemDocModel.getDocumentType().getName();
item.setDocumentTypeFromModel(itemDocType); //this one comes from the nuxeo documentType
- System.out.println("\r\n******** AuthorityItemDocumentModelHandlder documentType **************\r\n\tdocModel: "+itemDocType+"\r\n\tpayload: "+documentType);
+ //DEBUG: System.out.println("\r\n******** AuthorityItemDocumentModelHandlder documentType **************\r\n\tdocModel: "+itemDocType+"\r\n\tpayload: "+documentType);
boolean usedDocumentTypeFromPayload = true;
if ( ! Tools.isBlank(documentType)){
if (documentType.equals(itemDocType)){
import java.util.Map;
import org.collectionspace.services.TaxonJAXBSchema;
+import org.collectionspace.services.client.TaxonomyAuthorityClient;
import org.collectionspace.services.common.document.DocumentFilter;
import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.service.ObjectPartType;
super(COMMON_PART_LABEL);
}
+ @Override
+ public String getAuthorityServicePath(){
+ return TaxonomyAuthorityClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
+ }
+
/* (non-Javadoc)
* @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
*/
import java.util.Iterator;
import java.util.List;
+import org.collectionspace.services.client.VocabularyClient;
import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
public VocabularyItemDocumentModelHandler() {
super(COMMON_PART_LABEL);
}
+
+ @Override
+ public String getAuthorityServicePath(){
+ return VocabularyClient.SERVICE_PATH_COMPONENT; // CSPACE-3932
+ }
@Override