]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5489: Added "supports hierarchy" field to document handler parameter list...
authorRichard Millet <richard.millet@berkeley.edu>
Wed, 29 Aug 2012 19:22:34 +0000 (12:22 -0700)
committerRichard Millet <richard.millet@berkeley.edu>
Wed, 29 Aug 2012 19:22:34 +0000 (12:22 -0700)
.gitignore
services/collectionobject/sample/sample/.project
services/common/src/main/java/org/collectionspace/services/common/document/AbstractMultipartDocumentHandlerImpl.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/RemoteDocumentModelHandlerImpl.java
services/config/src/main/resources/service.xsd
services/jaxb/src/main/resources/relations_common.xsd
services/organization/sample/sample/.project
services/person/sample/sample/.classpath
services/person/sample/sample/.project
services/vocabulary/sample/sample/.project

index c7db4707be70cfe822e33df0b732011dfc9151c7..09e375b94090f1c65f739e533bf0f421c9cc3ed7 100644 (file)
@@ -1,3 +1,7 @@
+.metadata/
+services/collectionobject/sample/sample/.classpath
+services/organization/sample/sample/.classpath
+services/vocabulary/sample/sample/.classpath
 3rdparty/nuxeo/nuxeo-platform-thumbnail/.classpath
 3rdparty/nuxeo/nuxeo-platform-thumbnail/.project
 3rdparty/nuxeo/nuxeo-platform-thumbnail/.settings/
index e028f2e1590dac9f310455e932965cb0957fcba5..219f5cff3875ff50b4e86ba8f39c6a57721ac5c3 100644 (file)
                        </arguments>\r
                </buildCommand>\r
                <buildCommand>\r
-                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
+                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
                        <arguments>\r
                        </arguments>\r
                </buildCommand>\r
                <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
+                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
                        <arguments>\r
                        </arguments>\r
                </buildCommand>\r
index a8a580ff59329c65ed243dd1bffb4fc586d6e033..a30a45eef19d084d0a0d93490213b51477f495d6 100644 (file)
@@ -49,6 +49,13 @@ public abstract class AbstractMultipartDocumentHandlerImpl<T, TL, WT, WTL>
        //Empty constructor
     }
 
+    /*
+     * By default we won't support object hierarchy
+     */
+    public boolean supportsHierarchy() {
+       return false;
+    }
+    
     /* (non-Javadoc)
      * @see org.collectionspace.services.common.document.AbstractDocumentHandlerImpl#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
      */
index 8bff24172997d647aa8279f0866f2b08be8d8d5b..22c7f1355b4aba6c0d8311a9a7620771fbb67056 100644 (file)
@@ -126,17 +126,6 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
                        docModel, label, id, true);\r
     }\r
 \r
-       public DocHandlerParams.Params getDocHandlerParams() throws DocumentException {\r
-               MultipartServiceContext sc = (MultipartServiceContext) getServiceContext();\r
-               ServiceBindingType sb = sc.getServiceBinding();\r
-               DocHandlerParams dhb = sb.getDocHandlerParams();\r
-               if (dhb != null && dhb.getParams() != null) {\r
-                       return dhb.getParams();\r
-               }\r
-               throw new DocumentException("No DocHandlerParams configured for: "\r
-                               + sb.getName());\r
-       }\r
-\r
     public String getSummaryFields(AbstractCommonList theCommonList) throws DocumentException {\r
         return getDocHandlerParams().getSummaryFields();\r
     }\r
index 623a86dc647ff34fd43a9f9eacd523f2adcd906b..1a4271ac71cfa888c6bad8bdcc98818c98986643 100644 (file)
@@ -49,6 +49,7 @@ 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.document.BadRequestException;
+import org.collectionspace.services.common.document.DocumentException;
 import org.collectionspace.services.common.document.DocumentUtils;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.common.document.DocumentFilter;
@@ -58,8 +59,10 @@ import org.collectionspace.services.common.storage.jpa.JpaStorageUtils;
 import org.collectionspace.services.common.api.RefNameUtils;
 import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
 import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthRefConfigInfo;
+import org.collectionspace.services.config.service.DocHandlerParams;
 import org.collectionspace.services.config.service.ListResultField;
 import org.collectionspace.services.config.service.ObjectPartType;
+import org.collectionspace.services.config.service.ServiceBindingType;
 import org.collectionspace.services.nuxeo.util.NuxeoUtils;
 import org.dom4j.Element;
 
@@ -98,6 +101,37 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
         }
     }
 
+    /*
+     * Returns the document handler parameters that were loaded at startup from the
+     * tenant bindings config file.
+     */
+       public DocHandlerParams.Params getDocHandlerParams() throws DocumentException {
+               MultipartServiceContext sc = (MultipartServiceContext) getServiceContext();
+               ServiceBindingType sb = sc.getServiceBinding();
+               DocHandlerParams dhb = sb.getDocHandlerParams();
+               if (dhb != null && dhb.getParams() != null) {
+                       return dhb.getParams();
+               }
+               throw new DocumentException("No DocHandlerParams configured for: "
+                               + sb.getName());
+       }
+    
+    @Override
+    public boolean supportsHierarchy() {
+       boolean result;
+       
+       DocHandlerParams.Params params = null;
+       try {
+                       params = getDocHandlerParams();
+               } catch (DocumentException e) {
+                       // TODO Auto-generated catch block
+                       logger.error(String.format("Could not get document handler params for class %s", this.getClass().getName()), e);
+               }
+               result = params.isSupportsHierarchy();
+       
+       return result;
+    }
+
        @Override
        public void handleWorkflowTransition(DocumentWrapper<DocumentModel> wrapDoc, TransitionDef transitionDef)
                        throws Exception {
index f059239c006ce8bd4c0509b7ca092bf16d894326..8726ef87b2a183e59f2c78a03bbcdf31b7e300d6 100644 (file)
                 <xs:complexType>
                     <xs:sequence>
                         <xs:element name="SchemaName" type="xs:string" minOccurs="0" maxOccurs="1"/>
+                        <xs:element name="supportsHierarchy" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false"/>
                         <xs:element name="DublinCoreTitle" type="xs:string" minOccurs="0" maxOccurs="1"/>
                         <xs:element name="SummaryFields" type="xs:string" minOccurs="0" maxOccurs="1"/>
                         <xs:element name="AbstractCommonListClassname" type="xs:string" minOccurs="0" maxOccurs="1"/>
index 48e5fe1f36347479e933bdc2c75926f1c094a236..af01c9a156382d2875b171476216b4f9f8b17b9f 100644 (file)
@@ -26,6 +26,7 @@
                <xs:element name="csid" type="xs:string" />            \r
                 <!-- type of relationship between two entities -->\r
                 <xs:element name="relationshipType" type="xs:string" minOccurs="1"/>\r
+                <xs:element name="relationshipMetaType" type="xs:string" minOccurs="0"/>\r
                 <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
                 <!--- New Names -->\r
                 <xs:element name="subjectCsid" type="xs:string"  minOccurs="1" maxOccurs="1"/>     <!-- new name for documentId1 -->\r
index ba16f0f4c40836e71fb329f3e71102962823c8c8..7af1b27899f25f71f31260a802aa4fd009b71928 100644 (file)
                        </arguments>\r
                </buildCommand>\r
                <buildCommand>\r
-                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
+                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
                        <arguments>\r
                        </arguments>\r
                </buildCommand>\r
                <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
+                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
                        <arguments>\r
                        </arguments>\r
                </buildCommand>\r
index 68da5cd86f3e17eec825062ff1acba8a13814cb3..b6fe6934a63a1d723a97db39b222cd0fe8521ca5 100644 (file)
@@ -3,7 +3,7 @@
        <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
        <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>\r
        <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
+       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>\r
        <classpathentry kind="output" path="target/classes"/>\r
 </classpath>\r
index 7c3143f9401d558f71fe9f1558313cb3fd92ff79..3128252a211dc2ff85e7c23860eb0d8301d4c2fd 100644 (file)
                        </arguments>\r
                </buildCommand>\r
                <buildCommand>\r
-                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
+                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
                        <arguments>\r
                        </arguments>\r
                </buildCommand>\r
                <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
+                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
                        <arguments>\r
                        </arguments>\r
                </buildCommand>\r
index 86790550456a8f5c9b9e318a8218e87b09f3c21c..bdf494a1242b2e5c52799b8e59386d950e6ee593 100644 (file)
                        </arguments>\r
                </buildCommand>\r
                <buildCommand>\r
-                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
+                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
                        <arguments>\r
                        </arguments>\r
                </buildCommand>\r
                <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
+                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
                        <arguments>\r
                        </arguments>\r
                </buildCommand>\r