<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
<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
--- /dev/null
+<?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>
+
--- /dev/null
+<?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>
+
+
</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
--- /dev/null
+<?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
-<?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
--- /dev/null
+<?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>
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
<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>
}\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
\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
\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
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
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
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
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;
// return docHandler;
// }
- /**
- * Creates the loanin.
- *
- * @param input the input
- *
- * @return the response
- */
@POST
public Response createLoanin(String xmlText) {
try {
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;
}
/**
* Update loanin.
- *
* @param csid the csid
- * @param theUpdate the the update
- *
* @return the multipart output
*/
@PUT
package org.collectionspace.services.client;
import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.objectexit.ObjectexitCommonList;
+
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;
*
*/
- public ClientResponse<AbstractCommonList> readList() {
+ public ClientResponse<ObjectexitCommonList> readList() {
return getProxy().readList();
}
+
+ public ObjectexitCommonList readList2(){
+ ObjectexitCommonList list = readList().getEntity(ObjectexitCommonList.class);
+ return list;
+ }
}
import org.collectionspace.services.client.workflow.WorkflowClient;
import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.objectexit.ObjectexitCommonList;
+
/**
* @version $Revision: 2108 $
@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);
}
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;
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/>
}
@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
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();
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
</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>