]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5036: Needed to shuffle some of the Relationship service constants to avoid...
authorRichard Millet <remillet@berkeley.edu>
Tue, 29 May 2012 19:20:50 +0000 (12:20 -0700)
committerRichard Millet <remillet@berkeley.edu>
Tue, 29 May 2012 19:20:50 +0000 (12:20 -0700)
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java
services/common/pom.xml
services/common/src/main/java/org/collectionspace/services/common/relation/nuxeo/RelationConstants.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocumentModelHandler.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java
services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java
services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionDocumentModelHandler.java
services/relation/client/src/main/java/org/collectionspace/services/client/RelationClient.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java

index 87c0c1d91f229c91e31846f0bfaff586e53f92e4..a1eb74d2eeb75d73f362b28a448feacc31c412dd 100644 (file)
@@ -26,8 +26,6 @@ package org.collectionspace.services.client;
 import javax.ws.rs.core.Response;
 import org.apache.commons.httpclient.HttpClient;
 import org.jboss.resteasy.client.ClientResponse;
-
-import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 
 /**
index ddd7fa93e9d6e49bb6639c4f4e4ec08a3887f483..a892bfeec9e3b75de94f503bbaa9b5bb7a0bdae5 100644 (file)
             <artifactId>org.collectionspace.services.client</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
index ef9982447a68d1d5405efdf501895a6a4b450880..e640ad98e0b548f809812e2983b2e54cc7e6c8c6 100644 (file)
@@ -23,6 +23,7 @@
  */
 package org.collectionspace.services.common.relation.nuxeo;
 
+
 /**
  * CollectionObjectConstants processes CollectionObject document
  *
@@ -33,4 +34,6 @@ public class RelationConstants {
     public final static String NUXEO_SCHEMA_NAME = "relations_common";
     /** The Constant REL_NUXEO_SCHEMA_ROOT_ELEMENT. */
     final public static String NUXEO_SCHEMA_ROOT_ELEMENT = "relationtype";
+    
+    
 }
index 4bef1cb51cb632b984561281f695605eccde54e6..9b81c82102468f4dcac0cd2c2a4c0d6c81612384 100644 (file)
@@ -30,6 +30,7 @@ import java.util.HashMap;
 import java.util.Iterator;\r
 import java.util.List;\r
 \r
+import org.collectionspace.services.client.CollectionSpaceClient;\r
 import org.collectionspace.services.common.ReflectionMapper;\r
 import org.collectionspace.services.common.api.Tools;\r
 import org.collectionspace.services.common.context.MultipartServiceContext;\r
@@ -67,9 +68,9 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
     \r
     protected static final int NUM_STANDARD_LIST_RESULT_FIELDS = 4;\r
     protected static final String STANDARD_LIST_CSID_FIELD = "csid";\r
-    protected static final String STANDARD_LIST_URI_FIELD = COLLECTIONSPACE_CORE_URI;\r
-    protected static final String STANDARD_LIST_UPDATED_AT_FIELD = COLLECTIONSPACE_CORE_UPDATED_AT;\r
-    protected static final String STANDARD_LIST_WORKFLOW_FIELD = COLLECTIONSPACE_CORE_WORKFLOWSTATE;\r
+    protected static final String STANDARD_LIST_URI_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_URI;\r
+    protected static final String STANDARD_LIST_UPDATED_AT_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT;\r
+    protected static final String STANDARD_LIST_WORKFLOW_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_WORKFLOWSTATE;\r
 \r
     @Override\r
     public AbstractCommonList getCommonPartList() {\r
@@ -166,8 +167,8 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
 \r
        public static String getUpdatedAtAsString(DocumentModel docModel) throws Exception {\r
                        GregorianCalendar cal = (GregorianCalendar)\r
-                                                               docModel.getProperty(COLLECTIONSPACE_CORE_SCHEMA,\r
-                                                                                       COLLECTIONSPACE_CORE_UPDATED_AT);\r
+                                                               docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,\r
+                                                                               CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT);\r
                        String updatedAt = DateTimeFormatUtils.formatAsISO8601Timestamp(cal);\r
                        return updatedAt;\r
        }\r
index 363d5e7c2e6b57e1a8798c853ccfc6614654a100..533a4f7263ce50ce72b1cbe2344e8dac593a50a5 100644 (file)
@@ -30,9 +30,9 @@ import javax.ws.rs.core.MultivaluedMap;
 
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IQueryManager;
+import org.collectionspace.services.client.IRelationsManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
-import org.collectionspace.services.client.RelationClient;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils;
@@ -388,13 +388,13 @@ public abstract class DocumentModelHandler<T, TL>
                String docType = this.getServiceContext().getDocumentType();            
                String selectFields = IQueryManager.CMIS_TARGET_CSID + ", "
                                + IQueryManager.CMIS_TARGET_TITLE + ", "
-                               + RelationClient.CMIS_CSPACE_RELATIONS_TITLE + ", "
-                               + RelationClient.CMIS_CSPACE_RELATIONS_OBJECT_ID + ", "
-                               + RelationClient.CMIS_CSPACE_RELATIONS_SUBJECT_ID;
+                               + IRelationsManager.CMIS_CSPACE_RELATIONS_TITLE + ", "
+                               + IRelationsManager.CMIS_CSPACE_RELATIONS_OBJECT_ID + ", "
+                               + IRelationsManager.CMIS_CSPACE_RELATIONS_SUBJECT_ID;
                String targetTable = docType + " " + IQueryManager.CMIS_TARGET_PREFIX;
-               String relTable = RelationClient.SERVICE_DOC_TYPE + " " + IQueryManager.CMIS_RELATIONS_PREFIX;
-               String relObjectCsidCol = RelationClient.CMIS_CSPACE_RELATIONS_OBJECT_ID;
-               String relSubjectCsidCol = RelationClient.CMIS_CSPACE_RELATIONS_SUBJECT_ID;
+               String relTable = IRelationsManager.DOC_TYPE + " " + IQueryManager.CMIS_RELATIONS_PREFIX;
+               String relObjectCsidCol = IRelationsManager.CMIS_CSPACE_RELATIONS_OBJECT_ID;
+               String relSubjectCsidCol = IRelationsManager.CMIS_CSPACE_RELATIONS_SUBJECT_ID;
                String targetCsidCol = IQueryManager.CMIS_TARGET_CSID;
                //
                // Build up the query arguments
index d0ec9fc6cdb4e31f6b3940fe70409cf47a97c7c9..3e5dc322a009d750943c498ead894ef16d66dc2d 100644 (file)
@@ -24,7 +24,6 @@
 package org.collectionspace.services.nuxeo.client.java;
 
 import java.util.ArrayList;
-import java.util.GregorianCalendar;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -39,6 +38,7 @@ import javax.xml.bind.JAXBElement;
 import org.collectionspace.services.authorization.AccountPermission;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.lifecycle.TransitionDef;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PayloadInputPart;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -48,7 +48,6 @@ import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.common.context.JaxRsContext;
 import org.collectionspace.services.common.context.MultipartServiceContext;
 import org.collectionspace.services.common.context.ServiceContext;
-import org.collectionspace.services.common.datetime.DateTimeFormatUtils;
 import org.collectionspace.services.common.document.BadRequestException;
 import org.collectionspace.services.common.document.DocumentUtils;
 import org.collectionspace.services.common.document.DocumentWrapper;
@@ -59,7 +58,6 @@ import org.collectionspace.services.common.storage.jpa.JpaStorageUtils;
 import org.collectionspace.services.common.vocabulary.RefNameUtils;
 import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
 import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthRefConfigInfo;
-import org.collectionspace.services.config.service.InitHandler.Params.Field;
 import org.collectionspace.services.config.service.ListResultField;
 import org.collectionspace.services.config.service.ObjectPartType;
 import org.collectionspace.services.nuxeo.util.NuxeoUtils;
@@ -67,12 +65,9 @@ import org.dom4j.Element;
 
 import org.nuxeo.ecm.core.api.DocumentModel;
 import org.nuxeo.ecm.core.api.DocumentModelList;
-import org.nuxeo.ecm.core.api.model.Property;
 import org.nuxeo.ecm.core.api.model.PropertyException;
 import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
 
-import org.nuxeo.ecm.core.schema.types.Schema;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -210,7 +205,7 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
                 continue; // unknown part, ignore
             }
             Map<String, Object> unQObjectProperties = extractPart(docModel, schema, partMeta);
-            if(COLLECTIONSPACE_CORE_SCHEMA.equals(schema)) {
+            if(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA.equals(schema)) {
                addExtraCoreValues(docModel, unQObjectProperties);
             }
             addOutputPart(unQObjectProperties, schema, partMeta);
@@ -220,7 +215,7 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
     
     private void addExtraCoreValues(DocumentModel docModel, Map<String, Object> unQObjectProperties)
                throws Exception {
-        unQObjectProperties.put(COLLECTIONSPACE_CORE_WORKFLOWSTATE, docModel.getCurrentLifeCycleState());
+        unQObjectProperties.put(CollectionSpaceClient.COLLECTIONSPACE_CORE_WORKFLOWSTATE, docModel.getCurrentLifeCycleState());
     }
     
     private void addAccountPermissionsPart() throws Exception {
@@ -319,11 +314,11 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
     public void filterReadOnlyPropertiesForPart(
             Map<String, Object> objectProps, ObjectPartType partMeta) {
        // Should add in logic to filter most of the core items on update
-       if(partMeta.getLabel().equalsIgnoreCase(COLLECTIONSPACE_CORE_SCHEMA)) {
-               objectProps.remove(COLLECTIONSPACE_CORE_CREATED_AT);
-               objectProps.remove(COLLECTIONSPACE_CORE_CREATED_BY);
-               objectProps.remove(COLLECTIONSPACE_CORE_URI);
-               objectProps.remove(COLLECTIONSPACE_CORE_TENANTID);
+       if(partMeta.getLabel().equalsIgnoreCase(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA)) {
+               objectProps.remove(CollectionSpaceClient.COLLECTIONSPACE_CORE_CREATED_AT);
+               objectProps.remove(CollectionSpaceClient.COLLECTIONSPACE_CORE_CREATED_BY);
+               objectProps.remove(CollectionSpaceClient.COLLECTIONSPACE_CORE_URI);
+               objectProps.remove(CollectionSpaceClient.COLLECTIONSPACE_CORE_TENANTID);
                // Note that the updatedAt/updatedBy fields are set internally
                // in DocumentModelHandler.handleCoreValues().
        }
index d3a0d82f091dc71c1e832cc14b9cb18bb5d9ffe2..0e70d480045e022304eadd0f6a0018b07a904c31 100644 (file)
@@ -27,6 +27,7 @@ import java.util.UUID;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MultivaluedMap;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -692,8 +693,8 @@ public class RepositoryJavaClientImpl implements RepositoryClient<PoxPayloadIn,
     @Override
     public String getDocURI(DocumentWrapper<DocumentModel> wrappedDoc) throws ClientException {
        DocumentModel docModel = wrappedDoc.getWrappedObject();
-        String uri = (String)docModel.getProperty(DocumentModelHandler.COLLECTIONSPACE_CORE_SCHEMA,
-                               DocumentModelHandler.COLLECTIONSPACE_CORE_URI);
+        String uri = (String)docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,
+                       CollectionSpaceClient.COLLECTIONSPACE_CORE_URI);
         return uri;
     }
 
index 9855919bc54eed2a6fd9ba2e320d6eda2e9d7ba9..ecc0a72a44b0233b8152999dc0b14d21f6038765 100644 (file)
@@ -30,6 +30,7 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -39,8 +40,6 @@ import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.datetime.DateTimeFormatUtils;
 import org.collectionspace.services.common.document.DocumentException;
 import org.collectionspace.services.common.query.QueryContext;
-import org.collectionspace.services.config.service.ListResultField;
-import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
 
 import org.dom4j.Document;
 import org.dom4j.io.SAXReader;
@@ -283,8 +282,8 @@ public class NuxeoUtils {
         //
         // Restrict search to the current tenant ID.  Is the domain path filter (above) still needed?
         //
-        query.append(/*IQueryManager.SEARCH_QUALIFIER_AND +*/ " WHERE " + DocumentModelHandler.COLLECTIONSPACE_CORE_SCHEMA + ":"
-                + DocumentModelHandler.COLLECTIONSPACE_CORE_TENANTID
+        query.append(/*IQueryManager.SEARCH_QUALIFIER_AND +*/ " WHERE " + CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA + ":"
+                + CollectionSpaceClient.COLLECTIONSPACE_CORE_TENANTID
                 + " = " + queryContext.getTenantId());
         //
         // Finally, append the incoming where clause
index 65cc55f675eced9b80c2e3b5bfe326b363bbfe0b..6bd499298607d4cd97d3e5f9e37bc46dafff8879 100644 (file)
@@ -26,11 +26,7 @@ package org.collectionspace.services.dimension.nuxeo;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.ws.rs.core.MultivaluedMap;
-
 import org.collectionspace.services.dimension.DimensionJAXBSchema;
-import org.collectionspace.services.client.IQueryManager;
-import org.collectionspace.services.client.RelationClient;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.dimension.DimensionsCommon;
 import org.collectionspace.services.dimension.DimensionsCommonList;
index 7949c3345d2e869343ef39bb308974adbafec8de..7e3f5aef1ec567e3ff4637324ccfa991784550a6 100644 (file)
@@ -29,28 +29,20 @@ package org.collectionspace.services.client;
 import org.jboss.resteasy.client.ClientResponse;
 import org.collectionspace.services.relation.RelationsCommonList;
 
-
 /**
  * The Class RelationClient.
  */
 public class RelationClient extends AbstractPoxServiceClientImpl<RelationsCommonList, RelationProxy> {
-       public static final String SERVICE_DOC_TYPE = "Relation"; // Used for CMIS queries only -should be the same as what's in the tenant bindings
-       public static final String SERVICE_NAME = "relations";
+       public static final String SERVICE_DOC_TYPE = IRelationsManager.DOC_TYPE; // Used for CMIS queries only -should be the same as what's in the tenant bindings
+       public static final String SERVICE_NAME = IRelationsManager.SERVICE_NAME;
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
        public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";     
        public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
        public static final String SERVICE_COMMON_LIST_NAME = "relations-common-list";
 
-    public static final String SERVICE_COMMONPART_NAME = SERVICE_NAME + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+    public static final String SERVICE_COMMONPART_NAME = IRelationsManager.SERVICE_COMMONPART_NAME;
 
-       // Relations CMIS property mapping constants
-       public final static String CMIS_CSPACE_RELATIONS_SUBJECT_ID = IQueryManager.CMIS_RELATIONS_PREFIX
-                       + "." + SERVICE_COMMONPART_NAME + ":subjectCsid";
-       public final static String CMIS_CSPACE_RELATIONS_OBJECT_ID = IQueryManager.CMIS_RELATIONS_PREFIX
-                       + "." + SERVICE_COMMONPART_NAME + ":objectCsid";
-       public final static String CMIS_CSPACE_RELATIONS_TITLE = IQueryManager.CMIS_RELATIONS_PREFIX
-                       + "." + IQueryManager.CMIS_NUXEO_TITLE;
     
        @Override
        public String getServiceName() {
index 689319ae33dfbbd6cbdb962b8862b830d1b70371..d2732224a8e180af543049768779e56056aa88c1 100644 (file)
@@ -50,6 +50,7 @@ import org.collectionspace.services.relation.RelationsCommonList.RelationListIte
 import org.collectionspace.services.relation.RelationsDocListItem;
 
 // HACK HACK HACK
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.OrgAuthorityClient;
 import org.collectionspace.services.client.LocationAuthorityClient;
@@ -430,8 +431,8 @@ public class RelationDocumentModelHandler
                properties.put((fSubject?RelationJAXBSchema.SUBJECT_CSID:RelationJAXBSchema.OBJECT_CSID),
                                                        csid);
        
-               String uri = (String) subjectOrObjectDocModel.getProperty(COLLECTIONSPACE_CORE_SCHEMA,
-                                                                                                                                       COLLECTIONSPACE_CORE_URI);
+               String uri = (String) subjectOrObjectDocModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,
+                               CollectionSpaceClient.COLLECTIONSPACE_CORE_URI);
                properties.put((fSubject?RelationJAXBSchema.SUBJECT_URI:RelationJAXBSchema.OBJECT_URI),
                                                        uri);