]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4943 - fixed problem with refObjs call and extended schemas. Added tests to...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Tue, 20 Mar 2012 19:46:04 +0000 (12:46 -0700)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Tue, 20 Mar 2012 19:46:04 +0000 (12:46 -0700)
20 files changed:
services/IntegrationTests/src/test/resources/test-data/xmlreplay/AuthsREADME.txt [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/acquisition.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/lifesciperson.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_and_lifesci.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_and_lifesci_set_broader.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/lifesciPersonWithRelns.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/refObjs.res.xml [new file with mode: 0644]
services/common/src/main/cspace/config/services/tenants/lifesci/tenant-bindings.delta.xml
services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java
services/person/3rdparty/build.xml
services/person/3rdparty/nuxeo-platform-person-lifesci/build.xml [new file with mode: 0644]
services/person/3rdparty/nuxeo-platform-person-lifesci/pom.xml [new file with mode: 0644]
services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/META-INF/MANIFEST.MF [new file with mode: 0644]
services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/core-types-contrib.xml [new file with mode: 0644]
services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/deployment-fragment.xml [new file with mode: 0644]
services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/ecm-types-contrib.xml [new file with mode: 0644]
services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/layouts-contrib.xml [new file with mode: 0644]
services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/life-cycle-contrib.xml [new file with mode: 0644]
services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/schemas/persons_naturalhistory.xsd [new file with mode: 0644]
services/person/3rdparty/pom.xml

diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/AuthsREADME.txt b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/AuthsREADME.txt
new file mode 100644 (file)
index 0000000..5df8263
--- /dev/null
@@ -0,0 +1,13 @@
+To produce the auths content values, you needs to base64 encode the credentials. 
+
+This means, for example that if you want to use:
+
+ Login:    admin@core.collectionspace.org
+ Password: Administrator
+
+Then you have to encode the string "admin@core.collectionspace.org:Administrator" which
+should yield the encoded string: "YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I="
+
+A convenient way to encode and decode (to verify results, or check values that
+are already coded in the various xmlReplay files) is to use the online service 
+at: http://www.motobit.com/util/base64-decoder-encoder.asp
\ No newline at end of file
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/acquisition.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/acquisition.xml
new file mode 100644 (file)
index 0000000..73447b4
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="acquisitions">
+       <ns3:acquisitions_common xmlns:ns3="http://collectionspace.org/services/acquisition">
+               <acquisitionDates>
+                       <acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>
+               </acquisitionDates>
+               <acquisitionReferenceNumber>${acqNum}</acquisitionReferenceNumber>
+               <owners>
+                       <owner>${owner}</owner>
+               </owners>
+       </ns3:acquisitions_common>
+</document>
+
+
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/lifesciperson.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/lifesciperson.xml
new file mode 100644 (file)
index 0000000..d123098
--- /dev/null
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+  <!-- Authenticate into the lifesci tenant for extension testing -->
+  <auths default="admin@lifesci.collectionspace.org">
+    <auth ID="admin@lifesci.collectionspace.org"
+      >YWRtaW5AbGlmZXNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+  </auths>
+
+  <!-- 
+    testGroup ID="person" is not live.  It works, but may not clean up correctly. 
+    For now, use ID="updatePerson"
+  -->
+  <testGroup ID="person" autoDeletePOSTS="true">
+    <test ID="PersonAuth1" auth="admin@lifesci.collectionspace.org">
+      <method>POST</method>
+      <uri>/cspace-services/personauthorities/</uri>
+      <filename>person/personauthorities_common.xml</filename>
+      <vars>
+        <var ID="authShortIdentifier">TestPersonAuthority</var>
+      </vars>
+    </test>
+    <test ID="Person1">
+      <method>POST</method>
+      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+      <filename>person/persons_common_and_lifesci.xml</filename>
+      <vars>
+        <var ID="shortIdentifier">johnWayneActor1</var>
+        <var ID="foreName">John</var>
+        <var ID="surName">Wayne</var>
+        <var ID="entityType">Actor</var>
+        <var ID="lifeSpan">Way Long Time</var>
+      </vars>
+    </test>
+    <test ID="Person2">
+      <method>POST</method>
+      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+      <filename>person/persons_common_and_lifesci.xml</filename>
+      <vars>
+        <var ID="shortIdentifier">billyBob1</var>
+        <var ID="foreName">Billy-Bob</var>
+        <var ID="surName">Homeboy</var>
+        <var ID="entityType">Goof</var>
+        <var ID="lifeSpan">Too Long</var>
+      </vars>
+    </test>
+    <test ID="getAuthorityList">
+      <method>GET</method>
+      <uri>/cspace-services/personauthorities/</uri>
+    </test>
+    <test ID="getAuthorityByName">
+      <method>GET</method>
+      <uri>/cspace-services/personauthorities/urn:cspace:name(TestPersonAuthority)</uri>
+    </test>
+    <test ID="getAuthorityByCSID">
+      <method>GET</method>
+      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}</uri>
+    </test>
+    <test ID="getPersonList">
+      <method>GET</method>
+      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+    </test>
+    <test ID="getPerson1">
+      <method>GET</method>
+      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+    </test>
+
+    <test ID="UpdatePerson2WithRelations">
+      <method>PUT</method>
+      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
+      <filename>person/persons_common_and_lifesci_set_broader.xml</filename>
+      <vars>
+        <var ID="shortIdentifier">billyBob1</var>
+        <var ID="foreName">Billy-Bob</var>
+        <var ID="surName">Homeboy</var>
+        <var ID="entityType">Goof</var>
+        <var ID="lifeSpan">Too Long</var>
+        <var ID="childCSID">${Person2.CSID}</var>
+        <var ID="parentCSID">${Person1.CSID}</var>
+        <var ID="parentName">John Wayne</var>
+      </vars>
+    </test>
+
+    <test ID="getPerson1WithRelations">
+      <method>GET</method>
+      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true</uri>
+      <response>
+        <expected level="ADDOK"/>
+        <filename>person/res/lifesciPersonWithRelns.res.xml</filename>
+        <!-- NOTE: vars are referenced in lifesciPersonWithRelns.res.xml
+          from tests in this test group, e.g. 
+          PersonParent.CSID :: ${PersonParent.CSID} 
+          These vars are all in the expression context while this group is active,
+          because we hang onto all ServiceResult objects for the duration of the group,
+          and ServiceObjects keep their vars.
+        -->
+        <startElement>/document/*[local-name()='relations-common-list']</startElement>
+      </response>
+    </test>
+               
+               <test ID="getPerson2WithRelations">
+      <method>GET</method>
+      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}?showAllRelations=true</uri>
+      <response>
+        <expected level="ADDOK"/>
+        <filename>person/res/lifesciPersonWithRelns.res.xml</filename>
+        <!-- NOTE: vars are referenced in lifesciPersonWithRelns.res.xml
+          from tests in this test group, e.g. 
+          PersonParent.CSID :: ${PersonParent.CSID} 
+          These vars are all in the expression context while this group is active,
+          because we hang onto all ServiceResult objects for the duration of the group,
+          and ServiceObjects keep their vars.
+        -->
+        <startElement>/document/*[local-name()='relations-common-list']</startElement>
+      </response>
+               </test>
+
+               <test ID="createLoanin1" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansin/</uri>
+                       <filename>authrefs/loanin.xml</filename>
+                       <vars>
+                               <var ID="loannum">42</var>
+                               <var ID="person">${getPerson1.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="getPerson1RefObjs">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+                       <response>
+                               <expected level="ADDOK"/>
+                               <filename>person/res/refObjs.res.xml</filename>
+                               <vars>
+                                       <var ID="numFound">1</var>
+                               </vars>
+                       </response>
+               </test>
+
+               <test ID="createAcquisition1" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/acquisitions/</uri>
+                       <filename>person/acquisition.xml</filename>
+                       <vars>
+                               <var ID="acqNum">42</var>
+                               <var ID="owner">${getPerson1.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="getPerson1RefObjs">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+                       <response>
+                               <expected level="ADDOK"/>
+                               <filename>person/res/refObjs.res.xml</filename>
+                               <vars>
+                                       <var ID="numFound">2</var>
+                               </vars>
+                       </response>
+               </test>
+
+  </testGroup>
+
+</xmlReplay>
+
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_and_lifesci.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_and_lifesci.xml
new file mode 100644 (file)
index 0000000..d6532c2
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="persons">
+  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <displayName>${foreName} ${surName}</displayName>
+    <displayNameComputed>false</displayNameComputed>
+    <shortDisplayName>>${foreName} ${surName}</shortDisplayName>
+    <shortDisplayNameComputed>false</shortDisplayNameComputed>
+               <foreName>${foreName}</foreName>
+               <surName>${surName}</surName>
+       </ns2:persons_common>
+       <ns4:persons_naturalhistory xmlns:ns4="http://collectionspace.org/services/person/domain/naturalhistory" xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <entityType>${entityType}</entityType>
+               <lifeSpan>${lifeSpan}</lifeSpan>
+       </ns4:persons_naturalhistory>
+</document>
+
+
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_and_lifesci_set_broader.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_and_lifesci_set_broader.xml
new file mode 100644 (file)
index 0000000..9955abb
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="persons">
+  <pers:persons_common xmlns:pers="http://collectionspace.org/services/person">
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <displayName>${foreName} ${surName}</displayName>
+    <displayNameComputed>false</displayNameComputed>
+    <shortDisplayName>>${foreName} ${surName}</shortDisplayName>
+    <shortDisplayNameComputed>false</shortDisplayNameComputed>
+               <foreName>${foreName}</foreName>
+               <surName>${surName}</surName>
+       </pers:persons_common>
+       <pnh:persons_naturalhistory xmlns:pnh="http://collectionspace.org/services/person/domain/naturalhistory">
+               <entityType>${entityType}</entityType>
+               <lifeSpan>${lifeSpan}</lifeSpan>
+       </pnh:persons_naturalhistory>
+       <relns:relations-common-list xmlns:relns="http://collectionspace.org/services/relation">
+    <relation-list-item>
+                       <subjectCsid>${childCSID}</subjectCsid>
+      <relationshipType>hasBroader</relationshipType>
+      <predicate>hasBroader</predicate>
+                       <objectCsid>${parentCSID}</objectCsid>
+      <subject>
+        <csid>${childCSID}</csid>
+        <name>${foreName} ${surName}</name>
+        <documentType>PersonTenant2</documentType>
+      </subject>
+      <object>
+        <csid>${parentCSID}</csid>
+        <name>${parentName}</name>
+        <documentType>PersonTenant2</documentType>
+      </object>
+    </relation-list-item>
+       </relns:relations-common-list>
+</document>
+
+
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/lifesciPersonWithRelns.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/lifesciPersonWithRelns.res.xml
new file mode 100644 (file)
index 0000000..d9661ff
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="persons">  
+  <ns2:relations-common-list xmlns:ns2="http://collectionspace.org/services/relation" xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <totalItems>1</totalItems>
+    <!-- 
+    This file represents the expected response from test case
+       lifesciperson.xml :: 
+    These are the vars that are available from the time Person1 is created.
+    Person1.CSID       ${Person1.CSID}
+    Person2.CSID     ${Person2.CSID}
+       -->
+
+
+    <relation-list-item>
+      <subjectCsid>${Person2.CSID}</subjectCsid>
+      <objectCsid>${Person1.CSID}</objectCsid>
+      <predicate>hasBroader</predicate>
+      <subject>
+        <csid>${Person2.CSID}</csid>
+      </subject>
+      <object>
+        <csid>${Person1.CSID}</csid>
+      </object>
+    </relation-list-item>
+  </ns2:relations-common-list>
+</document>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/refObjs.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/refObjs.res.xml
new file mode 100644 (file)
index 0000000..7b7ccfb
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns3:authority-ref-doc-list xmlns:ns2="http://collectionspace.org/services/jaxb"
+    xmlns:ns3="http://collectionspace.org/services/common/authorityref">
+               <itemsInPage>${numFound}</itemsInPage>
+               <totalItems>${numFound}</totalItems>
+</ns3:authority-ref-doc-list>
index bf072662d0adfc1fd52b20834df2e72e16afd5ae..2cd346a9de5f5954834efb1e1e6c647ce57f915d 100644 (file)
                </service:object>
 
        </tenant:serviceBindings>
+
+       <tenant:serviceBindings merge:matcher="id" id="Persons">
+    <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
+                       <service:params>
+                               <service:ListResultsFields>
+                                       <service:ListResultField merge:matcher="skip" merge:action="insert" >
+              <service:element>entityType</service:element>
+              <service:schema>persons_naturalhistory</service:schema>
+                                                       <service:xpath>entityType</service:xpath>
+            </service:ListResultField>
+                               </service:ListResultsFields>
+                       </service:params>
+    </service:DocHandlerParams>
+
+               <service:object xmlns:service="http://collectionspace.org/services/common/service">
+                       <service:part id="3" merge:matcher="skip" merge:action="insert" control_group="Managed"
+                               versionable="true" auditable="false" label="persons_naturalhistory" updated="" order="3">
+                               <service:content contentType="application/xml">
+                                       <service:xmlContent namespaceURI="http://collectionspace.org/services/person/domain/naturalhistory"
+                                               schemaLocation="http://collectionspace.org/services/person/domain/naturalhistory http://collectionspace.org/services/person/domain/persons_naturalhistory.xsd"
+                                       />
+                               </service:content>
+                               <service:properties>
+                                       <!-- See CSPACE-3938 for potential additional authRef and termRef entries -->
+                                       <types:item xmlns:types="http://collectionspace.org/services/common/types">
+                                               <types:key>authRef</types:key>
+                                               <types:value>affiliatedPersonOrgGroupList/*/affiliatedPersonOrg</types:value>
+                                       </types:item>
+                                       <types:item xmlns:types="http://collectionspace.org/services/common/types">
+                                               <types:key>authRef</types:key>
+                                               <types:value>orgContactNames|orgContactName</types:value>
+                                       </types:item>
+                                       <types:item xmlns:types="http://collectionspace.org/services/common/types">
+                                               <types:key>termRef</types:key>
+                                               <types:value>affiliatedPersonOrgGroupList/*/affiliatedPersonOrgType</types:value>
+                                       </types:item>
+                                       <types:item xmlns:types="http://collectionspace.org/services/common/types">
+                                               <types:key>termRef</types:key>
+                                               <types:value>nameTypes|nameType</types:value>
+                                       </types:item>
+                                       <types:item xmlns:types="http://collectionspace.org/services/common/types">
+                                               <types:key>termRef</types:key>
+                                               <types:value>nameSource</types:value>
+                                       </types:item>
+                                       <types:item xmlns:types="http://collectionspace.org/services/common/types">
+                                               <types:key>termRef</types:key>
+                                               <types:value>entityType</types:value>
+                                       </types:item>
+                               </service:properties>
+                       </service:part>
+               </service:object>
+       </tenant:serviceBindings>
        
   </tenant:tenantBinding>
                       
index 614d32e624995aef926568d3ba81ca549c8a85fc..6daadf926c17f0a201d622dbf039927ed39bd508 100644 (file)
@@ -363,7 +363,10 @@ public class NuxeoUtils {
      */
     static public final String buildNXQLQuery(ServiceContext ctx, QueryContext queryContext) throws Exception {
         StringBuilder query = new StringBuilder("SELECT * FROM ");
-        query.append(NuxeoUtils.getTenantQualifiedDocType(queryContext)); // Nuxeo doctype must be tenant qualified.
+        // Since we have a tenant qualification in the WHERE clause, we do not need 
+        // tenant-specific doc types
+        // query.append(NuxeoUtils.getTenantQualifiedDocType(queryContext)); // Nuxeo doctype must be tenant qualified.
+        query.append(queryContext.getDocType());
         appendNXQLWhere(query, queryContext);
         appendNXQLOrderBy(query, queryContext);
         return query.toString();
@@ -385,8 +388,11 @@ public class NuxeoUtils {
             } else {
                 query.append(",");
             }
-            String tqDocType = getTenantQualifiedDocType(queryContext, docType);
-            query.append(tqDocType); // Nuxeo doctype must be tenant qualified.
+            // Since we have a tenant qualification in the WHERE clause, we do not need 
+            // tenant-specific doc types
+            // String tqDocType = getTenantQualifiedDocType(queryContext, docType);
+            // query.append(tqDocType); // Nuxeo doctype must be tenant qualified.
+            query.append(docType);
         }
         appendNXQLWhere(query, queryContext);
         // FIXME add 'order by' clause here, if appropriate
index fbc5416b0da7f718f2dca76f7a201ec5b87e148c..516b147bf9bb53b4fe032b867bcbaaccb8ece17b 100644 (file)
     <target name="deploy" depends="install"\r
     description="deploy person in ${jee.server.nuxeo}">\r
         <ant antfile="nuxeo-platform-cs-person/build.xml" target="deploy" inheritall="false"/>\r
+        <ant antfile="nuxeo-platform-person-lifesci/build.xml" target="deploy" inheritall="false"/>\r
     </target>\r
 \r
     <target name="undeploy"\r
     description="undeploy person from ${jee.server.nuxeo}">\r
         <ant antfile="nuxeo-platform-cs-person/build.xml" target="undeploy" inheritall="false"/>\r
+        <ant antfile="nuxeo-platform-person-lifesci/build.xml" target="undeploy" inheritall="false"/>\r
     </target>\r
 \r
     <target name="dist"\r
     description="generate distribution for person" depends="package">\r
         <ant antfile="nuxeo-platform-cs-person/build.xml" target="dist" inheritall="false"/>\r
+        <ant antfile="nuxeo-platform-person-lifesci/build.xml" target="dist" inheritall="false"/>\r
     </target>\r
     \r
     <target name="dist_installer"\r
     description="generate distribution for collectionobject" depends="package">\r
         <ant antfile="nuxeo-platform-cs-person/build.xml" target="dist_installer" inheritall="false"/>\r
+        <ant antfile="nuxeo-platform-person-lifesci/build.xml" target="dist_installer" inheritall="false"/>\r
     </target>\r
 \r
 </project>\r
diff --git a/services/person/3rdparty/nuxeo-platform-person-lifesci/build.xml b/services/person/3rdparty/nuxeo-platform-person-lifesci/build.xml
new file mode 100644 (file)
index 0000000..155c3ae
--- /dev/null
@@ -0,0 +1,147 @@
+
+<project name="nuxeo-platform-person-lifesci" default="package" basedir=".">
+    <description>
+        Person nuxeo document type for the lifesci tenant
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../../.."/>
+    <!-- environment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+    <property name="dist"  location="dist"/>
+    <property name="nuxeo.person.jar"
+        value="org.collectionspace.services.person.3rdparty.lifesci.nuxeo-${cspace.release}.jar"/>
+    <property name="nuxeo.person.jars.all"
+        value="org.collectionspace.services.person.3rdparty.*.nuxeo-*.jar"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+        <!-- Create the time stamp -->
+        <tstamp/>
+        <!-- Create the build directory structure used by compile -->
+        <mkdir dir="${build}"/>
+    </target>
+
+    <target name="package" depends="package-unix,package-windows"
+        description="Package CollectionSpace Services" />
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="install" depends="install-unix,install-windows"
+  description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    
+    <target name="clean" depends="clean-unix,clean-windows"
+        description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+        description="deploy person doctype in ${jee.server.nuxeo}">
+        <copy file="${basedir}/target/${nuxeo.person.jar}"
+        todir="${jee.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy person doctype from ${jee.server.nuxeo}">
+        <delete>
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.person.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+    <target name="dist"
+       description="generate distribution for person doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.person.jar}"/>
+        </copy>
+    </target>
+
+    <target name="dist_installer"
+       description="Creates an installer distribution for Person doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.installer.services}/person/nuxeo">
+            <fileset file="${basedir}/target/${nuxeo.person.jar}"/>
+        </copy>
+    </target>
+</project>
diff --git a/services/person/3rdparty/nuxeo-platform-person-lifesci/pom.xml b/services/person/3rdparty/nuxeo-platform-person-lifesci/pom.xml
new file mode 100644 (file)
index 0000000..484c0cd
--- /dev/null
@@ -0,0 +1,56 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.person.3rdparty</artifactId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.person.3rdparty.lifesci.nuxeo</artifactId>
+    <packaging>jar</packaging>
+    <description>
+        Person Nuxeo document type for Tenant ID = "2"
+    </description>
+
+       <properties>
+               <CustomSchemaName>persons_naturalhistory</CustomSchemaName>
+               <TenantId>2</TenantId>
+               <TenantLabel>lifesci</TenantLabel>
+       </properties>
+       
+    <build>
+               <resources>
+                 <resource>
+                       <directory>../../../../3rdparty/nuxeo/nuxeo-doctype/src/main/resources</directory>
+                       <filtering>true</filtering>
+                 </resource>
+                 <resource>
+                       <directory>../../../../3rdparty/nuxeo/nuxeo-doctype-custom/src/main/resources</directory>
+                       <filtering>true</filtering>
+                 </resource>
+                 <resource>
+                       <directory>src/main/resources</directory>
+                       <filtering>true</filtering>
+                 </resource>
+               </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
+                        <manifestEntries>
+                            <Bundle-Version>${eclipseVersion}</Bundle-Version>
+                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+</project>
diff --git a/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/META-INF/MANIFEST.MF b/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..8dfecb2
--- /dev/null
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: org.collectionspace.person.lifesci
+Bundle-SymbolicName: org.collectionspace.person.lifesci;singleton:=true 
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Bundle-Vendor: Nuxeo 
+Require-Bundle: org.nuxeo.runtime, 
+ org.nuxeo.ecm.core.api, 
+ org.nuxeo.ecm.core,
+ org.nuxeo.ecm.core.api,
+ org.nuxeo.ecm.platform.types.api,
+ org.nuxeo.ecm.platform.versioning.api,
+ org.nuxeo.ecm.platform.ui,
+ org.nuxeo.ecm.platform.forms.layout.client,
+ org.nuxeo.ecm.platform.ws,
+ org.collectionspace.collectionspace_core
+Provide-Package: org.collectionspace.person.lifesci
+Nuxeo-Component: OSGI-INF/core-types-contrib.xml,
+ OSGI-INF/life-cycle-contrib.xml,
+ OSGI-INF/ecm-types-contrib.xml,
+ OSGI-INF/layouts-contrib.xml
+
diff --git a/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/core-types-contrib.xml b/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/core-types-contrib.xml
new file mode 100644 (file)
index 0000000..2ffba8c
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.person.lifesci.coreTypes">
+  
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
+    <schema name="persons_naturalhistory" prefix="persons_naturalhistory" src="schemas/persons_naturalhistory.xsd"/>
+  </extension>
+  
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
+    <doctype name="PersonTenant2" extends="Person">
+      <schema name="common"/>
+      <schema name="dublincore"/>
+      <schema name="collectionspace_core"/>
+      <schema name="persons_common"/>
+      <schema name="persons_naturalhistory"/>
+      <prefetch>persons_common:displayName persons_common:refName persons_common:shortIdentifier</prefetch>
+    </doctype>
+  </extension>
+    
+</component>
diff --git a/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/deployment-fragment.xml b/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/deployment-fragment.xml
new file mode 100644 (file)
index 0000000..270abbd
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<fragment>
+
+  <extension target="application#MODULE">
+    <module>
+      <java>${bundle.fileName}</java>
+    </module>
+  </extension>
+  
+</fragment>
diff --git a/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/ecm-types-contrib.xml b/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/ecm-types-contrib.xml
new file mode 100644 (file)
index 0000000..aa11b07
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.person.lifesci.ecm.types">
+  <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
+    <type id="PersonTenant2" coretype="PersonTenant2">
+      <label>org.collectionspace.person</label>
+      <!--icon>/icons/file.gif</icon-->
+      <default-view>view_documents</default-view>
+
+      <layouts mode="any">
+        <layout>heading</layout>
+        <layout>collectionspace_core</layout>
+        <layout>person</layout>
+        <layout>person_naturalhistory</layout>
+      </layouts>        
+    </type>
+
+    <type id="Folder" coretype="Folder">
+      <subtypes>
+        <type>PersonTenant2</type>
+      </subtypes>
+    </type>
+    
+    <type id="Workspace" coretype="Workspace">
+      <subtypes>
+        <type>PersonTenant2</type>
+      </subtypes>
+    </type>
+
+  </extension>
+</component>
diff --git a/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/layouts-contrib.xml b/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/layouts-contrib.xml
new file mode 100644 (file)
index 0000000..580506c
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+
+<component name="org.collectionspace.persons_naturalhistory.layouts.webapp">
+
+  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
+    point="layouts">
+
+    <layout name="persons_naturalhistory">
+       <!--
+      <templates>
+        <template mode="any">/layouts/layout_default_template.xhtml</template>
+      </templates>
+      <rows>
+        <row><widget>exampleField</widget></row>
+      </rows>
+
+      <widget name="exampleField" type="text">
+        <labels>
+          <label mode="any">exampleField</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="persons_naturalhistory">exampleField</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      -->
+    </layout>
+  </extension>
+</component>
diff --git a/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/life-cycle-contrib.xml b/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/OSGI-INF/life-cycle-contrib.xml
new file mode 100644 (file)
index 0000000..3a36934
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.person.lifesci.LifeCycleManagerExtensions">
+
+  <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+             point="types">
+    <types>
+      <type name="PersonTenant2">default</type>
+    </types>
+  </extension>
+
+</component>
diff --git a/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/schemas/persons_naturalhistory.xsd b/services/person/3rdparty/nuxeo-platform-person-lifesci/src/main/resources/schemas/persons_naturalhistory.xsd
new file mode 100644 (file)
index 0000000..936a3d5
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+  Person schema (XSD)
+  
+  Entity  : Person
+  Part    : Domain - Natural History (example)
+  Used for: Nuxeo EP core document type
+  
+  $LastChangedRevision: 4929 $
+  $LastChangedDate: 2011-06-07 13:26:32 -0700 (Tue, 07 Jun 2011) $
+-->
+
+<xs:schema 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:ns="http://collectionspace.org/services/person/domain/naturalhistory"
+  xmlns="http://collectionspace.org/services/person/domain/naturalhistory"
+  targetNamespace="http://collectionspace.org/services/person/domain/naturalhistory"
+  version="0.1">
+
+  <!-- used for testing
+  <xs:element name="nh-string" type="xs:string" />
+  <xs:element name="nh-int" type="xs:int"/>
+  <xs:element name="nh-long" type="xs:long"/>
+  <xs:element name="nh-date" type="xs:dateTime"/>
+  <xs:element name="nh-note" type="xs:string"/>
+  -->
+
+ <xs:element name="nameTypes">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="nameType" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="affiliatedPersonOrgGroupList" type="affiliatedPersonOrgGroupList"/>
+
+  <xs:complexType name="affiliatedPersonOrgGroupList">
+    <xs:sequence>
+      <xs:element name="affiliatedPersonOrgGroup" type="affiliatedPersonOrgGroup" minOccurs="0"
+        maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="affiliatedPersonOrgGroup">
+    <xs:sequence>
+      <xs:element name="affiliatedPersonOrg" type="xs:string"/>
+      <xs:element name="affiliatedPersonOrgType" type="xs:string"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:element name="nameSource" type="xs:string"/>
+  <xs:element name="entityType" type="xs:string"/>
+  <xs:element name="lifeSpan" type="xs:string"/>
+  <xs:element name="scopeNote" type="xs:string"/>
+  <xs:element name="sourceNote" type="xs:string"/>
+  <xs:element name="orgContactNames">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="orgContactName" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="nameFunctions">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="nameFunction" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
index e25a2d0ecfddff24e9076ef160a3307e44fdce49..4458c6825e0220acd8b580545de7b13e14e2a2da 100644 (file)
@@ -19,5 +19,6 @@
 \r
     <modules>\r
         <module>nuxeo-platform-cs-person</module>\r
+        <module>nuxeo-platform-person-lifesci</module>\r
     </modules>\r
 </project>\r