]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3908
authorLaramie Crocker <laramie@berkeley.edu>
Thu, 28 Apr 2011 15:34:59 +0000 (15:34 +0000)
committerLaramie Crocker <laramie@berkeley.edu>
Thu, 28 Apr 2011 15:34:59 +0000 (15:34 +0000)
17 files changed:
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dev-master.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/1.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/loanout.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe35.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe17.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe35.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml
services/common/src/main/cspace/config/services/tenants/collectionspace/tenant-bindings.xml
services/common/src/main/java/org/collectionspace/services/common/ReflectionMapper.java
services/common/src/main/java/org/collectionspace/services/common/ResourceBase.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java
services/loanin/service/src/main/java/org/collectionspace/services/loanin/LoaninResource.java
services/objectexit/client/src/main/java/org/collectionspace/services/client/ObjectExitClient.java
services/objectexit/client/src/main/java/org/collectionspace/services/client/ObjectExitProxy.java
services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitServiceTest.java
services/objectexit/jaxb/src/main/resources/objectexit_common.xsd

index 8d9a52ecfa4e68c001220406c5655d196181e945..56e80ff96eebb51965542405512668b7952a611a 100644 (file)
@@ -12,7 +12,7 @@
     <protoHostPort>http://localhost:8180</protoHostPort>\r
     \r
     <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->\r
-    <dump payloads="false" dumpServiceResult="auto" />\r
+    <dump payloads="false" dumpServiceResult="full" />\r
     \r
     <auths default="admin@collectionspace.org">\r
        <auth ID="admin@collectionspace.org">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>\r
     <!-- TODO: this almost works now:\r
     <run controlFile="./security.xml" testGroup="security" />\r
     --> \r
-   \r
+    \r
+    \r
+    <!-- TODO: make this an override: autoDeletePOSTS="true"-->\r
+\r
+    \r
     <!--  These all work with POX:\r
     <run controlFile="./security.xml" testGroup="deleteBug" />\r
     <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />\r
@@ -86,8 +90,9 @@
        <run controlFile="objectexit/object-exit-display.xml" testGroup="refNameDisplayNameOnly" />\r
     <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />\r
     <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />\r
+    <run controlFile="loanout/loanout.xml" testGroup="makeone" />\r
+    <run controlFile="objectexit/object-exit.xml" testGroup="checkList" />\r
     --> \r
-    <!-- TODO: make this an override: autoDeletePOSTS="true"-->\r
     \r
         \r
     \r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/1.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/1.xml
new file mode 100644 (file)
index 0000000..a04c4f7
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="loansout">
+  <ns2:loansout_common xmlns:ns2="http://collectionspace.org/services/loanout" xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <loanOutNumber>loanoutNumber-1303941414596</loanOutNumber>
+    <borrower>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</borrower>
+    <borrowersContact>urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth):person:name(Chris Contact)'Chris Contact'</borrowersContact>
+    <loanedObjectStatusGroupList>
+      <loanedObjectStatusGroup>
+        <loanedObjectStatus>returned</loanedObjectStatus>
+        <loanedObjectStatusNote>Left under the front mat.</loanedObjectStatusNote>
+      </loanedObjectStatusGroup>
+    </loanedObjectStatusGroupList>
+    <loanReturnDate>returnDate-1303941414596</loanReturnDate>
+    <loanOutNote>utf-8-data-fragment:ΔӁŴΩ</loanOutNote>
+    <loanPurpose>Allow people in cold climes to share the magic of Surfboards of the 1960s.</loanPurpose>
+  </ns2:loansout_common>
+</document>
+
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/loanout.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/loanout.xml
new file mode 100644 (file)
index 0000000..58d360a
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+    <auths>
+        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
+        <auth ID="admin@collectionspace.org">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
+        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
+    </auths>
+   
+    <testGroup ID="makeone" autoDeletePOSTS="false">
+         <test ID="loanout1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/loansout/</uri>
+             <filename>loanout/1.xml</filename>
+         </test>
+    </testGroup>
+
+</xmlReplay>
+        
+        
index c0b11cb42663df326be7c254ef79341f96c42f35..1f2cb10447720958355e9c4c5ac077fc17e0b039 100644 (file)
              </response>\r
         </test>\r
     </testGroup>\r
+    \r
+    <testGroup ID="checkList" autoDeletePOSTS="true">\r
+        <test ID="oe35"  auth="test">\r
+             <method>POST</method>\r
+             <uri>/cspace-services/objectexit/</uri>\r
+             <vars>\r
+               <var ID="exitNumber">checkList-1234</var>\r
+            </vars>\r
+            <filename>objectexit/oe35.xml</filename>\r
+        </test>\r
+        <test ID="o36">\r
+            <method>GET</method>\r
+            <uri>/cspace-services/objectexit/</uri>\r
+            <response>\r
+                <expected level="ADDOK" />\r
+                <filename>objectexit/res/oe35.res.xml</filename>\r
+                <vars>\r
+                                       <var ID="CSID">${oe35.CSID}</var>\r
+                               </vars>\r
+                               <!-- Look for one <objectexit-list-item> with the <exitNumber> that we \r
+                                    set in the POST, and see if it is in the response\r
+                               -->\r
+                <startElement>//objectexit-list-item[./exitNumber='checkList-1234']</startElement>\r
+             </response>\r
+        </test>\r
+    </testGroup>\r
+\r
      \r
          \r
              \r
              </response>\r
         </test>\r
     </testGroup>\r
+    \r
 \r
 </xmlReplay>\r
         \r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe35.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe35.xml
new file mode 100644 (file)
index 0000000..a707148
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+<document name="objectexit">\r
+    <ns2:objectexit_common\r
+            xmlns:ns2="http://collectionspace.org/services/objectexit"\r
+            xmlns:ns3="http://collectionspace.org/services/jaxb">\r
+        <depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>\r
+        <exitNumber>${exitNumber}</exitNumber>\r
+    </ns2:objectexit_common>\r
+</document>\r
+\r
index c9f6cbc3d6ae601975e3701708bed8f002d1845d..97c4e2d9bae6c58524c80788dd1352819b60750b 100755 (executable)
@@ -1,2 +1,14 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns3:authority-ref-list xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/common/authorityref"><pageNum>0</pageNum><pageSize>40</pageSize><itemsInPage>1</itemsInPage><totalItems>1</totalItems><authority-ref-item><sourceField>objectexit_common:depositor</sourceField><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</refName><authDisplayName>ObjectexitPersonAuth</authDisplayName><uri>/personauthorities/urn:cspace:name(ObjectexitPersonAuth)/items/urn:cspace:name(davenportDepositor)</uri></authority-ref-item></ns3:authority-ref-list>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+<ns3:authority-ref-list xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/common/authorityref">\r
+  <pageNum>0</pageNum>\r
+  <pageSize>40</pageSize>\r
+  <itemsInPage>1</itemsInPage>\r
+  <totalItems>1</totalItems>\r
+  <authority-ref-item>\r
+    <sourceField>objectexit_common:depositor</sourceField>\r
+    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</refName>\r
+    <authDisplayName>ObjectexitPersonAuth</authDisplayName>\r
+    <uri>/personauthorities/urn:cspace:name(ObjectexitPersonAuth)/items/urn:cspace:name(davenportDepositor)</uri>\r
+  </authority-ref-item>\r
+</ns3:authority-ref-list>\r
 \r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe35.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe35.res.xml
new file mode 100644 (file)
index 0000000..85d4af9
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<ns3:objectexit-common-list xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/objectexit">
+  <pageNum>0</pageNum>
+  <pageSize>40</pageSize>
+  <itemsInPage>1</itemsInPage>
+  <totalItems>1</totalItems>
+  <fieldsReturned>exitNumber|currentOwner|uri|csid</fieldsReturned>
+  <objectexit-list-item>
+    <exitNumber>${exitNumber}</exitNumber>
+    <uri>/objectexit/${CSID}</uri>
+    <csid>${CSID}</csid>
+  </objectexit-list-item>
+</ns3:objectexit-common-list>
index 6450c6520486466b33df4d243f73c9965953ee7b..a267c369254c325843a7e6d50b9967f0fb274508 100755 (executable)
          File below this line have been ported. -->\r
     <!-- ============================================= -->\r
     \r
-    <!--\r
-    <run controlFile="relation/relation.xml" testGroup="makeRelations" />\r
-    <run controlFile="person/person.xml" testGroup="updatePerson" />\r
-   -->\r
-   \r
     <run controlFile="./security.xml" testGroup="deleteBug" />\r
     <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />\r
+    <run controlFile="objectexit/object-exit.xml" testGroup="checkList" />\r
        <run controlFile="objectexit/object-exit-display.xml" testGroup="refNameDisplayNameOnly" />\r
     <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />\r
     <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />\r
index 063dafa23a2398372dc91abe7f4dd63992522bfe..66dafd3815a71fbb87e490d3a9e9e26e919b211c 100644 (file)
                      <service:SchemaName>blobs</service:SchemaName>
                      <service:DublinCoreTitle>blobs</service:DublinCoreTitle>
                      <service:SummaryFields>name|mimeType|encoding|length|uri|csid</service:SummaryFields>
-                     <service:AbstractCommonListClassname>org.collectionspace.services.blob.BlobsCommonList</service:AbstractCommonListClassname>
-                     <service:CommonListItemClassname>org.collectionspace.services.blob.BlobsCommonList$BlobListItem</service:CommonListItemClassname>
+                     <service:AbstractCommonListClassname></service:AbstractCommonListClassname>
+                     <service:CommonListItemClassname></service:CommonListItemClassname>
                      <service:ListResultsItemMethodName>getBlobListItem</service:ListResultsItemMethodName>
                      <service:ListResultsFields>
                          <service:ListResultField>
 
                         <service:ListResultField>
                             <service:element>mimeType</service:element>
-                                                                                                               <service:xpath>mimeType</service:xpath>
+                                                       <service:xpath>mimeType</service:xpath>
                         </service:ListResultField>
 
                         <service:ListResultField>
                             <service:xpath>encoding</service:xpath>
                         </service:ListResultField>
 
-                        <service:ListResultField>
-                            <service:element>length</service:element>
-                            <service:xpath>length</service:xpath>
-                                                                                               </service:ListResultField>
-                                                                                       </service:ListResultsFields>
+                         <service:ListResultField>
+                             <service:element>length</service:element>
+                             <service:xpath>length</service:xpath>
+                         </service:ListResultField>
+                     </service:ListResultsFields>
                 </service:params>
             </service:DocHandlerParams>
             <service:validatorHandler xmlns:service='http://collectionspace.org/services/common/service'>
                      <service:SchemaName>loansin</service:SchemaName>
                      <service:DublinCoreTitle>loansin</service:DublinCoreTitle>
                      <service:SummaryFields>loanInNumber|lenderList|loanReturnDate|uri|csid</service:SummaryFields>
-                     <service:AbstractCommonListClassname>org.collectionspace.services.loanin.LoansinCommonList</service:AbstractCommonListClassname>
-                     <service:CommonListItemClassname>org.collectionspace.services.loanin.LoansinCommonList$LoaninListItem</service:CommonListItemClassname>
+                     <service:AbstractCommonListClassname></service:AbstractCommonListClassname>
+                     <service:CommonListItemClassname></service:CommonListItemClassname>
                      <service:ListResultsItemMethodName>getLoaninListItem</service:ListResultsItemMethodName>
                      <service:ListResultsFields>
                          <service:ListResultField>
                          </service:ListResultField>
                         <service:ListResultField>
                             <service:element>lender</service:element>
-                                                                                                               <service:xpath>lenderGroupList/[0]/lender</service:xpath>
+                                                   <service:xpath>lenderGroupList/[0]/lender</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
                             <service:element>loanReturnDate</service:element>
             <service:DocHandlerParams xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:classname>org.collectionspace.services.objectexit.nuxeo.ObjectExitDocumentModelHandler</service:classname>
                 <service:params>
-                     <service:SchemaName>objectexit</service:SchemaName>
-                     <service:DublinCoreTitle>objectexit</service:DublinCoreTitle>
-                     <service:SummaryFields>exitNumber|currentOwner|uri|csid</service:SummaryFields>
-                     <service:AbstractCommonListClassname>org.collectionspace.services.objectexit.ObjectexitCommonList</service:AbstractCommonListClassname>
-                     <service:CommonListItemClassname>org.collectionspace.services.objectexit.ObjectexitCommonList$ObjectexitListItem</service:CommonListItemClassname>
-                     <service:ListResultsItemMethodName>getObjectexitListItem</service:ListResultsItemMethodName>
-                     <service:ListResultsFields>
-                         <service:ListResultField>
-                             <service:element>exitNumber</service:element>
-                             <service:xpath>exitNumber</service:xpath>
-                         </service:ListResultField>
+                    <service:SchemaName>objectexit</service:SchemaName>
+                    <service:DublinCoreTitle>objectexit</service:DublinCoreTitle>
+                    <service:SummaryFields>exitNumber|currentOwner|uri|csid</service:SummaryFields>
+                    <service:AbstractCommonListClassname>org.collectionspace.services.objectexit.ObjectexitCommonList
+                    </service:AbstractCommonListClassname>
+                    <service:CommonListItemClassname>org.collectionspace.services.objectexit.ObjectexitCommonList$ObjectexitListItem
+                    </service:CommonListItemClassname>
+                    <service:ListResultsItemMethodName>getObjectexitListItem</service:ListResultsItemMethodName>
+                    <service:ListResultsFields>
+                        <service:ListResultField>
+                            <service:element>exitNumber</service:element>
+                            <service:xpath>exitNumber</service:xpath>
+                            <service:setter>setExitNumber</service:setter>
+                        </service:ListResultField>
                         <service:ListResultField>
                             <service:element>currentOwner</service:element>
-                                                                                                               <service:xpath>currentOwner</service:xpath>
+                            <service:xpath>currentOwner</service:xpath>
+                            <service:setter>setCurrentOwner</service:setter>
                         </service:ListResultField>
-                                                                                       </service:ListResultsFields>
+                    </service:ListResultsFields>
                 </service:params>
             </service:DocHandlerParams>
             <service:validatorHandler xmlns:service='http://collectionspace.org/services/common/service'>
                 org.collectionspace.services.objectexit.nuxeo.ObjectExitValidatorHandler
             </service:validatorHandler>
             <service:properties xmlns:service='http://collectionspace.org/services/common/service'>
-                <types:item><types:key>objectNameProperty</types:key><types:value>currentOwner</types:value></types:item>
-                <types:item><types:key>objectNumberProperty</types:key><types:value>exitNumber</types:value></types:item>
+                <types:item>
+                    <types:key>objectNameProperty</types:key>
+                    <types:value>currentOwner</types:value>
+                </types:item>
+                <types:item>
+                    <types:key>objectNumberProperty</types:key>
+                    <types:value>exitNumber</types:value>
+                </types:item>
             </service:properties>
             <service:object name="ObjectExit" version="0.1"
                             xmlns:service='http://collectionspace.org/services/common/service'>
                               label="objectexit-system" updated="" order="0">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                            namespaceURI="http://collectionspace.org/services/common/system"
-                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
+                                namespaceURI="http://collectionspace.org/services/common/system"
+                                schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                               versionable="true" auditable="false"
                               label="objectexit_common" updated="" order="1">
                     <service:properties>
-                        <types:item><types:key>authRef</types:key><types:value>currentOwner</types:value></types:item>
-                        <types:item><types:key>authRef</types:key><types:value>depositor</types:value></types:item>
+                        <types:item>
+                            <types:key>authRef</types:key>
+                            <types:value>currentOwner</types:value>
+                        </types:item>
+                        <types:item>
+                            <types:key>authRef</types:key>
+                            <types:value>depositor</types:value>
+                        </types:item>
                     </service:properties>
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                            namespaceURI="http://collectionspace.org/services/objectexit"
-                            schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">
+                                namespaceURI="http://collectionspace.org/services/objectexit"
+                                schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                               label="collectionspace_core" updated="" order="2">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                            namespaceURI="http://collectionspace.org/collectionspace_core/"
-                            schemaLocation="http://collectionspace.org/collectionspace_core/ http://services.collectionspace.org/collectionspace_core.xsd">
+                                namespaceURI="http://collectionspace.org/collectionspace_core/"
+                                schemaLocation="http://collectionspace.org/collectionspace_core/ http://services.collectionspace.org/collectionspace_core.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         </tenant:serviceBindings>
         <!-- end objectexit service meta-data -->
 
-       <!-- begin group service meta-data -->
+        <!-- begin group service meta-data -->
         <tenant:serviceBindings name="Groups" type="procedure" version="0.1">
             <service:uriPath xmlns:service='http://collectionspace.org/services/common/service'>
                 /groups/*/workflow/
                      <service:SchemaName>groups</service:SchemaName>
                      <service:DublinCoreTitle>groups</service:DublinCoreTitle>
                      <service:SummaryFields>title|uri|csid</service:SummaryFields>
-                     <service:AbstractCommonListClassname>org.collectionspace.services.group.GroupCommonList</service:AbstractCommonListClassname>
-                     <service:CommonListItemClassname>org.collectionspace.services.group.GroupCommonList$GroupListItem</service:CommonListItemClassname>
+                     <service:AbstractCommonListClassname></service:AbstractCommonListClassname>
+                     <service:CommonListItemClassname></service:CommonListItemClassname>
                      <service:ListResultsItemMethodName>getGroupListItem</service:ListResultsItemMethodName>
                      <service:ListResultsFields>
                          <service:ListResultField>
                              <service:element>title</service:element>
                              <service:xpath>title</service:xpath>
                          </service:ListResultField>
-                                                                                       </service:ListResultsFields>
+                                               </service:ListResultsFields>
                 </service:params>
             </service:DocHandlerParams>
             <service:validatorHandler xmlns:service='http://collectionspace.org/services/common/service'>
                     <service:DublinCoreTitle>imports</service:DublinCoreTitle>
                     <service:SummaryFields>importsField|uri|csid</service:SummaryFields>
                     <service:AbstractCommonListClassname>org.collectionspace.services.imports.ImportsCommonList</service:AbstractCommonListClassname>
-                    <service:CommonListItemClassname>org.collectionspace.services.imports.ImportsCommonList$ImportsListItem
-                    </service:CommonListItemClassname>
+                    <service:CommonListItemClassname>org.collectionspace.services.imports.ImportsCommonList$ImportsListItem</service:CommonListItemClassname>
                     <service:ListResultsItemMethodName>getImportsListItem</service:ListResultsItemMethodName>
                     <service:ListResultsFields>
                         <service:ListResultField>
                             <service:element>importsField</service:element>
                             <service:xpath>importsField</service:xpath>
+                            <service:setter>setImportsField</service:setter>
                         </service:ListResultField>
                     </service:ListResultsFields>
                 </service:params>
                      <service:SchemaName>media</service:SchemaName>
                      <service:DublinCoreTitle>media</service:DublinCoreTitle>
                      <service:SummaryFields>title|source|filename|identificationNumber|uri|csid</service:SummaryFields>
-                     <service:AbstractCommonListClassname>org.collectionspace.services.media.MediaCommonList</service:AbstractCommonListClassname>
-                     <service:CommonListItemClassname>org.collectionspace.services.media.MediaCommonList$MediaListItem</service:CommonListItemClassname>
+                     <service:AbstractCommonListClassname></service:AbstractCommonListClassname>
+                     <service:CommonListItemClassname></service:CommonListItemClassname>
                      <service:ListResultsItemMethodName>getMediaListItem</service:ListResultsItemMethodName>
                      <service:ListResultsFields>
                          <service:ListResultField>
                          </service:ListResultField>
                         <service:ListResultField>
                             <service:element>source</service:element>
-                                                                                                               <service:xpath>source</service:xpath>
+                                                       <service:xpath>source</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
                             <service:element>filename</service:element>
                         <service:ListResultField>
                             <service:element>identificationNumber</service:element>
                             <service:xpath>identificationNumber</service:xpath>
-                                                                                               </service:ListResultField>
-                                                                                       </service:ListResultsFields>
+                        </service:ListResultField>
+                     </service:ListResultsFields>
                 </service:params>
             </service:DocHandlerParams>
             <service:validatorHandler xmlns:service='http://collectionspace.org/services/common/service'>
                      <service:SchemaName>acquisition</service:SchemaName>
                      <service:DublinCoreTitle>acquisition</service:DublinCoreTitle>
                      <service:SummaryFields>acquisitionReferenceNumber|acquisitionSources|owners|uri|csid</service:SummaryFields>
-                     <service:AbstractCommonListClassname>org.collectionspace.services.acquisition.AcquisitionsCommonList</service:AbstractCommonListClassname>
-                     <service:CommonListItemClassname>org.collectionspace.services.acquisition.AcquisitionsCommonList$AcquisitionListItem</service:CommonListItemClassname>
+                     <service:AbstractCommonListClassname></service:AbstractCommonListClassname>
+                     <service:CommonListItemClassname></service:CommonListItemClassname>
                      <service:ListResultsItemMethodName>getAcquisitionListItem</service:ListResultsItemMethodName>
                      <service:ListResultsFields>
                          <service:ListResultField>
                          </service:ListResultField>
                         <service:ListResultField>
                             <service:element>acquisitionSource</service:element>
-                                                                                                               <service:xpath>acquisitionSources/[0]</service:xpath>
+                                                       <service:xpath>acquisitionSources/[0]</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
                             <service:element>owner</service:element>
index 99f3e59dd5a5621303b2872c24f3702bf8c5b4cc..b7780a657bf7a2f4b3f15147f4f5f48f0f2a1d65 100755 (executable)
@@ -91,6 +91,10 @@ public class ReflectionMapper {
     }\r
 \r
     public static Object instantiate(String classname) throws Exception {\r
+        if (classname == null) {\r
+            throw new Exception("classname was null in ReflectionMapper.instantiate()");\r
+        }\r
+        classname = classname.trim();\r
         Class cl = Class.forName(classname);\r
         Class [] classParm = null;\r
         Object [] objectParm = null;\r
index d546c77e3a1a086e6a3f16d13ebf8d4cd3351da9..e9831fa5746d4b11e96fb18199f295818b5b9e21 100644 (file)
@@ -231,7 +231,7 @@ extends AbstractMultiPartCollectionSpaceResourceImpl {
         \r
         return result;\r
     }\r
-    \r
+\r
 \r
     /** subclasses may override this method, which is called from #get(String)\r
      *  which handles setup of ServiceContext and DocumentHandler, and Exception handling.*/\r
@@ -245,23 +245,26 @@ extends AbstractMultiPartCollectionSpaceResourceImpl {
 \r
     //======================= GET without csid. List, search, etc. =====================================\r
 \r
-       @GET\r
-       public AbstractCommonList getList(@Context UriInfo ui) {\r
-               MultivaluedMap<String, String> queryParams = ui.getQueryParameters();\r
-               String keywords = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_KW);\r
-               if (keywords != null) {\r
-                       return search(queryParams, keywords);\r
-               } else {\r
-                       return getList(queryParams);\r
-               }\r
-       }\r
+    @GET\r
+    public AbstractCommonList getList(@Context UriInfo ui) {\r
+        MultivaluedMap<String, String> queryParams = ui.getQueryParameters();\r
+        String keywords = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_KW);\r
+        AbstractCommonList list;\r
+        if (keywords != null) {\r
+            list = search(queryParams, keywords);\r
+        } else {\r
+            list = getList(queryParams);\r
+        }\r
+        return list;\r
+    }\r
 \r
     protected AbstractCommonList getList(MultivaluedMap<String, String> queryParams) {\r
         try {\r
             ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(queryParams);\r
             DocumentHandler handler = createDocumentHandler(ctx);\r
             getRepositoryClient(ctx).getFiltered(ctx, handler);\r
-            return (AbstractCommonList)handler.getCommonPartList();\r
+            AbstractCommonList list = (AbstractCommonList)handler.getCommonPartList();\r
+            return list;\r
         } catch (Exception e) {\r
             throw bigReThrow(e, ServiceMessages.LIST_FAILED);\r
         }\r
index 96daaf235d550e8aba765dad3f174e60a2c150b6..dba9ab816735012b367beeef0a21b55e1493577a 100755 (executable)
@@ -93,6 +93,10 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
     public AbstractCommonList createAbstractCommonListImpl() throws Exception {\r
         //  String classname = this.commonList.getClass().getName();\r
         String classname = getDocHandlerParams().getAbstractCommonListClassname();\r
+        if (classname == null){\r
+            throw new Exception("in createAbstractCommonListImpl. getDocHandlerParams().getAbstractCommonListClassname() is null");\r
+        }\r
+        classname = classname.trim();\r
         return (AbstractCommonList)(ReflectionMapper.instantiate(classname));\r
     }\r
 \r
@@ -132,8 +136,36 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
         throw new UnsupportedOperationException();\r
     }\r
 \r
+    //Laramie20110427 Restored this method since it correctly grabs all params from DocHandlerParams.\r
     @Override\r
     public AbstractCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {\r
+        String classname = getDocHandlerParams().getAbstractCommonListClassname();\r
+        if (Tools.isBlank(classname)){\r
+             return extractCommonPartListPATRICK(wrapDoc);\r
+        }\r
+\r
+        String label = getServiceContext().getCommonPartLabel();\r
+        AbstractCommonList commonList = createAbstractCommonListImpl();\r
+        //LC extractPagingInfo((commonList), wrapDoc);\r
+        commonList.setFieldsReturned(getSummaryFields(commonList));\r
+        List list = createItemsList(commonList);\r
+        Iterator<DocumentModel> iter = wrapDoc.getWrappedObject().iterator();\r
+        while(iter.hasNext()){\r
+            DocumentModel docModel = iter.next();\r
+            String id = NuxeoUtils.getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString());\r
+            Object item = createItemForCommonList(docModel, label, id);\r
+            list.add(item);\r
+        }\r
+        extractPagingInfo((commonList), wrapDoc); //LC\r
+        return commonList;\r
+    }\r
+\r
+    // Laramie20110427 I renamed this method, and restored the method of the same name above.\r
+    //                               this makes the AbstractCommonList descendents as specified in DocHandlerParams\r
+    //                                get pulled in correctly.  XPath search works.\r
+    //     And I commented out the @Override annotation:\r
+    //@Override\r
+    public AbstractCommonList extractCommonPartListPATRICK(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {\r
         //String label = getServiceContext().getCommonPartLabel();\r
         \r
         /*\r
@@ -168,7 +200,7 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
        String commonSchema = getServiceContext().getCommonPartLabel();\r
        CommonList commonList = new CommonList();\r
         extractPagingInfo(commonList, wrapDoc);\r
-        List<ListResultField> resultsFields = getListItemsArray(); \r
+        List<ListResultField> resultsFields = getListItemsArray();  //Lookup in tenant-bindings.xml\r
         int nFields = resultsFields.size()+2;\r
         String fields[] = new String[nFields];\r
         fields[0] = "csid";\r
index e3cb711ef86370f70603fcf1fcb367e1da1dcca3..8b19a5877e001c5536f38b2676a7aec52ecf8bd0 100644 (file)
@@ -48,6 +48,7 @@ import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
 import org.collectionspace.services.common.ClientType;
 import org.collectionspace.services.common.ServiceMain;
+import org.collectionspace.services.common.ServiceMessages;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.common.context.MultipartServiceContext;
 import org.collectionspace.services.common.context.MultipartServiceContextFactory;
@@ -137,13 +138,6 @@ public class LoaninResource extends
 //        return docHandler;
 //    }
 
-    /**
-     * Creates the loanin.
-     * 
-     * @param input the input
-     * 
-     * @return the response
-     */
     @POST
     public Response createLoanin(String xmlText) {
         try {
@@ -263,17 +257,8 @@ public class LoaninResource extends
             DocumentHandler handler = createDocumentHandler(ctx);
             getRepositoryClient(ctx).getFiltered(ctx, handler);
             loaninObjectList = (CommonList) handler.getCommonPartList();
-        } catch (UnauthorizedException ue) {
-            Response response = Response.status(
-                    Response.Status.UNAUTHORIZED).entity("Index failed reason " + ue.getErrorReason()).type("text/plain").build();
-            throw new WebApplicationException(response);
         } catch (Exception e) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Caught exception in getLoaninList", e);
-            }
-            Response response = Response.status(
-                    Response.Status.INTERNAL_SERVER_ERROR).entity("Index failed").type("text/plain").build();
-            throw new WebApplicationException(response);
+            throw bigReThrow(e, ServiceMessages.LIST_FAILED, "no-csid-for-list");
         }
         return loaninObjectList;
     }
@@ -353,10 +338,7 @@ public class LoaninResource extends
     
     /**
      * Update loanin.
-     * 
      * @param csid the csid
-     * @param theUpdate the the update
-     * 
      * @return the multipart output
      */
     @PUT
index 01b947a00c96a9c2f4816f6754b5e6b640d0224a..5851400f6db9b1f0246bc422160970e271f14f1c 100644 (file)
@@ -17,6 +17,8 @@
 package org.collectionspace.services.client;
 
 import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.objectexit.ObjectexitCommonList;
+
 import org.jboss.resteasy.client.ClientResponse;
 
 /**
@@ -26,7 +28,7 @@ import org.jboss.resteasy.client.ClientResponse;
  * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
  *
  */
-public class ObjectExitClient extends AbstractPoxServiceClientImpl<AbstractCommonList, ObjectExitProxy> {
+public class ObjectExitClient extends AbstractPoxServiceClientImpl<ObjectexitCommonList, ObjectExitProxy> {
        public static final String SERVICE_NAME = "objectexit";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -53,7 +55,12 @@ public class ObjectExitClient extends AbstractPoxServiceClientImpl<AbstractCommo
         * 
         */
        
-    public ClientResponse<AbstractCommonList> readList() {
+    public ClientResponse<ObjectexitCommonList> readList() {
         return getProxy().readList();
     }
+
+    public ObjectexitCommonList readList2(){
+        ObjectexitCommonList list = readList().getEntity(ObjectexitCommonList.class);
+        return list;
+    }
 }
index 85ed676b0d05bd0381b9a774b489b8988c4c4353..49189d2af2f387234ac0999d210d81291672627b 100644 (file)
@@ -9,6 +9,8 @@ import javax.ws.rs.QueryParam;
 
 import org.collectionspace.services.client.workflow.WorkflowClient;
 import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.objectexit.ObjectexitCommonList;
+
 
 /**
  * @version $Revision: 2108 $
@@ -16,21 +18,21 @@ import org.collectionspace.services.jaxb.AbstractCommonList;
 @Path(ObjectExitClient.SERVICE_PATH + "/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface ObjectExitProxy extends CollectionSpacePoxProxy<AbstractCommonList> {
+public interface ObjectExitProxy extends CollectionSpacePoxProxy<ObjectexitCommonList> {
     // List
     @GET
-    ClientResponse<AbstractCommonList> readList();
+    ClientResponse<ObjectexitCommonList> readList();
     
     @Override
        @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readIncludeDeleted(
+    ClientResponse<ObjectexitCommonList> readIncludeDeleted(
             @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
 
     @Override
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> keywordSearchIncludeDeleted(
+    ClientResponse<ObjectexitCommonList> keywordSearchIncludeDeleted(
                @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
             @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
 }
index b886aedaedf1bcbe8b34a46e18db1557744ae7d6..0e4dba46274fa5d9a391da5474a52e89219e101a 100644 (file)
@@ -33,6 +33,7 @@ import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.objectexit.ObjectexitCommonList;
 import org.collectionspace.services.objectexit.ObjectexitCommon;
 
 import org.jboss.resteasy.client.ClientResponse;
@@ -42,6 +43,8 @@ import org.testng.annotations.Test;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+//import org.w3c.dom.Element;
+//import org.w3c.dom.Node;
 
 /**
  * ObjectExitServiceTest, carries out tests against a deployed and running ObjectExit Service. <p/>
@@ -66,13 +69,13 @@ public class ObjectExitServiceTest extends AbstractServiceTestImpl {
        }
     
     @Override
-    protected CollectionSpaceClient<AbstractCommonList, ObjectExitProxy> getClientInstance() {
+    protected CollectionSpaceClient getClientInstance() {
         return new ObjectExitClient();
     }
 
     @Override
     protected AbstractCommonList getAbstractCommonList(ClientResponse<AbstractCommonList> response) {
-        return response.getEntity(AbstractCommonList.class);
+        return response.getEntity(ObjectexitCommonList.class);
     }
 
     @Override
@@ -119,9 +122,14 @@ public class ObjectExitServiceTest extends AbstractServiceTestImpl {
         logger.debug(testBanner(testName, CLASS_NAME));
         setupReadList();
         ObjectExitClient client = new ObjectExitClient();
-        ClientResponse<AbstractCommonList> res = client.readList();
-        AbstractCommonList list = res.getEntity();
+        ClientResponse<ObjectexitCommonList> res = client.readList();
+        String bar = "\r\n\r\n=================================\r\n\r\n";
+        System.out.println(bar+" res: "+res);
+        ObjectexitCommonList  list = res.getEntity();
+
+        System.out.println(bar+" list: "+list);
         assertStatusCode(res, testName);
+
         if (logger.isDebugEnabled()) {
             List<AbstractCommonList.ListItem> items =
                 list.getListItem();
@@ -132,6 +140,23 @@ public class ObjectExitServiceTest extends AbstractServiceTestImpl {
                 i++;
             }
         }
+
+        /*
+        List<AbstractCommonList.ListItem> items = list.getListItem();
+        int i = 0;
+        for(AbstractCommonList.ListItem item : items){
+            List<Element> elList = item.getAny();
+            StringBuilder elementStrings = new StringBuilder();
+            for(Element el : elList) {
+                Node textEl = el.getFirstChild();
+                if (textEl != null){
+                    elementStrings.append("["+el.getNodeName()+":"+textEl.getNodeValue()+"] ");
+                }
+            }
+            System.out.println("\r\n\r\n\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~"+testName + ": list-item[" + i + "]: "+elementStrings.toString());
+            i++;
+        }
+        */
     }
 
     @Override
index 254e0ee8e53af1cafafe731235c8bdfa23721a0b..75fce14005dd7334642650f52ded6c0e46138f6c 100644 (file)
             </xs:appinfo>
         </xs:annotation>
     </xs:complexType>
-    
+
+
+    <!-- objectexit records, as in nuxeo repository -->
+    <xs:element name="objectexit-common-list">
+        <xs:complexType>
+            <xs:complexContent>
+                <xs:extension base="abstractCommonList">
+                    <xs:sequence>
+                        <xs:element name="objectexit-list-item" maxOccurs="unbounded">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:element name="exitNumber" type="xs:string"
+                                        minOccurs="1" />
+                                    <xs:element name="currentOwner" type="xs:string"
+                                        minOccurs="1" />
+                                    <xs:element name="uri" type="xs:anyURI"
+                                        minOccurs="1" />
+                                    <xs:element name="csid" type="xs:string"
+                                        minOccurs="1" />
+
+
+
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
+                    </xs:sequence>
+                </xs:extension>
+            </xs:complexContent>
+        </xs:complexType>
+    </xs:element>
+
 </xs:schema>