]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
Normalizing LF vs CRLF in all files.
authorremillet <remillet@yahoo.com>
Tue, 16 Dec 2014 19:25:52 +0000 (11:25 -0800)
committerremillet <remillet@yahoo.com>
Tue, 16 Dec 2014 19:25:52 +0000 (11:25 -0800)
Normalizing LF vs CRLF in all files.

659 files changed:
.classpath
.gitattributes [new file with mode: 0644]
.project
3rdparty/.classpath
3rdparty/.project
3rdparty/build.xml
3rdparty/nuxeo/.classpath
3rdparty/nuxeo/.project
3rdparty/nuxeo/build.xml
3rdparty/nuxeo/nuxeo-doctype-custom/src/main/resources/META-INF/MANIFEST.MF
3rdparty/nuxeo/nuxeo-doctype/src/main/resources/META-INF/MANIFEST.MF
3rdparty/nuxeo/nuxeo-doctype/src/main/resources/OSGI-INF/deployment-fragment.xml
3rdparty/nuxeo/nuxeo-platform-collectionspace/pom.xml
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/META-INF/MANIFEST.MF
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/deployment-fragment.xml
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/querymodel-contrib.xml
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/subitem.xsd
3rdparty/nuxeo/nuxeo-platform-quote-api/pom.xml
3rdparty/nuxeo/nuxeo-platform-quote/LGPL.txt
3rdparty/nuxeo/nuxeo-platform-quote/pom.xml
3rdparty/nuxeo/nuxeo-server/Bundle List.txt
build.properties
build.xml
installer/build.xml
nbproject/project.xml
pom.xml
services/.classpath
services/.project
services/IntegrationTests/pom.xml
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/PayloadLogger.java
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/ServiceResult.java
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/TreeWalkResults.java
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlCompareJdom.java
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplay.java
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplayEval.java
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplayTest.java
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplayTransport.java
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlCompareJdomRepeatingTest.java
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlCompareJdomTest.java
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplayMasterTest.java
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/XmlReplaySelfTest.java
services/IntegrationTests/src/test/resources/log4j.properties
services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/ac2.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/acquisitions.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac1.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac2.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac3.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/res/ac3list.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/personauthority.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/personitem.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/locationItems.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/locationItemsWithShortID.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItems.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItemsContainingWord1.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItemsContainingWord2.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItemsOnlyWord1.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefs.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsComplex.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple2.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/loanin.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPerson.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPerson1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPerson2.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/newPersonAuthority.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/organizations_common.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/orgauthorities_common.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/res/refObjs.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/updatePerson1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/updatePerson2.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-create-updateobjloc-nocontext.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-create-updateobjloc.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-invoke-updateobjloc-group.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-invoke-updateobjloc-list.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-invoke-updateobjloc-nocontext.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-invoke-updateobjloc-single.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-update-object-loc.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch1InvContext.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batchBadInvContext.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batchBadInvContextList.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batchInvContextList.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batchInvContextSingle.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-3.txt
services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin-notes.txt
services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/non-latin.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/bugs/nonlatin/utf-8-bug.txt
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/AuthRefsCollObj.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-collectionobject.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/nh-part.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dev-all.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dev-master-example.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension-master.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/2-put.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/res/import-objectexit-utf8.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanin/li1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanin/loanin.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/3-locations_w_relations_CSID.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/4-locations_w_relations_mixed.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/5-locations_w_relations_RefNames.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/media/media.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/media/oe11.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/media/oe15.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/media/oe9.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit-display.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe11.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe13.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe15.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe23.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe3.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe35.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe4.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe5.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeObject.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oePersonDisplayOnly.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oePersonauthority.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeRepeat.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe10.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe12.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe14.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe16.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe17.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe2.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe22.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe23.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe27.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe28.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe29.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe30.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe6.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe8.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/3-organizations_w_relations.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organizations_common.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organizations_ucb.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organizations_ucbist.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/orgauthorities_common.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/orgauthorities_testorgauth.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/repeatables.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/personTermStatusSearch.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person_pmadry.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person_pschmitz.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/personauthorities_common.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/personauthorities_testpersonauth.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_delete_all_relations_PUT.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_delete_relations_PUT.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_w_relations.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_w_relations_2.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_w_relations_3.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/persons_common_w_relations_POST.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/personlistActive.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/personlistAll.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/personlistNone.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/oe1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/relation.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/res/workflowState.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1InvContextStandalone.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/1-bigbird-permission.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/10-permissionroles-elmo.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-bigbird-permission-CRU.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/11-permissionroles-bigbird-CRU.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-bigbird-permission-R.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/12-permissionroles-bigbird-R.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/13-permissionroles-bigbird.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/2-elmo-permission.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/3-role-test-cm.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/4-role-intern.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/5-account-bigbird.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/6-account-elmo.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/7-accountroles-bigbird.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/8-account-roles-elmo.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/9-permissionroles-bigbird.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/security/Base64-authentication-notes.txt
services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master-self-test.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-self-test.xml
services/JaxRsServiceProvider/pom.xml
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CSpaceResteasyBootstrap.java
services/JaxRsServiceProvider/src/main/resources/META-INF/persistence.xml
services/JaxRsServiceProvider/src/main/resources/log4j.properties
services/JaxRsServiceProvider/src/main/webapp/WEB-INF/jboss-web.xml
services/JaxRsServiceProvider/src/main/webapp/WEB-INF/login.conf
services/JaxRsServiceProvider/src/main/webapp/WEB-INF/web.xml
services/PerformanceTests/pom.xml
services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/CollectionSpacePerformanceTest.java
services/PerformanceTests/src/test/resources/log4j.properties
services/account/.classpath
services/account/.project
services/account/build.xml
services/account/client/build.xml
services/account/client/pom.xml
services/account/client/src/test/resources/log4j.properties
services/account/jaxb/src/test/resources/log4j.properties
services/account/pom.xml
services/account/pstore/build.xml
services/account/pstore/pom.xml
services/account/pstore/src/main/resources/db/postgresql/README.txt
services/account/pstore/src/test/resources/log4j.properties
services/account/service/pom.xml
services/acquisition/.classpath
services/acquisition/.project
services/acquisition/3rdparty/.classpath
services/acquisition/3rdparty/.project
services/acquisition/3rdparty/build.xml
services/acquisition/3rdparty/pom.xml
services/acquisition/build.xml
services/acquisition/client/pom.xml
services/acquisition/client/src/test/resources/log4j.properties
services/acquisition/jaxb/src/main/java/org/collectionspace/services/AcquisitionJAXBSchema.java
services/acquisition/jaxb/src/main/java/org/collectionspace/services/AcquisitionListItemJAXBSchema.java
services/acquisition/pom.xml
services/acquisition/service/pom.xml
services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionValidatorHandler.java
services/authentication/.classpath
services/authentication/.project
services/authentication/build.xml
services/authentication/client/build.xml
services/authentication/client/pom.xml
services/authentication/client/src/test/resources/log4j.properties
services/authentication/nb-configuration.xml
services/authentication/pom.xml
services/authentication/pstore/build.xml
services/authentication/pstore/pom.xml
services/authentication/pstore/src/main/resources/db/postgresql/README.txt
services/authentication/service/build.xml
services/authentication/service/src/main/java/org/collectionspace/authentication/jaas/CSpaceJBossDBLoginModule.java
services/authentication/service/src/test/resources/log4j.properties
services/authority/build.xml
services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemJAXBSchema.java
services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemListItemJAXBSchema.java
services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityJAXBSchema.java
services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityListItemJAXBSchema.java
services/authority/pom.xml
services/authority/service/pom.xml
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/IVocabManager.java
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/VocabManager.java
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/VocabManagerImpl.java
services/authorization-mgt/.classpath
services/authorization-mgt/.project
services/authorization-mgt/build.xml
services/authorization-mgt/client/build.xml
services/authorization-mgt/client/pom.xml
services/authorization-mgt/client/src/test/resources/log4j.properties
services/authorization-mgt/import/build.xml
services/authorization-mgt/import/pom.xml
services/authorization-mgt/import/src/main/resources/log4j.properties
services/authorization-mgt/service/build.xml
services/authorization-mgt/service/pom.xml
services/authorization/.classpath
services/authorization/.project
services/authorization/build.xml
services/authorization/jaxb/pom.xml
services/authorization/jaxb/src/main/resources/accounts_permissions.xsd
services/authorization/jaxb/src/test/resources/log4j.properties
services/authorization/pstore/build.xml
services/authorization/pstore/pom.xml
services/authorization/pstore/src/main/resources/db/postgresql/README.txt
services/authorization/service/build.xml
services/authorization/service/src/main/java/org/collectionspace/services/authorization/PermissionActionUtil.java
services/authorization/service/src/test/resources/log4j.properties
services/batch/.project
services/batch/3rdparty/.project
services/batch/3rdparty/nuxeo-platform-cs-batch/src/main/resources/META-INF/MANIFEST.MF
services/batch/3rdparty/nuxeo-platform-cs-batch/src/main/resources/schemas/batch_common.xsd
services/batch/client/src/test/resources/log4j.properties
services/batch/service/src/main/java/org/collectionspace/services/batch/BatchInvocable.java
services/blob/.project
services/blob/3rdparty/.project
services/blob/client/src/test/java/org/collectionspace/services/client/test/BlobScaleTest.java
services/blob/client/src/test/resources/log4j.properties
services/blob/jaxb/.classpath
services/build.xml
services/citation/.classpath
services/citation/.project
services/citation/3rdparty/.classpath
services/citation/3rdparty/.project
services/citation/jaxb/src/main/java/org/collectionspace/services/CitationJAXBSchema.java
services/client/pom.xml
services/client/src/main/java/org/collectionspace/services/client/AbstractCommonListPoxServiceClientImpl.java
services/client/src/main/java/org/collectionspace/services/client/AbstractCommonListUtils.java
services/client/src/main/java/org/collectionspace/services/client/AbstractPoxServiceClientImpl.java
services/client/src/main/java/org/collectionspace/services/client/AbstractServiceClientImpl.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityClient.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityProxy.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClientUtils.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceCommonListPoxProxy.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxClient.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxProxy.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java
services/client/src/main/java/org/collectionspace/services/client/IClientQueryParams.java
services/client/src/main/java/org/collectionspace/services/client/IQueryManager.java
services/client/src/main/java/org/collectionspace/services/client/PayloadInputPart.java
services/client/src/main/java/org/collectionspace/services/client/PayloadOutputPart.java
services/client/src/main/java/org/collectionspace/services/client/PayloadPart.java
services/client/src/main/java/org/collectionspace/services/client/PoxPayload.java
services/client/src/main/java/org/collectionspace/services/client/PoxPayloadIn.java
services/client/src/main/java/org/collectionspace/services/client/PoxPayloadOut.java
services/client/src/main/java/org/collectionspace/services/client/Profiler.java
services/client/src/main/java/org/collectionspace/services/client/TestServiceProxy.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractAuthorityServiceTest.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractPoxServiceTestImpl.java
services/client/src/main/java/org/collectionspace/services/client/test/BaseServiceTest.java
services/client/src/main/java/org/collectionspace/services/client/test/ServiceTestUtils.java
services/client/src/main/resources/collectionspace-client.properties
services/client/src/test/resources/log4j.properties
services/collectionobject/.classpath
services/collectionobject/.project
services/collectionobject/3rdparty/.classpath
services/collectionobject/3rdparty/.project
services/collectionobject/3rdparty/build.xml
services/collectionobject/3rdparty/nuxeo-platform-collectionobject-lifesci/build.xml
services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/build.xml
services/collectionobject/3rdparty/pom.xml
services/collectionobject/build.xml
services/collectionobject/client/nbactions.xml
services/collectionobject/client/pom.xml
services/collectionobject/client/src/test/resources/log4j.properties
services/collectionobject/installer/build.xml
services/collectionobject/jaxb/src/main/java/org/collectionspace/services/CollectionObjectJAXBSchema.java
services/collectionobject/jaxb/src/main/java/org/collectionspace/services/CollectionObjectListItemJAXBSchema.java
services/collectionobject/nbactions.xml
services/collectionobject/pom.xml
services/collectionobject/sample/.classpath
services/collectionobject/sample/.project
services/collectionobject/sample/sample/.project
services/collectionobject/sample/sample/src/main/resources/collectionspace-client.properties
services/collectionobject/service/pom.xml
services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectValidatorHandler.java
services/common-api/pom.xml
services/common-api/src/main/java/org/collectionspace/services/common/api/CommonAPI.java
services/common-api/src/main/java/org/collectionspace/services/common/api/FileTools.java
services/common-api/src/main/java/org/collectionspace/services/common/api/RefName.java
services/common-api/src/main/java/org/collectionspace/services/common/api/Tools.java
services/common-api/src/main/java/org/collectionspace/services/common/api/ZipTools.java
services/common-api/src/test/java/org/collectionspace/services/common/api/test/RefNameTest.java
services/common-test/src/test/resources/log4j.properties
services/common/pom.xml
services/common/src/main/java/org/collectionspace/services/common/AbstractCollectionSpaceResourceImpl.java
services/common/src/main/java/org/collectionspace/services/common/AbstractMultiPartCollectionSpaceResourceImpl.java
services/common/src/main/java/org/collectionspace/services/common/ConfigurationException.java
services/common/src/main/java/org/collectionspace/services/common/Download.java
services/common/src/main/java/org/collectionspace/services/common/FileUtils.java
services/common/src/main/java/org/collectionspace/services/common/IFragmentHandler.java
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/common/ResourceMap.java
services/common/src/main/java/org/collectionspace/services/common/ResourceMapHolder.java
services/common/src/main/java/org/collectionspace/services/common/ResourceMapImpl.java
services/common/src/main/java/org/collectionspace/services/common/ServiceMain.java
services/common/src/main/java/org/collectionspace/services/common/ServletTools.java
services/common/src/main/java/org/collectionspace/services/common/UriTemplate.java
services/common/src/main/java/org/collectionspace/services/common/UriTemplateFactory.java
services/common/src/main/java/org/collectionspace/services/common/UriTemplateRegistry.java
services/common/src/main/java/org/collectionspace/services/common/XmlSaxFragmenter.java
services/common/src/main/java/org/collectionspace/services/common/authorization_mgt/AuthorizationCommon.java
services/common/src/main/java/org/collectionspace/services/common/authorization_mgt/AuthorizationRoleRel.java
services/common/src/main/java/org/collectionspace/services/common/blob/BlobInput.java
services/common/src/main/java/org/collectionspace/services/common/blob/BlobOutput.java
services/common/src/main/java/org/collectionspace/services/common/blob/BlobUtil.java
services/common/src/main/java/org/collectionspace/services/common/config/ServiceConfigUtils.java
services/common/src/main/java/org/collectionspace/services/common/config/TenantBindingUtils.java
services/common/src/main/java/org/collectionspace/services/common/context/JaxRsContext.java
services/common/src/main/java/org/collectionspace/services/common/context/RemoteServiceContextFactory.java
services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java
services/common/src/main/java/org/collectionspace/services/common/document/DocumentFilter.java
services/common/src/main/java/org/collectionspace/services/common/document/DocumentListWrapper.java
services/common/src/main/java/org/collectionspace/services/common/document/DocumentListWrapperImpl.java
services/common/src/main/java/org/collectionspace/services/common/document/ValidatorHandlerImpl.java
services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java
services/common/src/main/java/org/collectionspace/services/common/init/AddIndices.java
services/common/src/main/java/org/collectionspace/services/common/init/IInitHandler.java
services/common/src/main/java/org/collectionspace/services/common/init/InitHandler.java
services/common/src/main/java/org/collectionspace/services/common/invocable/InvocableUtils.java
services/common/src/main/java/org/collectionspace/services/common/profile/BufferedServletInputStream.java
services/common/src/main/java/org/collectionspace/services/common/profile/BufferedServletOutputStream.java
services/common/src/main/java/org/collectionspace/services/common/profile/CSpaceFilter.java
services/common/src/main/java/org/collectionspace/services/common/profile/PayloadFilter.java
services/common/src/main/java/org/collectionspace/services/common/profile/RequestWrapper.java
services/common/src/main/java/org/collectionspace/services/common/profile/ResponseWrapper.java
services/common/src/main/java/org/collectionspace/services/common/query/QueryContext.java
services/common/src/main/java/org/collectionspace/services/common/query/QueryManager.java
services/common/src/main/java/org/collectionspace/services/common/query/QueryResultList.java
services/common/src/main/java/org/collectionspace/services/common/query/nuxeo/QueryManagerNuxeoImpl.java
services/common/src/main/java/org/collectionspace/services/common/relation/RelationJAXBSchema.java
services/common/src/main/java/org/collectionspace/services/common/relation/RelationListItemJAXBSchema.java
services/common/src/main/java/org/collectionspace/services/common/storage/JDBCTools.java
services/common/src/main/java/org/collectionspace/services/common/storage/jpa/JpaDocumentHandler.java
services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/CommonList.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoClientEmbedded.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoConnectorEmbedded.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/ObjectFactory.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteSubItemDocumentModelHandlerImpl.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/package-info.java
services/common/src/main/resources/version.xsd
services/common/src/test/java/org/collectionspace/services/common/test/UriTemplateRegistryTest.java
services/common/src/test/java/org/collectionspace/services/common/test/UriTemplateTest.java
services/common/src/test/resources/test-data/XmlSaxFragmenter-sample.xml
services/config/src/main/java/org/collectionspace/services/common/config/PropertyItemUtils.java
services/contact/.classpath
services/contact/.project
services/contact/3rdparty/.classpath
services/contact/3rdparty/.project
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClient.java
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClientImpl.java
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsProxy.java
services/dimension/.classpath
services/dimension/.project
services/dimension/3rdparty/.classpath
services/dimension/3rdparty/.project
services/dimension/3rdparty/build.xml
services/dimension/3rdparty/nuxeo-platform-cs-dimension/src/main/resources/schemas/dimensions_common.xsd
services/dimension/3rdparty/pom.xml
services/dimension/build.xml
services/dimension/client/pom.xml
services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionXmlReplayTest.java
services/dimension/client/src/test/resources/log4j.properties
services/dimension/client/src/test/resources/test-data/xmlreplay/dimension-master.xml
services/dimension/client/src/test/resources/test-data/xmlreplay/dimension.xml
services/dimension/client/src/test/resources/test-data/xmlreplay/dimension/1.xml
services/dimension/jaxb/src/main/java/org/collectionspace/services/dimension/DimensionJAXBSchema.java
services/dimension/jaxb/src/main/java/org/collectionspace/services/dimension/DimensionListItemJAXBSchema.java
services/dimension/pom.xml
services/dimension/service/pom.xml
services/group/.classpath
services/group/.project
services/group/3rdparty/.classpath
services/group/3rdparty/.project
services/group/client/src/test/resources/log4j.properties
services/hyperjaxb/pom.xml
services/id/.classpath
services/id/.project
services/id/3rdparty/.classpath
services/id/3rdparty/nuxeo-platform-cs-id/.classpath
services/id/build.xml
services/id/jaxb/.classpath
services/id/service/src/test/resources/log4j.properties
services/imports/.project
services/imports/3rdparty/.project
services/imports/3rdparty/nuxeo-platform-cs-imports/src/main/resources/META-INF/MANIFEST.MF
services/imports/3rdparty/nuxeo-platform-cs-imports/src/main/resources/schemas/imports_common.xsd
services/imports/service/src/main/java/org/collectionspace/services/imports/nuxeo/ImportCommand.java
services/imports/service/src/main/resources/templates/service-document.xml
services/imports/service/src/test/resources/requests/authority-request.xml
services/imports/service/src/test/resources/requests/collectionobject-request.xml
services/installer/build.xml
services/intake/.classpath
services/intake/.project
services/intake/3rdparty/.classpath
services/intake/3rdparty/.project
services/intake/3rdparty/build.xml
services/intake/3rdparty/pom.xml
services/intake/build.xml
services/intake/client/pom.xml
services/intake/client/src/test/java/org/collectionspace/services/client/test/OrganizationAuthRefDocsTest.java
services/intake/client/src/test/resources/log4j.properties
services/intake/jaxb/src/main/java/org/collectionspace/services/IntakeJAXBSchema.java
services/intake/jaxb/src/main/java/org/collectionspace/services/IntakeListItemJAXBSchema.java
services/intake/pom.xml
services/intake/service/pom.xml
services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeValidatorHandler.java
services/jaxb/pom.xml
services/jaxb/src/main/resources/relations_common.xsd
services/loanin/.classpath
services/loanin/.project
services/loanin/3rdparty/.classpath
services/loanin/3rdparty/.project
services/loanin/client/src/test/resources/log4j.properties
services/loanout/.project
services/loanout/3rdparty/.project
services/loanout/client/src/test/resources/log4j.properties
services/location/.classpath
services/location/.project
services/location/3rdparty/.classpath
services/location/3rdparty/.project
services/location/3rdparty/build.xml
services/location/3rdparty/pom.xml
services/location/build.xml
services/location/client/pom.xml
services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClientUtils.java
services/location/client/src/test/resources/log4j.properties
services/location/installer/build.xml
services/location/jaxb/src/main/java/org/collectionspace/services/LocationJAXBSchema.java
services/location/pom.xml
services/location/service/pom.xml
services/media/.project
services/media/3rdparty/.project
services/media/client/src/test/resources/log4j.properties
services/media/service/src/main/java/org/collectionspace/services/media/MediaBlobInput.java
services/movement/.project
services/movement/3rdparty/.project
services/movement/client/src/test/resources/log4j.properties
services/note/.classpath
services/note/.project
services/note/3rdparty/.classpath
services/note/3rdparty/.project
services/note/3rdparty/build.xml
services/note/3rdparty/nuxeo-platform-cs-note/build.xml
services/note/3rdparty/nuxeo-platform-cs-note/pom.xml
services/note/3rdparty/nuxeo-platform-cs-note/src/main/resources/META-INF/MANIFEST.MF
services/note/3rdparty/nuxeo-platform-cs-note/src/main/resources/OSGI-INF/core-types-contrib.xml
services/note/3rdparty/nuxeo-platform-cs-note/src/main/resources/OSGI-INF/deployment-fragment.xml
services/note/3rdparty/nuxeo-platform-cs-note/src/main/resources/OSGI-INF/ecm-types-contrib.xml
services/note/3rdparty/nuxeo-platform-cs-note/src/main/resources/OSGI-INF/layouts-contrib.xml
services/note/3rdparty/nuxeo-platform-cs-note/src/main/resources/schemas/notes_common.xsd
services/note/3rdparty/pom.xml
services/note/build.xml
services/note/client/pom.xml
services/note/client/src/main/java/org/collectionspace/services/client/NoteClient.java
services/note/client/src/main/java/org/collectionspace/services/client/NoteClientUtils.java
services/note/client/src/main/java/org/collectionspace/services/client/NoteProxy.java
services/note/client/src/test/java/org/collectionspace/services/client/test/NoteServiceTest.java
services/note/client/src/test/resources/log4j.properties
services/note/jaxb/pom.xml
services/note/jaxb/src/main/java/org/collectionspace/services/note/NoteJAXBSchema.java
services/note/jaxb/src/main/java/org/collectionspace/services/note/NoteListItemJAXBSchema.java
services/note/jaxb/src/main/resources/notes-common.xsd
services/note/pom.xml
services/note/service/pom.xml
services/note/service/profiles.xml
services/note/service/src/main/java/org/collectionspace/services/note/NoteResource.java
services/note/service/src/main/java/org/collectionspace/services/note/nuxeo/NoteConstants.java
services/note/service/src/main/java/org/collectionspace/services/note/nuxeo/NoteDocumentModelHandler.java
services/note/service/src/test/java/org/collectionspace/services/test/NoteServiceTest.java
services/note/service/src/test/resources/log4j.xml
services/objectexit/.project
services/objectexit/3rdparty/.project
services/objectexit/client/src/test/resources/log4j.properties
services/organization/.classpath
services/organization/.project
services/organization/3rdparty/.classpath
services/organization/3rdparty/.project
services/organization/3rdparty/build.xml
services/organization/3rdparty/pom.xml
services/organization/build.xml
services/organization/client/pom.xml
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java
services/organization/client/src/test/resources/log4j.properties
services/organization/installer/build.xml
services/organization/jaxb/src/main/java/org/collectionspace/services/OrganizationJAXBSchema.java
services/organization/pom.xml
services/organization/sample/.classpath
services/organization/sample/.project
services/organization/sample/pom.xml
services/organization/sample/sample/.project
services/organization/sample/sample/pom.xml
services/organization/sample/sample/src/main/java/org/collectionspace/services/organization/client/sample/Sample.java
services/organization/sample/sample/src/main/resources/collectionspace-client.properties
services/organization/sample/sample/src/main/resources/log4j.xml
services/organization/service/pom.xml
services/person/.classpath
services/person/.project
services/person/3rdparty/.classpath
services/person/3rdparty/.project
services/person/3rdparty/build.xml
services/person/3rdparty/pom.xml
services/person/build.xml
services/person/client/pom.xml
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClientUtils.java
services/person/client/src/test/resources/log4j.properties
services/person/installer/build.xml
services/person/jaxb/src/main/java/org/collectionspace/services/PersonJAXBSchema.java
services/person/pom.xml
services/person/sample/.classpath
services/person/sample/.project
services/person/sample/pom.xml
services/person/sample/sample/.classpath
services/person/sample/sample/.project
services/person/sample/sample/pom.xml
services/person/sample/sample/src/main/java/org/collectionspace/services/person/client/sample/Sample.java
services/person/sample/sample/src/main/resources/collectionspace-client.properties
services/person/sample/sample/src/main/resources/log4j.xml
services/person/service/pom.xml
services/query/.classpath
services/query/.project
services/query/pom.xml
services/query/service/pom.xml
services/relation/.classpath
services/relation/.project
services/relation/3rdparty/.classpath
services/relation/3rdparty/.project
services/relation/3rdparty/build.xml
services/relation/3rdparty/nuxeo-platform-cs-relation/build.xml
services/relation/3rdparty/nuxeo-platform-cs-relation/pom.xml
services/relation/3rdparty/nuxeo-platform-cs-relation/src/main/resources/META-INF/MANIFEST.MF
services/relation/3rdparty/nuxeo-platform-cs-relation/src/main/resources/schemas/relations_common.xsd
services/relation/build.xml
services/relation/client/pom.xml
services/relation/client/src/test/resources/log4j.properties
services/relation/pom.xml
services/relation/service/pom.xml
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationValidatorHandler.java
services/report/.classpath
services/report/.project
services/report/3rdparty/.classpath
services/report/3rdparty/.project
services/report/3rdparty/build.xml
services/report/3rdparty/nuxeo-platform-cs-report/src/main/resources/META-INF/MANIFEST.MF
services/report/3rdparty/nuxeo-platform-cs-report/src/main/resources/schemas/reports_common.xsd
services/report/3rdparty/pom.xml
services/report/build.xml
services/report/client/pom.xml
services/report/client/src/test/resources/log4j.properties
services/report/jaxb/src/main/java/org/collectionspace/services/ReportJAXBSchema.java
services/report/pom.xml
services/report/service/pom.xml
services/report/service/src/main/java/org/collectionspace/services/report/nuxeo/ReportPostInitHandler.java
services/report/service/src/main/java/org/collectionspace/services/report/nuxeo/ReportValidatorHandler.java
services/sdk/.classpath
services/sdk/pom.xml
services/sdk/sample/.classpath
services/sdk/sample/pom.xml
services/sdk/sample/src/main/java/org/collectionspace/services/sdk/sample/Sample.java
services/sdk/sample/src/main/resources/collectionspace-client.properties
services/security/.classpath
services/security/.project
services/security/build.xml
services/security/client/build.xml
services/security/client/pom.xml
services/security/client/src/test/resources/log4j.properties
services/security/pom.xml
services/vocabulary/.classpath
services/vocabulary/.project
services/vocabulary/3rdparty/.classpath
services/vocabulary/3rdparty/.project
services/vocabulary/3rdparty/build.xml
services/vocabulary/3rdparty/nuxeo-platform-cs-vocabulary/src/main/resources/schemas/README.txt
services/vocabulary/3rdparty/pom.xml
services/vocabulary/build.xml
services/vocabulary/client/pom.xml
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClientUtils.java
services/vocabulary/client/src/test/resources/log4j.properties
services/vocabulary/installer/build.xml
services/vocabulary/pom.xml
services/vocabulary/sample/.classpath
services/vocabulary/sample/.project
services/vocabulary/sample/pom.xml
services/vocabulary/sample/sample/.project
services/vocabulary/sample/sample/pom.xml
services/vocabulary/sample/sample/src/main/java/org/collectionspace/services/vocabulary/client/sample/Sample.java
services/vocabulary/sample/sample/src/main/resources/collectionspace-client.properties
services/vocabulary/service/pom.xml
services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/META-INF/MANIFEST.MF
services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/schemas/workflow_common.xsd
services/workflow/client/src/test/resources/log4j.properties

index 505c7192a516c57aff1e56ee8f44ccc0f9f7b4fd..ff1a8fa3c8d09503c07ab1f8b67ba409cd4e3130 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
-       <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
-       <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+       <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+       <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..412eeda
--- /dev/null
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs     diff=csharp
+*.sln    merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc   diff=astextplain
+*.DOC   diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot  diff=astextplain
+*.DOT  diff=astextplain
+*.pdf  diff=astextplain
+*.PDF   diff=astextplain
+*.rtf   diff=astextplain
+*.RTF   diff=astextplain
index 5cd13a441fc46774c18f9ce6ca85f3bd6978c72b..8eb9f989036036f1c1291f02214c7e1ea3b43b10 100644 (file)
--- a/.project
+++ b/.project
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d7501e2c414b1a2ce2d6897a7845b083f8d5a48f..b8a2888f85c05af58ffc1b59f294ca0bacb70267 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 85949a7f9cd54a61f95d016237dc69295578ce8b..f5836278636973c706bb61fc3fe1da33b3c68d84 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 3c91e03e91d3d5cef96250fdb2bdbe9edddc1164..f0c11704325ba569a6bcdcddc13c0fb387a9d492 100644 (file)
-\r
-<project name="3rdparty" default="package" basedir=".">\r
-    <description>\r
-        collectionspace 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value=".."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-    <property name="dist"  location="dist"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    <!-- Create the build directory structure used by compile -->\r
-        <mkdir dir="${build}"/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-               description="Package CollectionSpace Services" />               \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="install" depends="package,install-unix,install-windows"\r
-       description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-       description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="package"\r
-       description="deploy 3rdparty in ${jee.server.cspace}">\r
-        <copy todir="${db.base.dir}/jdbc_drivers">\r
-            <fileset dir="${basedir}/jdbc_drivers"/>\r
-        </copy>\r
-\r
-        <ant antfile="nuxeo/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-       description="undeploy 3rdparty from ${jee.server.cspace}">\r
-        <ant antfile="nuxeo/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-       description="generate distribution for 3rdparty">\r
-        <ant antfile="nuxeo/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="3rdparty" default="package" basedir=".">
+    <description>
+        collectionspace 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value=".."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+    <property name="dist"  location="dist"/>
+
+    <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="package,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="package"
+       description="deploy 3rdparty in ${jee.server.cspace}">
+        <copy todir="${db.base.dir}/jdbc_drivers">
+            <fileset dir="${basedir}/jdbc_drivers"/>
+        </copy>
+
+        <ant antfile="nuxeo/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+       description="undeploy 3rdparty from ${jee.server.cspace}">
+        <ant antfile="nuxeo/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+       description="generate distribution for 3rdparty">
+        <ant antfile="nuxeo/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index d7501e2c414b1a2ce2d6897a7845b083f8d5a48f..b8a2888f85c05af58ffc1b59f294ca0bacb70267 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 8fb749d177b45dd8ffd55c6f1120c24bbac04937..a3f1889bc47f9ba15083590d57a1371929a9646f 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.3rdparty.nuxeo</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.3rdparty.nuxeo</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 71eb3207dbde961f446032cdf5bf6c3cc35710f9..5ec4bb01ef22ffa27c5b126a590b8e415ef88ca5 100644 (file)
-<project name="nuxeo" default="package" basedir=".">\r
-    <description> collectionspace nuxeo </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- environment should be declared before reading build.properties -->\r
-    <property environment="env"/>\r
-    <property file="${services.trunk}/build.properties"/>\r
-    <property name="mvn.opts" value="-V"/>\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-    <property name="dist" location="dist"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix"/>\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows"/>\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-        <!-- Create the build directory structure used by compile -->\r
-        <mkdir dir="${build}"/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-        description="Package CollectionSpace Services"/>\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package"/>\r
-            <arg value="-Dmaven.test.skip=true"/>\r
-            <arg value="-f"/>\r
-            <arg value="${basedir}/pom.xml"/>\r
-            <arg value="-N"/>\r
-            <arg value="${mvn.opts}"/>\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c"/>\r
-            <arg value="mvn.bat"/>\r
-            <arg value="package"/>\r
-            <arg value="-Dmaven.test.skip=true"/>\r
-            <arg value="-f"/>\r
-            <arg value="${basedir}/pom.xml"/>\r
-            <arg value="-N"/>\r
-            <arg value="${mvn.opts}"/>\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="package,install-unix,install-windows" description="Install"/>\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install"/>\r
-            <arg value="-Dmaven.test.skip=true"/>\r
-            <arg value="-f"/>\r
-            <arg value="${basedir}/pom.xml"/>\r
-            <arg value="-N"/>\r
-            <arg value="${mvn.opts}"/>\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c"/>\r
-            <arg value="mvn.bat"/>\r
-            <arg value="install"/>\r
-            <arg value="-Dmaven.test.skip=true"/>\r
-            <arg value="-f"/>\r
-            <arg value="${basedir}/pom.xml"/>\r
-            <arg value="-N"/>\r
-            <arg value="${mvn.opts}"/>\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows" description="Delete target directories">\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean"/>\r
-            <arg value="${mvn.opts}"/>\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c"/>\r
-            <arg value="mvn.bat"/>\r
-            <arg value="clean"/>\r
-            <arg value="${mvn.opts}"/>\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests"/>\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test"/>\r
-            <arg value="${mvn.opts}"/>\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c"/>\r
-            <arg value="mvn.bat"/>\r
-            <arg value="test"/>\r
-            <arg value="${mvn.opts}"/>\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="package"\r
-        description="deploy nuxeo server libs to ${jee.server.cspace}">\r
-        <copy todir="${jee.server.cspace}/nuxeo-server">\r
-            <fileset dir="${basedir}/nuxeo-server/${nuxeo.release}">\r
-                <exclude name="**/config/*-repo-config.xml"/>\r
-            </fileset>\r
-        </copy>\r
-        <echo message="Copying Nuxeo prototype repo config file ..."/>\r
-        <copy todir="${jee.server.cspace}/cspace/config/services" overwrite="true">\r
-            <fileset file="${basedir}/nuxeo-server/${nuxeo.release}/config/proto-repo-config.xml"/>\r
-            <filterset>\r
-                <filter token="DB_NUXEO_NAME" value="${db.nuxeo.name}"/>\r
-                <!-- The actual database name will be substituted during system -->\r
-                <!-- startup, within each repository-specific config file that is 'cloned' from the -->\r
-                <!-- prototype repo config file being written to here. -->\r
-                <filter token="DB_SERVER_HOSTNAME" value="${db.host}"/>\r
-                <filter token="DB_PORT" value="${db.port}"/>\r
-                <filter token="DB_JDBC_OPTIONS" value="${db.jdbc.urloptions.encoded}"/>\r
-                <filter token="XA_DATASOURCE" value="${db.xaDataSource}"/>\r
-                <filter token="NUXEO_USER" value="${db.nuxeo.user}"/>\r
-                <filter token="NUXEO_PW" value="${db.nuxeo.user.password}"/>\r
-            </filterset>\r
-        </copy>\r
-        <ant antfile="nuxeo-platform-collectionspace/build.xml" target="deploy" inheritall="false"/>\r
-        <ant antfile="nuxeo-platform-listener/build.xml" target="deploy" inheritall="false"/>\r
-        <!-- Disabled due to integration issues between ImageMagick and Ghostscript on Linux systems        \r
-        <ant antfile="nuxeo-platform-thumbnail/build.xml" target="deploy" inheritall="false"/>\r
-        -->\r
-    </target>\r
-\r
-    <target name="undeploy" description="undeploy nuxeo server libs from ${jee.server.cspace}">\r
-        <delete dir="${jee.server.cspace}/nuxeo-server/bundles"/>\r
-        <delete dir="${jee.server.cspace}/nuxeo-server/config"/>\r
-        <delete dir="${jee.server.cspace}/nuxeo-server/lib"/>\r
-        <delete file="${jee.server.cspace}/cspace/config/services/proto-repo-config.xml"\r
-            failonerror="false"/>\r
-        <ant antfile="nuxeo-platform-collectionspace/build.xml" target="undeploy" inheritall="false"/>\r
-        <ant antfile="nuxeo-platform-listener/build.xml" target="undeploy" inheritall="false"/>\r
-        <ant antfile="nuxeo-platform-quote/build.xml" target="undeploy" inheritall="false"/>\r
-        <ant antfile="nuxeo-platform-quote-api/build.xml" target="undeploy" inheritall="false"/>\r
-        <!-- Disabled due to integration issues between ImageMagick and Ghostscript on Linux systems\r
-               <ant antfile="nuxeo-platform-thumbnail/build.xml" target="undeploy" inheritall="false"/>\r
-               -->\r
-    </target>\r
-\r
-    <target name="dist" description="generate distribution for nuxeo server libs" depends="package">\r
-        <copy todir="${services.trunk}/${dist.server.cspace}/nuxeo-server">\r
-            <fileset dir="${basedir}/nuxeo-server"/>\r
-        </copy>\r
-    </target>\r
-\r
-</project>\r
+<project name="nuxeo" default="package" basedir=".">
+    <description> collectionspace nuxeo </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="-V"/>
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+    <property name="dist" location="dist"/>
+
+    <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="package,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="package"
+        description="deploy nuxeo server libs to ${jee.server.cspace}">
+        <copy todir="${jee.server.cspace}/nuxeo-server">
+            <fileset dir="${basedir}/nuxeo-server/${nuxeo.release}">
+                <exclude name="**/config/*-repo-config.xml"/>
+            </fileset>
+        </copy>
+        <echo message="Copying Nuxeo prototype repo config file ..."/>
+        <copy todir="${jee.server.cspace}/cspace/config/services" overwrite="true">
+            <fileset file="${basedir}/nuxeo-server/${nuxeo.release}/config/proto-repo-config.xml"/>
+            <filterset>
+                <filter token="DB_NUXEO_NAME" value="${db.nuxeo.name}"/>
+                <!-- The actual database name will be substituted during system -->
+                <!-- startup, within each repository-specific config file that is 'cloned' from the -->
+                <!-- prototype repo config file being written to here. -->
+                <filter token="DB_SERVER_HOSTNAME" value="${db.host}"/>
+                <filter token="DB_PORT" value="${db.port}"/>
+                <filter token="DB_JDBC_OPTIONS" value="${db.jdbc.urloptions.encoded}"/>
+                <filter token="XA_DATASOURCE" value="${db.xaDataSource}"/>
+                <filter token="NUXEO_USER" value="${db.nuxeo.user}"/>
+                <filter token="NUXEO_PW" value="${db.nuxeo.user.password}"/>
+            </filterset>
+        </copy>
+        <ant antfile="nuxeo-platform-collectionspace/build.xml" target="deploy" inheritall="false"/>
+        <ant antfile="nuxeo-platform-listener/build.xml" target="deploy" inheritall="false"/>
+        <!-- Disabled due to integration issues between ImageMagick and Ghostscript on Linux systems        
+        <ant antfile="nuxeo-platform-thumbnail/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy" description="undeploy nuxeo server libs from ${jee.server.cspace}">
+        <delete dir="${jee.server.cspace}/nuxeo-server/bundles"/>
+        <delete dir="${jee.server.cspace}/nuxeo-server/config"/>
+        <delete dir="${jee.server.cspace}/nuxeo-server/lib"/>
+        <delete file="${jee.server.cspace}/cspace/config/services/proto-repo-config.xml"
+            failonerror="false"/>
+        <ant antfile="nuxeo-platform-collectionspace/build.xml" target="undeploy" inheritall="false"/>
+        <ant antfile="nuxeo-platform-listener/build.xml" target="undeploy" inheritall="false"/>
+        <ant antfile="nuxeo-platform-quote/build.xml" target="undeploy" inheritall="false"/>
+        <ant antfile="nuxeo-platform-quote-api/build.xml" target="undeploy" inheritall="false"/>
+        <!-- Disabled due to integration issues between ImageMagick and Ghostscript on Linux systems
+               <ant antfile="nuxeo-platform-thumbnail/build.xml" target="undeploy" inheritall="false"/>
+               -->
+    </target>
+
+    <target name="dist" description="generate distribution for nuxeo server libs" depends="package">
+        <copy todir="${services.trunk}/${dist.server.cspace}/nuxeo-server">
+            <fileset dir="${basedir}/nuxeo-server"/>
+        </copy>
+    </target>
+
+</project>
index 8fa6e5589bb88ab9c073b3e2058d2bd248c7b231..fb636d6b2ab6fa3a25c8bd48e80ee434a7615012 100644 (file)
@@ -1,18 +1,18 @@
-Manifest-Version: 1.0 \r
-Bundle-ManifestVersion: 1 \r
-Bundle-Name: org.collectionspace.${ServiceName}.${TenantLabel}\r
-Bundle-SymbolicName: org.collectionspace.${ServiceName}.${TenantLabel};singleton:=true \r
-Bundle-Version: 1.0.0\r
-Bundle-Localization: plugin\r
-Bundle-Vendor: Nuxeo \r
-Require-Bundle: org.nuxeo.runtime, \r
- org.nuxeo.ecm.core.api,\r
- org.nuxeo.ecm.core,\r
- org.nuxeo.ecm.webapp.core,\r
- org.collectionspace.collectionspace_core,\r
- org.collectionspace.${ServiceName}\r
-Provide-Package: org.collectionspace.${ServiceName}.${TenantLabel}\r
-Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
- OSGI-INF/life-cycle-contrib.xml,\r
- OSGI-INF/ecm-types-contrib.xml,\r
- OSGI-INF/layouts-contrib.xml\r
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: org.collectionspace.${ServiceName}.${TenantLabel}
+Bundle-SymbolicName: org.collectionspace.${ServiceName}.${TenantLabel};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.webapp.core,
+ org.collectionspace.collectionspace_core,
+ org.collectionspace.${ServiceName}
+Provide-Package: org.collectionspace.${ServiceName}.${TenantLabel}
+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
index d9ab43c8701d84326074e15a9267baf3b79cabac..2a1f5c469abace7da9e852c0386c84aafb3e33fe 100644 (file)
@@ -1,18 +1,18 @@
-Manifest-Version: 1.0 \r
-Bundle-ManifestVersion: 1 \r
-Bundle-Name: org.collectionspace.${ServiceName}\r
-Bundle-SymbolicName: org.collectionspace.${ServiceName};singleton:=true \r
-Bundle-Version: 1.0.0\r
-Bundle-Localization: plugin\r
-Bundle-Vendor: Nuxeo \r
-Require-Bundle: org.nuxeo.runtime, \r
- org.nuxeo.ecm.core.api,\r
- org.nuxeo.ecm.core,\r
- org.nuxeo.ecm.webapp.core,\r
- org.collectionspace.collectionspace_core\r
-Provide-Package: org.collectionspace.${ServiceName}\r
-Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
- OSGI-INF/life-cycle-contrib.xml,\r
- OSGI-INF/ecm-types-contrib.xml,\r
- OSGI-INF/layouts-contrib.xml\r
-\r
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: org.collectionspace.${ServiceName}
+Bundle-SymbolicName: org.collectionspace.${ServiceName};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.webapp.core,
+ org.collectionspace.collectionspace_core
+Provide-Package: org.collectionspace.${ServiceName}
+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
+
index 226075b98d5cc6418a9ce5ee3688ac7e83fc4b2c..270abbd5f94b6ef70ed7b24956b6ef7701815222 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0"?>\r
-<fragment>\r
-\r
-  <extension target="application#MODULE">\r
-    <module>\r
-      <java>${bundle.fileName}</java>\r
-    </module>\r
-  </extension>\r
-  \r
-</fragment>\r
+<?xml version="1.0"?>
+<fragment>
+
+  <extension target="application#MODULE">
+    <module>
+      <java>${bundle.fileName}</java>
+    </module>
+  </extension>
+  
+</fragment>
index 70a7a9b9344e1603b6f0281f3afeb373e3b90161..f9c689c3c77655cf94502f82f777d9c6257a2661 100644 (file)
@@ -1,33 +1,33 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-\r
-  <parent>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.3rdparty.nuxeo</artifactId>\r
-    <version>4.2-SNAPSHOT</version>\r
-  </parent>\r
-\r
-  <modelVersion>4.0.0</modelVersion>\r
-  <artifactId>org.collectionspace.services.3rdparty.nuxeo.collectionspace_core</artifactId>\r
-  <name>Nuxeo CollectionSpace core extension</name>\r
-  <description> Nuxeo Enterprise Platform: CS extensions </description>\r
-\r
-  <build>\r
-    <plugins>\r
-      <plugin>\r
-        <groupId>org.apache.maven.plugins</groupId>\r
-        <artifactId>maven-jar-plugin</artifactId>\r
-        <configuration>\r
-          <archive>\r
-            <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>\r
-            <manifestEntries>\r
-              <Bundle-Version>${eclipseVersion}</Bundle-Version>\r
-              <Bundle-ManifestVersion>2</Bundle-ManifestVersion>\r
-            </manifestEntries>\r
-          </archive>\r
-        </configuration>\r
-      </plugin>\r
-    </plugins>\r
-  </build>\r
-</project>\r
+<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.3rdparty.nuxeo</artifactId>
+    <version>4.2-SNAPSHOT</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>org.collectionspace.services.3rdparty.nuxeo.collectionspace_core</artifactId>
+  <name>Nuxeo CollectionSpace core extension</name>
+  <description> Nuxeo Enterprise Platform: CS extensions </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
+            <manifestEntries>
+              <Bundle-Version>${eclipseVersion}</Bundle-Version>
+              <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+            </manifestEntries>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
index 7d63efb52e73c770a5f5098956bf4ffea55045b6..e5cac979594d89199ff3a3e92ef8cdc309a9a223 100644 (file)
@@ -1,19 +1,19 @@
-Manifest-Version: 1.0 \r
-Bundle-ManifestVersion: 1 \r
-Bundle-Name: org.collectionspace.shared\r
-Bundle-SymbolicName: org.collectionspace.shared;singleton:=true \r
-Bundle-Version: 1.0.0\r
-Bundle-Localization: plugin\r
-Bundle-Vendor: Nuxeo\r
-Require-Bundle: org.nuxeo.runtime, \r
- org.nuxeo.ecm.core.api,\r
- org.nuxeo.ecm.core,\r
- org.nuxeo.ecm.webapp.core\r
-Provide-Package: org.collectionspace.shared\r
-Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
- OSGI-INF/default-life-cycle-contrib.xml,\r
- OSGI-INF/ecm-types-contrib.xml,\r
- OSGI-INF/layouts-contrib.xml,\r
- OSGI-INF/querymodel-contrib.xml\r
-\r
-\r
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: org.collectionspace.shared
+Bundle-SymbolicName: org.collectionspace.shared;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.webapp.core
+Provide-Package: org.collectionspace.shared
+Nuxeo-Component: OSGI-INF/core-types-contrib.xml,
+ OSGI-INF/default-life-cycle-contrib.xml,
+ OSGI-INF/ecm-types-contrib.xml,
+ OSGI-INF/layouts-contrib.xml,
+ OSGI-INF/querymodel-contrib.xml
+
+
index 226075b98d5cc6418a9ce5ee3688ac7e83fc4b2c..270abbd5f94b6ef70ed7b24956b6ef7701815222 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0"?>\r
-<fragment>\r
-\r
-  <extension target="application#MODULE">\r
-    <module>\r
-      <java>${bundle.fileName}</java>\r
-    </module>\r
-  </extension>\r
-  \r
-</fragment>\r
+<?xml version="1.0"?>
+<fragment>
+
+  <extension target="application#MODULE">
+    <module>
+      <java>${bundle.fileName}</java>
+    </module>
+  </extension>
+  
+</fragment>
index 34e84b3d4109d4aff38d9c580195d3693c876799..b2cf492a65edb6042027c79013f7ccbea195526f 100644 (file)
@@ -1,20 +1,20 @@
-<?xml version="1.0"?>\r
-\r
-<component name="com.collectionspace.query.model.override">\r
-  <require>org.nuxeo.ecm.webapp.querymodel.DefaultQueryModels</require>\r
-  <extension\r
-    target="org.nuxeo.ecm.core.search.api.client.querymodel.QueryModelService"\r
-    point="model">\r
-    <queryModel name="CURRENT_DOC_CHILDREN">\r
-      <pattern>\r
-        SELECT * FROM Document WHERE ecm:parentId = ? AND\r
-        ecm:isCheckedInVersion = 0 AND ecm:mixinType != 'HiddenInNavigation'\r
-        AND ecm:currentLifeCycleState != 'deleted' AND ecm:isProxy = 0 \r
-      </pattern>\r
-      <sortable value="true" defaultSortColumn="dc:created"\r
-        defaultSortAscending="false" />\r
-      <max>50</max>\r
-    </queryModel>\r
-</extension>\r
-</component>\r
-\r
+<?xml version="1.0"?>
+
+<component name="com.collectionspace.query.model.override">
+  <require>org.nuxeo.ecm.webapp.querymodel.DefaultQueryModels</require>
+  <extension
+    target="org.nuxeo.ecm.core.search.api.client.querymodel.QueryModelService"
+    point="model">
+    <queryModel name="CURRENT_DOC_CHILDREN">
+      <pattern>
+        SELECT * FROM Document WHERE ecm:parentId = ? AND
+        ecm:isCheckedInVersion = 0 AND ecm:mixinType != 'HiddenInNavigation'
+        AND ecm:currentLifeCycleState != 'deleted' AND ecm:isProxy = 0 
+      </pattern>
+      <sortable value="true" defaultSortColumn="dc:created"
+        defaultSortAscending="false" />
+      <max>50</max>
+    </queryModel>
+</extension>
+</component>
+
index 75b6087cf167c6e2ab2194aec10b563e0b0f7fcf..085c73a7a7870ddb4a22dac733bf60a8ffb35d1b 100644 (file)
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
-    Older (?) CollectionObject Core Schema for Nuxeo EP\r
-\r
-    $LastChangedRevision: 2099 $\r
-    $LastChangedDate: 2010-05-14 17:24:06 -0700 (Fri, 14 May 2010) $\r
--->\r
-\r
-<xs:schema \r
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-    xmlns:ns="http://collectionspace.org/subitem/"\r
-    xmlns="http://collectionspace.org/subitem/"\r
-    targetNamespace="http://collectionspace.org/subitem/"\r
-    version="0.1">\r
-\r
-    <!--  SubItem Common Information Group -->\r
-    <!--  owner is the csid of the owning LocationAuthority -->\r
-    <xs:element name="owner" type="xs:string" />\r
-    <xs:element name="isPrimary" type="xs:boolean"/>\r
-    <xs:element name="order" type="xs:unsignedInt"/>\r
-</xs:schema>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Older (?) CollectionObject Core Schema for Nuxeo EP
+
+    $LastChangedRevision: 2099 $
+    $LastChangedDate: 2010-05-14 17:24:06 -0700 (Fri, 14 May 2010) $
+-->
+
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/subitem/"
+    xmlns="http://collectionspace.org/subitem/"
+    targetNamespace="http://collectionspace.org/subitem/"
+    version="0.1">
+
+    <!--  SubItem Common Information Group -->
+    <!--  owner is the csid of the owning LocationAuthority -->
+    <xs:element name="owner" type="xs:string" />
+    <xs:element name="isPrimary" type="xs:boolean"/>
+    <xs:element name="order" type="xs:unsignedInt"/>
+</xs:schema>
index 9f61b74b9425022269571579e37094c1c539a63d..470c6051839d01027c1e09f9df64559f8abec624 100644 (file)
@@ -1,50 +1,50 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" \r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-       <modelVersion>4.0.0</modelVersion>\r
-       <parent>\r
-               <groupId>org.collectionspace.services</groupId>\r
-               <artifactId>org.collectionspace.services.3rdparty.nuxeo</artifactId>\r
-               <version>4.2-SNAPSHOT</version>\r
-       </parent>\r
-\r
-       <groupId>org.collectionspace.services</groupId>\r
-       <artifactId>org.collectionspace.services.3rdparty.nuxeo.quote-api</artifactId>\r
-    <name>org.collectionspace.services.3rdparty.nuxeo.quote-api</name>\r
-    <description>\r
-               Nuxeo Enterprise Platform: CollectionSpace's Nuxeo Quote Service API.\r
-       </description>\r
-\r
-       <dependencies>\r
-               <dependency>\r
-                 <groupId>org.nuxeo.ecm.core</groupId>\r
-                 <artifactId>nuxeo-core-api</artifactId>\r
-                 <version>${nuxeo.core.version}</version>\r
-               </dependency>\r
-       </dependencies>\r
-\r
-    <build>\r
-               <resources>\r
-            <resource>\r
-                <directory>src/main/resources</directory>\r
-                <filtering>true</filtering>\r
-            </resource>\r
-               </resources>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-jar-plugin</artifactId>\r
-                <configuration>\r
-                    <archive>\r
-                        <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>\r
-                        <manifestEntries>\r
-                            <Bundle-Version>${eclipseVersion}</Bundle-Version>\r
-                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>\r
-                        </manifestEntries>\r
-                    </archive>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-       \r
-</project>\r
+<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">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.collectionspace.services</groupId>
+               <artifactId>org.collectionspace.services.3rdparty.nuxeo</artifactId>
+               <version>4.2-SNAPSHOT</version>
+       </parent>
+
+       <groupId>org.collectionspace.services</groupId>
+       <artifactId>org.collectionspace.services.3rdparty.nuxeo.quote-api</artifactId>
+    <name>org.collectionspace.services.3rdparty.nuxeo.quote-api</name>
+    <description>
+               Nuxeo Enterprise Platform: CollectionSpace's Nuxeo Quote Service API.
+       </description>
+
+       <dependencies>
+               <dependency>
+                 <groupId>org.nuxeo.ecm.core</groupId>
+                 <artifactId>nuxeo-core-api</artifactId>
+                 <version>${nuxeo.core.version}</version>
+               </dependency>
+       </dependencies>
+
+    <build>
+               <resources>
+            <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> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
+                        <manifestEntries>
+                            <Bundle-Version>${eclipseVersion}</Bundle-Version>
+                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+       
+</project>
index cbee875ba6ddb0dadab286daf7ccec2f6f64191f..b1e3f5a2638797271cbc9b91b856c05ed6942c8f 100644 (file)
-                 GNU LESSER GENERAL PUBLIC LICENSE\r
-                      Version 2.1, February 1999\r
-\r
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- Everyone is permitted to copy and distribute verbatim copies\r
- of this license document, but changing it is not allowed.\r
-\r
-[This is the first released version of the Lesser GPL.  It also counts\r
- as the successor of the GNU Library Public License, version 2, hence\r
- the version number 2.1.]\r
-\r
-                           Preamble\r
-\r
-  The licenses for most software are designed to take away your\r
-freedom to share and change it.  By contrast, the GNU General Public\r
-Licenses are intended to guarantee your freedom to share and change\r
-free software--to make sure the software is free for all its users.\r
-\r
-  This license, the Lesser General Public License, applies to some\r
-specially designated software packages--typically libraries--of the\r
-Free Software Foundation and other authors who decide to use it.  You\r
-can use it too, but we suggest you first think carefully about whether\r
-this license or the ordinary General Public License is the better\r
-strategy to use in any particular case, based on the explanations below.\r
-\r
-  When we speak of free software, we are referring to freedom of use,\r
-not price.  Our General Public Licenses are designed to make sure that\r
-you have the freedom to distribute copies of free software (and charge\r
-for this service if you wish); that you receive source code or can get\r
-it if you want it; that you can change the software and use pieces of\r
-it in new free programs; and that you are informed that you can do\r
-these things.\r
-\r
-  To protect your rights, we need to make restrictions that forbid\r
-distributors to deny you these rights or to ask you to surrender these\r
-rights.  These restrictions translate to certain responsibilities for\r
-you if you distribute copies of the library or if you modify it.\r
-\r
-  For example, if you distribute copies of the library, whether gratis\r
-or for a fee, you must give the recipients all the rights that we gave\r
-you.  You must make sure that they, too, receive or can get the source\r
-code.  If you link other code with the library, you must provide\r
-complete object files to the recipients, so that they can relink them\r
-with the library after making changes to the library and recompiling\r
-it.  And you must show them these terms so they know their rights.\r
-\r
-  We protect your rights with a two-step method: (1) we copyright the\r
-library, and (2) we offer you this license, which gives you legal\r
-permission to copy, distribute and/or modify the library.\r
-\r
-  To protect each distributor, we want to make it very clear that\r
-there is no warranty for the free library.  Also, if the library is\r
-modified by someone else and passed on, the recipients should know\r
-that what they have is not the original version, so that the original\r
-author's reputation will not be affected by problems that might be\r
-introduced by others.\r
-\f\r
-  Finally, software patents pose a constant threat to the existence of\r
-any free program.  We wish to make sure that a company cannot\r
-effectively restrict the users of a free program by obtaining a\r
-restrictive license from a patent holder.  Therefore, we insist that\r
-any patent license obtained for a version of the library must be\r
-consistent with the full freedom of use specified in this license.\r
-\r
-  Most GNU software, including some libraries, is covered by the\r
-ordinary GNU General Public License.  This license, the GNU Lesser\r
-General Public License, applies to certain designated libraries, and\r
-is quite different from the ordinary General Public License.  We use\r
-this license for certain libraries in order to permit linking those\r
-libraries into non-free programs.\r
-\r
-  When a program is linked with a library, whether statically or using\r
-a shared library, the combination of the two is legally speaking a\r
-combined work, a derivative of the original library.  The ordinary\r
-General Public License therefore permits such linking only if the\r
-entire combination fits its criteria of freedom.  The Lesser General\r
-Public License permits more lax criteria for linking other code with\r
-the library.\r
-\r
-  We call this license the "Lesser" General Public License because it\r
-does Less to protect the user's freedom than the ordinary General\r
-Public License.  It also provides other free software developers Less\r
-of an advantage over competing non-free programs.  These disadvantages\r
-are the reason we use the ordinary General Public License for many\r
-libraries.  However, the Lesser license provides advantages in certain\r
-special circumstances.\r
-\r
-  For example, on rare occasions, there may be a special need to\r
-encourage the widest possible use of a certain library, so that it becomes\r
-a de-facto standard.  To achieve this, non-free programs must be\r
-allowed to use the library.  A more frequent case is that a free\r
-library does the same job as widely used non-free libraries.  In this\r
-case, there is little to gain by limiting the free library to free\r
-software only, so we use the Lesser General Public License.\r
-\r
-  In other cases, permission to use a particular library in non-free\r
-programs enables a greater number of people to use a large body of\r
-free software.  For example, permission to use the GNU C Library in\r
-non-free programs enables many more people to use the whole GNU\r
-operating system, as well as its variant, the GNU/Linux operating\r
-system.\r
-\r
-  Although the Lesser General Public License is Less protective of the\r
-users' freedom, it does ensure that the user of a program that is\r
-linked with the Library has the freedom and the wherewithal to run\r
-that program using a modified version of the Library.\r
-\r
-  The precise terms and conditions for copying, distribution and\r
-modification follow.  Pay close attention to the difference between a\r
-"work based on the library" and a "work that uses the library".  The\r
-former contains code derived from the library, whereas the latter must\r
-be combined with the library in order to run.\r
-\f\r
-                 GNU LESSER GENERAL PUBLIC LICENSE\r
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
-\r
-  0. This License Agreement applies to any software library or other\r
-program which contains a notice placed by the copyright holder or\r
-other authorized party saying it may be distributed under the terms of\r
-this Lesser General Public License (also called "this License").\r
-Each licensee is addressed as "you".\r
-\r
-  A "library" means a collection of software functions and/or data\r
-prepared so as to be conveniently linked with application programs\r
-(which use some of those functions and data) to form executables.\r
-\r
-  The "Library", below, refers to any such software library or work\r
-which has been distributed under these terms.  A "work based on the\r
-Library" means either the Library or any derivative work under\r
-copyright law: that is to say, a work containing the Library or a\r
-portion of it, either verbatim or with modifications and/or translated\r
-straightforwardly into another language.  (Hereinafter, translation is\r
-included without limitation in the term "modification".)\r
-\r
-  "Source code" for a work means the preferred form of the work for\r
-making modifications to it.  For a library, complete source code means\r
-all the source code for all modules it contains, plus any associated\r
-interface definition files, plus the scripts used to control compilation\r
-and installation of the library.\r
-\r
-  Activities other than copying, distribution and modification are not\r
-covered by this License; they are outside its scope.  The act of\r
-running a program using the Library is not restricted, and output from\r
-such a program is covered only if its contents constitute a work based\r
-on the Library (independent of the use of the Library in a tool for\r
-writing it).  Whether that is true depends on what the Library does\r
-and what the program that uses the Library does.\r
-  \r
-  1. You may copy and distribute verbatim copies of the Library's\r
-complete source code as you receive it, in any medium, provided that\r
-you conspicuously and appropriately publish on each copy an\r
-appropriate copyright notice and disclaimer of warranty; keep intact\r
-all the notices that refer to this License and to the absence of any\r
-warranty; and distribute a copy of this License along with the\r
-Library.\r
-\r
-  You may charge a fee for the physical act of transferring a copy,\r
-and you may at your option offer warranty protection in exchange for a\r
-fee.\r
-\f\r
-  2. You may modify your copy or copies of the Library or any portion\r
-of it, thus forming a work based on the Library, and copy and\r
-distribute such modifications or work under the terms of Section 1\r
-above, provided that you also meet all of these conditions:\r
-\r
-    a) The modified work must itself be a software library.\r
-\r
-    b) You must cause the files modified to carry prominent notices\r
-    stating that you changed the files and the date of any change.\r
-\r
-    c) You must cause the whole of the work to be licensed at no\r
-    charge to all third parties under the terms of this License.\r
-\r
-    d) If a facility in the modified Library refers to a function or a\r
-    table of data to be supplied by an application program that uses\r
-    the facility, other than as an argument passed when the facility\r
-    is invoked, then you must make a good faith effort to ensure that,\r
-    in the event an application does not supply such function or\r
-    table, the facility still operates, and performs whatever part of\r
-    its purpose remains meaningful.\r
-\r
-    (For example, a function in a library to compute square roots has\r
-    a purpose that is entirely well-defined independent of the\r
-    application.  Therefore, Subsection 2d requires that any\r
-    application-supplied function or table used by this function must\r
-    be optional: if the application does not supply it, the square\r
-    root function must still compute square roots.)\r
-\r
-These requirements apply to the modified work as a whole.  If\r
-identifiable sections of that work are not derived from the Library,\r
-and can be reasonably considered independent and separate works in\r
-themselves, then this License, and its terms, do not apply to those\r
-sections when you distribute them as separate works.  But when you\r
-distribute the same sections as part of a whole which is a work based\r
-on the Library, the distribution of the whole must be on the terms of\r
-this License, whose permissions for other licensees extend to the\r
-entire whole, and thus to each and every part regardless of who wrote\r
-it.\r
-\r
-Thus, it is not the intent of this section to claim rights or contest\r
-your rights to work written entirely by you; rather, the intent is to\r
-exercise the right to control the distribution of derivative or\r
-collective works based on the Library.\r
-\r
-In addition, mere aggregation of another work not based on the Library\r
-with the Library (or with a work based on the Library) on a volume of\r
-a storage or distribution medium does not bring the other work under\r
-the scope of this License.\r
-\r
-  3. You may opt to apply the terms of the ordinary GNU General Public\r
-License instead of this License to a given copy of the Library.  To do\r
-this, you must alter all the notices that refer to this License, so\r
-that they refer to the ordinary GNU General Public License, version 2,\r
-instead of to this License.  (If a newer version than version 2 of the\r
-ordinary GNU General Public License has appeared, then you can specify\r
-that version instead if you wish.)  Do not make any other change in\r
-these notices.\r
-\f\r
-  Once this change is made in a given copy, it is irreversible for\r
-that copy, so the ordinary GNU General Public License applies to all\r
-subsequent copies and derivative works made from that copy.\r
-\r
-  This option is useful when you wish to copy part of the code of\r
-the Library into a program that is not a library.\r
-\r
-  4. You may copy and distribute the Library (or a portion or\r
-derivative of it, under Section 2) in object code or executable form\r
-under the terms of Sections 1 and 2 above provided that you accompany\r
-it with the complete corresponding machine-readable source code, which\r
-must be distributed under the terms of Sections 1 and 2 above on a\r
-medium customarily used for software interchange.\r
-\r
-  If distribution of object code is made by offering access to copy\r
-from a designated place, then offering equivalent access to copy the\r
-source code from the same place satisfies the requirement to\r
-distribute the source code, even though third parties are not\r
-compelled to copy the source along with the object code.\r
-\r
-  5. A program that contains no derivative of any portion of the\r
-Library, but is designed to work with the Library by being compiled or\r
-linked with it, is called a "work that uses the Library".  Such a\r
-work, in isolation, is not a derivative work of the Library, and\r
-therefore falls outside the scope of this License.\r
-\r
-  However, linking a "work that uses the Library" with the Library\r
-creates an executable that is a derivative of the Library (because it\r
-contains portions of the Library), rather than a "work that uses the\r
-library".  The executable is therefore covered by this License.\r
-Section 6 states terms for distribution of such executables.\r
-\r
-  When a "work that uses the Library" uses material from a header file\r
-that is part of the Library, the object code for the work may be a\r
-derivative work of the Library even though the source code is not.\r
-Whether this is true is especially significant if the work can be\r
-linked without the Library, or if the work is itself a library.  The\r
-threshold for this to be true is not precisely defined by law.\r
-\r
-  If such an object file uses only numerical parameters, data\r
-structure layouts and accessors, and small macros and small inline\r
-functions (ten lines or less in length), then the use of the object\r
-file is unrestricted, regardless of whether it is legally a derivative\r
-work.  (Executables containing this object code plus portions of the\r
-Library will still fall under Section 6.)\r
-\r
-  Otherwise, if the work is a derivative of the Library, you may\r
-distribute the object code for the work under the terms of Section 6.\r
-Any executables containing that work also fall under Section 6,\r
-whether or not they are linked directly with the Library itself.\r
-\f\r
-  6. As an exception to the Sections above, you may also combine or\r
-link a "work that uses the Library" with the Library to produce a\r
-work containing portions of the Library, and distribute that work\r
-under terms of your choice, provided that the terms permit\r
-modification of the work for the customer's own use and reverse\r
-engineering for debugging such modifications.\r
-\r
-  You must give prominent notice with each copy of the work that the\r
-Library is used in it and that the Library and its use are covered by\r
-this License.  You must supply a copy of this License.  If the work\r
-during execution displays copyright notices, you must include the\r
-copyright notice for the Library among them, as well as a reference\r
-directing the user to the copy of this License.  Also, you must do one\r
-of these things:\r
-\r
-    a) Accompany the work with the complete corresponding\r
-    machine-readable source code for the Library including whatever\r
-    changes were used in the work (which must be distributed under\r
-    Sections 1 and 2 above); and, if the work is an executable linked\r
-    with the Library, with the complete machine-readable "work that\r
-    uses the Library", as object code and/or source code, so that the\r
-    user can modify the Library and then relink to produce a modified\r
-    executable containing the modified Library.  (It is understood\r
-    that the user who changes the contents of definitions files in the\r
-    Library will not necessarily be able to recompile the application\r
-    to use the modified definitions.)\r
-\r
-    b) Use a suitable shared library mechanism for linking with the\r
-    Library.  A suitable mechanism is one that (1) uses at run time a\r
-    copy of the library already present on the user's computer system,\r
-    rather than copying library functions into the executable, and (2)\r
-    will operate properly with a modified version of the library, if\r
-    the user installs one, as long as the modified version is\r
-    interface-compatible with the version that the work was made with.\r
-\r
-    c) Accompany the work with a written offer, valid for at\r
-    least three years, to give the same user the materials\r
-    specified in Subsection 6a, above, for a charge no more\r
-    than the cost of performing this distribution.\r
-\r
-    d) If distribution of the work is made by offering access to copy\r
-    from a designated place, offer equivalent access to copy the above\r
-    specified materials from the same place.\r
-\r
-    e) Verify that the user has already received a copy of these\r
-    materials or that you have already sent this user a copy.\r
-\r
-  For an executable, the required form of the "work that uses the\r
-Library" must include any data and utility programs needed for\r
-reproducing the executable from it.  However, as a special exception,\r
-the materials to be distributed need not include anything that is\r
-normally distributed (in either source or binary form) with the major\r
-components (compiler, kernel, and so on) of the operating system on\r
-which the executable runs, unless that component itself accompanies\r
-the executable.\r
-\r
-  It may happen that this requirement contradicts the license\r
-restrictions of other proprietary libraries that do not normally\r
-accompany the operating system.  Such a contradiction means you cannot\r
-use both them and the Library together in an executable that you\r
-distribute.\r
-\f\r
-  7. You may place library facilities that are a work based on the\r
-Library side-by-side in a single library together with other library\r
-facilities not covered by this License, and distribute such a combined\r
-library, provided that the separate distribution of the work based on\r
-the Library and of the other library facilities is otherwise\r
-permitted, and provided that you do these two things:\r
-\r
-    a) Accompany the combined library with a copy of the same work\r
-    based on the Library, uncombined with any other library\r
-    facilities.  This must be distributed under the terms of the\r
-    Sections above.\r
-\r
-    b) Give prominent notice with the combined library of the fact\r
-    that part of it is a work based on the Library, and explaining\r
-    where to find the accompanying uncombined form of the same work.\r
-\r
-  8. You may not copy, modify, sublicense, link with, or distribute\r
-the Library except as expressly provided under this License.  Any\r
-attempt otherwise to copy, modify, sublicense, link with, or\r
-distribute the Library is void, and will automatically terminate your\r
-rights under this License.  However, parties who have received copies,\r
-or rights, from you under this License will not have their licenses\r
-terminated so long as such parties remain in full compliance.\r
-\r
-  9. You are not required to accept this License, since you have not\r
-signed it.  However, nothing else grants you permission to modify or\r
-distribute the Library or its derivative works.  These actions are\r
-prohibited by law if you do not accept this License.  Therefore, by\r
-modifying or distributing the Library (or any work based on the\r
-Library), you indicate your acceptance of this License to do so, and\r
-all its terms and conditions for copying, distributing or modifying\r
-the Library or works based on it.\r
-\r
-  10. Each time you redistribute the Library (or any work based on the\r
-Library), the recipient automatically receives a license from the\r
-original licensor to copy, distribute, link with or modify the Library\r
-subject to these terms and conditions.  You may not impose any further\r
-restrictions on the recipients' exercise of the rights granted herein.\r
-You are not responsible for enforcing compliance by third parties with\r
-this License.\r
-\f\r
-  11. If, as a consequence of a court judgment or allegation of patent\r
-infringement or for any other reason (not limited to patent issues),\r
-conditions are imposed on you (whether by court order, agreement or\r
-otherwise) that contradict the conditions of this License, they do not\r
-excuse you from the conditions of this License.  If you cannot\r
-distribute so as to satisfy simultaneously your obligations under this\r
-License and any other pertinent obligations, then as a consequence you\r
-may not distribute the Library at all.  For example, if a patent\r
-license would not permit royalty-free redistribution of the Library by\r
-all those who receive copies directly or indirectly through you, then\r
-the only way you could satisfy both it and this License would be to\r
-refrain entirely from distribution of the Library.\r
-\r
-If any portion of this section is held invalid or unenforceable under any\r
-particular circumstance, the balance of the section is intended to apply,\r
-and the section as a whole is intended to apply in other circumstances.\r
-\r
-It is not the purpose of this section to induce you to infringe any\r
-patents or other property right claims or to contest validity of any\r
-such claims; this section has the sole purpose of protecting the\r
-integrity of the free software distribution system which is\r
-implemented by public license practices.  Many people have made\r
-generous contributions to the wide range of software distributed\r
-through that system in reliance on consistent application of that\r
-system; it is up to the author/donor to decide if he or she is willing\r
-to distribute software through any other system and a licensee cannot\r
-impose that choice.\r
-\r
-This section is intended to make thoroughly clear what is believed to\r
-be a consequence of the rest of this License.\r
-\r
-  12. If the distribution and/or use of the Library is restricted in\r
-certain countries either by patents or by copyrighted interfaces, the\r
-original copyright holder who places the Library under this License may add\r
-an explicit geographical distribution limitation excluding those countries,\r
-so that distribution is permitted only in or among countries not thus\r
-excluded.  In such case, this License incorporates the limitation as if\r
-written in the body of this License.\r
-\r
-  13. The Free Software Foundation may publish revised and/or new\r
-versions of the Lesser General Public License from time to time.\r
-Such new versions will be similar in spirit to the present version,\r
-but may differ in detail to address new problems or concerns.\r
-\r
-Each version is given a distinguishing version number.  If the Library\r
-specifies a version number of this License which applies to it and\r
-"any later version", you have the option of following the terms and\r
-conditions either of that version or of any later version published by\r
-the Free Software Foundation.  If the Library does not specify a\r
-license version number, you may choose any version ever published by\r
-the Free Software Foundation.\r
-\f\r
-  14. If you wish to incorporate parts of the Library into other free\r
-programs whose distribution conditions are incompatible with these,\r
-write to the author to ask for permission.  For software which is\r
-copyrighted by the Free Software Foundation, write to the Free\r
-Software Foundation; we sometimes make exceptions for this.  Our\r
-decision will be guided by the two goals of preserving the free status\r
-of all derivatives of our free software and of promoting the sharing\r
-and reuse of software generally.\r
-\r
-                           NO WARRANTY\r
-\r
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
-\r
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
-DAMAGES.\r
-\r
-                    END OF TERMS AND CONDITIONS\r
-\f\r
-           How to Apply These Terms to Your New Libraries\r
-\r
-  If you develop a new library, and you want it to be of the greatest\r
-possible use to the public, we recommend making it free software that\r
-everyone can redistribute and change.  You can do so by permitting\r
-redistribution under these terms (or, alternatively, under the terms of the\r
-ordinary General Public License).\r
-\r
-  To apply these terms, attach the following notices to the library.  It is\r
-safest to attach them to the start of each source file to most effectively\r
-convey the exclusion of warranty; and each file should have at least the\r
-"copyright" line and a pointer to where the full notice is found.\r
-\r
-    <one line to give the library's name and a brief idea of what it does.>\r
-    Copyright (C) <year>  <name of author>\r
-\r
-    This library is free software; you can redistribute it and/or\r
-    modify it under the terms of the GNU Lesser General Public\r
-    License as published by the Free Software Foundation; either\r
-    version 2.1 of the License, or (at your option) any later version.\r
-\r
-    This library is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-    Lesser General Public License for more details.\r
-\r
-    You should have received a copy of the GNU Lesser General Public\r
-    License along with this library; if not, write to the Free Software\r
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-\r
-Also add information on how to contact you by electronic and paper mail.\r
-\r
-You should also get your employer (if you work as a programmer) or your\r
-school, if any, to sign a "copyright disclaimer" for the library, if\r
-necessary.  Here is a sample; alter the names:\r
-\r
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
-\r
-  <signature of Ty Coon>, 1 April 1990\r
-  Ty Coon, President of Vice\r
-\r
-That's all there is to it!\r
-\r
-\r
+                 GNU LESSER GENERAL PUBLIC LICENSE
+                      Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                 GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                           NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
index dde8be7057a04dd2a67383eae2515dcb961b5011..45c294801de3cfe9fda12b9fd04f7a0913c5d4c9 100644 (file)
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-  <modelVersion>4.0.0</modelVersion>\r
-\r
-       <parent>\r
-               <groupId>org.collectionspace.services</groupId>\r
-               <artifactId>org.collectionspace.services.3rdparty.nuxeo</artifactId>\r
-               <version>4.2-SNAPSHOT</version>\r
-       </parent>\r
-\r
-  <groupId>org.collectionspace.services</groupId>\r
-  <artifactId>org.collectionspace.services.3rdparty.nuxeo.quote</artifactId>\r
-  <name>org.collectionspace.services.3rdparty.nuxeo.quote</name>\r
-  <description>\r
-       Nuxeo Enterprise Platform: CollectionSpace's Nuxeo Quote Service.\r
-  </description>\r
-\r
-  <dependencies>\r
-       <!--\r
-               CollectionSpace Dependencies\r
-       -->\r
-    <dependency>\r
-       <groupId>org.collectionspace.services</groupId>\r
-       <artifactId>org.collectionspace.services.3rdparty.nuxeo.quote-api</artifactId>\r
-    <version>${project.version}</version>\r
-    </dependency>\r
-       <!--\r
-               Nuxeo Dependencies\r
-       -->\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.core</groupId>\r
-      <artifactId>nuxeo-core-api</artifactId>\r
-      <version>${nuxeo.core.version}</version>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.core</groupId>\r
-      <artifactId>nuxeo-core-event</artifactId>\r
-      <version>${nuxeo.core.version}</version>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.core</groupId>\r
-      <artifactId>nuxeo-core-schema</artifactId>\r
-      <version>${nuxeo.core.version}</version>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.platform</groupId>\r
-      <artifactId>nuxeo-platform-relations-api</artifactId>\r
-      <version>${nuxeo.platform.version}</version>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.platform</groupId>\r
-      <artifactId>nuxeo-platform-api</artifactId>\r
-      <version>${nuxeo.platform.version}</version>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.platform</groupId>\r
-      <artifactId>nuxeo-platform-usermanager-api</artifactId>\r
-      <version>${nuxeo.platform.version}</version>\r
-    </dependency>\r
-\r
-    <dependency>\r
-      <groupId>javax.ejb</groupId>\r
-      <artifactId>ejb-api</artifactId>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>javax.annotation</groupId>\r
-      <artifactId>jsr250-api</artifactId>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>jboss</groupId>\r
-      <artifactId>jboss-annotations-ejb3</artifactId>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>javax.jms</groupId>\r
-      <artifactId>jms</artifactId>\r
-    </dependency>\r
-    <dependency>\r
-         <groupId>org.jboss.javaee</groupId>\r
-         <artifactId>jboss-javaee</artifactId>   \r
-    </dependency>\r
-    \r
-    <dependency>\r
-        <groupId>commons-logging</groupId>\r
-        <artifactId>commons-logging</artifactId>\r
-        <version>1.1.1</version>\r
-    </dependency>\r
-    <dependency>\r
-        <groupId>log4j</groupId>\r
-        <artifactId>log4j</artifactId>\r
-        <version>1.2.14</version>\r
-        <scope>provided</scope>\r
-    </dependency>\r
-    \r
-\r
-    <!-- test dependencies -->\r
-    <dependency>\r
-      <groupId>javax.transaction</groupId>\r
-      <artifactId>jta</artifactId>\r
-      <scope>test</scope>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.core</groupId>\r
-      <artifactId>nuxeo-core-jcr-connector</artifactId>\r
-      <version>1.6.2</version>\r
-      <scope>test</scope>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.core</groupId>\r
-      <artifactId>nuxeo-core-jcr-connector-test</artifactId>\r
-      <version>1.6.2</version>\r
-      <scope>test</scope>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.platform</groupId>\r
-      <artifactId>nuxeo-platform-relations-core</artifactId>\r
-      <version>${nuxeo.platform.version}</version>\r
-      <scope>test</scope>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.platform</groupId>\r
-      <artifactId>nuxeo-platform-relations-jena-plugin</artifactId>\r
-      <version>${nuxeo.platform.version}</version>\r
-      <scope>test</scope>\r
-    </dependency>\r
-    <dependency>\r
-      <groupId>org.nuxeo.ecm.platform</groupId>\r
-      <artifactId>nuxeo-platform-comment-core</artifactId>\r
-      <version>${nuxeo.platform.version}</version>\r
-      <scope>test</scope>\r
-    </dependency>\r
-  </dependencies>\r
-  \r
-    <build>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-jar-plugin</artifactId>\r
-                <configuration>\r
-                    <archive>\r
-                        <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>\r
-                        <manifestEntries>\r
-                            <Bundle-Version>${eclipseVersion}</Bundle-Version>\r
-                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>\r
-                        </manifestEntries>\r
-                    </archive>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-  \r
-\r
-</project>\r
+<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">
+  <modelVersion>4.0.0</modelVersion>
+
+       <parent>
+               <groupId>org.collectionspace.services</groupId>
+               <artifactId>org.collectionspace.services.3rdparty.nuxeo</artifactId>
+               <version>4.2-SNAPSHOT</version>
+       </parent>
+
+  <groupId>org.collectionspace.services</groupId>
+  <artifactId>org.collectionspace.services.3rdparty.nuxeo.quote</artifactId>
+  <name>org.collectionspace.services.3rdparty.nuxeo.quote</name>
+  <description>
+       Nuxeo Enterprise Platform: CollectionSpace's Nuxeo Quote Service.
+  </description>
+
+  <dependencies>
+       <!--
+               CollectionSpace Dependencies
+       -->
+    <dependency>
+       <groupId>org.collectionspace.services</groupId>
+       <artifactId>org.collectionspace.services.3rdparty.nuxeo.quote-api</artifactId>
+    <version>${project.version}</version>
+    </dependency>
+       <!--
+               Nuxeo Dependencies
+       -->
+    <dependency>
+      <groupId>org.nuxeo.ecm.core</groupId>
+      <artifactId>nuxeo-core-api</artifactId>
+      <version>${nuxeo.core.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.core</groupId>
+      <artifactId>nuxeo-core-event</artifactId>
+      <version>${nuxeo.core.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.core</groupId>
+      <artifactId>nuxeo-core-schema</artifactId>
+      <version>${nuxeo.core.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.platform</groupId>
+      <artifactId>nuxeo-platform-relations-api</artifactId>
+      <version>${nuxeo.platform.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.platform</groupId>
+      <artifactId>nuxeo-platform-api</artifactId>
+      <version>${nuxeo.platform.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.platform</groupId>
+      <artifactId>nuxeo-platform-usermanager-api</artifactId>
+      <version>${nuxeo.platform.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.ejb</groupId>
+      <artifactId>ejb-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.annotation</groupId>
+      <artifactId>jsr250-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>jboss</groupId>
+      <artifactId>jboss-annotations-ejb3</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.jms</groupId>
+      <artifactId>jms</artifactId>
+    </dependency>
+    <dependency>
+         <groupId>org.jboss.javaee</groupId>
+         <artifactId>jboss-javaee</artifactId>   
+    </dependency>
+    
+    <dependency>
+        <groupId>commons-logging</groupId>
+        <artifactId>commons-logging</artifactId>
+        <version>1.1.1</version>
+    </dependency>
+    <dependency>
+        <groupId>log4j</groupId>
+        <artifactId>log4j</artifactId>
+        <version>1.2.14</version>
+        <scope>provided</scope>
+    </dependency>
+    
+
+    <!-- test dependencies -->
+    <dependency>
+      <groupId>javax.transaction</groupId>
+      <artifactId>jta</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.core</groupId>
+      <artifactId>nuxeo-core-jcr-connector</artifactId>
+      <version>1.6.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.core</groupId>
+      <artifactId>nuxeo-core-jcr-connector-test</artifactId>
+      <version>1.6.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.platform</groupId>
+      <artifactId>nuxeo-platform-relations-core</artifactId>
+      <version>${nuxeo.platform.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.platform</groupId>
+      <artifactId>nuxeo-platform-relations-jena-plugin</artifactId>
+      <version>${nuxeo.platform.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.nuxeo.ecm.platform</groupId>
+      <artifactId>nuxeo-platform-comment-core</artifactId>
+      <version>${nuxeo.platform.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
+                        <manifestEntries>
+                            <Bundle-Version>${eclipseVersion}</Bundle-Version>
+                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+  
+
+</project>
index 7e8513e34baa5f81979e9b797f2579633a73d496..5f57a4cf87d6e10ffbb3bf3782c17d92c9e264d2 100644 (file)
@@ -1,36 +1,36 @@
-\r
-nuxeo-common-${version}.jar\r
-nuxeo-core-${version}.jar\r
-nuxeo-core-api-${version}.jar\r
-nuxeo-core-client-${version}.jar\r
-nuxeo-core-convert-api-${version}.jar\r
-nuxeo-core-event-${version}.jar\r
-nuxeo-core-io-${version}.jar\r
-nuxeo-core-query-${version}.jar\r
-nuxeo-core-schema-${version}.jar\r
-nuxeo-core-storage-sql-${version}.jar\r
-nuxeo-core-storage-sql-extensions-${version}.jar\r
-nuxeo-core-storage-sql-ra-${version}.jar\r
-nuxeo-platform-api-${version}.jar\r
-nuxeo-platform-audit-api-${version}.jar\r
-nuxeo-platform-directory-api-${version}.jar\r
-nuxeo-platform-filemanager-api-${version}.jar\r
-nuxeo-platform-filemanager-core-${version}.jar\r
-nuxeo-platform-imaging-api-${version}.jar\r
-nuxeo-platform-imaging-core-${version}.jar\r
-nuxeo-platform-imaging-preview-${version}.jar\r
-nuxeo-platform-login-${version}.jar\r
-nuxeo-platform-mimetype-api-${version}.jar\r
-nuxeo-platform-mimetype-core-${version}.jar\r
-nuxeo-platform-query-api-${version}.jar\r
-nuxeo-platform-search-api-${version}.jar\r
-nuxeo-platform-types-api-${version}.jar\r
-nuxeo-platform-types-core-${version}.jar\r
-nuxeo-platform-usermanager-api-${version}.jar\r
-nuxeo-runtime-${version}.jar\r
-nuxeo-runtime-datasource-${version}.jar\r
-nuxeo-runtime-jtajca-${version}.jar\r
-nuxeo-runtime-management-${version}.jar\r
-nuxeo-runtime-osgi-${version}.jar\r
-nuxeo-runtime-remoting-${version}.jar\r
-nuxeo-runtime-scripting-${version}.jar\r
+
+nuxeo-common-${version}.jar
+nuxeo-core-${version}.jar
+nuxeo-core-api-${version}.jar
+nuxeo-core-client-${version}.jar
+nuxeo-core-convert-api-${version}.jar
+nuxeo-core-event-${version}.jar
+nuxeo-core-io-${version}.jar
+nuxeo-core-query-${version}.jar
+nuxeo-core-schema-${version}.jar
+nuxeo-core-storage-sql-${version}.jar
+nuxeo-core-storage-sql-extensions-${version}.jar
+nuxeo-core-storage-sql-ra-${version}.jar
+nuxeo-platform-api-${version}.jar
+nuxeo-platform-audit-api-${version}.jar
+nuxeo-platform-directory-api-${version}.jar
+nuxeo-platform-filemanager-api-${version}.jar
+nuxeo-platform-filemanager-core-${version}.jar
+nuxeo-platform-imaging-api-${version}.jar
+nuxeo-platform-imaging-core-${version}.jar
+nuxeo-platform-imaging-preview-${version}.jar
+nuxeo-platform-login-${version}.jar
+nuxeo-platform-mimetype-api-${version}.jar
+nuxeo-platform-mimetype-core-${version}.jar
+nuxeo-platform-query-api-${version}.jar
+nuxeo-platform-search-api-${version}.jar
+nuxeo-platform-types-api-${version}.jar
+nuxeo-platform-types-core-${version}.jar
+nuxeo-platform-usermanager-api-${version}.jar
+nuxeo-runtime-${version}.jar
+nuxeo-runtime-datasource-${version}.jar
+nuxeo-runtime-jtajca-${version}.jar
+nuxeo-runtime-management-${version}.jar
+nuxeo-runtime-osgi-${version}.jar
+nuxeo-runtime-remoting-${version}.jar
+nuxeo-runtime-scripting-${version}.jar
index e4235883458bdb8ebafcf2d97f42070984075c8b..5177f9d47c27a56ee1720706b8d784cdc69205ce 100644 (file)
-host=127.0.0.1\r
-#cspace\r
-# Instance IDs help identify the databases and database users that belong to\r
-# a particular CollectionSpace server instance, in a configuration where\r
-# multiple CollectionSpace servers all share a single database server.\r
-# The instance ID is blank by default. If it is added, by convention, \r
-# instance IDs should begin with an underscore (_). E.g.: _trs80\r
-cspace.instance.id=\r
-release.version=4.2\r
-cspace.release=${release.version}-SNAPSHOT\r
-cspace.services.release=cspace-services-${cspace.release}\r
-domain.cspace=cspace-services\r
-cspace.services.context=${domain.cspace}\r
-cspace.services.war=${cspace.services.context}.war\r
-domain.nuxeo=nuxeo-server\r
-\r
-#nuxeo\r
-nuxeo.release=5.5-HF07\r
-nuxeo.ear=nuxeo.ear\r
-nuxeo.system=bundles\r
-\r
-## #old# nuxeo.plugins=${nuxeo.ear}/plugins\r
-nuxeo.plugins=plugins\r
-\r
-## #old#\r
-nuxeo.templates=templates\r
-\r
-## #old# distribution\r
-dist=dist\r
-dist.cspace=${dist}/cspace\r
-dist.nuxeo=${dist}/nuxeo\r
-dist.installer=${dist}/installer\r
-dist.installer.services=${dist.installer}/services\r
-\r
-## #old# dist cspace domain\r
-dist.domain.cspace=${domain.cspace}\r
-dist.server.cspace=${dist.cspace}/server/${jee.domain.cspace}\r
-dist.deploy.cspace=${dist.server.cspace}/deploy\r
-dist.lib.cspace=${dist.server.cspace}/lib\r
-\r
-## #old# dist nuxeo domain\r
-dist.domain.nuxeo=${domain.nuxeo}\r
-dist.server.nuxeo=${dist.nuxeo}/server/${jee.domain.nuxeo}\r
-dist.deploy.nuxeo=${dist.server.nuxeo}/deploy\r
-dist.lib.nuxeo=${dist.server.nuxeo}/lib\r
-dist.deploy.nuxeo.system=${dist.deploy.nuxeo}/${nuxeo.system}\r
-dist.deploy.nuxeo.plugins=${dist.deploy.nuxeo}/${nuxeo.plugins}\r
-\r
-#JEE Application Server\r
-jee.release=apache-tomcat-6.0.33\r
-jee.dir=${env.CSPACE_JEESERVER_HOME}\r
-jee.home=${jee.dir}\r
-jee.bin=${jee.home}/bin\r
-\r
-#JEE Application Server cspace domain\r
-jee.domain.cspace=${domain.cspace}\r
-jee.domain.cspace.port=8180\r
-jee.server.cspace=${jee.home}\r
-jee.deploy.cspace=${jee.server.cspace}/webapps\r
-jee.lib.cspace=${jee.server.cspace}/lib\r
-jee.deploy.cspace.services=${jee.deploy.cspace}/${cspace.services.war}\r
-\r
-#JEE Application Server nuxeo domain\r
-jee.domain.nuxeo=${domain.nuxeo}\r
-##old# #jee.domain.nuxeo.port=8080\r
-jee.server.nuxeo=${jee.home}/${jee.domain.nuxeo}\r
-jee.deploy.nuxeo=${jee.server.nuxeo}\r
-jee.lib.nuxeo=${jee.server.nuxeo}/lib\r
-jee.deploy.nuxeo.system=${jee.deploy.nuxeo}/${nuxeo.system}\r
-jee.deploy.nuxeo.plugins=${jee.deploy.nuxeo}/${nuxeo.plugins}\r
-\r
-# Apache Tomcat specific variables\r
-catalina.engine=Catalina\r
-catalina.hostname=localhost\r
-catalina.base=${jee.dir}\r
-catalina.context.cspace=${jee.dir}/conf/${catalina.engine}/${catalina.hostname}/${cspace.services.context}.xml\r
-\r
-#nuxeo database templates directory\r
-##old# nuxeo.templates.dir=${jboss.home}/${nuxeo.templates}\r
-\r
-#nuxeo main config file\r
-nuxeo.main.config.file=${jee.bin}/nuxeo.conf\r
-#nuxeo database templates directory\r
-nuxeo.templates.dir=${jee.home}/${nuxeo.templates}\r
-\r
-db.base.dir=${jee.server.cspace}/cspace/services/db\r
-\r
-#database - select one or the other (not both!), and then uncomment the\r
-# appropriate section below the common settings\r
-#db=mysql|postgresql\r
-# db=mysql\r
-db=postgresql\r
-\r
-#For mysql, uncomment this, and comment out postgres section\r
-# db.port=3306\r
-# db.driver.jar=${db.base.dir}/jdbc_drivers/mysql-connector-java-5.1.7.jar\r
-# db.jdbc.driver.class=com.mysql.jdbc.Driver\r
-# db.dialect=org.hibernate.dialect.MySQLDialect\r
-# db.typemapping=mySQL\r
-# db.exceptionsorter=org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter\r
-# db.spring.acl.classIdentityQuery=SELECT @@IDENTITY\r
-# db.spring.acl.sidIdentityQuery=SELECT @@IDENTITY\r
-# db.xaDataSource=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource\r
-\r
-#For postgresql, uncomment this, and comment out mysql section\r
-db.port=5432\r
-db.driver.jar=${db.base.dir}/jdbc_drivers/postgresql-9.1-901.jdbc4.jar\r
-db.jdbc.driver.class=org.postgresql.Driver\r
-db.dialect=org.hibernate.dialect.PostgreSQLDialect\r
-db.typemapping=PostgreSQL 8.0\r
-# Should be org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter\r
-# but current JBoss does not seem to include it...\r
-db.exceptionsorter= \r
-db.spring.acl.classIdentityQuery=select currval(pg_get_serial_sequence('acl_class', 'id'))\r
-db.spring.acl.sidIdentityQuery=select currval(pg_get_serial_sequence('acl_sid', 'id'))\r
-db.xaDataSource=org.postgresql.xa.PGXADataSource\r
-\r
-#Hibernate properties for Ant and Maven plugins\r
-hibernate.dialect=${db.dialect}\r
-\r
-#database common settings\r
-db.script.dir=${jee.server.cspace}/cspace/services/db/${db}\r
-\r
-db.csadmin.name=postgres\r
-db.csadmin.user=csadmin\r
-db.csadmin.user.password=${env.DB_CSADMIN_PASSWORD}\r
-\r
-db.nuxeo.name=nuxeo${cspace.instance.id}\r
-db.nuxeo.user=${db.nuxeo.name}\r
-db.nuxeo.user.password=${env.DB_NUXEO_PASSWORD}\r
-\r
-db.cspace.name=cspace${cspace.instance.id}\r
-db.cspace.user=${db.cspace.name}\r
-db.cspace.user.password=${env.DB_CSPACE_PASSWORD}\r
-\r
-db.reader.user=reader${cspace.instance.id}\r
-db.reader.user.password=${env.DB_READER_PASSWORD}\r
-\r
-db.host=localhost\r
-db.jdbc.baseurl=jdbc:${db}://${db.host}:${db.port}\r
-\r
-#\r
-# JDBC options that can be added to the database URL.  We need to supply an "encoded" version\r
-# of the options for cases where the URL is processed inside of XML scripts/files\r
-#\r
-\r
-# Use the following JDBC options to enable CSpace to establish SSL\r
-# connections with the database server.\r
-#\r
-# ssl=true ;means we can talk SSL to the database server\r
-# sslfactory ;set this to the SSL factory class.  The default is to perform validation.  Use NonValidatingFactory class to skip validation\r
-# foo=true ;an extra "throw way" options seems to be needed to prevent parsing errors for some tools/code.  \r
-\r
-#\r
-# Here is an example of how to set the JDBC options for connecting to an SSL enabled\r
-# PostgreSQL server.\r
-#\r
-#db.jdbc.urloptions=ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory&foo=true\r
-#db.jdbc.urloptions.encoded=ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;foo=true\r
-\r
-#\r
-# By default, as placeholders, we'll supply meaningless JDBC options -both encoded and non-encode forms.\r
-#\r
-db.jdbc.urloptions=foo=true&bar=false\r
-db.jdbc.urloptions.encoded=foo=true&amp;bar=false\r
-\r
-#\r
-# JDBC urls that CollectionSpace needs to talk to the "admin" database, Nuxeo databases, and the "cspace" database (i.e., the AuthN/AuthZ database)\r
-#\r
-db.jdbc.csadmin.url=${db.jdbc.baseurl}/${db.csadmin.name}?${db.jdbc.urloptions}\r
-db.jdbc.csadmin.url.encoded=${db.jdbc.baseurl}/${db.csadmin.name}?${db.jdbc.urloptions.encoded}\r
-\r
-db.jdbc.nuxeo.url=${db.jdbc.baseurl}/${DatabaseName}?${db.jdbc.urloptions}\r
-db.jdbc.nuxeo.url.encoded=${db.jdbc.baseurl}/${DatabaseName}?${db.jdbc.urloptions.encoded}\r
-\r
-db.jdbc.cspace.url=${db.jdbc.baseurl}/${db.cspace.name}?${db.jdbc.urloptions}\r
+host=127.0.0.1
+#cspace
+# Instance IDs help identify the databases and database users that belong to
+# a particular CollectionSpace server instance, in a configuration where
+# multiple CollectionSpace servers all share a single database server.
+# The instance ID is blank by default. If it is added, by convention, 
+# instance IDs should begin with an underscore (_). E.g.: _trs80
+cspace.instance.id=
+release.version=4.2
+cspace.release=${release.version}-SNAPSHOT
+cspace.services.release=cspace-services-${cspace.release}
+domain.cspace=cspace-services
+cspace.services.context=${domain.cspace}
+cspace.services.war=${cspace.services.context}.war
+domain.nuxeo=nuxeo-server
+
+#nuxeo
+nuxeo.release=5.5-HF07
+nuxeo.ear=nuxeo.ear
+nuxeo.system=bundles
+
+## #old# nuxeo.plugins=${nuxeo.ear}/plugins
+nuxeo.plugins=plugins
+
+## #old#
+nuxeo.templates=templates
+
+## #old# distribution
+dist=dist
+dist.cspace=${dist}/cspace
+dist.nuxeo=${dist}/nuxeo
+dist.installer=${dist}/installer
+dist.installer.services=${dist.installer}/services
+
+## #old# dist cspace domain
+dist.domain.cspace=${domain.cspace}
+dist.server.cspace=${dist.cspace}/server/${jee.domain.cspace}
+dist.deploy.cspace=${dist.server.cspace}/deploy
+dist.lib.cspace=${dist.server.cspace}/lib
+
+## #old# dist nuxeo domain
+dist.domain.nuxeo=${domain.nuxeo}
+dist.server.nuxeo=${dist.nuxeo}/server/${jee.domain.nuxeo}
+dist.deploy.nuxeo=${dist.server.nuxeo}/deploy
+dist.lib.nuxeo=${dist.server.nuxeo}/lib
+dist.deploy.nuxeo.system=${dist.deploy.nuxeo}/${nuxeo.system}
+dist.deploy.nuxeo.plugins=${dist.deploy.nuxeo}/${nuxeo.plugins}
+
+#JEE Application Server
+jee.release=apache-tomcat-6.0.33
+jee.dir=${env.CSPACE_JEESERVER_HOME}
+jee.home=${jee.dir}
+jee.bin=${jee.home}/bin
+
+#JEE Application Server cspace domain
+jee.domain.cspace=${domain.cspace}
+jee.domain.cspace.port=8180
+jee.server.cspace=${jee.home}
+jee.deploy.cspace=${jee.server.cspace}/webapps
+jee.lib.cspace=${jee.server.cspace}/lib
+jee.deploy.cspace.services=${jee.deploy.cspace}/${cspace.services.war}
+
+#JEE Application Server nuxeo domain
+jee.domain.nuxeo=${domain.nuxeo}
+##old# #jee.domain.nuxeo.port=8080
+jee.server.nuxeo=${jee.home}/${jee.domain.nuxeo}
+jee.deploy.nuxeo=${jee.server.nuxeo}
+jee.lib.nuxeo=${jee.server.nuxeo}/lib
+jee.deploy.nuxeo.system=${jee.deploy.nuxeo}/${nuxeo.system}
+jee.deploy.nuxeo.plugins=${jee.deploy.nuxeo}/${nuxeo.plugins}
+
+# Apache Tomcat specific variables
+catalina.engine=Catalina
+catalina.hostname=localhost
+catalina.base=${jee.dir}
+catalina.context.cspace=${jee.dir}/conf/${catalina.engine}/${catalina.hostname}/${cspace.services.context}.xml
+
+#nuxeo database templates directory
+##old# nuxeo.templates.dir=${jboss.home}/${nuxeo.templates}
+
+#nuxeo main config file
+nuxeo.main.config.file=${jee.bin}/nuxeo.conf
+#nuxeo database templates directory
+nuxeo.templates.dir=${jee.home}/${nuxeo.templates}
+
+db.base.dir=${jee.server.cspace}/cspace/services/db
+
+#database - select one or the other (not both!), and then uncomment the
+# appropriate section below the common settings
+#db=mysql|postgresql
+# db=mysql
+db=postgresql
+
+#For mysql, uncomment this, and comment out postgres section
+# db.port=3306
+# db.driver.jar=${db.base.dir}/jdbc_drivers/mysql-connector-java-5.1.7.jar
+# db.jdbc.driver.class=com.mysql.jdbc.Driver
+# db.dialect=org.hibernate.dialect.MySQLDialect
+# db.typemapping=mySQL
+# db.exceptionsorter=org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
+# db.spring.acl.classIdentityQuery=SELECT @@IDENTITY
+# db.spring.acl.sidIdentityQuery=SELECT @@IDENTITY
+# db.xaDataSource=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
+
+#For postgresql, uncomment this, and comment out mysql section
+db.port=5432
+db.driver.jar=${db.base.dir}/jdbc_drivers/postgresql-9.1-901.jdbc4.jar
+db.jdbc.driver.class=org.postgresql.Driver
+db.dialect=org.hibernate.dialect.PostgreSQLDialect
+db.typemapping=PostgreSQL 8.0
+# Should be org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter
+# but current JBoss does not seem to include it...
+db.exceptionsorter= 
+db.spring.acl.classIdentityQuery=select currval(pg_get_serial_sequence('acl_class', 'id'))
+db.spring.acl.sidIdentityQuery=select currval(pg_get_serial_sequence('acl_sid', 'id'))
+db.xaDataSource=org.postgresql.xa.PGXADataSource
+
+#Hibernate properties for Ant and Maven plugins
+hibernate.dialect=${db.dialect}
+
+#database common settings
+db.script.dir=${jee.server.cspace}/cspace/services/db/${db}
+
+db.csadmin.name=postgres
+db.csadmin.user=csadmin
+db.csadmin.user.password=${env.DB_CSADMIN_PASSWORD}
+
+db.nuxeo.name=nuxeo${cspace.instance.id}
+db.nuxeo.user=${db.nuxeo.name}
+db.nuxeo.user.password=${env.DB_NUXEO_PASSWORD}
+
+db.cspace.name=cspace${cspace.instance.id}
+db.cspace.user=${db.cspace.name}
+db.cspace.user.password=${env.DB_CSPACE_PASSWORD}
+
+db.reader.user=reader${cspace.instance.id}
+db.reader.user.password=${env.DB_READER_PASSWORD}
+
+db.host=localhost
+db.jdbc.baseurl=jdbc:${db}://${db.host}:${db.port}
+
+#
+# JDBC options that can be added to the database URL.  We need to supply an "encoded" version
+# of the options for cases where the URL is processed inside of XML scripts/files
+#
+
+# Use the following JDBC options to enable CSpace to establish SSL
+# connections with the database server.
+#
+# ssl=true ;means we can talk SSL to the database server
+# sslfactory ;set this to the SSL factory class.  The default is to perform validation.  Use NonValidatingFactory class to skip validation
+# foo=true ;an extra "throw way" options seems to be needed to prevent parsing errors for some tools/code.  
+
+#
+# Here is an example of how to set the JDBC options for connecting to an SSL enabled
+# PostgreSQL server.
+#
+#db.jdbc.urloptions=ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory&foo=true
+#db.jdbc.urloptions.encoded=ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;foo=true
+
+#
+# By default, as placeholders, we'll supply meaningless JDBC options -both encoded and non-encode forms.
+#
+db.jdbc.urloptions=foo=true&bar=false
+db.jdbc.urloptions.encoded=foo=true&amp;bar=false
+
+#
+# JDBC urls that CollectionSpace needs to talk to the "admin" database, Nuxeo databases, and the "cspace" database (i.e., the AuthN/AuthZ database)
+#
+db.jdbc.csadmin.url=${db.jdbc.baseurl}/${db.csadmin.name}?${db.jdbc.urloptions}
+db.jdbc.csadmin.url.encoded=${db.jdbc.baseurl}/${db.csadmin.name}?${db.jdbc.urloptions.encoded}
+
+db.jdbc.nuxeo.url=${db.jdbc.baseurl}/${DatabaseName}?${db.jdbc.urloptions}
+db.jdbc.nuxeo.url.encoded=${db.jdbc.baseurl}/${DatabaseName}?${db.jdbc.urloptions.encoded}
+
+db.jdbc.cspace.url=${db.jdbc.baseurl}/${db.cspace.name}?${db.jdbc.urloptions}
 db.jdbc.cspace.url.encoded=${db.jdbc.baseurl}/${db.cspace.name}?${db.jdbc.urloptions.encoded}
\ No newline at end of file
index b65637f622002c890b9d91175b40170ff43e085e..41c0ba0b63bf84a1f5cec42203868146cd2f2620 100644 (file)
--- a/build.xml
+++ b/build.xml
-<project name="services-trunk" default="package" basedir=".">\r
-       <description>Collectionspace Services</description>\r
-       <!-- environment should be declared before reading build.properties -->\r
-       <property environment="env" />\r
-       <!-- set global properties for this build -->\r
-       <property file="build.properties" />\r
-       <property name="mvn.opts" value="-V" />\r
-       <property name="src" location="src" />\r
-\r
-       <condition property="osfamily-unix">\r
-               <os family="unix" />\r
-       </condition>\r
-       <condition property="osfamily-windows">\r
-               <os family="windows" />\r
-       </condition>\r
-\r
-       <target name="init">\r
-               <!-- Create the time stamp -->\r
-               <tstamp />\r
-       </target>\r
-\r
-       <target name="dist" depends="package" description="generate cspace service distribution">\r
-               <!-- Create the distribution directory -->\r
-               <mkdir dir="${basedir}/dist" />\r
-\r
-               <!-- copy db scripts, etc. -->\r
-               <copy todir="${basedir}/${dist.server.cspace}/cspace/services">\r
-                       <fileset dir="${src}/main/resources/scripts" />\r
-               </copy>\r
-\r
-               <!-- copy datasources -->\r
-               <copy todir="${basedir}/${dist.deploy.cspace}">\r
-                       <fileset dir="${src}/main/resources/config/${db}" />\r
-               </copy>\r
-               <ant antfile="3rdparty/build.xml" target="dist" inheritAll="false" />\r
-               <ant antfile="services/build.xml" target="dist" inheritAll="false" />\r
-\r
-               <!-- bundle up everything -->\r
-               <tar destfile="${basedir}/dist/${cspace.services.release}-${jee.release}.tar.gz" compression="gzip">\r
-                       <tarfileset dir="${basedir}/dist/cspace" preserveLeadingSlashes="true">\r
-                       </tarfileset>\r
-               </tar>\r
-       </target>\r
-\r
-       <target name="dist-jee-domains" depends="init" description="create JEE distributions for cspace and nuxeo">\r
-               <antcall target="dist-jee-cspace" />\r
-               <antcall target="dist-jee-nuxeo" />\r
-       </target>\r
-\r
-       <target name="dist-jee-cspace" depends="dist" description="generate JEE distribution for cspace">\r
-               <fail message="JEE container is not installed or ${jee.dir} not found">\r
-                       <condition>\r
-                               <not>\r
-                                       <available file="${jee.dir}" type="dir" />\r
-                               </not>\r
-                       </condition>\r
-               </fail>\r
-\r
-               <fail message="CSpace is not deployed or ${jee.deploy.cspace.services} not found">\r
-                       <condition>\r
-                               <not>\r
-                                       <available file="${jee.deploy.cspace.services}" type="file" />\r
-                               </not>\r
-                       </condition>\r
-               </fail>\r
-\r
-               <tar destfile="${basedir}/dist/${jee.release}-${domain.cspace}-${release.version}.tar.gz" compression="gzip">\r
-                       <tarfileset dir="${jee.dir}" prefix="${jee.release}" preserveLeadingSlashes="true">\r
-                               <exclude name="server/${jee.domain.nuxeo}/**" />\r
-                               <exclude name="server/${jee.domain.cspace}/log/**" />\r
-                               <exclude name="server/${jee.domain.cspace}/tmp/**" />\r
-                       </tarfileset>\r
-               </tar>\r
-       </target>\r
-\r
-       <target name="dist-jee-nuxeo" depends="dist" description="generate nuxeo domain distribution">\r
-               <fail message="JEE server is not installed or ${jee.dir} not found">\r
-                       <condition>\r
-                               <not>\r
-                                       <available file="${jee.dir}" type="dir" />\r
-                               </not>\r
-                       </condition>\r
-               </fail>\r
-\r
-               <fail message="Nuxeo is not deployed or ${jee.deploy.nuxeo.plugins} not found">\r
-                       <condition>\r
-                               <not>\r
-                                       <available file="${jee.deploy.nuxeo.plugins}" type="dir" />\r
-                               </not>\r
-                       </condition>\r
-               </fail>\r
-\r
-               <tar destfile="${basedir}/dist/${jee.release}-${domain.nuxeo}-${release.version}.tar.gz" compression="gzip">\r
-                       <tarfileset dir="${jee.dir}" prefix="${jee.release}" preserveLeadingSlashes="true">\r
-                               <exclude name="server/${jee.domain.cspace}/**" />\r
-                               <exclude name="server/${jee.domain.nuxeo}/log/**" />\r
-                               <exclude name="server/${jee.domain.nuxeo}/tmp/**" />\r
-                       </tarfileset>\r
-               </tar>\r
-       </target>\r
-\r
-       <target name="package" depends="package-unix,package-windows" description="mvn package" />\r
-       <target name="package-unix" if="osfamily-unix">\r
-               <exec executable="mvn" failonerror="true">\r
-                       <arg value="package" />\r
-                       <arg value="-Dmaven.test.skip=true" />\r
-                       <arg value="-f" />\r
-                       <arg value="${basedir}/pom.xml" />\r
-                       <arg value="-N" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-       <target name="package-windows" if="osfamily-windows">\r
-               <exec executable="cmd" failonerror="true">\r
-                       <arg value="/c" />\r
-                       <arg value="mvn.bat" />\r
-                       <arg value="package" />\r
-                       <arg value="-Dmaven.test.skip=true" />\r
-                       <arg value="-f" />\r
-                       <arg value="${basedir}/pom.xml" />\r
-                       <arg value="-N" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-\r
-       <target name="install" depends="install-unix,install-windows" description="mvn install" />\r
-       <target name="install-unix" if="osfamily-unix">\r
-               <exec executable="mvn" failonerror="true">\r
-                       <arg value="install" />\r
-                       <arg value="-Dmaven.test.skip=true" />\r
-                       <arg value="-f" />\r
-                       <arg value="${basedir}/pom.xml" />\r
-                       <arg value="-N" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-       <target name="install-windows" if="osfamily-windows">\r
-               <exec executable="cmd" failonerror="true">\r
-                       <arg value="/c" />\r
-                       <arg value="mvn.bat" />\r
-                       <arg value="install" />\r
-                       <arg value="-Dmaven.test.skip=true" />\r
-                       <arg value="-f" />\r
-                       <arg value="${basedir}/pom.xml" />\r
-                       <arg value="-N" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-\r
-       <target name="clean" depends="clean-unix,clean-windows" description="Delete target directories">\r
-               <delete dir="${basedir}/build" />\r
-               <delete dir="${basedir}/dist" />\r
-       </target>\r
-       <target name="clean-unix" if="osfamily-unix">\r
-               <exec executable="mvn" failonerror="true">\r
-                       <arg value="clean" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-       <target name="clean-windows" if="osfamily-windows">\r
-               <exec executable="cmd" failonerror="true">\r
-                       <arg value="/c" />\r
-                       <arg value="mvn.bat" />\r
-                       <arg value="clean" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-\r
-       <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-       <target name="test-unix" if="osfamily-unix">\r
-               <exec executable="mvn" failonerror="true">\r
-                       <arg value="test" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-       <target name="test-windows" if="osfamily-windows">\r
-               <exec executable="cmd" failonerror="true">\r
-                       <arg value="/c" />\r
-                       <arg value="mvn.bat" />\r
-                       <arg value="test" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-\r
-       <target name="doc" description="Build Java API docs">\r
-               <ant antfile="services/build.xml" target="doc" inheritAll="false" />\r
-       </target>\r
-\r
-       <target name="gen_ddl" description="generate service-specific tables(s), indices, etc.">\r
-               <ant antfile="services/build.xml" target="gen_ddl" inheritAll="false" />\r
-       </target>\r
-\r
-       <!--\r
-               Top-level target to create (or recreate) CollectionSpace related databases.  Checks the \r
-               'recreate_db' property or environment variable.\r
-       -->\r
-       <target name="create_db" depends="-create_db, -create_db_erase, -create_db_warn"\r
-               description="Creates or recreates CollectionSpace database(s), invoke subtasks for indexes, etc.">\r
-       </target>\r
-       \r
-       <!--\r
-               This target sets the Ant property 'create_db.recreate' based on the value of the Ant environment variable 'recreate_db'\r
-               and the command line property 'recreate_db'.  A command line value of 'true' for the 'recreate_db' property will override\r
-               the environment variable 'recreate_db' value.\r
-               \r
-               If the environment variable 'recreate_db' is set to true then the Ant property 'create_db.recreate' will get set to true; otherwise,\r
-               it will get set to the current value of the Ant property 'recreate_db' -which will be null if not set on the command line.\r
-       -->\r
-       <target name="-create_db">\r
-               <property environment="env"/>\r
-               <condition property="create_db.recreate" else="${recreate_db}" value="true">\r
-                       <equals arg1="${env.recreate_db}" arg2="true"/>\r
-               </condition>\r
-       </target>       \r
-\r
-       <!--\r
-               This target sends the 'create_nuxeo_db' and 'create_nuxeo_db' targets to all the Ant sub-modules/directories\r
-       -->\r
-       <target name="-create_db_erase" if="${create_db.recreate}" depends="create_db-unix, create_db-windows">\r
-               <antcall target="create_nuxeo_db" />\r
-               <antcall target="create_cspace_db" />\r
-       </target>\r
-       \r
-       <!--\r
-               Outputs a warning to the user that existing CollectionSpace databases will be replaced/overridden.\r
-       -->\r
-       <target name="-create_db_warn" unless="${create_db.recreate}">\r
-               <echo message="*** WARNING!  This target will delete any and all existing CollectionSpace databases."/>\r
-               <echo message="*** WARNING!  You must set the Ant recreate_db property to 'true' to invoke this target."/>\r
-               <echo message="*** WARNING!  For example,"/>\r
-               <echo message="*** WARNING!"/>\r
-               <echo message="*** WARNING!      'ant create_db -Drecreate_db=true'."/>\r
-               <echo message="*** WARNING!"/>\r
-               <echo message="*** WARNING!  Optionally, you can set an environment variable named recreate_db=true as well."/>\r
-               <fail message="*** ERROR - Ant property 'recreate_db' was not set to 'true'. See warning messages above."/>\r
-       </target>       \r
-\r
-       <target name="create_db-unix" if="osfamily-unix">\r
-               <exec executable="mvn" failonerror="true">\r
-                       <arg value="validate" /> <!-- Ensure proper env vars are set -->\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-       \r
-       <target name="create_db-windows" if="osfamily-windows">\r
-               <exec executable="cmd" failonerror="true">\r
-                       <arg value="/c" />\r
-                       <arg value="mvn.bat" />\r
-                       <arg value="validate" /> <!-- Ensure proper env vars are set -->\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-       \r
-\r
-       <target name="create_nuxeo_db" description="create nuxeo database">\r
-               <sql driver="${db.jdbc.driver.class}" url="${db.jdbc.csadmin.url}" userid="${db.csadmin.user}" password="${db.csadmin.user.password}" autocommit="true" src="${db.script.dir}/init_nuxeo_db.sql">\r
-                       <classpath>\r
-                               <pathelement path="${db.driver.jar}" />\r
-                       </classpath>\r
-               </sql>\r
-               <ant antfile="services/build.xml" target="create_nuxeo_db" inheritAll="false" />\r
-       </target>\r
-\r
-       <target name="create_cspace_db" description="create cspace database">\r
-               <sql driver="${db.jdbc.driver.class}" url="${db.jdbc.csadmin.url}" userid="${db.csadmin.user}" password="${db.csadmin.user.password}" autocommit="true" src="${db.script.dir}/init_cspace_db.sql">\r
-                       <classpath>\r
-                               <pathelement path="${db.driver.jar}" />\r
-                       </classpath>\r
-               </sql>\r
-               <ant antfile="services/build.xml" target="create_cspace_db" inheritAll="false" />\r
-       </target>\r
-\r
-       <target name="import" description="import default configuration">\r
-               <ant antfile="services/build.xml" target="import" inheritAll="false" />\r
-       </target>\r
-\r
-       <target name="deploy" depends="install, setup_initdb.sql" description="deploy services in ${jee.server.cspace}">\r
-               <!-- copy db scripts, etc. -->\r
-               <copy todir="${jee.server.cspace}/cspace/services/scripts">\r
-                       <fileset dir="${src}/main/resources/scripts/" />\r
-               </copy>\r
-               <ant antfile="3rdparty/build.xml" target="deploy" inheritAll="false" />\r
-               <ant antfile="services/build.xml" target="deploy" inheritAll="false" />\r
-       </target>\r
-\r
-       <target name="setup_initdb.sql" description="copy init_db scripts, replacing keywords">\r
-               <copy todir="${jee.server.cspace}/cspace/services/db">\r
-                       <fileset dir="${src}/main/resources/db" />\r
-                       <filterset>\r
-                               <filter token="DB_CSADMIN_NAME" value="${db.csadmin.name}" />\r
-                               <filter token="DB_CSADMIN_USER" value="${db.csadmin.user}" />\r
-                               <filter token="DB_CSADMIN_PASSWORD" value="${env.DB_CSADMIN_PASSWORD}" />\r
-                               <!-- Note: double-subs from ${db.xyz.password} fail -->\r
-\r
-                               <filter token="DB_CSPACE_NAME" value="${db.cspace.name}" />\r
-                               <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />\r
-                               <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" />\r
-                               <!-- Note: double-subs from ${db.xyz.password} fail -->\r
-\r
-                               <filter token="DB_NUXEO_NAME" value="${db.nuxeo.name}" />\r
-                               <filter token="DB_NUXEO_USER" value="${db.nuxeo.user}" />\r
-                               <filter token="DB_NUXEO_PASSWORD" value="${env.DB_NUXEO_PASSWORD}" />\r
-                               <!-- Note: double-subs from ${db.xyz.password} fail -->\r
-\r
-                               <filter token="DB_READER_USER" value="${db.reader.user}" />\r
-                               <filter token="DB_READER_PASSWORD" value="${env.DB_READER_PASSWORD}" />\r
-                               <!-- Note: double-subs from ${db.xyz.password} fail -->\r
-                       </filterset>\r
-               </copy>\r
-       </target>\r
-\r
-       <target name="undeploy" description="undeploy services from ${jee.server.cspace}">\r
-               <ant antfile="services/build.xml" target="undeploy" inheritAll="false" />\r
-               <ant antfile="3rdparty/build.xml" target="undeploy" inheritAll="false" />\r
-               <delete failonerror="false" dir="${jee.server.cspace}/cspace/services" />\r
-               <delete failonerror="false" dir="${jee.server.cspace}/cspace/config/services" />\r
-               <!-- Delete mysql-ds.xml to clean up pre-1.8 bundles -->\r
-               <delete failonerror="false" file="${jee.deploy.cspace}/mysql-ds.xml" />\r
-               <delete failonerror="false" file="${jee.deploy.cspace}/jee-ds.xml" />\r
-               <delete failonerror="false" file="${jee.deploy.cspace}/cspace-ds.xml" />\r
-       </target>\r
-\r
-       <target name="hotdeploy" depends="install" description="deploy services in running ${jee.server.cspace}">\r
-               <ant antfile="services/build.xml" target="hotdeploy" inheritAll="false" />\r
-       </target>\r
-\r
-       <target name="eclipse" depends="eclipse-unix,eclipse-windows" description="Generate Eclipse files" />\r
-       <target name="eclipse-unix" if="osfamily-unix">\r
-               <exec executable="mvn" failonerror="true">\r
-                       <arg value="eclipse:clean" />\r
-                       <arg value="eclipse:eclipse" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-               <exec executable="fixeclipse" failonerror="true" />\r
-       </target>\r
-       <target name="eclipse-windows" if="osfamily-windows">\r
-               <exec executable="cmd" failonerror="true">\r
-                       <arg value="/c" />\r
-                       <arg value="mvn.bat" />\r
-                       <arg value="eclipse:clean" />\r
-                       <arg value="eclipse:eclipse" />\r
-                       <arg value="${mvn.opts}" />\r
-               </exec>\r
-       </target>\r
-\r
-</project>\r
+<project name="services-trunk" default="package" basedir=".">
+       <description>Collectionspace Services</description>
+       <!-- environment should be declared before reading build.properties -->
+       <property environment="env" />
+       <!-- set global properties for this build -->
+       <property file="build.properties" />
+       <property name="mvn.opts" value="-V" />
+       <property name="src" location="src" />
+
+       <condition property="osfamily-unix">
+               <os family="unix" />
+       </condition>
+       <condition property="osfamily-windows">
+               <os family="windows" />
+       </condition>
+
+       <target name="init">
+               <!-- Create the time stamp -->
+               <tstamp />
+       </target>
+
+       <target name="dist" depends="package" description="generate cspace service distribution">
+               <!-- Create the distribution directory -->
+               <mkdir dir="${basedir}/dist" />
+
+               <!-- copy db scripts, etc. -->
+               <copy todir="${basedir}/${dist.server.cspace}/cspace/services">
+                       <fileset dir="${src}/main/resources/scripts" />
+               </copy>
+
+               <!-- copy datasources -->
+               <copy todir="${basedir}/${dist.deploy.cspace}">
+                       <fileset dir="${src}/main/resources/config/${db}" />
+               </copy>
+               <ant antfile="3rdparty/build.xml" target="dist" inheritAll="false" />
+               <ant antfile="services/build.xml" target="dist" inheritAll="false" />
+
+               <!-- bundle up everything -->
+               <tar destfile="${basedir}/dist/${cspace.services.release}-${jee.release}.tar.gz" compression="gzip">
+                       <tarfileset dir="${basedir}/dist/cspace" preserveLeadingSlashes="true">
+                       </tarfileset>
+               </tar>
+       </target>
+
+       <target name="dist-jee-domains" depends="init" description="create JEE distributions for cspace and nuxeo">
+               <antcall target="dist-jee-cspace" />
+               <antcall target="dist-jee-nuxeo" />
+       </target>
+
+       <target name="dist-jee-cspace" depends="dist" description="generate JEE distribution for cspace">
+               <fail message="JEE container is not installed or ${jee.dir} not found">
+                       <condition>
+                               <not>
+                                       <available file="${jee.dir}" type="dir" />
+                               </not>
+                       </condition>
+               </fail>
+
+               <fail message="CSpace is not deployed or ${jee.deploy.cspace.services} not found">
+                       <condition>
+                               <not>
+                                       <available file="${jee.deploy.cspace.services}" type="file" />
+                               </not>
+                       </condition>
+               </fail>
+
+               <tar destfile="${basedir}/dist/${jee.release}-${domain.cspace}-${release.version}.tar.gz" compression="gzip">
+                       <tarfileset dir="${jee.dir}" prefix="${jee.release}" preserveLeadingSlashes="true">
+                               <exclude name="server/${jee.domain.nuxeo}/**" />
+                               <exclude name="server/${jee.domain.cspace}/log/**" />
+                               <exclude name="server/${jee.domain.cspace}/tmp/**" />
+                       </tarfileset>
+               </tar>
+       </target>
+
+       <target name="dist-jee-nuxeo" depends="dist" description="generate nuxeo domain distribution">
+               <fail message="JEE server is not installed or ${jee.dir} not found">
+                       <condition>
+                               <not>
+                                       <available file="${jee.dir}" type="dir" />
+                               </not>
+                       </condition>
+               </fail>
+
+               <fail message="Nuxeo is not deployed or ${jee.deploy.nuxeo.plugins} not found">
+                       <condition>
+                               <not>
+                                       <available file="${jee.deploy.nuxeo.plugins}" type="dir" />
+                               </not>
+                       </condition>
+               </fail>
+
+               <tar destfile="${basedir}/dist/${jee.release}-${domain.nuxeo}-${release.version}.tar.gz" compression="gzip">
+                       <tarfileset dir="${jee.dir}" prefix="${jee.release}" preserveLeadingSlashes="true">
+                               <exclude name="server/${jee.domain.cspace}/**" />
+                               <exclude name="server/${jee.domain.nuxeo}/log/**" />
+                               <exclude name="server/${jee.domain.nuxeo}/tmp/**" />
+                       </tarfileset>
+               </tar>
+       </target>
+
+       <target name="package" depends="package-unix,package-windows" description="mvn package" />
+       <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="mvn 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="${basedir}/build" />
+               <delete dir="${basedir}/dist" />
+       </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="doc" description="Build Java API docs">
+               <ant antfile="services/build.xml" target="doc" inheritAll="false" />
+       </target>
+
+       <target name="gen_ddl" description="generate service-specific tables(s), indices, etc.">
+               <ant antfile="services/build.xml" target="gen_ddl" inheritAll="false" />
+       </target>
+
+       <!--
+               Top-level target to create (or recreate) CollectionSpace related databases.  Checks the 
+               'recreate_db' property or environment variable.
+       -->
+       <target name="create_db" depends="-create_db, -create_db_erase, -create_db_warn"
+               description="Creates or recreates CollectionSpace database(s), invoke subtasks for indexes, etc.">
+       </target>
+       
+       <!--
+               This target sets the Ant property 'create_db.recreate' based on the value of the Ant environment variable 'recreate_db'
+               and the command line property 'recreate_db'.  A command line value of 'true' for the 'recreate_db' property will override
+               the environment variable 'recreate_db' value.
+               
+               If the environment variable 'recreate_db' is set to true then the Ant property 'create_db.recreate' will get set to true; otherwise,
+               it will get set to the current value of the Ant property 'recreate_db' -which will be null if not set on the command line.
+       -->
+       <target name="-create_db">
+               <property environment="env"/>
+               <condition property="create_db.recreate" else="${recreate_db}" value="true">
+                       <equals arg1="${env.recreate_db}" arg2="true"/>
+               </condition>
+       </target>       
+
+       <!--
+               This target sends the 'create_nuxeo_db' and 'create_nuxeo_db' targets to all the Ant sub-modules/directories
+       -->
+       <target name="-create_db_erase" if="${create_db.recreate}" depends="create_db-unix, create_db-windows">
+               <antcall target="create_nuxeo_db" />
+               <antcall target="create_cspace_db" />
+       </target>
+       
+       <!--
+               Outputs a warning to the user that existing CollectionSpace databases will be replaced/overridden.
+       -->
+       <target name="-create_db_warn" unless="${create_db.recreate}">
+               <echo message="*** WARNING!  This target will delete any and all existing CollectionSpace databases."/>
+               <echo message="*** WARNING!  You must set the Ant recreate_db property to 'true' to invoke this target."/>
+               <echo message="*** WARNING!  For example,"/>
+               <echo message="*** WARNING!"/>
+               <echo message="*** WARNING!      'ant create_db -Drecreate_db=true'."/>
+               <echo message="*** WARNING!"/>
+               <echo message="*** WARNING!  Optionally, you can set an environment variable named recreate_db=true as well."/>
+               <fail message="*** ERROR - Ant property 'recreate_db' was not set to 'true'. See warning messages above."/>
+       </target>       
+
+       <target name="create_db-unix" if="osfamily-unix">
+               <exec executable="mvn" failonerror="true">
+                       <arg value="validate" /> <!-- Ensure proper env vars are set -->
+                       <arg value="${mvn.opts}" />
+               </exec>
+       </target>
+       
+       <target name="create_db-windows" if="osfamily-windows">
+               <exec executable="cmd" failonerror="true">
+                       <arg value="/c" />
+                       <arg value="mvn.bat" />
+                       <arg value="validate" /> <!-- Ensure proper env vars are set -->
+                       <arg value="${mvn.opts}" />
+               </exec>
+       </target>
+       
+
+       <target name="create_nuxeo_db" description="create nuxeo database">
+               <sql driver="${db.jdbc.driver.class}" url="${db.jdbc.csadmin.url}" userid="${db.csadmin.user}" password="${db.csadmin.user.password}" autocommit="true" src="${db.script.dir}/init_nuxeo_db.sql">
+                       <classpath>
+                               <pathelement path="${db.driver.jar}" />
+                       </classpath>
+               </sql>
+               <ant antfile="services/build.xml" target="create_nuxeo_db" inheritAll="false" />
+       </target>
+
+       <target name="create_cspace_db" description="create cspace database">
+               <sql driver="${db.jdbc.driver.class}" url="${db.jdbc.csadmin.url}" userid="${db.csadmin.user}" password="${db.csadmin.user.password}" autocommit="true" src="${db.script.dir}/init_cspace_db.sql">
+                       <classpath>
+                               <pathelement path="${db.driver.jar}" />
+                       </classpath>
+               </sql>
+               <ant antfile="services/build.xml" target="create_cspace_db" inheritAll="false" />
+       </target>
+
+       <target name="import" description="import default configuration">
+               <ant antfile="services/build.xml" target="import" inheritAll="false" />
+       </target>
+
+       <target name="deploy" depends="install, setup_initdb.sql" description="deploy services in ${jee.server.cspace}">
+               <!-- copy db scripts, etc. -->
+               <copy todir="${jee.server.cspace}/cspace/services/scripts">
+                       <fileset dir="${src}/main/resources/scripts/" />
+               </copy>
+               <ant antfile="3rdparty/build.xml" target="deploy" inheritAll="false" />
+               <ant antfile="services/build.xml" target="deploy" inheritAll="false" />
+       </target>
+
+       <target name="setup_initdb.sql" description="copy init_db scripts, replacing keywords">
+               <copy todir="${jee.server.cspace}/cspace/services/db">
+                       <fileset dir="${src}/main/resources/db" />
+                       <filterset>
+                               <filter token="DB_CSADMIN_NAME" value="${db.csadmin.name}" />
+                               <filter token="DB_CSADMIN_USER" value="${db.csadmin.user}" />
+                               <filter token="DB_CSADMIN_PASSWORD" value="${env.DB_CSADMIN_PASSWORD}" />
+                               <!-- Note: double-subs from ${db.xyz.password} fail -->
+
+                               <filter token="DB_CSPACE_NAME" value="${db.cspace.name}" />
+                               <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />
+                               <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" />
+                               <!-- Note: double-subs from ${db.xyz.password} fail -->
+
+                               <filter token="DB_NUXEO_NAME" value="${db.nuxeo.name}" />
+                               <filter token="DB_NUXEO_USER" value="${db.nuxeo.user}" />
+                               <filter token="DB_NUXEO_PASSWORD" value="${env.DB_NUXEO_PASSWORD}" />
+                               <!-- Note: double-subs from ${db.xyz.password} fail -->
+
+                               <filter token="DB_READER_USER" value="${db.reader.user}" />
+                               <filter token="DB_READER_PASSWORD" value="${env.DB_READER_PASSWORD}" />
+                               <!-- Note: double-subs from ${db.xyz.password} fail -->
+                       </filterset>
+               </copy>
+       </target>
+
+       <target name="undeploy" description="undeploy services from ${jee.server.cspace}">
+               <ant antfile="services/build.xml" target="undeploy" inheritAll="false" />
+               <ant antfile="3rdparty/build.xml" target="undeploy" inheritAll="false" />
+               <delete failonerror="false" dir="${jee.server.cspace}/cspace/services" />
+               <delete failonerror="false" dir="${jee.server.cspace}/cspace/config/services" />
+               <!-- Delete mysql-ds.xml to clean up pre-1.8 bundles -->
+               <delete failonerror="false" file="${jee.deploy.cspace}/mysql-ds.xml" />
+               <delete failonerror="false" file="${jee.deploy.cspace}/jee-ds.xml" />
+               <delete failonerror="false" file="${jee.deploy.cspace}/cspace-ds.xml" />
+       </target>
+
+       <target name="hotdeploy" depends="install" description="deploy services in running ${jee.server.cspace}">
+               <ant antfile="services/build.xml" target="hotdeploy" inheritAll="false" />
+       </target>
+
+       <target name="eclipse" depends="eclipse-unix,eclipse-windows" description="Generate Eclipse files" />
+       <target name="eclipse-unix" if="osfamily-unix">
+               <exec executable="mvn" failonerror="true">
+                       <arg value="eclipse:clean" />
+                       <arg value="eclipse:eclipse" />
+                       <arg value="${mvn.opts}" />
+               </exec>
+               <exec executable="fixeclipse" failonerror="true" />
+       </target>
+       <target name="eclipse-windows" if="osfamily-windows">
+               <exec executable="cmd" failonerror="true">
+                       <arg value="/c" />
+                       <arg value="mvn.bat" />
+                       <arg value="eclipse:clean" />
+                       <arg value="eclipse:eclipse" />
+                       <arg value="${mvn.opts}" />
+               </exec>
+       </target>
+
+</project>
index 20ac2d6f87a887cd4840ef3bac6b35741334b9fe..9e8bc943ae39966df927a629ce32ae2f5be0370f 100644 (file)
-<project name="trunk-install" default="package" basedir=".">\r
-    <description>\r
-        collectionspace services\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <property file="build.properties" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-    \r
-    <target name="install"\r
-       description="Installer: Copy artifacts for CollectionSpace Nuxeo doctypes">\r
-        <!-- cspace\server\cspace -->     \r
-        <copy todir="${jee.server.cspace}/cspace">\r
-            <fileset dir="${services.trunk}/${dist.server.cspace}/cspace"/>\r
-        </copy>\r
-        <!-- cspace\server\cspace\deploy -->     \r
-        <copy todir="${jee.server.cspace}/deploy">\r
-            <fileset dir="${services.trunk}/${dist.server.cspace}/deploy">\r
-               <include name="*"/>\r
-            </fileset>\r
-        </copy>\r
-        <!-- cspace\server\cspace\lib -->      \r
-        <copy todir="${jee.server.cspace}/lib">\r
-            <fileset dir="${services.trunk}/${dist.server.cspace}/lib"/>\r
-        </copy>   \r
-        <!-- cspace\server\cspace\nuxeo-client\lib -->     \r
-        <copy todir="${jee.server.cspace}/nuxeo-client/lib">\r
-            <fileset dir="${services.trunk}/${dist.server.cspace}/nuxeo-client/lib">\r
-               <include name="*.jar"/>\r
-                                               </fileset>\r
-        </copy>\r
-        <!-- cspace\server\cspace\nuxeo-client\lib (5.2GA) -->      \r
-        <copy todir="${jee.server.cspace}/nuxeo-client/lib">\r
-            <fileset dir="${services.trunk}/${dist.server.cspace}/nuxeo-client/lib/${nuxeo.release}">\r
-               <include name="*.jar"/>\r
-                                               </fileset>\r
-        </copy>\r
-        <!-- Now execute the "install" target on the services -->\r
-                               <ant antfile="services/build.xml" target="install" inheritAll="false"/>        \r
-    </target>    \r
-    \r
-    <target name="config" description="" depends="install">\r
-        <!-- Now execute the "install" target on the services -->\r
-                               <ant antfile="services/build.xml" target="config" inheritAll="false"/>        \r
-    </target>    \r
-    \r
-    <target name="predeploy" depends="config, create_cspace_db, create_nuxeo_db">\r
-                               <!-- Now, invoke the "predeploy" target on each of the services' install directories -->\r
-        <ant antfile="services/build.xml" target="predeploy" inheritAll="false"/>              \r
-    </target>\r
-\r
-               <target name="create_nuxeo_db" \r
-                                                       description="create nuxeo database">\r
-                       <sql driver="${db.jdbc.driver.class}"\r
-                                                        url="${db.jdbc.csadmin.url.encoded}"\r
-                                                        userid="${db.csadmin.user}"\r
-                                                        password="${db.csadmin.user.password}"\r
-                                                        autocommit="true"\r
-                                                        src="${db.script.dir}/init_nuxeo_db.sql"\r
-                                                        >\r
-                               <classpath>\r
-                                       <pathelement path="${db.driver.jar}"/>\r
-                               </classpath>\r
-                       </sql>\r
-               <ant antfile="services/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
-               </target>\r
-\r
-               <target name="create_cspace_db" \r
-                       description="create cspace database">\r
-                       <sql driver="${db.jdbc.driver.class}"\r
-                                                        url="${db.jdbc.csadmin.url.encoded}"\r
-                                                        userid="${db.csadmin.user}"\r
-                                                        password="${db.csadmin.user.password}"\r
-                                                        autocommit="true"\r
-                                                        src="${db.script.dir}/init_cspace_db.sql"\r
-                                                        >\r
-                               <classpath>\r
-                                       <pathelement path="${db.driver.jar}"/>\r
-                               </classpath>\r
-                       </sql>\r
-               <ant antfile="services/build.xml" target="create_cspace_db" inheritAll="false"/>\r
-               </target>\r
-\r
-\r
-    \r
-    <target name="deploy" description="">\r
-                               <!-- Now, invoke the "deploy" target on each of the services' install directories -->\r
-        <ant antfile="services/build.xml" target="deploy" inheritAll="false"/>         \r
-    </target>     \r
-       \r
-    <target name="postdeploy">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target." />\r
-                               </exec>\r
-                               <!-- Now, invoke the "postdeploy" target on each of the services' install directories -->\r
-        <ant antfile="services/build.xml" target="postdeploy" inheritAll="false"/>\r
-    </target>\r
-\r
-</project>\r
+<project name="trunk-install" default="package" basedir=".">
+    <description>
+        collectionspace services
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="build.properties" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+    
+    <target name="install"
+       description="Installer: Copy artifacts for CollectionSpace Nuxeo doctypes">
+        <!-- cspace\server\cspace -->     
+        <copy todir="${jee.server.cspace}/cspace">
+            <fileset dir="${services.trunk}/${dist.server.cspace}/cspace"/>
+        </copy>
+        <!-- cspace\server\cspace\deploy -->     
+        <copy todir="${jee.server.cspace}/deploy">
+            <fileset dir="${services.trunk}/${dist.server.cspace}/deploy">
+               <include name="*"/>
+            </fileset>
+        </copy>
+        <!-- cspace\server\cspace\lib -->      
+        <copy todir="${jee.server.cspace}/lib">
+            <fileset dir="${services.trunk}/${dist.server.cspace}/lib"/>
+        </copy>   
+        <!-- cspace\server\cspace\nuxeo-client\lib -->     
+        <copy todir="${jee.server.cspace}/nuxeo-client/lib">
+            <fileset dir="${services.trunk}/${dist.server.cspace}/nuxeo-client/lib">
+               <include name="*.jar"/>
+                                               </fileset>
+        </copy>
+        <!-- cspace\server\cspace\nuxeo-client\lib (5.2GA) -->      
+        <copy todir="${jee.server.cspace}/nuxeo-client/lib">
+            <fileset dir="${services.trunk}/${dist.server.cspace}/nuxeo-client/lib/${nuxeo.release}">
+               <include name="*.jar"/>
+                                               </fileset>
+        </copy>
+        <!-- Now execute the "install" target on the services -->
+                               <ant antfile="services/build.xml" target="install" inheritAll="false"/>        
+    </target>    
+    
+    <target name="config" description="" depends="install">
+        <!-- Now execute the "install" target on the services -->
+                               <ant antfile="services/build.xml" target="config" inheritAll="false"/>        
+    </target>    
+    
+    <target name="predeploy" depends="config, create_cspace_db, create_nuxeo_db">
+                               <!-- Now, invoke the "predeploy" target on each of the services' install directories -->
+        <ant antfile="services/build.xml" target="predeploy" inheritAll="false"/>              
+    </target>
+
+               <target name="create_nuxeo_db" 
+                                                       description="create nuxeo database">
+                       <sql driver="${db.jdbc.driver.class}"
+                                                        url="${db.jdbc.csadmin.url.encoded}"
+                                                        userid="${db.csadmin.user}"
+                                                        password="${db.csadmin.user.password}"
+                                                        autocommit="true"
+                                                        src="${db.script.dir}/init_nuxeo_db.sql"
+                                                        >
+                               <classpath>
+                                       <pathelement path="${db.driver.jar}"/>
+                               </classpath>
+                       </sql>
+               <ant antfile="services/build.xml" target="create_nuxeo_db" inheritAll="false"/>
+               </target>
+
+               <target name="create_cspace_db" 
+                       description="create cspace database">
+                       <sql driver="${db.jdbc.driver.class}"
+                                                        url="${db.jdbc.csadmin.url.encoded}"
+                                                        userid="${db.csadmin.user}"
+                                                        password="${db.csadmin.user.password}"
+                                                        autocommit="true"
+                                                        src="${db.script.dir}/init_cspace_db.sql"
+                                                        >
+                               <classpath>
+                                       <pathelement path="${db.driver.jar}"/>
+                               </classpath>
+                       </sql>
+               <ant antfile="services/build.xml" target="create_cspace_db" inheritAll="false"/>
+               </target>
+
+
+    
+    <target name="deploy" description="">
+                               <!-- Now, invoke the "deploy" target on each of the services' install directories -->
+        <ant antfile="services/build.xml" target="deploy" inheritAll="false"/>         
+    </target>     
+       
+    <target name="postdeploy">
+        <exec executable="echo">
+                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target." />
+                               </exec>
+                               <!-- Now, invoke the "postdeploy" target on each of the services' install directories -->
+        <ant antfile="services/build.xml" target="postdeploy" inheritAll="false"/>
+    </target>
+
+</project>
index 174e90fb589315929cabec87531354f94f78cd5d..d72cfac404a16d5e2be64a3dae8539261dd5b72f 100644 (file)
@@ -1,66 +1,66 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://www.netbeans.org/ns/project/1">\r
-    <type>org.netbeans.modules.ant.freeform</type>\r
-    <configuration>\r
-        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">\r
-            <name>Services</name>\r
-        </general-data>\r
-        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/2">\r
-            <!-- Do not use Project Properties customizer when editing this file manually. -->\r
-            <name>Services</name>\r
-            <properties/>\r
-            <folders>\r
-                <source-folder>\r
-                    <label>CS-Services</label>\r
-                    <location>.</location>\r
-                    <encoding>UTF-8</encoding>\r
-                </source-folder>\r
-                <source-folder>\r
-                    <label>src</label>\r
-                    <type>java</type>\r
-                    <location>src</location>\r
-                    <encoding>UTF-8</encoding>\r
-                </source-folder>\r
-            </folders>\r
-            <ide-actions>\r
-                <action name="build">\r
-                    <target>package</target>\r
-                </action>\r
-                <action name="clean">\r
-                    <target>clean</target>\r
-                </action>\r
-                <action name="run">\r
-                    <target>dist</target>\r
-                </action>\r
-                <action name="rebuild">\r
-                    <target>clean</target>\r
-                    <target>package</target>\r
-                </action>\r
-            </ide-actions>\r
-            <view>\r
-                <items>\r
-                    <source-folder style="packages">\r
-                        <label>src</label>\r
-                        <location>src</location>\r
-                    </source-folder>\r
-                    <source-file>\r
-                        <location>build.xml</location>\r
-                    </source-file>\r
-                </items>\r
-                <context-menu>\r
-                    <ide-action name="build"/>\r
-                    <ide-action name="rebuild"/>\r
-                    <ide-action name="clean"/>\r
-                    <ide-action name="run"/>\r
-                </context-menu>\r
-            </view>\r
-            <subprojects/>\r
-        </general-data>\r
-        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">\r
-            <compilation-unit>\r
-                <package-root>src</package-root>\r
-                <source-level>1.5</source-level>\r
-            </compilation-unit>\r
-        </java-data>\r
-    </configuration>\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.ant.freeform</type>
+    <configuration>
+        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+            <name>Services</name>
+        </general-data>
+        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/2">
+            <!-- Do not use Project Properties customizer when editing this file manually. -->
+            <name>Services</name>
+            <properties/>
+            <folders>
+                <source-folder>
+                    <label>CS-Services</label>
+                    <location>.</location>
+                    <encoding>UTF-8</encoding>
+                </source-folder>
+                <source-folder>
+                    <label>src</label>
+                    <type>java</type>
+                    <location>src</location>
+                    <encoding>UTF-8</encoding>
+                </source-folder>
+            </folders>
+            <ide-actions>
+                <action name="build">
+                    <target>package</target>
+                </action>
+                <action name="clean">
+                    <target>clean</target>
+                </action>
+                <action name="run">
+                    <target>dist</target>
+                </action>
+                <action name="rebuild">
+                    <target>clean</target>
+                    <target>package</target>
+                </action>
+            </ide-actions>
+            <view>
+                <items>
+                    <source-folder style="packages">
+                        <label>src</label>
+                        <location>src</location>
+                    </source-folder>
+                    <source-file>
+                        <location>build.xml</location>
+                    </source-file>
+                </items>
+                <context-menu>
+                    <ide-action name="build"/>
+                    <ide-action name="rebuild"/>
+                    <ide-action name="clean"/>
+                    <ide-action name="run"/>
+                </context-menu>
+            </view>
+            <subprojects/>
+        </general-data>
+        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
+            <compilation-unit>
+                <package-root>src</package-root>
+                <source-level>1.5</source-level>
+            </compilation-unit>
+        </java-data>
+    </configuration>
+</project>
diff --git a/pom.xml b/pom.xml
index 2c7dc57c89ac7e775367315f7cf1ca56e456c158..4c8680664d5dcb52fce4a07ee768e0fde855b8eb 100644 (file)
--- a/pom.xml
+++ b/pom.xml
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- This is a NOT a test -->\r
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-\r
-       <modelVersion>4.0.0</modelVersion>\r
-       <groupId>org.collectionspace.services</groupId>\r
-       <artifactId>org.collectionspace.services</artifactId>\r
-       <version>4.2-SNAPSHOT</version>\r
-       <packaging>pom</packaging>\r
-       <name>services</name>\r
-\r
-       <properties>\r
-               <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r
-               <cspace.services.version>4.2-SNAPSHOT</cspace.services.version>\r
-               <cspace.services.client.version>4.2-SNAPSHOT</cspace.services.client.version>\r
-               <nuxeo.general.release>5.5.0-HF07</nuxeo.general.release>\r
-               <nuxeo.shell.version>${nuxeo.general.release}</nuxeo.shell.version>\r
-               <nuxeo.platform.version>${nuxeo.general.release}</nuxeo.platform.version>\r
-               <nuxeo.core.version>${nuxeo.general.release}</nuxeo.core.version>\r
-               <spring.version>3.0.5.RELEASE</spring.version>\r
-               <spring.security.version>3.0.5.RELEASE</spring.security.version>\r
-       </properties>\r
-\r
-       <distributionManagement>\r
-               <repository>\r
-                       <id>libs-release-local</id>\r
-                       <name>libs-release-local</name>\r
-                       <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>\r
-               </repository>\r
-               <snapshotRepository>\r
-                       <id>libs-snapshot-local</id>\r
-                       <name>libs-snapshot-local</name>\r
-                       <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>\r
-               </snapshotRepository>\r
-       </distributionManagement>\r
-\r
-       <modules>\r
-               <module>3rdparty</module>\r
-               <module>services</module>\r
-       </modules>\r
-\r
-       <repositories>\r
-               <repository>\r
-                       <id>collectionspace-remote-repos</id>\r
-                       <name>collectionspace-remote-repos</name>\r
-                       <url>http://nightly.collectionspace.org:8081/artifactory/remote-repos</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-               <repository>\r
-                       <id>libs-release-local</id>\r
-                       <name>libs-release-local</name>\r
-                       <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-               <repository>\r
-                       <id>repo1</id>\r
-                       <name>Maven repo1</name>\r
-                       <url>http://repo1.maven.org/maven2</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-               <repository>\r
-                       <id>repo2</id>\r
-                       <name>Maven repo2</name>\r
-                       <url>http://repo2.maven.org/maven2</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-               <repository>\r
-                       <id>maven2-repository.dev.java.net</id>\r
-                       <name>Java.net Maven 2 Repository</name>\r
-                       <url>http://download.java.net/maven/2</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-               <!-- <repository> <id>maven1-repository.dev.java.net</id> <name>Java.net \r
-                       Maven 1 Repository</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> \r
-                       <snapshots> <enabled>false</enabled> </snapshots> </repository> -->\r
-\r
-               <repository>\r
-                       <id>jboss.org</id>\r
-                       <url>https://repository.jboss.org/nexus</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-               <!-- some security binaries available under .com only perhaps due to licensing \r
-                       issues -->\r
-               <repository>\r
-                       <id>jboss.com</id>\r
-                       <url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-\r
-               <repository>\r
-                       <id>codehaus repo</id>\r
-                       <name>codehaus repo</name>\r
-                       <url>http://repository.codehaus.org</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-\r
-               <repository>\r
-                       <id>nuxeo-public</id>\r
-                       <name>nuxeo-public</name>\r
-                       <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public</url>\r
-                       <releases>\r
-                               <enabled>true</enabled>\r
-                       </releases>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-\r
-               <repository>\r
-                       <id>public-snapshot</id>\r
-                       <url>http://maven.nuxeo.org/public-snapshot</url>\r
-                       <!-- Nuxeo Snapshots Repository is disabled. -->\r
-                       <releases>\r
-                               <enabled>false</enabled>\r
-                       </releases>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                               <!--<updatePolicy>never</updatePolicy> -->\r
-                       </snapshots>\r
-               </repository>\r
-\r
-               <repository>\r
-                       <id>public</id>\r
-                       <url>http://maven.nuxeo.org/public</url>\r
-                       <!-- Nuxeo Releases Repository is disabled. -->\r
-                       <releases>\r
-                               <enabled>true</enabled>\r
-                       </releases>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </repository>\r
-\r
-               <repository>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-                       <releases>\r
-                               <enabled>true</enabled>\r
-                       </releases>\r
-                       <id>el4jReleaseRepositoryExternal</id>\r
-                       <name>External release repository of the EL4J project</name>\r
-                       <url>http://public-el4.elca-services.ch/el4j/maven2repository</url>\r
-               </repository>\r
-\r
-               <repository>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-                       <releases>\r
-                               <enabled>true</enabled>\r
-                       </releases>\r
-                       <id>Apache</id>\r
-                       <name>External release repository of the Apache projects</name>\r
-                       <url>https://repository.apache.org/content/groups/public/</url>\r
-               </repository>\r
-\r
-       </repositories>\r
-\r
-       <pluginRepositories>\r
-               <pluginRepository>\r
-                       <id>collectionspace-remote-repos</id>\r
-                       <name>collectionspace-remote-repos</name>\r
-                       <url>http://nightly.collectionspace.org:8081/artifactory/remote-repos</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </pluginRepository>\r
-               <pluginRepository>\r
-                       <id>repo1</id>\r
-                       <name>Maven repo1</name>\r
-                       <url>http://repo1.maven.org/maven2</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </pluginRepository>\r
-               <pluginRepository>\r
-                       <id>maven repo</id>\r
-                       <name>maven repo</name>\r
-                       <url>http://repo2.maven.org/maven2</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </pluginRepository>\r
-               <pluginRepository>\r
-                       <id>maven2-repository.dev.java.net</id>\r
-                       <url>http://download.java.net/maven/2</url>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </pluginRepository>\r
-               <pluginRepository>\r
-                       <id>Codehaus Repository</id>\r
-                       <url>http://repository.codehaus.org/</url>\r
-                       <releases>\r
-                               <enabled>true</enabled>\r
-                       </releases>\r
-                       <snapshots>\r
-                               <enabled>false</enabled>\r
-                       </snapshots>\r
-               </pluginRepository>\r
-       </pluginRepositories>\r
-\r
-       <build>\r
-               <pluginManagement>\r
-                       <plugins>\r
-                               <plugin>\r
-                                       <groupId>org.apache.maven.plugins</groupId>\r
-                                       <artifactId>maven-javadoc-plugin</artifactId>\r
-                                       <version>2.6.1</version>\r
-                                       <configuration>\r
-                                               <show>public</show>\r
-                                       </configuration>\r
-                               </plugin>\r
-                               <plugin>\r
-                                       <groupId>org.apache.maven.plugins</groupId>\r
-                                       <artifactId>maven-compiler-plugin</artifactId>\r
-                                       <version>2.3</version>\r
-                                       <configuration>\r
-                                               <source>1.7</source>\r
-                                               <target>1.7</target>\r
-                                       </configuration>\r
-                               </plugin>\r
-                               <plugin>\r
-                                       <groupId>org.apache.maven.plugins</groupId>\r
-                                       <artifactId>maven-assembly-plugin</artifactId>\r
-                                       <configuration>\r
-                                       </configuration>\r
-                               </plugin>\r
-                               <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> \r
-                                       <configuration> <dependencyLocationEnabled>false</dependencyLocationEnabled> \r
-                                       <unzipCommand>/usr/bin/unzip -o &gt; err.txt</unzipCommand> </configuration> \r
-                                       </plugin> -->\r
-                               <plugin>\r
-                                       <groupId>org.apache.maven.plugins</groupId>\r
-                                       <artifactId>maven-war-plugin</artifactId>\r
-                                       <version>2.1.1</version>\r
-                                       <configuration>\r
-                                               <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>\r
-                                               <archive>\r
-                                                       <manifest>\r
-                                                               <addClasspath>true</addClasspath>\r
-                                                       </manifest>\r
-                                               </archive>\r
-                                       </configuration>\r
-                               </plugin>\r
-\r
-                               <plugin>\r
-                                       <groupId>org.apache.maven.plugins</groupId>\r
-                                       <artifactId>maven-jar-plugin</artifactId>\r
-                                       <version>2.2</version>\r
-                               </plugin>\r
-\r
-                               <plugin>\r
-                                       <groupId>org.apache.maven.plugins</groupId>\r
-                                       <artifactId>maven-dependency-plugin</artifactId>\r
-                                       <executions>\r
-                                               <execution>\r
-                                                       <id>classpath</id>\r
-                                                       <goals>\r
-                                                               <goal>build-classpath</goal>\r
-                                                       </goals>\r
-                                                       <configuration>\r
-                                                               <outputFile>classpath</outputFile>\r
-                                                       </configuration>\r
-                                               </execution>\r
-                                       </executions>\r
-                               </plugin>\r
-                               <!--This plugin's configuration is used to store Eclipse m2e settings \r
-                                       only. It has no influence on the Maven build itself. -->\r
-                               <plugin>\r
-                                       <groupId>org.eclipse.m2e</groupId>\r
-                                       <artifactId>lifecycle-mapping</artifactId>\r
-                                       <version>1.0.0</version>\r
-                                       <configuration>\r
-                                               <lifecycleMappingMetadata>\r
-                                                       <pluginExecutions>\r
-                                                               <pluginExecution>\r
-                                                                       <pluginExecutionFilter>\r
-                                                                               <groupId>org.jvnet.hyperjaxb3</groupId>\r
-                                                                               <artifactId>maven-hyperjaxb3-plugin</artifactId>\r
-                                                                               <versionRange>[0.5.6,)</versionRange>\r
-                                                                               <goals>\r
-                                                                                       <goal>generate</goal>\r
-                                                                               </goals>\r
-                                                                       </pluginExecutionFilter>\r
-                                                                       <action>\r
-                                                                               <execute></execute>\r
-                                                                       </action>\r
-                                                               </pluginExecution>\r
-                                                               <pluginExecution>\r
-                                                                       <pluginExecutionFilter>\r
-                                                                               <groupId>\r
-                                                                                       org.apache.maven.plugins\r
-                                                                               </groupId>\r
-                                                                               <artifactId>\r
-                                                                                       maven-antrun-plugin\r
-                                                                               </artifactId>\r
-                                                                               <versionRange>\r
-                                                                                       [1.3,)\r
-                                                                               </versionRange>\r
-                                                                               <goals>\r
-                                                                                       <goal>run</goal>\r
-                                                                               </goals>\r
-                                                                       </pluginExecutionFilter>\r
-                                                                       <action>\r
-                                                                               <ignore></ignore>\r
-                                                                       </action>\r
-                                                               </pluginExecution>\r
-                                                       </pluginExecutions>\r
-                                               </lifecycleMappingMetadata>\r
-                                       </configuration>\r
-                               </plugin>\r
-                       </plugins>\r
-               </pluginManagement>\r
-               <plugins>\r
-                       <plugin>\r
-                               <groupId>org.apache.maven.plugins</groupId>\r
-                               <artifactId>maven-compiler-plugin</artifactId>\r
-                       </plugin>\r
-                       <!-- \r
-                               This plugin ensures that the required environment variables are set before we perform\r
-                               any build related tasks.\r
-                        -->\r
-                       <plugin>\r
-                               <artifactId>maven-antrun-plugin</artifactId>\r
-                               <executions>\r
-                                       <execution>\r
-                                               <id>check-environment-vars</id>\r
-                                               <phase>validate</phase>\r
-                                               <goals>\r
-                                                       <goal>run</goal>\r
-                                               </goals>\r
-                                               <configuration>\r
-                                                       <tasks>\r
-                                                               <fail unless="env.CSPACE_JEESERVER_HOME" message="Required environment variable CSPACE_JEESERVER_HOME has not been set." />\r
-                                                               <fail unless="env.DB_CSPACE_PASSWORD" message="Required environment variable DB_CSPACE_PASSWORD has not been set." />\r
-                                                               <fail unless="env.DB_NUXEO_PASSWORD" message="Required environment variable DB_NUXEO_PASSWORD has not been set." />\r
-                                                               <fail unless="env.DB_READER_PASSWORD" message="Required environment variable DB_READER_PASSWORD has not been set." />\r
-                                                               <fail unless="env.DB_CSADMIN_PASSWORD" message="Required environment variable DB_CSADMIN_PASSWORD has not been set." />\r
-                                                               <!--\r
-                                                                       Fail if these deprecated environment variables are set.\r
-                                                               -->\r
-                                                               <fail if="env.DB_USER" message="The deprecated environment variable DB_USER should not be set." />\r
-                                                               <fail if="env.DB_PASSWORD" message="The deprecated environment variable DB_PASSWORD should not be set.  Ensure that DB_CSADMIN_PASSWORD is set instead." />\r
-                                                               <fail if="env.DB_PASSWORD_CSPACE" message="The deprecated environment variable DB_PASSWORD_CSPACE should not be set.  Ensure that DB_CSPACE_PASSWORD is set instead." />\r
-                                                               <fail if="env.DB_PASSWORD_NUXEO" message="The deprecated environment variable DB_PASSWORD_NUXEO should not be set.  Ensure that DB_NUXEO_PASSWORD is set instead." />\r
-                                                       </tasks>\r
-                                               </configuration>\r
-                                       </execution>\r
-                               </executions>\r
-                       </plugin>\r
-               </plugins>\r
-       </build>\r
-\r
-       <dependencyManagement>\r
-               <dependencies>\r
-                       <dependency>\r
-                               <groupId>org.slf4j</groupId>\r
-                               <artifactId>slf4j-api</artifactId>\r
-                               <version>1.6.1</version>\r
-                       </dependency>\r
-                       <dependency>\r
-                               <groupId>org.slf4j</groupId>\r
-                               <artifactId>slf4j-log4j12</artifactId>\r
-                               <version>1.6.1</version>\r
-                       </dependency>\r
-                       <dependency>\r
-                               <groupId>org.testng</groupId>\r
-                               <artifactId>testng</artifactId>\r
-                               <version>6.1.1</version>\r
-                               <!-- <version>5.6</version> -->\r
-                               <scope>test</scope>\r
-                       </dependency>\r
-                       <dependency>\r
-                               <groupId>javax.ejb</groupId>\r
-                               <artifactId>ejb</artifactId>\r
-                               <version>${jboss.ejb.version}</version>\r
-                               <scope>provided</scope>\r
-                       </dependency>\r
-                       <dependency>\r
-                               <groupId>javax.annotation</groupId>\r
-                               <artifactId>jsr250-api</artifactId>\r
-                               <version>1.0</version>\r
-                               <scope>provided</scope>\r
-                       </dependency>\r
-                       <dependency>\r
-                               <groupId>javax.jms</groupId>\r
-                               <artifactId>jms</artifactId>\r
-                               <version>1.1</version>\r
-                               <scope>provided</scope>\r
-                       </dependency>\r
-                       <dependency>\r
-                               <groupId>javax.transaction</groupId>\r
-                               <artifactId>jta</artifactId>\r
-                               <version>1.1</version>\r
-                               <!-- <scope>provided</scope> -->\r
-                       </dependency>\r
-\r
-                       <dependency>\r
-                               <groupId>org.jboss.remoting</groupId>\r
-                               <artifactId>jboss-remoting</artifactId>\r
-                               <version>2.5.1</version>\r
-                               <scope>provided</scope>\r
-                       </dependency>\r
-                       <dependency>\r
-                               <groupId>jboss</groupId>\r
-                               <artifactId>jboss-annotations-ejb3</artifactId>\r
-                               <version>3.0-RC8</version>\r
-                               <scope>provided</scope>\r
-                       </dependency>\r
-                       <dependency>\r
-                               <groupId>org.jboss.javaee</groupId>\r
-                               <artifactId>jboss-javaee</artifactId>\r
-                               <version>5.0.1.GA</version>\r
-                               <scope>provided</scope>\r
-                       </dependency>\r
-\r
-                       <dependency>\r
-                               <groupId>javax.ejb</groupId>\r
-                               <artifactId>ejb-api</artifactId>\r
-                               <version>3.0</version>\r
-                               <scope>provided</scope>\r
-                       </dependency>\r
-               </dependencies>\r
-       </dependencyManagement>\r
-\r
-       <reporting>\r
-               <plugins>\r
-                       <plugin>\r
-                               <groupId>org.apache.maven.plugins</groupId>\r
-                               <artifactId>maven-project-info-reports-plugin</artifactId>\r
-                               <version>2.6</version>\r
-                               <configuration>\r
-                               </configuration>\r
-                               <reportSets>\r
-                                       <reportSet>\r
-                                               <reports>\r
-                                                       <report>dependencies</report>\r
-                                               </reports>\r
-                                       </reportSet>\r
-                               </reportSets>\r
-                       </plugin>\r
-                       <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> \r
-                               <version>2.6.1</version> <configuration> <show>public</show> </configuration> \r
-                               </plugin> -->\r
-               </plugins>\r
-       </reporting>\r
-\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is a NOT a test -->
+<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">
+
+       <modelVersion>4.0.0</modelVersion>
+       <groupId>org.collectionspace.services</groupId>
+       <artifactId>org.collectionspace.services</artifactId>
+       <version>4.2-SNAPSHOT</version>
+       <packaging>pom</packaging>
+       <name>services</name>
+
+       <properties>
+               <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+               <cspace.services.version>4.2-SNAPSHOT</cspace.services.version>
+               <cspace.services.client.version>4.2-SNAPSHOT</cspace.services.client.version>
+               <nuxeo.general.release>5.5.0-HF07</nuxeo.general.release>
+               <nuxeo.shell.version>${nuxeo.general.release}</nuxeo.shell.version>
+               <nuxeo.platform.version>${nuxeo.general.release}</nuxeo.platform.version>
+               <nuxeo.core.version>${nuxeo.general.release}</nuxeo.core.version>
+               <spring.version>3.0.5.RELEASE</spring.version>
+               <spring.security.version>3.0.5.RELEASE</spring.security.version>
+       </properties>
+
+       <distributionManagement>
+               <repository>
+                       <id>libs-release-local</id>
+                       <name>libs-release-local</name>
+                       <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>
+               </repository>
+               <snapshotRepository>
+                       <id>libs-snapshot-local</id>
+                       <name>libs-snapshot-local</name>
+                       <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>
+               </snapshotRepository>
+       </distributionManagement>
+
+       <modules>
+               <module>3rdparty</module>
+               <module>services</module>
+       </modules>
+
+       <repositories>
+               <repository>
+                       <id>collectionspace-remote-repos</id>
+                       <name>collectionspace-remote-repos</name>
+                       <url>http://nightly.collectionspace.org:8081/artifactory/remote-repos</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+               <repository>
+                       <id>libs-release-local</id>
+                       <name>libs-release-local</name>
+                       <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+               <repository>
+                       <id>repo1</id>
+                       <name>Maven repo1</name>
+                       <url>http://repo1.maven.org/maven2</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+               <repository>
+                       <id>repo2</id>
+                       <name>Maven repo2</name>
+                       <url>http://repo2.maven.org/maven2</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+               <repository>
+                       <id>maven2-repository.dev.java.net</id>
+                       <name>Java.net Maven 2 Repository</name>
+                       <url>http://download.java.net/maven/2</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+               <!-- <repository> <id>maven1-repository.dev.java.net</id> <name>Java.net 
+                       Maven 1 Repository</name> <url>http://download.java.net/maven/1</url> <layout>legacy</layout> 
+                       <snapshots> <enabled>false</enabled> </snapshots> </repository> -->
+
+               <repository>
+                       <id>jboss.org</id>
+                       <url>https://repository.jboss.org/nexus</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+               <!-- some security binaries available under .com only perhaps due to licensing 
+                       issues -->
+               <repository>
+                       <id>jboss.com</id>
+                       <url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+
+               <repository>
+                       <id>codehaus repo</id>
+                       <name>codehaus repo</name>
+                       <url>http://repository.codehaus.org</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+
+               <repository>
+                       <id>nuxeo-public</id>
+                       <name>nuxeo-public</name>
+                       <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public</url>
+                       <releases>
+                               <enabled>true</enabled>
+                       </releases>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+
+               <repository>
+                       <id>public-snapshot</id>
+                       <url>http://maven.nuxeo.org/public-snapshot</url>
+                       <!-- Nuxeo Snapshots Repository is disabled. -->
+                       <releases>
+                               <enabled>false</enabled>
+                       </releases>
+                       <snapshots>
+                               <enabled>false</enabled>
+                               <!--<updatePolicy>never</updatePolicy> -->
+                       </snapshots>
+               </repository>
+
+               <repository>
+                       <id>public</id>
+                       <url>http://maven.nuxeo.org/public</url>
+                       <!-- Nuxeo Releases Repository is disabled. -->
+                       <releases>
+                               <enabled>true</enabled>
+                       </releases>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </repository>
+
+               <repository>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+                       <releases>
+                               <enabled>true</enabled>
+                       </releases>
+                       <id>el4jReleaseRepositoryExternal</id>
+                       <name>External release repository of the EL4J project</name>
+                       <url>http://public-el4.elca-services.ch/el4j/maven2repository</url>
+               </repository>
+
+               <repository>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+                       <releases>
+                               <enabled>true</enabled>
+                       </releases>
+                       <id>Apache</id>
+                       <name>External release repository of the Apache projects</name>
+                       <url>https://repository.apache.org/content/groups/public/</url>
+               </repository>
+
+       </repositories>
+
+       <pluginRepositories>
+               <pluginRepository>
+                       <id>collectionspace-remote-repos</id>
+                       <name>collectionspace-remote-repos</name>
+                       <url>http://nightly.collectionspace.org:8081/artifactory/remote-repos</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </pluginRepository>
+               <pluginRepository>
+                       <id>repo1</id>
+                       <name>Maven repo1</name>
+                       <url>http://repo1.maven.org/maven2</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </pluginRepository>
+               <pluginRepository>
+                       <id>maven repo</id>
+                       <name>maven repo</name>
+                       <url>http://repo2.maven.org/maven2</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </pluginRepository>
+               <pluginRepository>
+                       <id>maven2-repository.dev.java.net</id>
+                       <url>http://download.java.net/maven/2</url>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </pluginRepository>
+               <pluginRepository>
+                       <id>Codehaus Repository</id>
+                       <url>http://repository.codehaus.org/</url>
+                       <releases>
+                               <enabled>true</enabled>
+                       </releases>
+                       <snapshots>
+                               <enabled>false</enabled>
+                       </snapshots>
+               </pluginRepository>
+       </pluginRepositories>
+
+       <build>
+               <pluginManagement>
+                       <plugins>
+                               <plugin>
+                                       <groupId>org.apache.maven.plugins</groupId>
+                                       <artifactId>maven-javadoc-plugin</artifactId>
+                                       <version>2.6.1</version>
+                                       <configuration>
+                                               <show>public</show>
+                                       </configuration>
+                               </plugin>
+                               <plugin>
+                                       <groupId>org.apache.maven.plugins</groupId>
+                                       <artifactId>maven-compiler-plugin</artifactId>
+                                       <version>2.3</version>
+                                       <configuration>
+                                               <source>1.7</source>
+                                               <target>1.7</target>
+                                       </configuration>
+                               </plugin>
+                               <plugin>
+                                       <groupId>org.apache.maven.plugins</groupId>
+                                       <artifactId>maven-assembly-plugin</artifactId>
+                                       <configuration>
+                                       </configuration>
+                               </plugin>
+                               <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> 
+                                       <configuration> <dependencyLocationEnabled>false</dependencyLocationEnabled> 
+                                       <unzipCommand>/usr/bin/unzip -o &gt; err.txt</unzipCommand> </configuration> 
+                                       </plugin> -->
+                               <plugin>
+                                       <groupId>org.apache.maven.plugins</groupId>
+                                       <artifactId>maven-war-plugin</artifactId>
+                                       <version>2.1.1</version>
+                                       <configuration>
+                                               <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
+                                               <archive>
+                                                       <manifest>
+                                                               <addClasspath>true</addClasspath>
+                                                       </manifest>
+                                               </archive>
+                                       </configuration>
+                               </plugin>
+
+                               <plugin>
+                                       <groupId>org.apache.maven.plugins</groupId>
+                                       <artifactId>maven-jar-plugin</artifactId>
+                                       <version>2.2</version>
+                               </plugin>
+
+                               <plugin>
+                                       <groupId>org.apache.maven.plugins</groupId>
+                                       <artifactId>maven-dependency-plugin</artifactId>
+                                       <executions>
+                                               <execution>
+                                                       <id>classpath</id>
+                                                       <goals>
+                                                               <goal>build-classpath</goal>
+                                                       </goals>
+                                                       <configuration>
+                                                               <outputFile>classpath</outputFile>
+                                                       </configuration>
+                                               </execution>
+                                       </executions>
+                               </plugin>
+                               <!--This plugin's configuration is used to store Eclipse m2e settings 
+                                       only. It has no influence on the Maven build itself. -->
+                               <plugin>
+                                       <groupId>org.eclipse.m2e</groupId>
+                                       <artifactId>lifecycle-mapping</artifactId>
+                                       <version>1.0.0</version>
+                                       <configuration>
+                                               <lifecycleMappingMetadata>
+                                                       <pluginExecutions>
+                                                               <pluginExecution>
+                                                                       <pluginExecutionFilter>
+                                                                               <groupId>org.jvnet.hyperjaxb3</groupId>
+                                                                               <artifactId>maven-hyperjaxb3-plugin</artifactId>
+                                                                               <versionRange>[0.5.6,)</versionRange>
+                                                                               <goals>
+                                                                                       <goal>generate</goal>
+                                                                               </goals>
+                                                                       </pluginExecutionFilter>
+                                                                       <action>
+                                                                               <execute></execute>
+                                                                       </action>
+                                                               </pluginExecution>
+                                                               <pluginExecution>
+                                                                       <pluginExecutionFilter>
+                                                                               <groupId>
+                                                                                       org.apache.maven.plugins
+                                                                               </groupId>
+                                                                               <artifactId>
+                                                                                       maven-antrun-plugin
+                                                                               </artifactId>
+                                                                               <versionRange>
+                                                                                       [1.3,)
+                                                                               </versionRange>
+                                                                               <goals>
+                                                                                       <goal>run</goal>
+                                                                               </goals>
+                                                                       </pluginExecutionFilter>
+                                                                       <action>
+                                                                               <ignore></ignore>
+                                                                       </action>
+                                                               </pluginExecution>
+                                                       </pluginExecutions>
+                                               </lifecycleMappingMetadata>
+                                       </configuration>
+                               </plugin>
+                       </plugins>
+               </pluginManagement>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-compiler-plugin</artifactId>
+                       </plugin>
+                       <!-- 
+                               This plugin ensures that the required environment variables are set before we perform
+                               any build related tasks.
+                        -->
+                       <plugin>
+                               <artifactId>maven-antrun-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>check-environment-vars</id>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>run</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <tasks>
+                                                               <fail unless="env.CSPACE_JEESERVER_HOME" message="Required environment variable CSPACE_JEESERVER_HOME has not been set." />
+                                                               <fail unless="env.DB_CSPACE_PASSWORD" message="Required environment variable DB_CSPACE_PASSWORD has not been set." />
+                                                               <fail unless="env.DB_NUXEO_PASSWORD" message="Required environment variable DB_NUXEO_PASSWORD has not been set." />
+                                                               <fail unless="env.DB_READER_PASSWORD" message="Required environment variable DB_READER_PASSWORD has not been set." />
+                                                               <fail unless="env.DB_CSADMIN_PASSWORD" message="Required environment variable DB_CSADMIN_PASSWORD has not been set." />
+                                                               <!--
+                                                                       Fail if these deprecated environment variables are set.
+                                                               -->
+                                                               <fail if="env.DB_USER" message="The deprecated environment variable DB_USER should not be set." />
+                                                               <fail if="env.DB_PASSWORD" message="The deprecated environment variable DB_PASSWORD should not be set.  Ensure that DB_CSADMIN_PASSWORD is set instead." />
+                                                               <fail if="env.DB_PASSWORD_CSPACE" message="The deprecated environment variable DB_PASSWORD_CSPACE should not be set.  Ensure that DB_CSPACE_PASSWORD is set instead." />
+                                                               <fail if="env.DB_PASSWORD_NUXEO" message="The deprecated environment variable DB_PASSWORD_NUXEO should not be set.  Ensure that DB_NUXEO_PASSWORD is set instead." />
+                                                       </tasks>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+       </build>
+
+       <dependencyManagement>
+               <dependencies>
+                       <dependency>
+                               <groupId>org.slf4j</groupId>
+                               <artifactId>slf4j-api</artifactId>
+                               <version>1.6.1</version>
+                       </dependency>
+                       <dependency>
+                               <groupId>org.slf4j</groupId>
+                               <artifactId>slf4j-log4j12</artifactId>
+                               <version>1.6.1</version>
+                       </dependency>
+                       <dependency>
+                               <groupId>org.testng</groupId>
+                               <artifactId>testng</artifactId>
+                               <version>6.1.1</version>
+                               <!-- <version>5.6</version> -->
+                               <scope>test</scope>
+                       </dependency>
+                       <dependency>
+                               <groupId>javax.ejb</groupId>
+                               <artifactId>ejb</artifactId>
+                               <version>${jboss.ejb.version}</version>
+                               <scope>provided</scope>
+                       </dependency>
+                       <dependency>
+                               <groupId>javax.annotation</groupId>
+                               <artifactId>jsr250-api</artifactId>
+                               <version>1.0</version>
+                               <scope>provided</scope>
+                       </dependency>
+                       <dependency>
+                               <groupId>javax.jms</groupId>
+                               <artifactId>jms</artifactId>
+                               <version>1.1</version>
+                               <scope>provided</scope>
+                       </dependency>
+                       <dependency>
+                               <groupId>javax.transaction</groupId>
+                               <artifactId>jta</artifactId>
+                               <version>1.1</version>
+                               <!-- <scope>provided</scope> -->
+                       </dependency>
+
+                       <dependency>
+                               <groupId>org.jboss.remoting</groupId>
+                               <artifactId>jboss-remoting</artifactId>
+                               <version>2.5.1</version>
+                               <scope>provided</scope>
+                       </dependency>
+                       <dependency>
+                               <groupId>jboss</groupId>
+                               <artifactId>jboss-annotations-ejb3</artifactId>
+                               <version>3.0-RC8</version>
+                               <scope>provided</scope>
+                       </dependency>
+                       <dependency>
+                               <groupId>org.jboss.javaee</groupId>
+                               <artifactId>jboss-javaee</artifactId>
+                               <version>5.0.1.GA</version>
+                               <scope>provided</scope>
+                       </dependency>
+
+                       <dependency>
+                               <groupId>javax.ejb</groupId>
+                               <artifactId>ejb-api</artifactId>
+                               <version>3.0</version>
+                               <scope>provided</scope>
+                       </dependency>
+               </dependencies>
+       </dependencyManagement>
+
+       <reporting>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-project-info-reports-plugin</artifactId>
+                               <version>2.6</version>
+                               <configuration>
+                               </configuration>
+                               <reportSets>
+                                       <reportSet>
+                                               <reports>
+                                                       <report>dependencies</report>
+                                               </reports>
+                                       </reportSet>
+                               </reportSets>
+                       </plugin>
+                       <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> 
+                               <version>2.6.1</version> <configuration> <show>public</show> </configuration> 
+                               </plugin> -->
+               </plugins>
+       </reporting>
+
+</project>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 62e96255f7dfc7aae66c1ecc4445df21e6fa4886..78d6efb7d7249450f406f387b7a4699e2d342096 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.main</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.main</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 4f0c76dd2707bc7d1ffc6d639b1a71ca2a44317d..741d64810694c907c6b4d05b0ae816745f546f5f 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.IntegrationTests</artifactId>\r
-    <name>services.IntegrationTests</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <!-- CollectionObject dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.dimension.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.dimension.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-<!-- External dependencies -->\r
-        <dependency>\r
-                       <groupId>commons-cli</groupId>\r
-                       <artifactId>commons-cli</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-            <scope>compile</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>jaxen</groupId>\r
-            <artifactId>jaxen</artifactId>\r
-            <version>1.1.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.apache.commons</groupId>\r
-            <artifactId>commons-jexl</artifactId>\r
-            <version>2.0.1</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>jdom</groupId>\r
-            <artifactId>jdom</artifactId>\r
-            <version>1.0</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-IntegrationTests</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-jar-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <goals>\r
-                            <goal>test-jar</goal>\r
-                        </goals>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-            <plugin>\r
-                <!-- The way this works, is you call:\r
-                     cd C:\src\trunk\services\IntegrationTests\\r
-                        mvn exec:java\r
-                     or, with an override:\r
-                        mvn exec:java -DxmlReplayBaseDir=C:/my/override/directory\r
-                     or:\r
-                        mvn -DskipTests exec:java -DtestID=testfoo -DtestGroupID=bar -DxmlReplayBaseDir=mojo -DautoDeletePOSTS=true\r
-                -->\r
-                <groupId>org.codehaus.mojo</groupId>\r
-                <artifactId>exec-maven-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <goals>\r
-                            <goal>java</goal>\r
-                        </goals>\r
-                    </execution>\r
-                </executions>\r
-                <configuration>\r
-                    <mainClass>org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay</mainClass>\r
-                    <arguments>\r
-                        <argument>-xmlReplayBaseDir</argument>\r
-                        <argument>${basedir}/src/test/resources/test-data/xmlreplay</argument>\r
-                    </arguments>\r
-                    <systemProperties>\r
-                    </systemProperties>\r
-                </configuration>\r
-            </plugin>\r
-\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.IntegrationTests</artifactId>
+    <name>services.IntegrationTests</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- CollectionObject dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.dimension.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.dimension.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+<!-- External dependencies -->
+        <dependency>
+                       <groupId>commons-cli</groupId>
+                       <artifactId>commons-cli</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jaxen</groupId>
+            <artifactId>jaxen</artifactId>
+            <version>1.1.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-jexl</artifactId>
+            <version>2.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>jdom</groupId>
+            <artifactId>jdom</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-IntegrationTests</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <!-- The way this works, is you call:
+                     cd C:\src\trunk\services\IntegrationTests\
+                        mvn exec:java
+                     or, with an override:
+                        mvn exec:java -DxmlReplayBaseDir=C:/my/override/directory
+                     or:
+                        mvn -DskipTests exec:java -DtestID=testfoo -DtestGroupID=bar -DxmlReplayBaseDir=mojo -DautoDeletePOSTS=true
+                -->
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <mainClass>org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay</mainClass>
+                    <arguments>
+                        <argument>-xmlReplayBaseDir</argument>
+                        <argument>${basedir}/src/test/resources/test-data/xmlreplay</argument>
+                    </arguments>
+                    <systemProperties>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+</project>
+
index 905abb1a6f638e4235fd0477c1b013d93d7705dd..2d3ab5cac63a21956fc951eac36b40584fe423b4 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.IntegrationTests.xmlreplay;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-\r
-import java.io.*;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-public class PayloadLogger{\r
-\r
-    public static void saveReport(){\r
-        reporter.writeTable();\r
-    }\r
-\r
-    private static Reporter reporter = new Reporter();\r
-\r
-    private static volatile int ID = 1000;\r
-    public String getID(){\r
-        return ""+ID;\r
-    }\r
-\r
-    private static String DD = "--";\r
-    private static String LABEL="LABEL: ";\r
-\r
-    static class Reporter {\r
-        public Reporter(){\r
-            table.append("<html><body><table border='1'>\r\n");\r
-        }\r
-        public static final String START = "<tr><td>";\r
-        public static final String SEP = "</td><td>";\r
-        public static final String END = "</td></tr>";\r
-\r
-        public void writeTable(){\r
-            table.append("</table></body></html>");\r
-            saveFile("./xml/", "results.html", table.toString());\r
-        }\r
-\r
-        private StringBuffer table = new StringBuffer();\r
-\r
-        public synchronized void finished(HttpTraffic traffic){\r
-            String direction = traffic.isRequest ?\r
-                                "<span style='background-color: lightgreen;'>==&gt;</span>"\r
-                                :\r
-                                " &lt;==";\r
-            table.append(START)\r
-                    .append(direction)\r
-                    .append(SEP)\r
-                    .append(traffic==null ? "null" : traffic.toRow(SEP, this))\r
-                    .append(END);\r
-        }\r
-\r
-        public synchronized void finished(List<HttpTraffic> trafficList){\r
-            for (HttpTraffic traffic: trafficList){\r
-                finished(traffic);\r
-            }\r
-        }\r
-\r
-        public static String link(String desc, String url){\r
-            return "<a href='"+url+"'>"+desc+"</a>";\r
-        }\r
-        public static final String newline = "<br />\r\n";\r
-\r
-    }\r
-\r
-\r
-    static class HttpTraffic {\r
-        public HttpTraffic(){\r
-            payloads = new ArrayList<Part>();\r
-        }\r
-        public List<Part> payloads;\r
-        public String method = "";\r
-        public String url = "";\r
-        public String queryParams = "";\r
-        public String message = "";\r
-        public int responseCode = 0;\r
-        public String boundary = "";\r
-        public String location = "";\r
-        public long contentLength = -1;\r
-        public boolean isRequest = true;\r
-        public boolean extra = false;\r
-        public String ID = "0";\r
-        public int nexti = 0;\r
-\r
-        public Part getPart(String label){\r
-            for (Part part : payloads){\r
-                if (part.label.equalsIgnoreCase(label)){\r
-                    return part;\r
-                }\r
-            }\r
-            return null;\r
-        }\r
-\r
-        public String toRow(String sep, Reporter reporter){\r
-            StringBuffer b = new StringBuffer();\r
-            for (Part part : payloads){\r
-                String name = part.label;\r
-                if (part.filename.length()==0){\r
-                    continue;\r
-                }\r
-                if (name.trim().length()<=0){\r
-                    name = ID;\r
-                }\r
-                name = name+" ("+part.filetype+')';\r
-                String link = reporter.link(name, part.filename);\r
-                b.append(link)\r
-                 .append(reporter.newline);\r
-            }\r
-            String parts = b.toString();\r
-            if (isRequest){\r
-                return  ID+sep\r
-                        +method+sep\r
-                        +url+sep\r
-                        +queryParams+sep\r
-                        +sep\r
-                        +parts;\r
-            } else {\r
-                return  ID+sep\r
-                        +responseCode+sep\r
-                        +message+sep\r
-                        +location+sep\r
-                        +contentLength+sep\r
-                        +url\r
-                        +parts;\r
-            }\r
-        }\r
-    }\r
-\r
-    static class Part {\r
-        public Part(String boundary){\r
-            this.boundary = boundary;\r
-        }\r
-        public boolean isMultipart(){\r
-            return boundary.length()>0;\r
-        }\r
-        public String toString(){\r
-            return "Part:"+label+";";\r
-        }\r
-        public String filename = "";\r
-        public String filetype = "";\r
-        public String boundary;\r
-        public StringBuffer buffer = new StringBuffer();\r
-        public String getContent(){\r
-            return buffer.toString();\r
-        }\r
-        public String label = "";\r
-        public int readPart(String[]lines, int i){\r
-            String line = "";\r
-            boolean readingPartHeaders = true;\r
-            while(readingPartHeaders){\r
-                line = killTrailingWS(lines[i]);\r
-                if (line.toUpperCase().startsWith(LABEL)){\r
-                    this.label = line.substring(LABEL.length()).trim();\r
-                } else if (line.trim().length()==0){\r
-                    readingPartHeaders = false;\r
-                }\r
-                i++;\r
-            }\r
-            while (i<lines.length){\r
-                line = lines[i];\r
-                if (line.startsWith(DD+boundary)){\r
-                    return i;   \r
-                }\r
-                this.buffer.append(line).append("\r\n");   //todo: maybe don't add CRLF on last line.\r
-                i++;\r
-            }\r
-            return i;               \r
-        }\r
-        public int readRemaining(String [] lines, int i, long contentLength){\r
-            String line;\r
-            int bytesRead=0;\r
-            while (i<lines.length && bytesRead<contentLength){\r
-                line = killTrailingWS(lines[i]);\r
-                if (line.startsWith("HTTP/1.1")){\r
-                    return i;\r
-                }\r
-                int read = line.length();\r
-                bytesRead += read;\r
-                buffer.append(line).append("\r\n");   //todo: maybe don't add CRLF on last line.\r
-                i++;\r
-            }\r
-            return i;\r
-        }\r
-    }\r
-\r
-    public static String parseBoundary(String headerLine) {\r
-        if (Tools.isEmpty(headerLine)) {\r
-            return "";\r
-        }\r
-        String lineUP = headerLine.toUpperCase();\r
-        String boundary = "";\r
-        if (lineUP.startsWith("CONTENT-TYPE:")) {\r
-            String[] boundaryTokens = headerLine.split("boundary=");\r
-            if (boundaryTokens.length == 2) {\r
-                boundary = killTrailingWS(boundaryTokens[1]);\r
-                //Header might be:\r
-                // Content-Type: multipart/mixed; boundary=a97c20ab-3ef6-4adc-82b0-6cf28c450faf;charset=ISO-8859-1\r
-\r
-                String[] boundaryTerm = boundary.split(";");\r
-                boundary = boundaryTerm[0];\r
-\r
-            } else if (boundaryTokens.length > 2) {\r
-                System.err.println("WARNING: too many tokens after boundary= on Content-Type: header line: " + headerLine);\r
-            }\r
-        }\r
-        return boundary;\r
-    }\r
-\r
-    /** places the boundary on the HttpTraffic in parameter object if boundary found in header "Content-Type:".\r
-     *  @return the index of the NEXT line the caller should read. */\r
-    protected static int readHeaders(HttpTraffic traffic, String[]lines, int i){\r
-        int lineCount = lines.length;\r
-        String line, lineUP;\r
-        // Now read headers until we are ready for payload or parts.\r
-        while (i<lineCount){\r
-            line = lines[i];\r
-            if (line.trim().length()==0){  //blank line seen: end of headers.\r
-                i++;\r
-                break;\r
-            } else {  //still reading outer headers.\r
-                lineUP = line.toUpperCase().trim();\r
-                if (lineUP.startsWith("CONTENT-TYPE:")){\r
-                    String[] boundaryTokens = line.split("boundary=");\r
-                    if (boundaryTokens.length == 2){\r
-                        traffic.boundary = killTrailingWS(boundaryTokens[1]);\r
-\r
-                    } else if (boundaryTokens.length > 2){\r
-                        System.err.println("WARNING: too many tokens after boundary= on Content-Type: header line: "+line);\r
-                    }\r
-                } else if (lineUP.startsWith("LOCATION: ")){\r
-                    traffic.location = killTrailingWS(line.substring("LOCATION: ".length()));\r
-                } else if (lineUP.startsWith("CONTENT-LENGTH: ")){\r
-                    traffic.contentLength = Integer.parseInt(killTrailingWS(line.substring("CONTENT-LENGTH: ".length())));\r
-                }\r
-                i++;\r
-            }\r
-        }\r
-        return i;\r
-    }\r
-\r
-\r
-    //  0  1  2  3\r
-    //  a  b  c  \r\r
-\r
-    private static String killTrailingWS(String s){\r
-        int i = s.length();\r
-        while (i>0){\r
-            char c = s.charAt(i-1);\r
-            if (c=='\r' || c=='\n' || c==' '){\r
-                i--;\r
-                continue;\r
-            } else {\r
-                break;\r
-            }\r
-        }\r
-        return s.substring(0, i);\r
-    }\r
-\r
-    public static HttpTraffic readPayloads(String fullPayload, String boundary, long contentLength){\r
-        HttpTraffic traffic = new HttpTraffic();\r
-        traffic.contentLength = contentLength;\r
-        traffic.boundary = boundary;\r
-        String [] lines = fullPayload.split("\\n", -1);\r
-        readPayloads(traffic, lines, 0);\r
-        return traffic;\r
-    }\r
-\r
-    protected static int readPayloads(HttpTraffic traffic, String[]lines, int i){\r
-        if (traffic.boundary.length()<=0){   //END of headers, and no boundary, so read remaining and return.\r
-            if (traffic.contentLength == 0){\r
-                return i;\r
-            }\r
-            Part part = new Part("");\r
-            traffic.payloads.add(part);\r
-            i = part.readRemaining(lines, i, traffic.contentLength);\r
-            return i;\r
-        }\r
-        int lineCount = lines.length;\r
-        String line;\r
-        while (i<lineCount){\r
-            //rest of message is payloads.\r
-            line = lines[i];\r
-\r
-            if (line.startsWith( DD + traffic.boundary + DD )){   //this is the ending boundary.\r
-                //close and accept payload chunk.\r
-                i++;  //bump past last boundary.  There might be more traffic after this.\r
-                return i;\r
-            } else if (line.startsWith(DD + traffic.boundary)){   //this is a first or middle boundary, but not last boundary.\r
-                i++;  //bump past boundary\r
-                //begin payload chunk\r
-                Part part = new Part(traffic.boundary);\r
-                traffic.payloads.add(part);\r
-                i = part.readPart(lines, i);\r
-            } else {\r
-                return i;\r
-                //if (line.trim().length()>0){\r
-                //    System.err.println("********** Skipping line: "+line); //either parser error, or something is outside of a boundary.\r
-                //}\r
-                //i++;\r
-            }\r
-        }\r
-        return i;\r
-    }\r
-\r
-         \r
-    private HttpTraffic parseForward(String forward, int nexti){\r
-        HttpTraffic forwardTraffic = new HttpTraffic();\r
-        forwardTraffic.isRequest = true;\r
-        forwardTraffic.ID = getID();\r
-        //String[] lines = forward.split("\\r\\n", -1);\r
-        String[] lines = forward.split("\\n", -1);\r
-        int lineCount = lines.length;\r
-        String line;\r
-        int i = nexti;\r
-\r
-        // Read the first line, and figure out if GET, POST, etc., and the URI\r
-        line = lines[i];\r
-        while (line.trim().length()==0){\r
-            i++;\r
-            if (i>=lineCount-1){\r
-                return null;\r
-            }\r
-            line = lines[i];\r
-        }\r
-        String[] tokens = line.split(" ", -1);\r
-        forwardTraffic.method = tokens[0];\r
-        String urlString = tokens[1];\r
-        String[] urlHalves = urlString.split("\\?", -1); //look for a query string of the form /foo/bar?param=baz and break on question mark.\r
-        forwardTraffic.url = urlHalves[0];\r
-        if (urlHalves.length > 1){\r
-            forwardTraffic.queryParams = urlHalves[1];\r
-        }\r
-        i++;\r
-\r
-        //if (forwardTraffic.method.equals("GET")|| forwardTraffic.method.equals("DELETE")){\r
-        //    return forwardTraffic;\r
-        //}\r
-        // Now read headers until we are ready for payload or parts.\r
-        i = readHeaders(forwardTraffic, lines, i);\r
-\r
-        /*\r
-        if ( (i<lines.length-1) && (forwardTraffic.contentLength<=0) ) {  //0 means a 0 was seen, -1 means no header was seen, as will be the case in GET or DELETE.\r
-\r
-            //there are more lines, but content-length header was zero,\r
-            // this means we are getting keep-alive bunches of DELETEs or OKs back.\r
-            System.err.println("###### extra requests in this one."+getID());\r
-            String filename = getID()+'_'+forwardTraffic.method+'_'+forwardTraffic.url.replaceAll("/", "_")+".requests";\r
-            saveFile("./xml", filename, forward);\r
-            return forwardTraffic;\r
-        }\r
-        */\r
-\r
-        // We are past headers now. The rest of message is payloads.\r
-        i = readPayloads(forwardTraffic, lines, i);  //messes with forwardTraffic and places parts in it.\r
-        forwardTraffic.nexti = i;\r
-        return forwardTraffic;\r
-    }\r
-\r
-    private HttpTraffic parseReverse(String reverse, int nexti){\r
-        HttpTraffic reverseTraffic = new HttpTraffic();\r
-        reverseTraffic.isRequest = false;\r
-        reverseTraffic.ID = getID();\r
-        //String[] lines = reverse.split("\\r\\n", -1);\r
-        String[] lines = reverse.split("\\n", -1);\r
-        int lineCount = lines.length;\r
-        String line;\r
-        int i = nexti;\r
-        if (i>=lineCount){\r
-            return null;\r
-        }\r
-        line = lines[i];\r
-                   \r
-        // Read the first line, and figure out response code, message.\r
-        while (i<lineCount){\r
-            if (line.startsWith("HTTP/1.1")){\r
-                break;\r
-            }\r
-            i++;\r
-            line = lines[i];\r
-        }\r
-        String[] tokens = line.split(" ", 3);\r
-        String HTTP11 = tokens[0];\r
-        reverseTraffic.responseCode = Integer.parseInt(tokens[1]);\r
-        reverseTraffic.message = killTrailingWS(tokens[2]);\r
-        i++;  // done reading first line. Bump past first line.\r
-\r
-        //if (forwardResult.message.equals("OK")){\r
-        //    return forwardResult;\r
-        //}\r
-\r
-        // Now read headers until we are ready for payload or parts.\r
-        i = readHeaders(reverseTraffic, lines, i);\r
-\r
-        /*\r
-        if ( (i<lines.length-1) && (reverseTraffic.contentLength==0) ) {\r
-            //there are more lines, but content-length header was zero,\r
-            // this means we are getting keep-alive bunches of DELETEs or OKs back.\r
-            System.err.println("###### extra responses in this one."+id);\r
-            String filename = getID()+".reponses";\r
-            saveFile("./xml", filename, reverse);\r
-            reverseTraffic.extra = true;\r
-            return reverseTraffic;\r
-        }\r
-        */\r
-        // We are past headers now. The rest of message is payloads.\r
-        i = readPayloads(reverseTraffic, lines, i);  //messes with forwardResult and places parts in it.\r
-        reverseTraffic.nexti = i;\r
-        if (i>=lineCount){\r
-            reverseTraffic.nexti = -1;\r
-        }\r
-        return reverseTraffic;\r
-    }\r
-\r
-    private List<HttpTraffic> handleTcpDump(String dump){\r
-        int i = 0;\r
-        int trafficID = 0;\r
-        List<HttpTraffic> trafficList = new ArrayList<HttpTraffic>();\r
-        while (i>-1){\r
-            trafficID++;\r
-            HttpTraffic forward = parseForward(dump, i);\r
-            if (forward==null) break;\r
-            i = forward.nexti;\r
-            forward.ID = ""+trafficID;\r
-            if (forward.payloads.size()>0){\r
-                saveForwardFiles(forward);\r
-            }\r
-            trafficList.add(forward);\r
-\r
-            HttpTraffic reverse = parseReverse(dump, i);\r
-            if (reverse==null) break;\r
-            reverse.ID = ""+trafficID;\r
-            i = reverse.nexti;\r
-            if (reverse.payloads.size()>0){\r
-                saveReverseFiles(reverse);\r
-            }\r
-            trafficList.add(reverse);\r
-        }\r
-        return trafficList;\r
-    }\r
-\r
-    public static File saveFile(String dir, String relativeName, String content){\r
-        File result = null;\r
-        PrintWriter writer;\r
-        try{\r
-            result = new File(dir, relativeName);\r
-            writer = new PrintWriter(new FileOutputStream(result));\r
-        }catch (Exception e){\r
-            System.out.println("Can't write to file in saveFile: " + relativeName + "  \r\n" + e);\r
-            return null;\r
-        }\r
-        writer.write(content);\r
-        writer.close();\r
-        return result;\r
-    }\r
-    \r
-    private void saveForwardFiles(HttpTraffic fr){\r
-        for (Part part : fr.payloads){\r
-            String body = part.buffer.toString();\r
-            if (body.trim().length()==0){\r
-                continue;\r
-            }\r
-            String filename = fr.ID+'_'+fr.method+'_'+fr.url.replaceAll("/", "_")+'_'+part.label+".xml";\r
-            filename = filename.replaceAll("/", "_");\r
-            System.out.println("trying to save file: "+filename+" :: "+fr);\r
-            part.filename = filename;\r
-            saveFile("./xml", filename, body);\r
-        }\r
-    }\r
-    \r
-    private void saveReverseFiles(HttpTraffic fr){\r
-        for (Part part : fr.payloads){\r
-            String body = part.buffer.toString();\r
-            if (body.trim().length()==0){\r
-                continue;\r
-            }\r
-            String filename = fr.ID+'_'+fr.method+'_'+fr.url.replaceAll("/", "_");\r
-            if (part.label.length()==0){\r
-                if (body.trim().startsWith("<?xml")){\r
-                    filename = filename + "_res.xml";\r
-                    part.filetype = "xml";\r
-                } else {\r
-                    filename = filename + "_res.txt";\r
-                    part.filetype = "txt";\r
-                }\r
-            } else {\r
-                filename = filename + '_'+part.label+"_res.xml";\r
-                part.filetype = "xml";\r
-            }\r
-            filename = filename.replaceAll("/", "_");\r
-            System.out.println("trying to save file: "+filename+" :: "+fr);\r
-            part.filename = filename;\r
-            saveFile("./xml", filename, body);\r
-        }\r
-    }\r
-\r
-    public static String readFile(String dir, String relPath) throws Exception{\r
-        File theFile = new File(dir, relPath);\r
-        FileInputStream fis = new FileInputStream(theFile);\r
-        byte[] theData = new byte[(int) theFile.length()];\r
-        // need to check the number of bytes read here\r
-        int howmany = fis.read(theData);\r
-        fis.close();\r
-        return new String(theData);\r
-    }\r
-\r
-    public static List<HttpTraffic> process(String httpSessionTraffic){\r
-        PayloadLogger pll = new PayloadLogger();\r
-        List<HttpTraffic> trafficList = pll.handleTcpDump(httpSessionTraffic);\r
-        return trafficList;\r
-    }\r
-\r
-    public static void main(String[]args) throws Exception {\r
-        String dump = readFile(".", args[0]);\r
-        PayloadLogger pll = new PayloadLogger();\r
-        List<HttpTraffic> trafficList = pll.handleTcpDump(dump);\r
-        reporter.finished(trafficList);\r
-        saveReport();\r
-    }\r
-\r
-    \r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.collectionspace.services.IntegrationTests.xmlreplay;
+
+import org.collectionspace.services.common.api.Tools;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public class PayloadLogger{
+
+    public static void saveReport(){
+        reporter.writeTable();
+    }
+
+    private static Reporter reporter = new Reporter();
+
+    private static volatile int ID = 1000;
+    public String getID(){
+        return ""+ID;
+    }
+
+    private static String DD = "--";
+    private static String LABEL="LABEL: ";
+
+    static class Reporter {
+        public Reporter(){
+            table.append("<html><body><table border='1'>\r\n");
+        }
+        public static final String START = "<tr><td>";
+        public static final String SEP = "</td><td>";
+        public static final String END = "</td></tr>";
+
+        public void writeTable(){
+            table.append("</table></body></html>");
+            saveFile("./xml/", "results.html", table.toString());
+        }
+
+        private StringBuffer table = new StringBuffer();
+
+        public synchronized void finished(HttpTraffic traffic){
+            String direction = traffic.isRequest ?
+                                "<span style='background-color: lightgreen;'>==&gt;</span>"
+                                :
+                                " &lt;==";
+            table.append(START)
+                    .append(direction)
+                    .append(SEP)
+                    .append(traffic==null ? "null" : traffic.toRow(SEP, this))
+                    .append(END);
+        }
+
+        public synchronized void finished(List<HttpTraffic> trafficList){
+            for (HttpTraffic traffic: trafficList){
+                finished(traffic);
+            }
+        }
+
+        public static String link(String desc, String url){
+            return "<a href='"+url+"'>"+desc+"</a>";
+        }
+        public static final String newline = "<br />\r\n";
+
+    }
+
+
+    static class HttpTraffic {
+        public HttpTraffic(){
+            payloads = new ArrayList<Part>();
+        }
+        public List<Part> payloads;
+        public String method = "";
+        public String url = "";
+        public String queryParams = "";
+        public String message = "";
+        public int responseCode = 0;
+        public String boundary = "";
+        public String location = "";
+        public long contentLength = -1;
+        public boolean isRequest = true;
+        public boolean extra = false;
+        public String ID = "0";
+        public int nexti = 0;
+
+        public Part getPart(String label){
+            for (Part part : payloads){
+                if (part.label.equalsIgnoreCase(label)){
+                    return part;
+                }
+            }
+            return null;
+        }
+
+        public String toRow(String sep, Reporter reporter){
+            StringBuffer b = new StringBuffer();
+            for (Part part : payloads){
+                String name = part.label;
+                if (part.filename.length()==0){
+                    continue;
+                }
+                if (name.trim().length()<=0){
+                    name = ID;
+                }
+                name = name+" ("+part.filetype+')';
+                String link = reporter.link(name, part.filename);
+                b.append(link)
+                 .append(reporter.newline);
+            }
+            String parts = b.toString();
+            if (isRequest){
+                return  ID+sep
+                        +method+sep
+                        +url+sep
+                        +queryParams+sep
+                        +sep
+                        +parts;
+            } else {
+                return  ID+sep
+                        +responseCode+sep
+                        +message+sep
+                        +location+sep
+                        +contentLength+sep
+                        +url
+                        +parts;
+            }
+        }
+    }
+
+    static class Part {
+        public Part(String boundary){
+            this.boundary = boundary;
+        }
+        public boolean isMultipart(){
+            return boundary.length()>0;
+        }
+        public String toString(){
+            return "Part:"+label+";";
+        }
+        public String filename = "";
+        public String filetype = "";
+        public String boundary;
+        public StringBuffer buffer = new StringBuffer();
+        public String getContent(){
+            return buffer.toString();
+        }
+        public String label = "";
+        public int readPart(String[]lines, int i){
+            String line = "";
+            boolean readingPartHeaders = true;
+            while(readingPartHeaders){
+                line = killTrailingWS(lines[i]);
+                if (line.toUpperCase().startsWith(LABEL)){
+                    this.label = line.substring(LABEL.length()).trim();
+                } else if (line.trim().length()==0){
+                    readingPartHeaders = false;
+                }
+                i++;
+            }
+            while (i<lines.length){
+                line = lines[i];
+                if (line.startsWith(DD+boundary)){
+                    return i;   
+                }
+                this.buffer.append(line).append("\r\n");   //todo: maybe don't add CRLF on last line.
+                i++;
+            }
+            return i;               
+        }
+        public int readRemaining(String [] lines, int i, long contentLength){
+            String line;
+            int bytesRead=0;
+            while (i<lines.length && bytesRead<contentLength){
+                line = killTrailingWS(lines[i]);
+                if (line.startsWith("HTTP/1.1")){
+                    return i;
+                }
+                int read = line.length();
+                bytesRead += read;
+                buffer.append(line).append("\r\n");   //todo: maybe don't add CRLF on last line.
+                i++;
+            }
+            return i;
+        }
+    }
+
+    public static String parseBoundary(String headerLine) {
+        if (Tools.isEmpty(headerLine)) {
+            return "";
+        }
+        String lineUP = headerLine.toUpperCase();
+        String boundary = "";
+        if (lineUP.startsWith("CONTENT-TYPE:")) {
+            String[] boundaryTokens = headerLine.split("boundary=");
+            if (boundaryTokens.length == 2) {
+                boundary = killTrailingWS(boundaryTokens[1]);
+                //Header might be:
+                // Content-Type: multipart/mixed; boundary=a97c20ab-3ef6-4adc-82b0-6cf28c450faf;charset=ISO-8859-1
+
+                String[] boundaryTerm = boundary.split(";");
+                boundary = boundaryTerm[0];
+
+            } else if (boundaryTokens.length > 2) {
+                System.err.println("WARNING: too many tokens after boundary= on Content-Type: header line: " + headerLine);
+            }
+        }
+        return boundary;
+    }
+
+    /** places the boundary on the HttpTraffic in parameter object if boundary found in header "Content-Type:".
+     *  @return the index of the NEXT line the caller should read. */
+    protected static int readHeaders(HttpTraffic traffic, String[]lines, int i){
+        int lineCount = lines.length;
+        String line, lineUP;
+        // Now read headers until we are ready for payload or parts.
+        while (i<lineCount){
+            line = lines[i];
+            if (line.trim().length()==0){  //blank line seen: end of headers.
+                i++;
+                break;
+            } else {  //still reading outer headers.
+                lineUP = line.toUpperCase().trim();
+                if (lineUP.startsWith("CONTENT-TYPE:")){
+                    String[] boundaryTokens = line.split("boundary=");
+                    if (boundaryTokens.length == 2){
+                        traffic.boundary = killTrailingWS(boundaryTokens[1]);
+
+                    } else if (boundaryTokens.length > 2){
+                        System.err.println("WARNING: too many tokens after boundary= on Content-Type: header line: "+line);
+                    }
+                } else if (lineUP.startsWith("LOCATION: ")){
+                    traffic.location = killTrailingWS(line.substring("LOCATION: ".length()));
+                } else if (lineUP.startsWith("CONTENT-LENGTH: ")){
+                    traffic.contentLength = Integer.parseInt(killTrailingWS(line.substring("CONTENT-LENGTH: ".length())));
+                }
+                i++;
+            }
+        }
+        return i;
+    }
+
+
+    //  0  1  2  3
+    //  a  b  c  \r
+
+    private static String killTrailingWS(String s){
+        int i = s.length();
+        while (i>0){
+            char c = s.charAt(i-1);
+            if (c=='\r' || c=='\n' || c==' '){
+                i--;
+                continue;
+            } else {
+                break;
+            }
+        }
+        return s.substring(0, i);
+    }
+
+    public static HttpTraffic readPayloads(String fullPayload, String boundary, long contentLength){
+        HttpTraffic traffic = new HttpTraffic();
+        traffic.contentLength = contentLength;
+        traffic.boundary = boundary;
+        String [] lines = fullPayload.split("\\n", -1);
+        readPayloads(traffic, lines, 0);
+        return traffic;
+    }
+
+    protected static int readPayloads(HttpTraffic traffic, String[]lines, int i){
+        if (traffic.boundary.length()<=0){   //END of headers, and no boundary, so read remaining and return.
+            if (traffic.contentLength == 0){
+                return i;
+            }
+            Part part = new Part("");
+            traffic.payloads.add(part);
+            i = part.readRemaining(lines, i, traffic.contentLength);
+            return i;
+        }
+        int lineCount = lines.length;
+        String line;
+        while (i<lineCount){
+            //rest of message is payloads.
+            line = lines[i];
+
+            if (line.startsWith( DD + traffic.boundary + DD )){   //this is the ending boundary.
+                //close and accept payload chunk.
+                i++;  //bump past last boundary.  There might be more traffic after this.
+                return i;
+            } else if (line.startsWith(DD + traffic.boundary)){   //this is a first or middle boundary, but not last boundary.
+                i++;  //bump past boundary
+                //begin payload chunk
+                Part part = new Part(traffic.boundary);
+                traffic.payloads.add(part);
+                i = part.readPart(lines, i);
+            } else {
+                return i;
+                //if (line.trim().length()>0){
+                //    System.err.println("********** Skipping line: "+line); //either parser error, or something is outside of a boundary.
+                //}
+                //i++;
+            }
+        }
+        return i;
+    }
+
+         
+    private HttpTraffic parseForward(String forward, int nexti){
+        HttpTraffic forwardTraffic = new HttpTraffic();
+        forwardTraffic.isRequest = true;
+        forwardTraffic.ID = getID();
+        //String[] lines = forward.split("\\r\\n", -1);
+        String[] lines = forward.split("\\n", -1);
+        int lineCount = lines.length;
+        String line;
+        int i = nexti;
+
+        // Read the first line, and figure out if GET, POST, etc., and the URI
+        line = lines[i];
+        while (line.trim().length()==0){
+            i++;
+            if (i>=lineCount-1){
+                return null;
+            }
+            line = lines[i];
+        }
+        String[] tokens = line.split(" ", -1);
+        forwardTraffic.method = tokens[0];
+        String urlString = tokens[1];
+        String[] urlHalves = urlString.split("\\?", -1); //look for a query string of the form /foo/bar?param=baz and break on question mark.
+        forwardTraffic.url = urlHalves[0];
+        if (urlHalves.length > 1){
+            forwardTraffic.queryParams = urlHalves[1];
+        }
+        i++;
+
+        //if (forwardTraffic.method.equals("GET")|| forwardTraffic.method.equals("DELETE")){
+        //    return forwardTraffic;
+        //}
+        // Now read headers until we are ready for payload or parts.
+        i = readHeaders(forwardTraffic, lines, i);
+
+        /*
+        if ( (i<lines.length-1) && (forwardTraffic.contentLength<=0) ) {  //0 means a 0 was seen, -1 means no header was seen, as will be the case in GET or DELETE.
+
+            //there are more lines, but content-length header was zero,
+            // this means we are getting keep-alive bunches of DELETEs or OKs back.
+            System.err.println("###### extra requests in this one."+getID());
+            String filename = getID()+'_'+forwardTraffic.method+'_'+forwardTraffic.url.replaceAll("/", "_")+".requests";
+            saveFile("./xml", filename, forward);
+            return forwardTraffic;
+        }
+        */
+
+        // We are past headers now. The rest of message is payloads.
+        i = readPayloads(forwardTraffic, lines, i);  //messes with forwardTraffic and places parts in it.
+        forwardTraffic.nexti = i;
+        return forwardTraffic;
+    }
+
+    private HttpTraffic parseReverse(String reverse, int nexti){
+        HttpTraffic reverseTraffic = new HttpTraffic();
+        reverseTraffic.isRequest = false;
+        reverseTraffic.ID = getID();
+        //String[] lines = reverse.split("\\r\\n", -1);
+        String[] lines = reverse.split("\\n", -1);
+        int lineCount = lines.length;
+        String line;
+        int i = nexti;
+        if (i>=lineCount){
+            return null;
+        }
+        line = lines[i];
+                   
+        // Read the first line, and figure out response code, message.
+        while (i<lineCount){
+            if (line.startsWith("HTTP/1.1")){
+                break;
+            }
+            i++;
+            line = lines[i];
+        }
+        String[] tokens = line.split(" ", 3);
+        String HTTP11 = tokens[0];
+        reverseTraffic.responseCode = Integer.parseInt(tokens[1]);
+        reverseTraffic.message = killTrailingWS(tokens[2]);
+        i++;  // done reading first line. Bump past first line.
+
+        //if (forwardResult.message.equals("OK")){
+        //    return forwardResult;
+        //}
+
+        // Now read headers until we are ready for payload or parts.
+        i = readHeaders(reverseTraffic, lines, i);
+
+        /*
+        if ( (i<lines.length-1) && (reverseTraffic.contentLength==0) ) {
+            //there are more lines, but content-length header was zero,
+            // this means we are getting keep-alive bunches of DELETEs or OKs back.
+            System.err.println("###### extra responses in this one."+id);
+            String filename = getID()+".reponses";
+            saveFile("./xml", filename, reverse);
+            reverseTraffic.extra = true;
+            return reverseTraffic;
+        }
+        */
+        // We are past headers now. The rest of message is payloads.
+        i = readPayloads(reverseTraffic, lines, i);  //messes with forwardResult and places parts in it.
+        reverseTraffic.nexti = i;
+        if (i>=lineCount){
+            reverseTraffic.nexti = -1;
+        }
+        return reverseTraffic;
+    }
+
+    private List<HttpTraffic> handleTcpDump(String dump){
+        int i = 0;
+        int trafficID = 0;
+        List<HttpTraffic> trafficList = new ArrayList<HttpTraffic>();
+        while (i>-1){
+            trafficID++;
+            HttpTraffic forward = parseForward(dump, i);
+            if (forward==null) break;
+            i = forward.nexti;
+            forward.ID = ""+trafficID;
+            if (forward.payloads.size()>0){
+                saveForwardFiles(forward);
+            }
+            trafficList.add(forward);
+
+            HttpTraffic reverse = parseReverse(dump, i);
+            if (reverse==null) break;
+            reverse.ID = ""+trafficID;
+            i = reverse.nexti;
+            if (reverse.payloads.size()>0){
+                saveReverseFiles(reverse);
+            }
+            trafficList.add(reverse);
+        }
+        return trafficList;
+    }
+
+    public static File saveFile(String dir, String relativeName, String content){
+        File result = null;
+        PrintWriter writer;
+        try{
+            result = new File(dir, relativeName);
+            writer = new PrintWriter(new FileOutputStream(result));
+        }catch (Exception e){
+            System.out.println("Can't write to file in saveFile: " + relativeName + "  \r\n" + e);
+            return null;
+        }
+        writer.write(content);
+        writer.close();
+        return result;
+    }
+    
+    private void saveForwardFiles(HttpTraffic fr){
+        for (Part part : fr.payloads){
+            String body = part.buffer.toString();
+            if (body.trim().length()==0){
+                continue;
+            }
+            String filename = fr.ID+'_'+fr.method+'_'+fr.url.replaceAll("/", "_")+'_'+part.label+".xml";
+            filename = filename.replaceAll("/", "_");
+            System.out.println("trying to save file: "+filename+" :: "+fr);
+            part.filename = filename;
+            saveFile("./xml", filename, body);
+        }
+    }
+    
+    private void saveReverseFiles(HttpTraffic fr){
+        for (Part part : fr.payloads){
+            String body = part.buffer.toString();
+            if (body.trim().length()==0){
+                continue;
+            }
+            String filename = fr.ID+'_'+fr.method+'_'+fr.url.replaceAll("/", "_");
+            if (part.label.length()==0){
+                if (body.trim().startsWith("<?xml")){
+                    filename = filename + "_res.xml";
+                    part.filetype = "xml";
+                } else {
+                    filename = filename + "_res.txt";
+                    part.filetype = "txt";
+                }
+            } else {
+                filename = filename + '_'+part.label+"_res.xml";
+                part.filetype = "xml";
+            }
+            filename = filename.replaceAll("/", "_");
+            System.out.println("trying to save file: "+filename+" :: "+fr);
+            part.filename = filename;
+            saveFile("./xml", filename, body);
+        }
+    }
+
+    public static String readFile(String dir, String relPath) throws Exception{
+        File theFile = new File(dir, relPath);
+        FileInputStream fis = new FileInputStream(theFile);
+        byte[] theData = new byte[(int) theFile.length()];
+        // need to check the number of bytes read here
+        int howmany = fis.read(theData);
+        fis.close();
+        return new String(theData);
+    }
+
+    public static List<HttpTraffic> process(String httpSessionTraffic){
+        PayloadLogger pll = new PayloadLogger();
+        List<HttpTraffic> trafficList = pll.handleTcpDump(httpSessionTraffic);
+        return trafficList;
+    }
+
+    public static void main(String[]args) throws Exception {
+        String dump = readFile(".", args[0]);
+        PayloadLogger pll = new PayloadLogger();
+        List<HttpTraffic> trafficList = pll.handleTcpDump(dump);
+        reporter.finished(trafficList);
+        saveReport();
+    }
+
+    
 }
\ No newline at end of file
index b9e879a37babdac714c3168748d14d310266ef2b..548a9b4d8aea6f3110b7af85f76393fa94cfd2fc 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.IntegrationTests.xmlreplay;\r
-\r
-import org.apache.commons.httpclient.Header;\r
-import org.collectionspace.services.common.api.Tools;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class ServiceResult {\r
-    public String testID = "";\r
-    public String testGroupID = "";\r
-    public String fullURL = "";\r
-    public String deleteURL = "";\r
-    public String location = "";\r
-    public String CSID = "";\r
-    public String subresourceCSID = "";\r
-    public String requestPayload = "";  //just like requestPayloadRaw, but may have multipart boundary and headers.\r
-    public String requestPayloadsRaw = "";\r
-    public String result = "";\r
-    public int responseCode = 0;\r
-    public String responseMessage = "";\r
-    public String method = "";\r
-    public String error = "";\r
-    public String fromTestID = "";\r
-    public String auth = "";\r
-    public String boundary = "";\r
-    public String payloadStrictness = "";\r
-    public long contentLength = 0;\r
-    public String failureReason = "";\r
-    public String expectedContentExpanded = "";\r
-    public Header[] responseHeaders = new Header[0];\r
-    public List<Integer> expectedCodes = new ArrayList<Integer>();\r
-    public Map<String,String>  vars = new HashMap<String,String>();\r
-    public void addVars(Map<String,String> newVars){\r
-        vars.putAll(newVars);\r
-    }\r
-    private Map<String, TreeWalkResults> partSummaries = new HashMap<String, TreeWalkResults>();\r
-    public void addPartSummary(String label, TreeWalkResults list){\r
-        partSummaries.put(label, list);\r
-    }\r
-    public String partsSummary(boolean detailed){\r
-        StringBuffer buf = new StringBuffer();\r
-        if (!isDomWalkOK()){\r
-            if (detailed) buf.append("\r\nDOM CHECK FAILED:\r\n");\r
-            else buf.append("; DOM CHECK FAILED:");\r
-        }\r
-        for (Map.Entry<String,TreeWalkResults> entry : partSummaries.entrySet()) {\r
-            String key = entry.getKey();\r
-            TreeWalkResults value = entry.getValue();\r
-            buf.append(" label:"+key+": ");\r
-            if (detailed){\r
-                buf.append("\r\n");\r
-                buf.append(value.fullSummary());\r
-            } else {\r
-                buf.append(value.miniSummary());\r
-            }\r
-\r
-        }\r
-        return buf.toString();\r
-    }\r
-    public boolean codeInSuccessRange(int code){\r
-        if (0<=code && code<200){\r
-            return false;\r
-        } else if (400<=code) {\r
-            return false;\r
-        }\r
-        return true;\r
-    }\r
-\r
-    public boolean isDomWalkOK(){\r
-        if (Tools.isEmpty(payloadStrictness)){\r
-            return true;\r
-        }\r
-        PAYLOAD_STRICTNESS strictness = PAYLOAD_STRICTNESS.valueOf(payloadStrictness);\r
-        for (Map.Entry<String,TreeWalkResults> entry : partSummaries.entrySet()) {\r
-            String key = entry.getKey();\r
-            TreeWalkResults value = entry.getValue();\r
-            if (value.hasDocErrors()){\r
-                failureReason = " : DOM DOC_ERROR; ";\r
-                return false;\r
-            }\r
-            switch (strictness){\r
-            case STRICT:\r
-                if (!value.isStrictMatch()) {\r
-                    failureReason = " : DOM NOT STRICT; ";\r
-                    return false;\r
-                }\r
-                break;\r
-            case ADDOK:\r
-                if (value.countFor(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT)>0) {\r
-                    failureReason = " : DOM TEXT_DIFFERENT; ";\r
-                    return false;\r
-                }\r
-                if (value.countFor(TreeWalkResults.TreeWalkEntry.STATUS.R_MISSING)>0){\r
-                    failureReason = " : DOM R_MISSING; ";\r
-                    return false;\r
-                }\r
-                break;\r
-            case TEXT:\r
-                if (value.countFor(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT)>0) {\r
-                    failureReason = " : DOM TEXT_DIFFERENT; ";\r
-                    return false;\r
-                }\r
-                break;\r
-            case TREE:\r
-                if (!value.treesMatch()) {\r
-                    failureReason = " : DOM TREE MISMATCH; ";\r
-                    return false;\r
-                }\r
-                break;\r
-            case TREE_TEXT:\r
-                if (value.countFor(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT)>0) {\r
-                    failureReason = " : DOM TEXT_DIFFERENT; ";\r
-                    return false;\r
-                }\r
-                if (!value.treesMatch()) {\r
-                    failureReason = " : DOM TREE MISMATCH; ";\r
-                    return false;\r
-                }\r
-                break;\r
-            case ZERO:\r
-                break;\r
-            }\r
-        }\r
-        return true;\r
-    }\r
-\r
-    private boolean overrideExpectedResult = false;\r
-\r
-    /** Call this method to create a ServiceResult mock object, for when you are doing autoDelete, and you come\r
-     *  across a GET : GETs don't have a DELETE url, so they don't need to be autoDeleted, so an empty ServiceResult object\r
-     *  signifies this.\r
-     */\r
-    public void overrideGotExpectedResult(){\r
-        overrideExpectedResult = true;\r
-    }\r
-\r
-    public boolean gotExpectedResult(){\r
-        if (overrideExpectedResult){\r
-            return true;\r
-        }\r
-        //if (Tools.notEmpty(failureReason)){\r
-        //    return false;\r
-        //}\r
-        for (Integer oneExpected : expectedCodes){\r
-            if (responseCode == oneExpected){\r
-                failureReason = "";\r
-                return isDomWalkOK();\r
-            }\r
-        }\r
-        if ( expectedCodes.size()>0 && codeInSuccessRange(responseCode)){ //none found, but result expected.\r
-            for (Integer oneExpected : expectedCodes){\r
-                if ( ! codeInSuccessRange(oneExpected)){\r
-                    failureReason = "";\r
-                    return isDomWalkOK();\r
-                }\r
-            }\r
-        }\r
-        boolean ok = codeInSuccessRange(responseCode);\r
-        if (ok) {\r
-            failureReason = "";\r
-            return isDomWalkOK();\r
-        }\r
-        failureReason = " : STATUS CODE UNEXPECTED; ";\r
-        return false;\r
-    }\r
-\r
-    //public static final String[] DUMP_OPTIONS = {"minimal", "detailed", "full"};\r
-    public static enum DUMP_OPTIONS {minimal, detailed, full, auto};\r
-\r
-    public static enum PAYLOAD_STRICTNESS {ZERO, ADDOK, TREE, TEXT, TREE_TEXT, STRICT};\r
-\r
-    public String toString(){\r
-        return detail(true);\r
-\r
-    }\r
-\r
-    private static final String LINE = "\r\n==================================";\r
-    private static final String CRLF = "\r\n";\r
-\r
-    public String detail(boolean includePayloads){\r
-        String res =  "{"\r
-                + ( gotExpectedResult() ? "SUCCESS" : "FAILURE"  )\r
-                + failureReason\r
-                +"; "+method\r
-                +"; "+responseCode\r
-                + ( (expectedCodes.size()>0) ? "; expectedCodes:"+expectedCodes : "" )\r
-                + ( Tools.notEmpty(testID) ? "; testID:"+testID : "" )\r
-                + ( Tools.notEmpty(testGroupID) ? "; testGroupID:"+testGroupID : "" )\r
-                + ( Tools.notEmpty(fromTestID) ? "; fromTestID:"+fromTestID : "" )\r
-                + ( Tools.notEmpty(responseMessage) ? "; msg:"+responseMessage : "" )\r
-                +"; URL:"+fullURL\r
-                +"; auth: "+auth\r
-                + ( Tools.notEmpty(deleteURL) ? "; deleteURL:"+deleteURL : "" )\r
-                + ( Tools.notEmpty(location) ? "; location.CSID:"+location : "" )\r
-                + ( Tools.notEmpty(error) ? "; ERROR:"+error : "" )\r
-                + "; gotExpected:"+gotExpectedResult()\r
-                //+";result:"+result+";"\r
-                + ( partsSummary(true))\r
-                +"}"\r
-                + ( includePayloads && Tools.notBlank(requestPayload) ? LINE+"requestPayload:"+LINE+CRLF+requestPayload+LINE : "" )\r
-                + ( includePayloads && Tools.notBlank(result) ? LINE+"result:"+LINE+CRLF+result : "" );\r
-        return res;\r
-    }\r
-\r
-    public String minimal(){\r
-        return minimal(false);\r
-    }\r
-\r
-    public String minimal(boolean verbosePartsSummary){\r
-        return "{"\r
-                + ( gotExpectedResult() ? "SUCCESS" : "FAILURE"  )\r
-                + failureReason\r
-                + ( Tools.notEmpty(testID) ? "; "+testID : "" )\r
-                +"; "+method\r
-                +"; "+responseCode\r
-                + (expectedCodes.size()>0 ? "; expected:"+expectedCodes : "")\r
-                + ( Tools.notEmpty(responseMessage) ? "; msg:"+responseMessage : "" )\r
-                +"; URL:"+fullURL\r
-                //for auth, see detail()   +"; auth: "+auth\r
-                + ( Tools.notEmpty(error) ? "; ERROR:"+error : "" )\r
-                + (verbosePartsSummary ? partsSummary(true) : partsSummary(false) )\r
-                +"}";\r
-    }\r
-    public String dump(ServiceResult.DUMP_OPTIONS opt, boolean hasError){\r
-        switch (opt){\r
-            case minimal:\r
-                return minimal(false);\r
-            case detailed:\r
-                return detail(false);\r
-            case full:\r
-                return detail(true);\r
-            case auto:\r
-                return minimal(hasError);\r
-            default:\r
-                return toString();\r
-        }\r
-    }\r
-\r
-    /** This method may be called from a test case, using a syntax like ${testID3.resValue("persons_common", "//refName")}   */\r
-    public String got(String xpath) throws Exception {\r
-        try {\r
-            //PayloadLogger.HttpTraffic traffic = PayloadLogger.readPayloads(this.result, this.boundary, this.contentLength);\r
-            //PayloadLogger.Part partFromServer = traffic.getPart(partName);\r
-            //String source = partFromServer.getContent();\r
-            String source = this.result;\r
-            if (Tools.isBlank(source)){\r
-                return "";\r
-            }\r
-            org.jdom.Element element = (org.jdom.Element) XmlCompareJdom.selectSingleNode(source, xpath, null);  //todo: passing null for namespace may not work.\r
-            String sr = element != null ? element.getText() : "";\r
-            return sr;\r
-        } catch (Exception e){\r
-            return "ERROR reading response value: "+e;\r
-        }\r
-    }\r
-\r
-    /** This method may be called from a test case, using a syntax like ${oe9.reqValue("personauthorities_common","//shortIdentifier")}    */\r
-    public String sent(String xpath) throws Exception {\r
-        try {\r
-            String source = this.requestPayload; // REM - 5/9/2012 : Changing to requestPayload from requestPayloadsRaw to get actual sent payload \r
-            if (source == null){\r
-                return "ERROR:null:requestPayloadsRaw";\r
-            }\r
-            org.jdom.Element element = (org.jdom.Element) XmlCompareJdom.selectSingleNode(source, xpath, null);   //e.g. "//shortIdentifier");  //todo: passing null for namespace may not work.\r
-            String sr = element != null ? element.getText() : "";\r
-            return sr;\r
-        } catch (Exception e){\r
-            return "ERROR reading request value: "+e;\r
-        }\r
-    }\r
-\r
-    public String get(String what){\r
-        if ("CSID".equals(what)){\r
-            return CSID;\r
-        } else if ("location".equals(what)){\r
-            return location;\r
-        } else if ("testID".equals(what)){\r
-            return testID;\r
-        } else if ("testGroupID".equals(what)){\r
-            return testGroupID;\r
-        } else if ("fullURL".equals(what)){\r
-            return fullURL;\r
-        } else if ("deleteURL".equals(what)){\r
-            return deleteURL;\r
-        } else if ("responseCode".equals(what)){\r
-            return ""+responseCode;\r
-        } else if ("method".equals(what)){\r
-            return method;\r
-        }\r
-        if (vars.containsKey(what)){\r
-            return vars.get(what);\r
-        }\r
-        return "";\r
-    }\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.collectionspace.services.IntegrationTests.xmlreplay;
+
+import org.apache.commons.httpclient.Header;
+import org.collectionspace.services.common.api.Tools;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class ServiceResult {
+    public String testID = "";
+    public String testGroupID = "";
+    public String fullURL = "";
+    public String deleteURL = "";
+    public String location = "";
+    public String CSID = "";
+    public String subresourceCSID = "";
+    public String requestPayload = "";  //just like requestPayloadRaw, but may have multipart boundary and headers.
+    public String requestPayloadsRaw = "";
+    public String result = "";
+    public int responseCode = 0;
+    public String responseMessage = "";
+    public String method = "";
+    public String error = "";
+    public String fromTestID = "";
+    public String auth = "";
+    public String boundary = "";
+    public String payloadStrictness = "";
+    public long contentLength = 0;
+    public String failureReason = "";
+    public String expectedContentExpanded = "";
+    public Header[] responseHeaders = new Header[0];
+    public List<Integer> expectedCodes = new ArrayList<Integer>();
+    public Map<String,String>  vars = new HashMap<String,String>();
+    public void addVars(Map<String,String> newVars){
+        vars.putAll(newVars);
+    }
+    private Map<String, TreeWalkResults> partSummaries = new HashMap<String, TreeWalkResults>();
+    public void addPartSummary(String label, TreeWalkResults list){
+        partSummaries.put(label, list);
+    }
+    public String partsSummary(boolean detailed){
+        StringBuffer buf = new StringBuffer();
+        if (!isDomWalkOK()){
+            if (detailed) buf.append("\r\nDOM CHECK FAILED:\r\n");
+            else buf.append("; DOM CHECK FAILED:");
+        }
+        for (Map.Entry<String,TreeWalkResults> entry : partSummaries.entrySet()) {
+            String key = entry.getKey();
+            TreeWalkResults value = entry.getValue();
+            buf.append(" label:"+key+": ");
+            if (detailed){
+                buf.append("\r\n");
+                buf.append(value.fullSummary());
+            } else {
+                buf.append(value.miniSummary());
+            }
+
+        }
+        return buf.toString();
+    }
+    public boolean codeInSuccessRange(int code){
+        if (0<=code && code<200){
+            return false;
+        } else if (400<=code) {
+            return false;
+        }
+        return true;
+    }
+
+    public boolean isDomWalkOK(){
+        if (Tools.isEmpty(payloadStrictness)){
+            return true;
+        }
+        PAYLOAD_STRICTNESS strictness = PAYLOAD_STRICTNESS.valueOf(payloadStrictness);
+        for (Map.Entry<String,TreeWalkResults> entry : partSummaries.entrySet()) {
+            String key = entry.getKey();
+            TreeWalkResults value = entry.getValue();
+            if (value.hasDocErrors()){
+                failureReason = " : DOM DOC_ERROR; ";
+                return false;
+            }
+            switch (strictness){
+            case STRICT:
+                if (!value.isStrictMatch()) {
+                    failureReason = " : DOM NOT STRICT; ";
+                    return false;
+                }
+                break;
+            case ADDOK:
+                if (value.countFor(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT)>0) {
+                    failureReason = " : DOM TEXT_DIFFERENT; ";
+                    return false;
+                }
+                if (value.countFor(TreeWalkResults.TreeWalkEntry.STATUS.R_MISSING)>0){
+                    failureReason = " : DOM R_MISSING; ";
+                    return false;
+                }
+                break;
+            case TEXT:
+                if (value.countFor(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT)>0) {
+                    failureReason = " : DOM TEXT_DIFFERENT; ";
+                    return false;
+                }
+                break;
+            case TREE:
+                if (!value.treesMatch()) {
+                    failureReason = " : DOM TREE MISMATCH; ";
+                    return false;
+                }
+                break;
+            case TREE_TEXT:
+                if (value.countFor(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT)>0) {
+                    failureReason = " : DOM TEXT_DIFFERENT; ";
+                    return false;
+                }
+                if (!value.treesMatch()) {
+                    failureReason = " : DOM TREE MISMATCH; ";
+                    return false;
+                }
+                break;
+            case ZERO:
+                break;
+            }
+        }
+        return true;
+    }
+
+    private boolean overrideExpectedResult = false;
+
+    /** Call this method to create a ServiceResult mock object, for when you are doing autoDelete, and you come
+     *  across a GET : GETs don't have a DELETE url, so they don't need to be autoDeleted, so an empty ServiceResult object
+     *  signifies this.
+     */
+    public void overrideGotExpectedResult(){
+        overrideExpectedResult = true;
+    }
+
+    public boolean gotExpectedResult(){
+        if (overrideExpectedResult){
+            return true;
+        }
+        //if (Tools.notEmpty(failureReason)){
+        //    return false;
+        //}
+        for (Integer oneExpected : expectedCodes){
+            if (responseCode == oneExpected){
+                failureReason = "";
+                return isDomWalkOK();
+            }
+        }
+        if ( expectedCodes.size()>0 && codeInSuccessRange(responseCode)){ //none found, but result expected.
+            for (Integer oneExpected : expectedCodes){
+                if ( ! codeInSuccessRange(oneExpected)){
+                    failureReason = "";
+                    return isDomWalkOK();
+                }
+            }
+        }
+        boolean ok = codeInSuccessRange(responseCode);
+        if (ok) {
+            failureReason = "";
+            return isDomWalkOK();
+        }
+        failureReason = " : STATUS CODE UNEXPECTED; ";
+        return false;
+    }
+
+    //public static final String[] DUMP_OPTIONS = {"minimal", "detailed", "full"};
+    public static enum DUMP_OPTIONS {minimal, detailed, full, auto};
+
+    public static enum PAYLOAD_STRICTNESS {ZERO, ADDOK, TREE, TEXT, TREE_TEXT, STRICT};
+
+    public String toString(){
+        return detail(true);
+
+    }
+
+    private static final String LINE = "\r\n==================================";
+    private static final String CRLF = "\r\n";
+
+    public String detail(boolean includePayloads){
+        String res =  "{"
+                + ( gotExpectedResult() ? "SUCCESS" : "FAILURE"  )
+                + failureReason
+                +"; "+method
+                +"; "+responseCode
+                + ( (expectedCodes.size()>0) ? "; expectedCodes:"+expectedCodes : "" )
+                + ( Tools.notEmpty(testID) ? "; testID:"+testID : "" )
+                + ( Tools.notEmpty(testGroupID) ? "; testGroupID:"+testGroupID : "" )
+                + ( Tools.notEmpty(fromTestID) ? "; fromTestID:"+fromTestID : "" )
+                + ( Tools.notEmpty(responseMessage) ? "; msg:"+responseMessage : "" )
+                +"; URL:"+fullURL
+                +"; auth: "+auth
+                + ( Tools.notEmpty(deleteURL) ? "; deleteURL:"+deleteURL : "" )
+                + ( Tools.notEmpty(location) ? "; location.CSID:"+location : "" )
+                + ( Tools.notEmpty(error) ? "; ERROR:"+error : "" )
+                + "; gotExpected:"+gotExpectedResult()
+                //+";result:"+result+";"
+                + ( partsSummary(true))
+                +"}"
+                + ( includePayloads && Tools.notBlank(requestPayload) ? LINE+"requestPayload:"+LINE+CRLF+requestPayload+LINE : "" )
+                + ( includePayloads && Tools.notBlank(result) ? LINE+"result:"+LINE+CRLF+result : "" );
+        return res;
+    }
+
+    public String minimal(){
+        return minimal(false);
+    }
+
+    public String minimal(boolean verbosePartsSummary){
+        return "{"
+                + ( gotExpectedResult() ? "SUCCESS" : "FAILURE"  )
+                + failureReason
+                + ( Tools.notEmpty(testID) ? "; "+testID : "" )
+                +"; "+method
+                +"; "+responseCode
+                + (expectedCodes.size()>0 ? "; expected:"+expectedCodes : "")
+                + ( Tools.notEmpty(responseMessage) ? "; msg:"+responseMessage : "" )
+                +"; URL:"+fullURL
+                //for auth, see detail()   +"; auth: "+auth
+                + ( Tools.notEmpty(error) ? "; ERROR:"+error : "" )
+                + (verbosePartsSummary ? partsSummary(true) : partsSummary(false) )
+                +"}";
+    }
+    public String dump(ServiceResult.DUMP_OPTIONS opt, boolean hasError){
+        switch (opt){
+            case minimal:
+                return minimal(false);
+            case detailed:
+                return detail(false);
+            case full:
+                return detail(true);
+            case auto:
+                return minimal(hasError);
+            default:
+                return toString();
+        }
+    }
+
+    /** This method may be called from a test case, using a syntax like ${testID3.resValue("persons_common", "//refName")}   */
+    public String got(String xpath) throws Exception {
+        try {
+            //PayloadLogger.HttpTraffic traffic = PayloadLogger.readPayloads(this.result, this.boundary, this.contentLength);
+            //PayloadLogger.Part partFromServer = traffic.getPart(partName);
+            //String source = partFromServer.getContent();
+            String source = this.result;
+            if (Tools.isBlank(source)){
+                return "";
+            }
+            org.jdom.Element element = (org.jdom.Element) XmlCompareJdom.selectSingleNode(source, xpath, null);  //todo: passing null for namespace may not work.
+            String sr = element != null ? element.getText() : "";
+            return sr;
+        } catch (Exception e){
+            return "ERROR reading response value: "+e;
+        }
+    }
+
+    /** This method may be called from a test case, using a syntax like ${oe9.reqValue("personauthorities_common","//shortIdentifier")}    */
+    public String sent(String xpath) throws Exception {
+        try {
+            String source = this.requestPayload; // REM - 5/9/2012 : Changing to requestPayload from requestPayloadsRaw to get actual sent payload 
+            if (source == null){
+                return "ERROR:null:requestPayloadsRaw";
+            }
+            org.jdom.Element element = (org.jdom.Element) XmlCompareJdom.selectSingleNode(source, xpath, null);   //e.g. "//shortIdentifier");  //todo: passing null for namespace may not work.
+            String sr = element != null ? element.getText() : "";
+            return sr;
+        } catch (Exception e){
+            return "ERROR reading request value: "+e;
+        }
+    }
+
+    public String get(String what){
+        if ("CSID".equals(what)){
+            return CSID;
+        } else if ("location".equals(what)){
+            return location;
+        } else if ("testID".equals(what)){
+            return testID;
+        } else if ("testGroupID".equals(what)){
+            return testGroupID;
+        } else if ("fullURL".equals(what)){
+            return fullURL;
+        } else if ("deleteURL".equals(what)){
+            return deleteURL;
+        } else if ("responseCode".equals(what)){
+            return ""+responseCode;
+        } else if ("method".equals(what)){
+            return method;
+        }
+        if (vars.containsKey(what)){
+            return vars.get(what);
+        }
+        return "";
+    }
+
+}
index 021dfe66ed666eb2216e6e2f2973e5c4fdb85209..fe24956544f7190f0640ddb68c379f2c838d8423 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.IntegrationTests.xmlreplay;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Arrays;\r
-import java.util.List;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class TreeWalkResults extends ArrayList<TreeWalkResults.TreeWalkEntry> {\r
-      public String toString(String LEAD){\r
-          StringBuffer res = new StringBuffer();\r
-          for (TreeWalkResults.TreeWalkEntry entry: this) {\r
-              res.append(entry.toString(LEAD));\r
-          }\r
-          return  res.toString();\r
-      }\r
-\r
-    /** This cllass has two public Lists: you can construct your own to set the acceptable and unacceptable STATUS codes.\r
-     *   They are defaulted to R_ADDED being acceptable. */\r
-    public static class MatchSpec {\r
-        public static final TreeWalkEntry.STATUS[]  defaultAcceptableStatiArray = {TreeWalkEntry.STATUS.INFO,\r
-                                                                                         TreeWalkEntry.STATUS.MATCHED,\r
-                                                                                         TreeWalkEntry.STATUS.R_ADDED};\r
-\r
-        public static final TreeWalkEntry.STATUS[] defaultErrorStatiArray =           {TreeWalkEntry.STATUS.R_MISSING,\r
-                                                                                          TreeWalkEntry.STATUS.NESTED_ERROR,\r
-                                                                                          TreeWalkEntry.STATUS.TEXT_DIFFERENT,\r
-                                                                                          TreeWalkEntry.STATUS.DOC_ERROR};\r
-        public List<TreeWalkEntry.STATUS> errorStati;\r
-\r
-        public static MatchSpec createDefault(){\r
-            MatchSpec result = new MatchSpec();\r
-            result.errorStati = Arrays.asList(defaultErrorStatiArray);\r
-            return result;\r
-        }\r
-        public static MatchSpec create(TreeWalkEntry.STATUS[] statiArray){\r
-            MatchSpec result = new MatchSpec();\r
-            result.errorStati = Arrays.asList(statiArray);\r
-            return result;\r
-        }\r
-        public void removeErrorFromSpec(TreeWalkEntry.STATUS status){\r
-            ArrayList arrayList = new ArrayList(errorStati);\r
-            arrayList.remove(status);\r
-            errorStati = arrayList;\r
-        }\r
-        public String toString(){\r
-            StringBuffer buff = new StringBuffer("{");\r
-            int i = 0;\r
-            for (TreeWalkEntry.STATUS status : errorStati){\r
-                 if (i>0) buff.append(",");\r
-                String foo = status.toString();\r
-                buff.append(foo);\r
-                i++;\r
-            }\r
-            buff.append("}");\r
-            return buff.toString();\r
-        }\r
-\r
-    }\r
-\r
-    public static class TreeWalkEntry {\r
-        public String lpath = "";\r
-        public String rpath = "";\r
-        public String ltextTrimmed = "";\r
-        public String rtextTrimmed = "";\r
-        public String expected = "";\r
-        public String actual = "";\r
-        public String message = "";\r
-        public String errmessage = "";\r
-        public TreeWalkResults nested;\r
-        public static enum STATUS {INFO, MATCHED, R_MISSING, R_ADDED, DOC_ERROR, TEXT_DIFFERENT, NESTED_ERROR};\r
-        public STATUS status;\r
-        public String toString(){\r
-            return toString("\r\n");\r
-        }\r
-        public String toString(String LEAD){\r
-            String INDENT = "    ";\r
-            return\r
-                 LEAD + "{"\r
-                 +status.name()\r
-                 +(Tools.notEmpty(lpath) ? ", L.path:"+lpath : "")\r
-                 +(Tools.notEmpty(rpath) ? ", R.path:"+rpath : "")\r
-                 +(Tools.notEmpty(message) ? ", message:"+message : "")\r
-                 +(Tools.notEmpty(errmessage) ? ", errmessage:"+errmessage : "")\r
-                 +", status:"+status\r
-                 +((status != STATUS.MATCHED) && Tools.notEmpty(ltextTrimmed) ? ","+LEAD+"    L.trimmed:"+ltextTrimmed : "")\r
-                 +((status != STATUS.MATCHED) && Tools.notEmpty(rtextTrimmed) ? ","+LEAD+"    R.trimmed:"+rtextTrimmed : "")\r
-                 +((status != STATUS.MATCHED) && Tools.notEmpty(expected) ? LEAD+"EXPECTED:"+LEAD+"------------------"+LEAD+expected.trim()+LEAD+"------------------" : "")\r
-                 +((status != STATUS.MATCHED) && Tools.notEmpty(actual) ? LEAD+"ACTUAL:"+LEAD+"------------------"+LEAD+actual.trim()+LEAD+"------------------"+LEAD : "")\r
-                 +((status != STATUS.MATCHED) && (nested != null) ? LEAD+"NESTED:"+LEAD+"------------------"+LEAD+nested.toString(LEAD+INDENT)+LEAD+"------------------"+LEAD : "")\r
-                 +"}";\r
-        }\r
-    }\r
-\r
-    public boolean hasDocErrors(){\r
-        for (TreeWalkEntry entry : this){\r
-            if (entry.status == TreeWalkEntry.STATUS.DOC_ERROR){\r
-                return true;\r
-            }\r
-        }\r
-        return false;\r
-    }\r
-\r
-    public String getErrorMessages(){\r
-        StringBuffer buf = new StringBuffer();\r
-        boolean first = true;\r
-        for (TreeWalkEntry entry : this){\r
-            if ( Tools.notEmpty(entry.errmessage)){\r
-                if (first) {\r
-                    buf.append(",errors:");\r
-                } else {\r
-                    buf.append(',');\r
-                }\r
-                buf.append('\''+entry.errmessage+"\'");\r
-                first = false;\r
-            }\r
-        }\r
-        return buf.toString();\r
-    }\r
-\r
-\r
-\r
-    public boolean isStrictMatch(){\r
-        for (TreeWalkEntry entry : this){\r
-            if (entry.status == TreeWalkEntry.STATUS.DOC_ERROR){\r
-                return false;\r
-            }\r
-            if ( !(   entry.status == TreeWalkEntry.STATUS.MATCHED\r
-                   || entry.status == TreeWalkEntry.STATUS.INFO)){\r
-                return false;\r
-            }\r
-        }\r
-        return true;\r
-    }\r
-    public int getMismatchCount(){\r
-        int c = 0;\r
-        for (TreeWalkEntry entry : this){\r
-            if ( entry.status == TreeWalkEntry.STATUS.DOC_ERROR\r
-                || entry.status != TreeWalkEntry.STATUS.MATCHED\r
-                || entry.status != TreeWalkEntry.STATUS.INFO){\r
-                c++;\r
-            }\r
-        }\r
-        return c;\r
-    }\r
-    /** For our purposes, trees match if they have the same element tree structure - no checking is done for text node changes. */\r
-    public boolean treesMatch(){\r
-        for (TreeWalkEntry entry : this){\r
-            if (entry.status == TreeWalkEntry.STATUS.DOC_ERROR\r
-                || entry.status == TreeWalkEntry.STATUS.R_MISSING\r
-                || entry.status == TreeWalkEntry.STATUS.R_ADDED  ){\r
-                return false;\r
-            }\r
-        }\r
-        return true;\r
-    }\r
-\r
-    public boolean treesMatch(MatchSpec matchSpec) {\r
-        for (TreeWalkEntry entry : this) {\r
-            if (matchSpec.errorStati.contains(entry.status)) {\r
-                return false;\r
-            }\r
-        }\r
-        return true;\r
-    }\r
-\r
-    public int countFor(TreeWalkEntry.STATUS status){\r
-        int count = 0;\r
-        for (TreeWalkEntry entry : this){\r
-            if (entry.status.equals(status)){\r
-                count++;\r
-            }\r
-        }\r
-        return count;\r
-    }\r
-\r
-    public String miniSummary(){\r
-        //MATCHED, INFO, R_MISSING, R_ADDED, TEXT_DIFFERENT};\r
-        StringBuffer buf = new StringBuffer();\r
-        buf.append("{");\r
-        boolean nextline = false;\r
-        for (TreeWalkEntry.STATUS st : TreeWalkEntry.STATUS.values()){\r
-            if (nextline) buf.append(',');\r
-            buf.append(st.name()+':'+countFor(st));\r
-            nextline = true;\r
-        }\r
-        buf.append(getErrorMessages());\r
-        buf.append("}");\r
-        return buf.toString();\r
-    }\r
-\r
-    public String fullSummary(){\r
-        StringBuffer buf = new StringBuffer();\r
-        for (TreeWalkResults.TreeWalkEntry entry : this){\r
-            buf.append(entry.toString()).append("\r\n");\r
-        }\r
-        return buf.toString();\r
-    }\r
-\r
-\r
-    public String leftID;\r
-    public String rightID;\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.collectionspace.services.IntegrationTests.xmlreplay;
+
+import org.collectionspace.services.common.api.Tools;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class TreeWalkResults extends ArrayList<TreeWalkResults.TreeWalkEntry> {
+      public String toString(String LEAD){
+          StringBuffer res = new StringBuffer();
+          for (TreeWalkResults.TreeWalkEntry entry: this) {
+              res.append(entry.toString(LEAD));
+          }
+          return  res.toString();
+      }
+
+    /** This cllass has two public Lists: you can construct your own to set the acceptable and unacceptable STATUS codes.
+     *   They are defaulted to R_ADDED being acceptable. */
+    public static class MatchSpec {
+        public static final TreeWalkEntry.STATUS[]  defaultAcceptableStatiArray = {TreeWalkEntry.STATUS.INFO,
+                                                                                         TreeWalkEntry.STATUS.MATCHED,
+                                                                                         TreeWalkEntry.STATUS.R_ADDED};
+
+        public static final TreeWalkEntry.STATUS[] defaultErrorStatiArray =           {TreeWalkEntry.STATUS.R_MISSING,
+                                                                                          TreeWalkEntry.STATUS.NESTED_ERROR,
+                                                                                          TreeWalkEntry.STATUS.TEXT_DIFFERENT,
+                                                                                          TreeWalkEntry.STATUS.DOC_ERROR};
+        public List<TreeWalkEntry.STATUS> errorStati;
+
+        public static MatchSpec createDefault(){
+            MatchSpec result = new MatchSpec();
+            result.errorStati = Arrays.asList(defaultErrorStatiArray);
+            return result;
+        }
+        public static MatchSpec create(TreeWalkEntry.STATUS[] statiArray){
+            MatchSpec result = new MatchSpec();
+            result.errorStati = Arrays.asList(statiArray);
+            return result;
+        }
+        public void removeErrorFromSpec(TreeWalkEntry.STATUS status){
+            ArrayList arrayList = new ArrayList(errorStati);
+            arrayList.remove(status);
+            errorStati = arrayList;
+        }
+        public String toString(){
+            StringBuffer buff = new StringBuffer("{");
+            int i = 0;
+            for (TreeWalkEntry.STATUS status : errorStati){
+                 if (i>0) buff.append(",");
+                String foo = status.toString();
+                buff.append(foo);
+                i++;
+            }
+            buff.append("}");
+            return buff.toString();
+        }
+
+    }
+
+    public static class TreeWalkEntry {
+        public String lpath = "";
+        public String rpath = "";
+        public String ltextTrimmed = "";
+        public String rtextTrimmed = "";
+        public String expected = "";
+        public String actual = "";
+        public String message = "";
+        public String errmessage = "";
+        public TreeWalkResults nested;
+        public static enum STATUS {INFO, MATCHED, R_MISSING, R_ADDED, DOC_ERROR, TEXT_DIFFERENT, NESTED_ERROR};
+        public STATUS status;
+        public String toString(){
+            return toString("\r\n");
+        }
+        public String toString(String LEAD){
+            String INDENT = "    ";
+            return
+                 LEAD + "{"
+                 +status.name()
+                 +(Tools.notEmpty(lpath) ? ", L.path:"+lpath : "")
+                 +(Tools.notEmpty(rpath) ? ", R.path:"+rpath : "")
+                 +(Tools.notEmpty(message) ? ", message:"+message : "")
+                 +(Tools.notEmpty(errmessage) ? ", errmessage:"+errmessage : "")
+                 +", status:"+status
+                 +((status != STATUS.MATCHED) && Tools.notEmpty(ltextTrimmed) ? ","+LEAD+"    L.trimmed:"+ltextTrimmed : "")
+                 +((status != STATUS.MATCHED) && Tools.notEmpty(rtextTrimmed) ? ","+LEAD+"    R.trimmed:"+rtextTrimmed : "")
+                 +((status != STATUS.MATCHED) && Tools.notEmpty(expected) ? LEAD+"EXPECTED:"+LEAD+"------------------"+LEAD+expected.trim()+LEAD+"------------------" : "")
+                 +((status != STATUS.MATCHED) && Tools.notEmpty(actual) ? LEAD+"ACTUAL:"+LEAD+"------------------"+LEAD+actual.trim()+LEAD+"------------------"+LEAD : "")
+                 +((status != STATUS.MATCHED) && (nested != null) ? LEAD+"NESTED:"+LEAD+"------------------"+LEAD+nested.toString(LEAD+INDENT)+LEAD+"------------------"+LEAD : "")
+                 +"}";
+        }
+    }
+
+    public boolean hasDocErrors(){
+        for (TreeWalkEntry entry : this){
+            if (entry.status == TreeWalkEntry.STATUS.DOC_ERROR){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public String getErrorMessages(){
+        StringBuffer buf = new StringBuffer();
+        boolean first = true;
+        for (TreeWalkEntry entry : this){
+            if ( Tools.notEmpty(entry.errmessage)){
+                if (first) {
+                    buf.append(",errors:");
+                } else {
+                    buf.append(',');
+                }
+                buf.append('\''+entry.errmessage+"\'");
+                first = false;
+            }
+        }
+        return buf.toString();
+    }
+
+
+
+    public boolean isStrictMatch(){
+        for (TreeWalkEntry entry : this){
+            if (entry.status == TreeWalkEntry.STATUS.DOC_ERROR){
+                return false;
+            }
+            if ( !(   entry.status == TreeWalkEntry.STATUS.MATCHED
+                   || entry.status == TreeWalkEntry.STATUS.INFO)){
+                return false;
+            }
+        }
+        return true;
+    }
+    public int getMismatchCount(){
+        int c = 0;
+        for (TreeWalkEntry entry : this){
+            if ( entry.status == TreeWalkEntry.STATUS.DOC_ERROR
+                || entry.status != TreeWalkEntry.STATUS.MATCHED
+                || entry.status != TreeWalkEntry.STATUS.INFO){
+                c++;
+            }
+        }
+        return c;
+    }
+    /** For our purposes, trees match if they have the same element tree structure - no checking is done for text node changes. */
+    public boolean treesMatch(){
+        for (TreeWalkEntry entry : this){
+            if (entry.status == TreeWalkEntry.STATUS.DOC_ERROR
+                || entry.status == TreeWalkEntry.STATUS.R_MISSING
+                || entry.status == TreeWalkEntry.STATUS.R_ADDED  ){
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public boolean treesMatch(MatchSpec matchSpec) {
+        for (TreeWalkEntry entry : this) {
+            if (matchSpec.errorStati.contains(entry.status)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public int countFor(TreeWalkEntry.STATUS status){
+        int count = 0;
+        for (TreeWalkEntry entry : this){
+            if (entry.status.equals(status)){
+                count++;
+            }
+        }
+        return count;
+    }
+
+    public String miniSummary(){
+        //MATCHED, INFO, R_MISSING, R_ADDED, TEXT_DIFFERENT};
+        StringBuffer buf = new StringBuffer();
+        buf.append("{");
+        boolean nextline = false;
+        for (TreeWalkEntry.STATUS st : TreeWalkEntry.STATUS.values()){
+            if (nextline) buf.append(',');
+            buf.append(st.name()+':'+countFor(st));
+            nextline = true;
+        }
+        buf.append(getErrorMessages());
+        buf.append("}");
+        return buf.toString();
+    }
+
+    public String fullSummary(){
+        StringBuffer buf = new StringBuffer();
+        for (TreeWalkResults.TreeWalkEntry entry : this){
+            buf.append(entry.toString()).append("\r\n");
+        }
+        return buf.toString();
+    }
+
+
+    public String leftID;
+    public String rightID;
 }
\ No newline at end of file
index fd49f9358a50990f62c30cf81f077ba2aee5f798..e6421751ef0dbe6b1e943e20fe3ea9b890e4df34 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.IntegrationTests.xmlreplay;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.jdom.Document;\r
-import org.jdom.Element;\r
-import org.jdom.JDOMException;\r
-import org.jdom.Namespace;\r
-import org.jdom.input.SAXBuilder;\r
-import org.jaxen.XPath;\r
-import org.jaxen.jdom.JDOMXPath;\r
-\r
-\r
-import java.io.IOException;\r
-import java.io.StringReader;\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.TreeWalkResults.TreeWalkEntry;\r
-import org.jdom.output.XMLOutputter;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class XmlCompareJdom {\r
-\r
-private static final String DEFAULT_SAX_DRIVER_CLASS = "org.apache.xerces.parsers.SAXParser";\r
-\r
-    public static org.jdom.Document getDocumentFromContent(String source) throws IOException, JDOMException {\r
-        org.jdom.Document doc;\r
-        SAXBuilder builder;\r
-        builder = new SAXBuilder();\r
-        builder.setValidation(false); //has no effect, I think.\r
-        doc = builder.build(new StringReader(source));\r
-        return doc;\r
-    }\r
-\r
-    public static TreeWalkResults compareParts(String expectedContent, String leftID, String actualPartContent, String rightID, String startElement, TreeWalkResults.MatchSpec matchSpec){\r
-        TreeWalkResults list = new TreeWalkResults();\r
-        try {\r
-\r
-            list.leftID = leftID;\r
-            list.rightID = rightID;\r
-            TreeWalkResults.TreeWalkEntry infoentry = new TreeWalkResults.TreeWalkEntry();\r
-            infoentry.expected = expectedContent;\r
-            infoentry.actual = actualPartContent;\r
-            infoentry.status = TreeWalkResults.TreeWalkEntry.STATUS.INFO;\r
-            infoentry.message = "\r\n    LEFT file: "+leftID+"\r\n    RIGHT file: "+rightID;\r
-            list.add(infoentry);\r
-            if (Tools.isEmpty(expectedContent)){\r
-                TreeWalkEntry entry = new TreeWalkEntry();\r
-                entry.status = TreeWalkEntry.STATUS.DOC_ERROR;\r
-                entry.errmessage = "L dom was empty.";\r
-                list.add(entry);\r
-            } else if (Tools.isEmpty(actualPartContent)){\r
-                TreeWalkEntry entry = new TreeWalkEntry();\r
-                entry.errmessage = "R dom was empty.";\r
-                entry.status = TreeWalkEntry.STATUS.DOC_ERROR;\r
-                list.add(entry);\r
-            } else {\r
-                Document expected = getDocumentFromContent(expectedContent);\r
-                Document actual = getDocumentFromContent(actualPartContent);\r
-                treeWalk(expected, actual, list, startElement, matchSpec);\r
-            }\r
-        } catch (Throwable t){\r
-            String msg = "ERROR in XmlReplay.compareParts(): "+t;\r
-            System.out.println(msg);\r
-            TreeWalkEntry entry = new TreeWalkEntry();\r
-                entry.status = TreeWalkEntry.STATUS.DOC_ERROR;\r
-                entry.errmessage = msg;\r
-                list.add(entry);\r
-        }\r
-        return list;\r
-    }\r
-\r
-    public static List select(Element element, String xpathExpression, Namespace namespace) throws Exception {\r
-        XPath xpath = new JDOMXPath(xpathExpression);\r
-        String prefix = namespace.getPrefix();\r
-        String uri = namespace.getURI();\r
-        xpath.addNamespace(prefix, uri);\r
-        return xpath.selectNodes(element);\r
-    }\r
-\r
-    public static Object selectSingleNode(Element element, String xpathExpression, Namespace namespace) throws Exception {\r
-        XPath xpath = new JDOMXPath(xpathExpression);\r
-        if (namespace != null) {\r
-            String prefix = namespace.getPrefix();\r
-            String uri = namespace.getURI();\r
-            xpath.addNamespace(prefix, uri);\r
-        }\r
-        return xpath.selectSingleNode(element);\r
-    }\r
-\r
-    public static Object selectSingleNode(String docSource, String xpathExpression, Namespace namespace) throws Exception {\r
-        Document doc = getDocumentFromContent(docSource);\r
-        Element element = doc.getRootElement();\r
-        XPath xpath = new JDOMXPath(xpathExpression);\r
-        if (namespace != null) {\r
-            String prefix = namespace.getPrefix();\r
-            String uri = namespace.getURI();\r
-            xpath.addNamespace(prefix, uri);\r
-        }\r
-        return xpath.selectSingleNode(element);\r
-    }\r
-\r
-    /*   MAYBE DEAL WITH NAMESPACES IN THIS KIND OF APPROACH.\r
-\r
-    for (Element el : doc.getRootElement().getDescendants(new ElementFilter())) {\r
-    if (el.getNamespace() != null) el.setNamespace(null);\r
-\r
-    xpath.addNamespace("x", d.getRootElement().getNamespaceUri());\r
-    */\r
-    public static boolean treeWalk(Document left, Document right, TreeWalkResults list, String startElement, TreeWalkResults.MatchSpec matchSpec) throws Exception {\r
-        Element leftElement = left.getRootElement();\r
-        Element rightElement = right.getRootElement();\r
-        if (Tools.notBlank(startElement)) {\r
-            XPath xpath = new JDOMXPath(startElement);\r
-            Object test = xpath.selectSingleNode(leftElement);\r
-            if (test!=null){\r
-                leftElement = (Element)test;\r
-            }\r
-            Object rtest = xpath.selectSingleNode(rightElement);\r
-            if (rtest!=null){\r
-                rightElement = (Element)rtest;\r
-            }\r
-        }\r
-        boolean res = treeWalk(leftElement, rightElement, "/", list, matchSpec);\r
-        return res;\r
-    }\r
-\r
-    public static boolean treeWalk(Element left, Element right, String parentPath, TreeWalkResults msgList, TreeWalkResults.MatchSpec matchSpec) throws Exception {\r
-        String SPACE = "     ";\r
-        if (left == null && right == null){\r
-            return true;\r
-        }\r
-        if (left == null){\r
-            return false;\r
-        }\r
-        if (right == null){\r
-            return false;\r
-        }\r
-        List l = left.getChildren();\r
-        Map foundRightMap = new HashMap();\r
-        List<String> foundRepeatingList = new ArrayList<String>();\r
-        boolean result = true;\r
-        for (Object o : l) {\r
-            if (!(o instanceof Element)){\r
-                continue;\r
-            }\r
-            Element leftChild = (Element)o;\r
-            //String leftChildName = leftChild.getName();\r
-            String leftChildName = leftChild.getQualifiedName();\r
-            if (Tools.isEmpty(leftChildName)){\r
-                continue;\r
-            }\r
-\r
-            Namespace namespace =  leftChild.getNamespace();\r
-\r
-            String leftChildPath = Tools.glue(parentPath, "/", leftChildName);\r
-\r
-            if (foundRepeatingList.indexOf(leftChildPath)>=0){\r
-                continue;\r
-            }\r
-            List leftlist = select(left, leftChildName, namespace);\r
-            if (leftlist != null && leftlist.size() > 1){\r
-                //System.out.println("-----------------doRepeating------"+leftChildPath);\r
-                foundRepeatingList.add(leftChildPath);\r
-                boolean repeatingIdentical =\r
-                    doRepeatingFieldComparison(leftlist, leftChildPath, leftChildName, left, right, msgList, namespace, matchSpec) ; //todo: deal with foundRightMap in this repeating field block.\r
-                if ( ! repeatingIdentical ){\r
-                    //System.out.println("\r\n\r\n\r\n*****************************\r\nOne repeating field failed: "+msgList);\r
-                    return false;\r
-                }\r
-                foundRightMap.put(leftChildName, "OK");\r
-            } else {\r
-                Element rightChild  = (Element)selectSingleNode(right,leftChildName, namespace);\r
-                if (rightChild == null){\r
-                    TreeWalkEntry entry = new TreeWalkEntry();\r
-                    entry.lpath = leftChildPath;                  //this works, but is questionable: selectSingleNode(right, "//*[local-name() = \"objectexit_common\"]")\r
-                    entry.status = TreeWalkEntry.STATUS.R_MISSING;\r
-                    msgList.add(entry);\r
-                    continue;\r
-                }\r
-                foundRightMap.put(leftChildName, "OK");\r
-                String leftChildTextTrim = leftChild.getText().trim();\r
-                String rightChildTextTrim = rightChild.getText().trim();\r
-                TreeWalkEntry entry = new TreeWalkEntry();\r
-                entry.ltextTrimmed = leftChildTextTrim;\r
-                entry.rtextTrimmed = rightChildTextTrim;\r
-                entry.lpath = leftChildPath;\r
-                entry.rpath = leftChildPath; //same\r
-\r
-                if (leftChildTextTrim.equals(rightChildTextTrim)){\r
-                    entry.status = TreeWalkEntry.STATUS.MATCHED;\r
-                    msgList.add(entry);\r
-                } else {\r
-                    entry.status = TreeWalkEntry.STATUS.TEXT_DIFFERENT;\r
-                    msgList.add(entry);\r
-                }\r
-                //============ DIVE !! =====================================================\r
-                result = result && treeWalk( leftChild, rightChild, leftChildPath, msgList, matchSpec);\r
-            }\r
-        }\r
-        for (Object r : right.getChildren()){\r
-            if (!(r instanceof Element)){\r
-                continue;\r
-            }\r
-            Element rightChild = (Element)r;\r
-            String rname = rightChild.getQualifiedName();\r
-            if (null==foundRightMap.get(rname)){\r
-                String rightChildPath = Tools.glue(parentPath, "/", rname);\r
-\r
-                TreeWalkEntry entry = new TreeWalkEntry();\r
-                entry.rpath = rightChildPath;\r
-                entry.status = TreeWalkEntry.STATUS.R_ADDED;\r
-                msgList.add(entry);\r
-            }\r
-        }\r
-        return true;\r
-    }\r
-\r
-    private static void dumpXML_OUT(Element el) throws Exception {\r
-        XMLOutputter outputter = new XMLOutputter();\r
-        outputter.output(el, System.out);\r
-    }\r
-    private static String dumpXML(Element el) throws Exception {\r
-        XMLOutputter outputter = new XMLOutputter();\r
-        return outputter.outputString(el);\r
-    }\r
-\r
-    public static boolean doRepeatingFieldComparison(List leftList,\r
-                                                                                     String leftChildPath,\r
-                                                                                     String leftChildName,\r
-                                                                                     Element left,\r
-                                                                                     Element right,\r
-                                                                                     TreeWalkResults msgList,\r
-                                                                                     Namespace namespace,\r
-                                                                                     TreeWalkResults.MatchSpec matchSpec)\r
-    throws Exception {\r
-        //todo: deal with foundRightMap in this repeating field block.\r
-        List rightList = select(right, leftChildName, namespace);\r
-        if (rightList == null || rightList.size() == 0 || rightList.size() < leftList.size()){\r
-            TreeWalkEntry twe = new TreeWalkEntry();\r
-            twe.lpath = leftChildPath;\r
-            twe.status = TreeWalkEntry.STATUS.R_MISSING;\r
-            String rmsg = (rightList == null)\r
-                    ? " Right: 0"\r
-                    : " Right: "+rightList.size();\r
-            twe.message = "Repeating field count not matched. Field: "+leftChildPath+" Left: "+leftList.size()+rmsg;\r
-            msgList.add(twe);\r
-            return false;\r
-        }\r
-        if (rightList.size() > leftList.size()){\r
-            TreeWalkEntry twe = new TreeWalkEntry();\r
-            twe.lpath = leftChildPath;\r
-            twe.status = TreeWalkEntry.STATUS.R_ADDED;\r
-            twe.message = "Repeating field count not matched. Field: "+leftChildPath+" Left: "+leftList.size()+" Right: "+rightList.size();\r
-            msgList.add(twe);\r
-            //LC 20110429 return false;\r
-        }\r
-\r
-        for (Object le : leftList){\r
-            boolean found = false;\r
-            Element leftEl = (Element)le;\r
-            //pl("left", leftEl);\r
-            for(Object re : rightList){\r
-                Element rightEl = (Element)re;\r
-                //pl("right", rightEl);\r
-                TreeWalkResults msgListInner = new TreeWalkResults();\r
-                //========== DIVE !!! =======================\r
-                treeWalk(leftEl, rightEl, leftChildPath, msgListInner, matchSpec);\r
-                //========================================\r
-\r
-                if (msgListInner.treesMatch(matchSpec)){   //if (msgListInner.isStrictMatch()){\r
-                    found = true;\r
-                    TreeWalkEntry twe = new TreeWalkEntry();\r
-                    twe.lpath = leftChildPath;\r
-                    twe.status = TreeWalkEntry.STATUS.MATCHED;\r
-                    msgList.add(twe);\r
-                    rightList.remove(re); //found it, don't need to inspect this element again.  Since we are breaking from loop, removing element won't mess up iterator--we get a new one on the next loop.\r
-                    break;\r
-                } else {\r
-                    TreeWalkEntry twe = new TreeWalkEntry();\r
-                    twe.lpath = leftChildPath;\r
-                    twe.status = TreeWalkEntry.STATUS.NESTED_ERROR;\r
-                    twe.nested = msgListInner;\r
-                    msgList.add(twe);\r
-                    //String line = "\r\n\r\n*********************************\r\n";\r
-                    //System.out.println(line+"TreeWalkResults: from walking rightEl: "+rightEl+" leftEl: "+leftEl + " msgListInner:"+ msgListInner+line);\r
-                }\r
-            }  // END for(rightList)\r
-            if ( ! found){\r
-                TreeWalkEntry twe = new TreeWalkEntry();\r
-                twe.lpath = leftChildPath;\r
-                twe.status = TreeWalkEntry.STATUS.R_MISSING;\r
-                twe.message = "Repeating field not matched. Source: {"+dumpXML(leftEl)+"}";\r
-                msgList.add(twe);\r
-                return false;\r
-            }\r
-        }  // END for(leftLlist)\r
-        return true;\r
-    }\r
-\r
-    private static void pl(String name, Element el) throws Exception {\r
-        Namespace namespace = el.getNamespace();\r
-        Object lobid = selectSingleNode(el, "@ID", namespace);\r
-        String lid = "";\r
-        if (lobid!=null){\r
-            lid = lobid.toString();\r
-        }\r
-\r
-        System.out.println(name+": "+lid);\r
-        dumpXML_OUT(el);\r
-        System.out.println();\r
-\r
-    }\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.IntegrationTests.xmlreplay;
+
+import org.collectionspace.services.common.api.Tools;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.Namespace;
+import org.jdom.input.SAXBuilder;
+import org.jaxen.XPath;
+import org.jaxen.jdom.JDOMXPath;
+
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.collectionspace.services.IntegrationTests.xmlreplay.TreeWalkResults.TreeWalkEntry;
+import org.jdom.output.XMLOutputter;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class XmlCompareJdom {
+
+private static final String DEFAULT_SAX_DRIVER_CLASS = "org.apache.xerces.parsers.SAXParser";
+
+    public static org.jdom.Document getDocumentFromContent(String source) throws IOException, JDOMException {
+        org.jdom.Document doc;
+        SAXBuilder builder;
+        builder = new SAXBuilder();
+        builder.setValidation(false); //has no effect, I think.
+        doc = builder.build(new StringReader(source));
+        return doc;
+    }
+
+    public static TreeWalkResults compareParts(String expectedContent, String leftID, String actualPartContent, String rightID, String startElement, TreeWalkResults.MatchSpec matchSpec){
+        TreeWalkResults list = new TreeWalkResults();
+        try {
+
+            list.leftID = leftID;
+            list.rightID = rightID;
+            TreeWalkResults.TreeWalkEntry infoentry = new TreeWalkResults.TreeWalkEntry();
+            infoentry.expected = expectedContent;
+            infoentry.actual = actualPartContent;
+            infoentry.status = TreeWalkResults.TreeWalkEntry.STATUS.INFO;
+            infoentry.message = "\r\n    LEFT file: "+leftID+"\r\n    RIGHT file: "+rightID;
+            list.add(infoentry);
+            if (Tools.isEmpty(expectedContent)){
+                TreeWalkEntry entry = new TreeWalkEntry();
+                entry.status = TreeWalkEntry.STATUS.DOC_ERROR;
+                entry.errmessage = "L dom was empty.";
+                list.add(entry);
+            } else if (Tools.isEmpty(actualPartContent)){
+                TreeWalkEntry entry = new TreeWalkEntry();
+                entry.errmessage = "R dom was empty.";
+                entry.status = TreeWalkEntry.STATUS.DOC_ERROR;
+                list.add(entry);
+            } else {
+                Document expected = getDocumentFromContent(expectedContent);
+                Document actual = getDocumentFromContent(actualPartContent);
+                treeWalk(expected, actual, list, startElement, matchSpec);
+            }
+        } catch (Throwable t){
+            String msg = "ERROR in XmlReplay.compareParts(): "+t;
+            System.out.println(msg);
+            TreeWalkEntry entry = new TreeWalkEntry();
+                entry.status = TreeWalkEntry.STATUS.DOC_ERROR;
+                entry.errmessage = msg;
+                list.add(entry);
+        }
+        return list;
+    }
+
+    public static List select(Element element, String xpathExpression, Namespace namespace) throws Exception {
+        XPath xpath = new JDOMXPath(xpathExpression);
+        String prefix = namespace.getPrefix();
+        String uri = namespace.getURI();
+        xpath.addNamespace(prefix, uri);
+        return xpath.selectNodes(element);
+    }
+
+    public static Object selectSingleNode(Element element, String xpathExpression, Namespace namespace) throws Exception {
+        XPath xpath = new JDOMXPath(xpathExpression);
+        if (namespace != null) {
+            String prefix = namespace.getPrefix();
+            String uri = namespace.getURI();
+            xpath.addNamespace(prefix, uri);
+        }
+        return xpath.selectSingleNode(element);
+    }
+
+    public static Object selectSingleNode(String docSource, String xpathExpression, Namespace namespace) throws Exception {
+        Document doc = getDocumentFromContent(docSource);
+        Element element = doc.getRootElement();
+        XPath xpath = new JDOMXPath(xpathExpression);
+        if (namespace != null) {
+            String prefix = namespace.getPrefix();
+            String uri = namespace.getURI();
+            xpath.addNamespace(prefix, uri);
+        }
+        return xpath.selectSingleNode(element);
+    }
+
+    /*   MAYBE DEAL WITH NAMESPACES IN THIS KIND OF APPROACH.
+
+    for (Element el : doc.getRootElement().getDescendants(new ElementFilter())) {
+    if (el.getNamespace() != null) el.setNamespace(null);
+
+    xpath.addNamespace("x", d.getRootElement().getNamespaceUri());
+    */
+    public static boolean treeWalk(Document left, Document right, TreeWalkResults list, String startElement, TreeWalkResults.MatchSpec matchSpec) throws Exception {
+        Element leftElement = left.getRootElement();
+        Element rightElement = right.getRootElement();
+        if (Tools.notBlank(startElement)) {
+            XPath xpath = new JDOMXPath(startElement);
+            Object test = xpath.selectSingleNode(leftElement);
+            if (test!=null){
+                leftElement = (Element)test;
+            }
+            Object rtest = xpath.selectSingleNode(rightElement);
+            if (rtest!=null){
+                rightElement = (Element)rtest;
+            }
+        }
+        boolean res = treeWalk(leftElement, rightElement, "/", list, matchSpec);
+        return res;
+    }
+
+    public static boolean treeWalk(Element left, Element right, String parentPath, TreeWalkResults msgList, TreeWalkResults.MatchSpec matchSpec) throws Exception {
+        String SPACE = "     ";
+        if (left == null && right == null){
+            return true;
+        }
+        if (left == null){
+            return false;
+        }
+        if (right == null){
+            return false;
+        }
+        List l = left.getChildren();
+        Map foundRightMap = new HashMap();
+        List<String> foundRepeatingList = new ArrayList<String>();
+        boolean result = true;
+        for (Object o : l) {
+            if (!(o instanceof Element)){
+                continue;
+            }
+            Element leftChild = (Element)o;
+            //String leftChildName = leftChild.getName();
+            String leftChildName = leftChild.getQualifiedName();
+            if (Tools.isEmpty(leftChildName)){
+                continue;
+            }
+
+            Namespace namespace =  leftChild.getNamespace();
+
+            String leftChildPath = Tools.glue(parentPath, "/", leftChildName);
+
+            if (foundRepeatingList.indexOf(leftChildPath)>=0){
+                continue;
+            }
+            List leftlist = select(left, leftChildName, namespace);
+            if (leftlist != null && leftlist.size() > 1){
+                //System.out.println("-----------------doRepeating------"+leftChildPath);
+                foundRepeatingList.add(leftChildPath);
+                boolean repeatingIdentical =
+                    doRepeatingFieldComparison(leftlist, leftChildPath, leftChildName, left, right, msgList, namespace, matchSpec) ; //todo: deal with foundRightMap in this repeating field block.
+                if ( ! repeatingIdentical ){
+                    //System.out.println("\r\n\r\n\r\n*****************************\r\nOne repeating field failed: "+msgList);
+                    return false;
+                }
+                foundRightMap.put(leftChildName, "OK");
+            } else {
+                Element rightChild  = (Element)selectSingleNode(right,leftChildName, namespace);
+                if (rightChild == null){
+                    TreeWalkEntry entry = new TreeWalkEntry();
+                    entry.lpath = leftChildPath;                  //this works, but is questionable: selectSingleNode(right, "//*[local-name() = \"objectexit_common\"]")
+                    entry.status = TreeWalkEntry.STATUS.R_MISSING;
+                    msgList.add(entry);
+                    continue;
+                }
+                foundRightMap.put(leftChildName, "OK");
+                String leftChildTextTrim = leftChild.getText().trim();
+                String rightChildTextTrim = rightChild.getText().trim();
+                TreeWalkEntry entry = new TreeWalkEntry();
+                entry.ltextTrimmed = leftChildTextTrim;
+                entry.rtextTrimmed = rightChildTextTrim;
+                entry.lpath = leftChildPath;
+                entry.rpath = leftChildPath; //same
+
+                if (leftChildTextTrim.equals(rightChildTextTrim)){
+                    entry.status = TreeWalkEntry.STATUS.MATCHED;
+                    msgList.add(entry);
+                } else {
+                    entry.status = TreeWalkEntry.STATUS.TEXT_DIFFERENT;
+                    msgList.add(entry);
+                }
+                //============ DIVE !! =====================================================
+                result = result && treeWalk( leftChild, rightChild, leftChildPath, msgList, matchSpec);
+            }
+        }
+        for (Object r : right.getChildren()){
+            if (!(r instanceof Element)){
+                continue;
+            }
+            Element rightChild = (Element)r;
+            String rname = rightChild.getQualifiedName();
+            if (null==foundRightMap.get(rname)){
+                String rightChildPath = Tools.glue(parentPath, "/", rname);
+
+                TreeWalkEntry entry = new TreeWalkEntry();
+                entry.rpath = rightChildPath;
+                entry.status = TreeWalkEntry.STATUS.R_ADDED;
+                msgList.add(entry);
+            }
+        }
+        return true;
+    }
+
+    private static void dumpXML_OUT(Element el) throws Exception {
+        XMLOutputter outputter = new XMLOutputter();
+        outputter.output(el, System.out);
+    }
+    private static String dumpXML(Element el) throws Exception {
+        XMLOutputter outputter = new XMLOutputter();
+        return outputter.outputString(el);
+    }
+
+    public static boolean doRepeatingFieldComparison(List leftList,
+                                                                                     String leftChildPath,
+                                                                                     String leftChildName,
+                                                                                     Element left,
+                                                                                     Element right,
+                                                                                     TreeWalkResults msgList,
+                                                                                     Namespace namespace,
+                                                                                     TreeWalkResults.MatchSpec matchSpec)
+    throws Exception {
+        //todo: deal with foundRightMap in this repeating field block.
+        List rightList = select(right, leftChildName, namespace);
+        if (rightList == null || rightList.size() == 0 || rightList.size() < leftList.size()){
+            TreeWalkEntry twe = new TreeWalkEntry();
+            twe.lpath = leftChildPath;
+            twe.status = TreeWalkEntry.STATUS.R_MISSING;
+            String rmsg = (rightList == null)
+                    ? " Right: 0"
+                    : " Right: "+rightList.size();
+            twe.message = "Repeating field count not matched. Field: "+leftChildPath+" Left: "+leftList.size()+rmsg;
+            msgList.add(twe);
+            return false;
+        }
+        if (rightList.size() > leftList.size()){
+            TreeWalkEntry twe = new TreeWalkEntry();
+            twe.lpath = leftChildPath;
+            twe.status = TreeWalkEntry.STATUS.R_ADDED;
+            twe.message = "Repeating field count not matched. Field: "+leftChildPath+" Left: "+leftList.size()+" Right: "+rightList.size();
+            msgList.add(twe);
+            //LC 20110429 return false;
+        }
+
+        for (Object le : leftList){
+            boolean found = false;
+            Element leftEl = (Element)le;
+            //pl("left", leftEl);
+            for(Object re : rightList){
+                Element rightEl = (Element)re;
+                //pl("right", rightEl);
+                TreeWalkResults msgListInner = new TreeWalkResults();
+                //========== DIVE !!! =======================
+                treeWalk(leftEl, rightEl, leftChildPath, msgListInner, matchSpec);
+                //========================================
+
+                if (msgListInner.treesMatch(matchSpec)){   //if (msgListInner.isStrictMatch()){
+                    found = true;
+                    TreeWalkEntry twe = new TreeWalkEntry();
+                    twe.lpath = leftChildPath;
+                    twe.status = TreeWalkEntry.STATUS.MATCHED;
+                    msgList.add(twe);
+                    rightList.remove(re); //found it, don't need to inspect this element again.  Since we are breaking from loop, removing element won't mess up iterator--we get a new one on the next loop.
+                    break;
+                } else {
+                    TreeWalkEntry twe = new TreeWalkEntry();
+                    twe.lpath = leftChildPath;
+                    twe.status = TreeWalkEntry.STATUS.NESTED_ERROR;
+                    twe.nested = msgListInner;
+                    msgList.add(twe);
+                    //String line = "\r\n\r\n*********************************\r\n";
+                    //System.out.println(line+"TreeWalkResults: from walking rightEl: "+rightEl+" leftEl: "+leftEl + " msgListInner:"+ msgListInner+line);
+                }
+            }  // END for(rightList)
+            if ( ! found){
+                TreeWalkEntry twe = new TreeWalkEntry();
+                twe.lpath = leftChildPath;
+                twe.status = TreeWalkEntry.STATUS.R_MISSING;
+                twe.message = "Repeating field not matched. Source: {"+dumpXML(leftEl)+"}";
+                msgList.add(twe);
+                return false;
+            }
+        }  // END for(leftLlist)
+        return true;
+    }
+
+    private static void pl(String name, Element el) throws Exception {
+        Namespace namespace = el.getNamespace();
+        Object lobid = selectSingleNode(el, "@ID", namespace);
+        String lid = "";
+        if (lobid!=null){
+            lid = lobid.toString();
+        }
+
+        System.out.println(name+": "+lid);
+        dumpXML_OUT(el);
+        System.out.println();
+
+    }
+}
index 944a8aea6bce53ae4cd915f6f1a01a0897d01eb4..45d8c875a170bdb5aab7b68ef3cdb3c2cd84e685 100644 (file)
-package org.collectionspace.services.IntegrationTests.xmlreplay;\r
-\r
-import org.apache.commons.cli.*;\r
-\r
-import org.apache.commons.io.FileUtils;\r
-import org.apache.commons.jexl2.JexlEngine;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.dom4j.*;\r
-import org.dom4j.io.SAXReader;\r
-\r
-import java.io.*;\r
-import java.util.*;\r
-\r
-/**  This class is used to replay a request to the Services layer, by sending the XML payload\r
- *   in an appropriate Multipart request.\r
- *   See example usage in calling class XmlReplayTest in services/IntegrationTests, and also in main() in this class.\r
- *   @author Laramie Crocker\r
- */\r
-public class XmlReplay {\r
-\r
-    public XmlReplay(String basedir, String reportsDir){\r
-        this.basedir = basedir;\r
-        this.serviceResultsMap = createResultsMap();\r
-        this.reportsList = new ArrayList<String>();\r
-        this.reportsDir = reportsDir;\r
-    }\r
-\r
-    public static final String DEFAULT_CONTROL = "xml-replay-control.xml";\r
-    public static final String DEFAULT_MASTER_CONTROL = "xml-replay-master.xml";\r
-    public static final String DEFAULT_DEV_MASTER_CONTROL = "dev-master.xml";\r
-\r
-    private String reportsDir = "";\r
-    public String getReportsDir(){\r
-        return reportsDir;\r
-    }\r
-    private String basedir = ".";  //set from constructor.\r
-    public String getBaseDir(){\r
-        return basedir;\r
-    }\r
-    \r
-    private String controlFileName = DEFAULT_CONTROL;\r
-    public String getControlFileName() {\r
-        return controlFileName;\r
-    }\r
-    public void setControlFileName(String controlFileName) {\r
-        this.controlFileName = controlFileName;\r
-    }\r
-\r
-    private String protoHostPort = "";\r
-    public String getProtoHostPort() {\r
-        return protoHostPort;\r
-    }\r
-    public void setProtoHostPort(String protoHostPort) {\r
-        this.protoHostPort = protoHostPort;\r
-    }\r
-\r
-    private boolean autoDeletePOSTS = true;\r
-    public boolean isAutoDeletePOSTS() {\r
-        return autoDeletePOSTS;\r
-    }\r
-    public void setAutoDeletePOSTS(boolean autoDeletePOSTS) {\r
-        this.autoDeletePOSTS = autoDeletePOSTS;\r
-    }\r
-\r
-    private Dump dump;\r
-    public Dump getDump() {\r
-        return dump;\r
-    }\r
-    public void setDump(Dump dump) {\r
-        this.dump = dump;\r
-    }\r
-\r
-    AuthsMap defaultAuthsMap;\r
-    public AuthsMap getDefaultAuthsMap(){\r
-        return defaultAuthsMap;\r
-    }\r
-    public void setDefaultAuthsMap(AuthsMap authsMap){\r
-        defaultAuthsMap = authsMap;\r
-    }\r
-\r
-    private Map<String, ServiceResult> serviceResultsMap;\r
-    public Map<String, ServiceResult> getServiceResultsMap(){\r
-        return serviceResultsMap;\r
-    }\r
-    public static Map<String, ServiceResult> createResultsMap(){\r
-        return new HashMap<String, ServiceResult>();\r
-    }\r
-\r
-    private List<String> reportsList;\r
-    public  List<String> getReportsList(){\r
-        return reportsList;\r
-    }\r
-\r
-    public String toString(){\r
-        return "XmlReplay{"+this.basedir+", "+this.defaultAuthsMap+", "+this.dump+", "+this.reportsDir+'}';\r
-    }\r
-\r
-    // ============== METHODS ===========================================================\r
-\r
-    /** Optional information method: call this method after instantiating this class using the constructor XmlReplay(String), which sets the basedir.  Then you\r
-     *   pass in your relative masterFilename to that basedir to this method, which will return true if the file is readable, valid xml, etc.\r
-     *   Do this in preference to  just seeing if File.exists(), because there are rules to finding the file relative to the maven test dir, yada, yada.\r
-     *   This method makes it easy to have a development test file that you don't check in, so that dev tests can be missing gracefully, etc.\r
-     */\r
-    public boolean masterConfigFileExists(String masterFilename){\r
-        try {\r
-            org.dom4j.Document doc = openMasterConfigFile(masterFilename);\r
-            if (doc == null){\r
-                return false;\r
-            }\r
-            return true;\r
-        } catch (Throwable t){\r
-            return false;\r
-        }\r
-    }\r
-\r
-    public org.dom4j.Document openMasterConfigFile(String masterFilename) throws FileNotFoundException {\r
-        String fullPath = Tools.glue(basedir, "/", masterFilename);\r
-        File f = new File(fullPath);\r
-        if (!f.exists()){\r
-            return null;\r
-        }\r
-        org.dom4j.Document document = getDocument(fullPath); //will check full path first, then checks relative to PWD.\r
-        if (document == null){\r
-            throw new FileNotFoundException("XmlReplay master control file ("+masterFilename+") not found in basedir: "+basedir+". Exiting test.");\r
-        }\r
-        return document;\r
-    }\r
-\r
-    /** specify the master config file, relative to getBaseDir(), but ignore any tests or testGroups in the master.\r
-     *  @return a Document object, which you don't need to use: all options will be stored in XmlReplay instance.\r
-     */\r
-    public org.dom4j.Document readOptionsFromMasterConfigFile(String masterFilename) throws FileNotFoundException {\r
-        org.dom4j.Document document = openMasterConfigFile(masterFilename);\r
-        if (document == null){\r
-            throw new FileNotFoundException(masterFilename);\r
-        }\r
-        protoHostPort = document.selectSingleNode("/xmlReplayMaster/protoHostPort").getText().trim();\r
-        AuthsMap authsMap = readAuths(document);\r
-        setDefaultAuthsMap(authsMap);\r
-        Dump dump = XmlReplay.readDumpOptions(document);\r
-        setDump(dump);\r
-        return document;\r
-    }\r
-\r
-    public List<List<ServiceResult>> runMaster(String masterFilename) throws Exception {\r
-        return runMaster(masterFilename, true);\r
-    }\r
-\r
-    /** Creates new instances of XmlReplay, one for each controlFile specified in the master,\r
-     *  and setting defaults from this instance, but not sharing ServiceResult objects or maps. */\r
-    public List<List<ServiceResult>> runMaster(String masterFilename, boolean readOptionsFromMaster) throws Exception {\r
-        List<List<ServiceResult>> list = new ArrayList<List<ServiceResult>>();\r
-        org.dom4j.Document document;\r
-        if (readOptionsFromMaster){\r
-            document = readOptionsFromMasterConfigFile(masterFilename);\r
-        } else {\r
-            document = openMasterConfigFile(masterFilename);\r
-        }\r
-        if (document==null){\r
-            throw new FileNotFoundException(masterFilename);\r
-        }\r
-        String controlFile, testGroup, test;\r
-        List<Node> runNodes;\r
-        runNodes = document.selectNodes("/xmlReplayMaster/run");\r
-        for (Node runNode : runNodes) {\r
-            controlFile = runNode.valueOf("@controlFile");\r
-            testGroup = runNode.valueOf("@testGroup");\r
-            test = runNode.valueOf("@test"); //may be empty\r
-\r
-            //Create a new instance and clone only config values, not any results maps.\r
-            XmlReplay replay = new XmlReplay(basedir, this.reportsDir);\r
-            replay.setControlFileName(controlFile);\r
-            replay.setProtoHostPort(protoHostPort);\r
-            replay.setAutoDeletePOSTS(isAutoDeletePOSTS());\r
-            replay.setDump(dump);\r
-            replay.setDefaultAuthsMap(getDefaultAuthsMap());\r
-\r
-            //Now run *that* instance.\r
-            List<ServiceResult> results = replay.runTests(testGroup, test);\r
-            list.add(results);\r
-            this.reportsList.addAll(replay.getReportsList());   //Add all the reports from the inner replay, to our master replay's reportsList, to generate the index.html file.\r
-        }\r
-        XmlReplayReport.saveIndexForMaster(basedir, reportsDir, masterFilename, this.reportsList);\r
-        return list;\r
-    }\r
-\r
-    /** Use this if you wish to run named tests within a testGroup, otherwise call runTestGroup(). */\r
-    public List<ServiceResult>  runTests(String testGroupID, String testID) throws Exception {\r
-        List<ServiceResult> result = runXmlReplayFile(this.basedir,\r
-                                this.controlFileName,\r
-                                testGroupID,\r
-                                testID,\r
-                                this.serviceResultsMap,\r
-                                this.autoDeletePOSTS,\r
-                                dump,\r
-                                this.protoHostPort,\r
-                                this.defaultAuthsMap,\r
-                                this.reportsList,\r
-                                this.reportsDir);\r
-        return result;\r
-    }\r
-\r
-    /** Use this if you wish to specify just ONE test to run within a testGroup, otherwise call runTestGroup(). */\r
-    public ServiceResult  runTest(String testGroupID, String testID) throws Exception {\r
-        List<ServiceResult> result = runXmlReplayFile(this.basedir,\r
-                                this.controlFileName,\r
-                                testGroupID,\r
-                                testID,\r
-                                this.serviceResultsMap,\r
-                                this.autoDeletePOSTS,\r
-                                dump,\r
-                                this.protoHostPort,\r
-                                this.defaultAuthsMap,\r
-                                this.reportsList,\r
-                                this.reportsDir);\r
-        if (result.size()>1){\r
-            throw new IndexOutOfBoundsException("Multiple ("+result.size()+") tests with ID='"+testID+"' were found within test group '"+testGroupID+"', but there should only be one test per ID attribute.");\r
-        }\r
-        return result.get(0);\r
-    }\r
-\r
-    /** Use this if you wish to run all tests within a testGroup.*/\r
-    public List<ServiceResult> runTestGroup(String testGroupID) throws Exception {\r
-        //NOTE: calling runTest with empty testID runs all tests in a test group, but don't expose this fact.\r
-        // Expose this method (runTestGroup) instead.\r
-        return runTests(testGroupID, "");\r
-    }\r
-\r
-    public List<ServiceResult>  autoDelete(String logName){\r
-        return autoDelete(this.serviceResultsMap, logName);\r
-    }\r
-\r
-    /** Use this method to clean up resources created on the server that returned CSIDs, if you have\r
-     *  specified autoDeletePOSTS==false, which means you are managing the cleanup yourself.\r
-     * @param serviceResultsMap a Map of ServiceResult objects, which will contain ServiceResult.deleteURL.\r
-     * @return a List<String> of debug info about which URLs could not be deleted.\r
-     */\r
-    public static List<ServiceResult> autoDelete(Map<String, ServiceResult> serviceResultsMap, String logName){\r
-        List<ServiceResult> results = new ArrayList<ServiceResult>();\r
-        for (ServiceResult pr : serviceResultsMap.values()){\r
-            try {\r
-                if (Tools.notEmpty(pr.deleteURL)){\r
-                    ServiceResult deleteResult = XmlReplayTransport.doDELETE(pr.deleteURL, pr.auth, pr.testID, "[autodelete:"+logName+"]");\r
-                    results.add(deleteResult);\r
-                } else {\r
-                    ServiceResult errorResult = new ServiceResult();\r
-                    errorResult.fullURL = pr.fullURL;\r
-                    errorResult.testGroupID = pr.testGroupID;\r
-                    errorResult.fromTestID = pr.fromTestID;\r
-                    errorResult.overrideGotExpectedResult();\r
-                    results.add(errorResult);\r
-                }\r
-            } catch (Throwable t){\r
-                String s = (pr!=null) ? "ERROR while cleaning up ServiceResult map: "+pr+" for "+pr.deleteURL+" :: "+t\r
-                                      : "ERROR while cleaning up ServiceResult map (null ServiceResult): "+t;\r
-                System.err.println(s);\r
-                ServiceResult errorResult = new ServiceResult();\r
-                errorResult.fullURL = pr.fullURL;\r
-                errorResult.testGroupID = pr.testGroupID;\r
-                errorResult.fromTestID = pr.fromTestID;\r
-                errorResult.error = s;\r
-                results.add(errorResult);\r
-            }\r
-        }\r
-        return results;\r
-    }\r
-\r
-    public static class AuthsMap {\r
-        Map<String,String> map;\r
-        String defaultID="";\r
-        public String getDefaultAuth(){\r
-            return map.get(defaultID);\r
-        }\r
-        public String toString(){\r
-            return "AuthsMap: {default='"+defaultID+"'; "+map.keySet()+'}';\r
-        }\r
-    }\r
-\r
-    public static AuthsMap readAuths(org.dom4j.Document document){\r
-    Map<String, String> map = new HashMap<String, String>();\r
-        List<Node> authNodes = document.selectNodes("//auths/auth");\r
-        for (Node auth : authNodes) {\r
-            map.put(auth.valueOf("@ID"), auth.getStringValue());\r
-        }\r
-        AuthsMap authsMap = new AuthsMap();\r
-        Node auths = document.selectSingleNode("//auths");\r
-        String defaultID = "";\r
-        if (auths != null){\r
-            defaultID = auths.valueOf("@default");\r
-        }\r
-        authsMap.map = map;\r
-        authsMap.defaultID = defaultID;\r
-        return authsMap;\r
-    }\r
-\r
-    public static class Dump {\r
-        public boolean payloads = false;\r
-        //public static final ServiceResult.DUMP_OPTIONS dumpServiceResultOptions = ServiceResult.DUMP_OPTIONS;\r
-        public ServiceResult.DUMP_OPTIONS dumpServiceResult = ServiceResult.DUMP_OPTIONS.minimal;\r
-        public String toString(){\r
-            return "payloads: "+payloads+" dumpServiceResult: "+dumpServiceResult;\r
-        }\r
-    }\r
-\r
-    public static Dump getDumpConfig(){\r
-        return new Dump();\r
-    }\r
-\r
-    public static Dump readDumpOptions(org.dom4j.Document document){\r
-        Dump dump = getDumpConfig();\r
-        Node dumpNode = document.selectSingleNode("//dump");\r
-        if (dumpNode != null){\r
-            dump.payloads = Tools.isTrue(dumpNode.valueOf("@payloads"));\r
-            String dumpServiceResultStr = dumpNode.valueOf("@dumpServiceResult");\r
-            if (Tools.notEmpty(dumpServiceResultStr)){\r
-                dump.dumpServiceResult = ServiceResult.DUMP_OPTIONS.valueOf(dumpServiceResultStr);\r
-            }\r
-        }\r
-        return dump;\r
-    }\r
-\r
-    private static class PartsStruct {\r
-        public List<Map<String,String>> varsList = new ArrayList<Map<String,String>>();\r
-        String responseFilename = "";\r
-        String overrideTestID = "";\r
-        String startElement = "";\r
-        String label = "";\r
-\r
-        public static PartsStruct readParts(Node testNode, final String testID, String xmlReplayBaseDir){\r
-            PartsStruct resultPartsStruct = new PartsStruct();\r
-            resultPartsStruct.responseFilename = testNode.valueOf("filename");\r
-            resultPartsStruct.startElement = testNode.valueOf("startElement");\r
-            resultPartsStruct.label = testNode.valueOf("label");\r
-            String responseFilename = testNode.valueOf("filename");\r
-            if (Tools.notEmpty(responseFilename)){\r
-                resultPartsStruct.responseFilename = xmlReplayBaseDir + '/' + responseFilename;\r
-                List<Node> varNodes = testNode.selectNodes("vars/var");\r
-                readVars(testNode, varNodes, resultPartsStruct);\r
-            }\r
-            return resultPartsStruct;\r
-        }\r
-\r
-        private static void readVars(Node testNode, List<Node> varNodes, PartsStruct resultPartsStruct){\r
-            Map<String,String> vars = new HashMap<String,String>();\r
-            resultPartsStruct.varsList.add(vars);\r
-            //System.out.println("### vars: "+vars.size()+" ########");\r
-            for (Node var: varNodes){\r
-                String ID = var.valueOf("@ID");\r
-                String value = var.getText();\r
-                //System.out.println("ID: "+ID+" value: "+value);\r
-                vars.put(ID, value); //vars is already part of resultPartsStruct.varsList\r
-            }\r
-            //System.out.println("### end-vars ########");\r
-        }\r
-    }\r
-\r
-\r
-\r
-    private static String fixupFullURL(String fullURL, String protoHostPort, String uri){\r
-        if ( ! uri.startsWith(protoHostPort)){\r
-            fullURL = Tools.glue(protoHostPort, "/", uri);\r
-        } else {\r
-            fullURL = uri;\r
-        }\r
-        return fullURL;\r
-    }\r
-\r
-    private static String fromTestID(String fullURL, Node testNode, Map<String, ServiceResult> serviceResultsMap){\r
-        String fromTestID = testNode.valueOf("fromTestID");\r
-        if (Tools.notEmpty(fromTestID)){\r
-            ServiceResult getPR = serviceResultsMap.get(fromTestID);\r
-            if (getPR != null){\r
-                fullURL = Tools.glue(fullURL, "/", getPR.location);\r
-            }\r
-        }\r
-        return fullURL;\r
-    }\r
-\r
-    private static String CSIDfromTestID(Node testNode, Map<String, ServiceResult> serviceResultsMap){\r
-        String result = "";\r
-        String fromTestID = testNode.valueOf("fromTestID");\r
-        if (Tools.notEmpty(fromTestID)){\r
-            ServiceResult getPR = serviceResultsMap.get(fromTestID);\r
-            if (getPR != null){\r
-                result = getPR.location;\r
-            }\r
-        }\r
-        return result;\r
-    }\r
-\r
-    public static org.dom4j.Document getDocument(String xmlFileName) {\r
-        org.dom4j.Document document = null;\r
-        SAXReader reader = new SAXReader();\r
-        try {\r
-            document = reader.read(xmlFileName);\r
-        } catch (DocumentException e) {\r
-            System.out.println("ERROR reading document: "+e);\r
-            //e.printStackTrace();\r
-        }\r
-        return document;\r
-    }\r
-\r
-    protected static String validateResponseSinglePayload(ServiceResult serviceResult,\r
-                                                 Map<String, ServiceResult> serviceResultsMap,\r
-                                                 PartsStruct expectedResponseParts,\r
-                                                 XmlReplayEval evalStruct)\r
-    throws Exception {\r
-        String OK = "";\r
-        byte[] b = FileUtils.readFileToByteArray(new File(expectedResponseParts.responseFilename));\r
-        String expectedPartContent = new String(b);\r
-        Map<String,String> vars = expectedResponseParts.varsList.get(0);  //just one part, so just one varsList.  Must be there, even if empty.\r
-        expectedPartContent = evalStruct.eval(expectedPartContent, serviceResultsMap, vars, evalStruct.jexl, evalStruct.jc);\r
-        serviceResult.expectedContentExpanded = expectedPartContent;\r
-        String label = "NOLABEL";\r
-        String leftID  = "{from expected part, label:"+label+" filename: "+expectedResponseParts.responseFilename+"}";\r
-        String rightID = "{from server, label:"+label\r
-                            +" fromTestID: "+serviceResult.fromTestID\r
-                            +" URL: "+serviceResult.fullURL\r
-                            +"}";\r
-        String startElement = expectedResponseParts.startElement;\r
-        String partLabel = expectedResponseParts.label;\r
-        if (Tools.isBlank(startElement)){\r
-            if (Tools.notBlank(partLabel))\r
-            startElement = "/document/*[local-name()='"+partLabel+"']";\r
-        }\r
-        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();\r
-        TreeWalkResults list =\r
-            XmlCompareJdom.compareParts(expectedPartContent,\r
-                                        leftID,\r
-                                        serviceResult.result,\r
-                                        rightID,\r
-                                        startElement,\r
-                                        matchSpec);\r
-        serviceResult.addPartSummary(label, list);\r
-        return OK;\r
-    }\r
-\r
-    protected static String validateResponse(ServiceResult serviceResult,\r
-                                             Map<String, ServiceResult> serviceResultsMap,\r
-                                             PartsStruct expectedResponseParts,\r
-                                             XmlReplayEval evalStruct){\r
-        String OK = "";\r
-        if (expectedResponseParts == null) return OK;\r
-        if (serviceResult == null) return OK;\r
-        if (serviceResult.result.length() == 0) return OK;\r
-        try {\r
-            return validateResponseSinglePayload(serviceResult, serviceResultsMap, expectedResponseParts, evalStruct);\r
-        } catch (Exception e){\r
-            String err = "ERROR in XmlReplay.validateResponse() : "+e;\r
-            return err  ;\r
-        }\r
-    }\r
-\r
-    //================= runXmlReplayFile ======================================================\r
-\r
-    public static List<ServiceResult> runXmlReplayFile(String xmlReplayBaseDir,\r
-                                          String controlFileName,\r
-                                          String testGroupID,\r
-                                          String oneTestID,\r
-                                          Map<String, ServiceResult> serviceResultsMap,\r
-                                          boolean param_autoDeletePOSTS,\r
-                                          Dump dump,\r
-                                          String protoHostPortParam,\r
-                                          AuthsMap defaultAuths,\r
-                                          List<String> reportsList,\r
-                                          String reportsDir)\r
-                                          throws Exception {\r
-        //Internally, we maintain two collections of ServiceResult:\r
-        //  the first is the return value of this method.\r
-        //  the second is the serviceResultsMap, which is used for keeping track of CSIDs created by POSTs, for later reference by DELETE, etc.\r
-        List<ServiceResult> results = new ArrayList<ServiceResult>();\r
-\r
-        XmlReplayReport report = new XmlReplayReport(reportsDir);\r
-\r
-        String controlFile = Tools.glue(xmlReplayBaseDir, "/", controlFileName);\r
-        org.dom4j.Document document;\r
-        document = getDocument(controlFile); //will check full path first, then checks relative to PWD.\r
-        if (document==null){\r
-            throw new FileNotFoundException("XmlReplay control file ("+controlFileName+") not found in basedir: "+xmlReplayBaseDir+" Exiting test.");\r
-        }\r
-        String protoHostPort;\r
-        if (Tools.isEmpty(protoHostPortParam)){\r
-            protoHostPort = document.selectSingleNode("/xmlReplay/protoHostPort").getText().trim();\r
-            System.out.println("DEPRECATED: Using protoHostPort ('"+protoHostPort+"') from xmlReplay file ('"+controlFile+"'), not master.");\r
-        } else {\r
-            protoHostPort = protoHostPortParam;\r
-        }\r
-        if (Tools.isEmpty(protoHostPort)){\r
-            throw new Exception("XmlReplay control file must have a protoHostPort element");\r
-        }\r
-\r
-        String authsMapINFO;\r
-        AuthsMap authsMap = readAuths(document);\r
-        if (authsMap.map.size()==0){\r
-            authsMap = defaultAuths;\r
-            authsMapINFO = "Using defaultAuths from master file: "+defaultAuths;\r
-        } else {\r
-            authsMapINFO = "Using AuthsMap from control file: "+authsMap;\r
-        }\r
-\r
-        report.addTestGroup(testGroupID, controlFileName);   //controlFileName is just the short name, without the full path.\r
-        String xmlReplayHeader = "========================================================================"\r
-                          +"\r\nXmlReplay running:"\r
-                          +"\r\n   controlFile: "+ (new File(controlFile).getCanonicalPath())\r
-                          +"\r\n   protoHostPort: "+protoHostPort\r
-                          +"\r\n   testGroup: "+testGroupID\r
-                          + (Tools.notEmpty(oneTestID) ? "\r\n   oneTestID: "+oneTestID : "")\r
-                          +"\r\n   AuthsMap: "+authsMapINFO\r
-                          +"\r\n   param_autoDeletePOSTS: "+param_autoDeletePOSTS\r
-                          +"\r\n   Dump info: "+dump\r
-                          +"\r\n========================================================================"\r
-                          +"\r\n";\r
-        report.addRunInfo(xmlReplayHeader);\r
-\r
-        System.out.println(xmlReplayHeader);\r
-\r
-        String autoDeletePOSTS = "";\r
-        List<Node> testgroupNodes;\r
-        if (Tools.notEmpty(testGroupID)){\r
-            testgroupNodes = document.selectNodes("//testGroup[@ID='"+testGroupID+"']");\r
-        } else {\r
-            testgroupNodes = document.selectNodes("//testGroup");\r
-        }\r
-\r
-        JexlEngine jexl = new JexlEngine();   // Used for expression language expansion from uri field.\r
-        XmlReplayEval evalStruct = new XmlReplayEval();\r
-        evalStruct.serviceResultsMap = serviceResultsMap;\r
-        evalStruct.jexl = jexl;\r
-\r
-        for (Node testgroup : testgroupNodes) {\r
-\r
-            XmlReplayEval.MapContextWKeys jc = new XmlReplayEval.MapContextWKeys();//MapContext();  //Get a new JexlContext for each test group.\r
-            evalStruct.jc = jc;\r
-\r
-            autoDeletePOSTS = testgroup.valueOf("@autoDeletePOSTS");\r
-            List<Node> tests;\r
-            if (Tools.notEmpty(oneTestID)){\r
-                tests = testgroup.selectNodes("test[@ID='"+oneTestID+"']");\r
-            } else {\r
-                tests = testgroup.selectNodes("test");\r
-            }\r
-            String authForTest = "";\r
-            int testElementIndex = -1;\r
-\r
-            for (Node testNode : tests) {\r
-                long startTime = System.currentTimeMillis();\r
-                try {\r
-                    testElementIndex++;\r
-                    String testID = testNode.valueOf("@ID");\r
-                    String testIDLabel = Tools.notEmpty(testID) ? (testGroupID+'.'+testID) : (testGroupID+'.'+testElementIndex);\r
-                    String method = testNode.valueOf("method");\r
-                    String uri = testNode.valueOf("uri");\r
-                    String fullURL = Tools.glue(protoHostPort, "/", uri);\r
-\r
-                    String authIDForTest = testNode.valueOf("@auth");\r
-                    String currentAuthForTest = authsMap.map.get(authIDForTest);\r
-                    if (Tools.notEmpty(currentAuthForTest)){\r
-                        authForTest = currentAuthForTest; //else just run with current from last loop;\r
-                    }\r
-                    if (Tools.isEmpty(authForTest)){\r
-                        authForTest = defaultAuths.getDefaultAuth();\r
-                    }\r
-\r
-                    if (uri.indexOf("$")>-1){\r
-                        uri = evalStruct.eval(uri, serviceResultsMap, null, jexl, jc);\r
-                    }\r
-                    fullURL = fixupFullURL(fullURL, protoHostPort, uri);\r
-\r
-                    List<Integer> expectedCodes = new ArrayList<Integer>();\r
-                    String expectedCodesStr = testNode.valueOf("expectedCodes");\r
-                    if (Tools.notEmpty(expectedCodesStr)){\r
-                         String[] codesArray = expectedCodesStr.split(",");\r
-                         for (String code : codesArray){\r
-                             expectedCodes.add(new Integer(code.trim()));\r
-                         }\r
-                    }\r
-\r
-                    Node responseNode = testNode.selectSingleNode("response");\r
-                    PartsStruct expectedResponseParts = null;\r
-                    if (responseNode!=null){\r
-                        expectedResponseParts = PartsStruct.readParts(responseNode, testID, xmlReplayBaseDir);\r
-                        //System.out.println("reponse parts: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+expectedResponseParts);\r
-                    }\r
-\r
-                    ServiceResult serviceResult;\r
-                    boolean isPOST = method.equalsIgnoreCase("POST");\r
-                    boolean isPUT =  method.equalsIgnoreCase("PUT");\r
-                    if ( isPOST || isPUT ) {\r
-                        PartsStruct parts = PartsStruct.readParts(testNode, testID, xmlReplayBaseDir);\r
-                        if (Tools.notEmpty(parts.overrideTestID)) {\r
-                            testID = parts.overrideTestID;\r
-                        }\r
-                        if (isPOST){\r
-                            String csid = CSIDfromTestID(testNode, serviceResultsMap);\r
-                            if (Tools.notEmpty(csid)) uri = Tools.glue(uri, "/", csid+"/items/");\r
-                        } else if (isPUT) {\r
-                            uri = fromTestID(uri, testNode, serviceResultsMap);\r
-                        }\r
-                        //vars only make sense in two contexts: POST/PUT, because you are submitting another file with internal expressions,\r
-                        // and in <response> nodes. For GET, DELETE, there is no payload, so all the URLs with potential expressions are right there in the testNode.\r
-                        Map<String,String> vars = null;\r
-                        if (parts.varsList.size()>0){\r
-                            vars = parts.varsList.get(0);\r
-                        }\r
-                        serviceResult = XmlReplayTransport.doPOST_PUTFromXML(parts.responseFilename, vars, protoHostPort, uri, method, XmlReplayTransport.APPLICATION_XML, evalStruct, authForTest, testIDLabel);\r
-                        if (vars!=null) {\r
-                            serviceResult.addVars(vars);\r
-                        }\r
-                        results.add(serviceResult);\r
-                        //if (isPOST){\r
-                            serviceResultsMap.put(testID, serviceResult);      //PUTs do not return a Location, so don't add PUTs to serviceResultsMap.\r
-                        //}\r
-                        fullURL = fixupFullURL(fullURL, protoHostPort, uri);\r
-                    } else if (method.equalsIgnoreCase("DELETE")){\r
-                        String fromTestID = testNode.valueOf("fromTestID");\r
-                        ServiceResult pr = serviceResultsMap.get(fromTestID);\r
-                        if (pr!=null){\r
-                            serviceResult = XmlReplayTransport.doDELETE(pr.deleteURL, authForTest, testIDLabel, fromTestID);\r
-                            serviceResult.fromTestID = fromTestID;\r
-                            if (expectedCodes.size()>0){\r
-                                serviceResult.expectedCodes = expectedCodes;\r
-                            }\r
-                            results.add(serviceResult);\r
-                            if (serviceResult.codeInSuccessRange(serviceResult.responseCode)){  //gotExpectedResult depends on serviceResult.expectedCodes.\r
-                                serviceResultsMap.remove(fromTestID);\r
-                            }\r
-                        } else {\r
-                            if (Tools.notEmpty(fromTestID)){\r
-                                serviceResult = new ServiceResult();\r
-                                serviceResult.responseCode = 0;\r
-                                serviceResult.error = "ID not found in element fromTestID: "+fromTestID;\r
-                                System.err.println("****\r\nServiceResult: "+serviceResult.error+". SKIPPING TEST. Full URL: "+fullURL);\r
-                            } else {\r
-                                serviceResult = XmlReplayTransport.doDELETE(fullURL, authForTest, testID, fromTestID);\r
-                            }\r
-                            serviceResult.fromTestID = fromTestID;\r
-                            results.add(serviceResult);\r
-                        }\r
-                    } else if (method.equalsIgnoreCase("GET")){\r
-                        fullURL = fromTestID(fullURL, testNode, serviceResultsMap);\r
-                        serviceResult = XmlReplayTransport.doGET(fullURL, authForTest, testIDLabel);\r
-                        results.add(serviceResult);\r
-                        serviceResultsMap.put(testID, serviceResult);\r
-                    } else if (method.equalsIgnoreCase("LIST")){\r
-                        fullURL = fixupFullURL(fullURL, protoHostPort, uri);\r
-                        String listQueryParams = ""; //TODO: empty for now, later may pick up from XML control file.\r
-                        serviceResult = XmlReplayTransport.doLIST(fullURL, listQueryParams, authForTest, testIDLabel);\r
-                        results.add(serviceResult);\r
-                        serviceResultsMap.put(testID, serviceResult);\r
-                    } else {\r
-                        throw new Exception("HTTP method not supported by XmlReplay: "+method);\r
-                    }\r
-\r
-                    serviceResult.testID = testID;\r
-                    serviceResult.fullURL = fullURL;\r
-                    serviceResult.auth = authForTest;\r
-                    serviceResult.method = method;\r
-                    if (expectedCodes.size()>0){\r
-                        serviceResult.expectedCodes = expectedCodes;\r
-                    }\r
-                    if (Tools.isEmpty(serviceResult.testID)) serviceResult.testID = testIDLabel;\r
-                    if (Tools.isEmpty(serviceResult.testGroupID)) serviceResult.testGroupID = testGroupID;\r
-\r
-                    Node expectedLevel = testNode.selectSingleNode("response/expected");\r
-                    if (expectedLevel!=null){\r
-                        String level = expectedLevel.valueOf("@level");\r
-                        serviceResult.payloadStrictness = level;\r
-                    }\r
-                    //=====================================================\r
-                    //  ALL VALIDATION FOR ALL REQUESTS IS DONE HERE:\r
-                    //=====================================================\r
-                    boolean hasError = false;\r
-                    String vError = validateResponse(serviceResult, serviceResultsMap, expectedResponseParts, evalStruct);\r
-                    if (Tools.notEmpty(vError)){\r
-                        serviceResult.error = vError;\r
-                        serviceResult.failureReason = " : VALIDATION ERROR; ";\r
-                        hasError = true;\r
-                    }\r
-                    if (hasError == false){\r
-                        hasError = ! serviceResult.gotExpectedResult();\r
-                    }\r
-\r
-                    boolean doingAuto = (dump.dumpServiceResult == ServiceResult.DUMP_OPTIONS.auto);\r
-                    String serviceResultRow = serviceResult.dump(dump.dumpServiceResult, hasError)+"; time:"+(System.currentTimeMillis()-startTime);\r
-                    String leader = (dump.dumpServiceResult == ServiceResult.DUMP_OPTIONS.detailed) ? "XmlReplay:"+testIDLabel+": ": "";\r
-\r
-                    report.addTestResult(serviceResult);\r
-\r
-                    if (   (dump.dumpServiceResult == ServiceResult.DUMP_OPTIONS.detailed)\r
-                        || (dump.dumpServiceResult == ServiceResult.DUMP_OPTIONS.full)         ){\r
-                        System.out.println("\r\n#---------------------#");\r
-                    }\r
-                    System.out.println(timeString()+" "+leader+serviceResultRow+"\r\n");\r
-                    if (dump.payloads || (doingAuto&&hasError) ) {\r
-                        if (Tools.notBlank(serviceResult.requestPayload)){\r
-                            System.out.println("\r\n========== request payload ===============");\r
-                            System.out.println(serviceResult.requestPayload);\r
-                            System.out.println("==========================================\r\n");\r
-                        }\r
-                    }\r
-                    if (dump.payloads || (doingAuto&&hasError)) {\r
-                        if (Tools.notBlank(serviceResult.result)){\r
-                            System.out.println("\r\n========== response payload ==============");\r
-                            System.out.println(serviceResult.result);\r
-                            System.out.println("==========================================\r\n");\r
-                        }\r
-                    }\r
-                } catch (Throwable t) {\r
-                    String msg = "ERROR: XmlReplay experienced an error in a test node: "+testNode+" Throwable: "+t;\r
-                    System.out.println(msg);\r
-                    System.out.println(Tools.getStackTrace(t));\r
-                    ServiceResult serviceResult = new ServiceResult();\r
-                    serviceResult.error = msg;\r
-                    serviceResult.failureReason = " : SYSTEM ERROR; ";\r
-                    results.add(serviceResult);\r
-                }\r
-            }\r
-            if (Tools.isTrue(autoDeletePOSTS)&&param_autoDeletePOSTS){\r
-                autoDelete(serviceResultsMap, "default");\r
-            }\r
-        }\r
-\r
-        //=== Now spit out the HTML report file ===\r
-        File m = new File(controlFileName);\r
-        String localName = m.getName();//don't instantiate, just use File to extract file name without directory.\r
-        String reportName = localName+'-'+testGroupID+".html";\r
-\r
-        File resultFile = report.saveReport(xmlReplayBaseDir, reportsDir, reportName);\r
-        if (resultFile!=null) {\r
-            String toc = report.getTOC(reportName);\r
-            reportsList.add(toc);\r
-        }\r
-        //================================\r
-\r
-        return results;\r
-    }\r
-\r
-               private static String timeString() {\r
-                       java.util.Date date= new java.util.Date();\r
-                       java.sql.Timestamp ts = new java.sql.Timestamp(date.getTime());\r
-                       return ts.toString();\r
-               }\r
-               \r
-\r
-    //======================== MAIN ===================================================================\r
-\r
-    private static Options createOptions() {\r
-        Options options = new Options();\r
-        options.addOption("xmlReplayBaseDir", true, "default/basedir");\r
-        return options;\r
-    }\r
-\r
-    public static String usage(){\r
-        String result = "org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay {args}\r\n"\r
-                        +"  -xmlReplayBaseDir <dir> \r\n"\r
-                        +" You may also override these with system args, e.g.: \r\n"\r
-                        +"   -DxmlReplayBaseDir=/path/to/dir \r\n"\r
-                        +" These may also be passed in via the POM.\r\n"\r
-                        +" You can also set these system args, e.g.: \r\n"\r
-                        +"  -DtestGroupID=<oneID> \r\n"\r
-                        +"  -DtestID=<one TestGroup ID>"\r
-                        +"  -DautoDeletePOSTS=<true|false> \r\n"\r
-                        +"    (note: -DautoDeletePOSTS won't force deletion if set to false in control file.";\r
-        return result;\r
-    }\r
-\r
-    private static String opt(CommandLine line, String option){\r
-        String result;\r
-        String fromProps = System.getProperty(option);\r
-        if (Tools.notEmpty(fromProps)){\r
-            return fromProps;\r
-        }\r
-        if (line==null){\r
-            return "";\r
-        }\r
-        result = line.getOptionValue(option);\r
-        if (result == null){\r
-            result = "";\r
-        }\r
-        return result;\r
-    }\r
-\r
-    public static void main(String[]args) throws Exception {\r
-        Options options = createOptions();\r
-        //System.out.println("System CLASSPATH: "+prop.getProperty("java.class.path", null));\r
-        CommandLineParser parser = new GnuParser();\r
-        try {\r
-            // parse the command line arguments\r
-            CommandLine line = parser.parse(options, args);\r
-\r
-            String xmlReplayBaseDir = opt(line, "xmlReplayBaseDir");\r
-            String reportsDir = opt(line, "reportsDir");\r
-            String testGroupID      = opt(line, "testGroupID");\r
-            String testID           = opt(line, "testID");\r
-            String autoDeletePOSTS  = opt(line, "autoDeletePOSTS");\r
-            String dumpResults      = opt(line, "dumpResults");\r
-            String controlFilename   = opt(line, "controlFilename");\r
-            String xmlReplayMaster  = opt(line, "xmlReplayMaster");\r
-\r
-            if (Tools.isBlank(reportsDir)){\r
-                reportsDir = xmlReplayBaseDir + XmlReplayTest.REPORTS_DIRNAME;\r
-            }\r
-            reportsDir = Tools.fixFilename(reportsDir);\r
-            xmlReplayBaseDir = Tools.fixFilename(xmlReplayBaseDir);\r
-            controlFilename = Tools.fixFilename(controlFilename);\r
-\r
-            boolean bAutoDeletePOSTS = true;\r
-            if (Tools.notEmpty(autoDeletePOSTS)) {\r
-                bAutoDeletePOSTS = Tools.isTrue(autoDeletePOSTS);\r
-            }\r
-            boolean bDumpResults = false;\r
-            if (Tools.notEmpty(dumpResults)) {\r
-                bDumpResults = Tools.isTrue(autoDeletePOSTS);\r
-            }\r
-            if (Tools.isEmpty(xmlReplayBaseDir)){\r
-                System.err.println("ERROR: xmlReplayBaseDir was not specified.");\r
-                return;\r
-            }\r
-            File f = new File(Tools.glue(xmlReplayBaseDir, "/", controlFilename));\r
-            if (Tools.isEmpty(xmlReplayMaster) && !f.exists()){\r
-                System.err.println("Control file not found: "+f.getCanonicalPath());\r
-                return;\r
-            }\r
-            File fMaster = new File(Tools.glue(xmlReplayBaseDir, "/", xmlReplayMaster));\r
-            if (Tools.notEmpty(xmlReplayMaster)  && !fMaster.exists()){\r
-                System.err.println("Master file not found: "+fMaster.getCanonicalPath());\r
-                return;\r
-            }\r
-\r
-            String xmlReplayBaseDirResolved = (new File(xmlReplayBaseDir)).getCanonicalPath();\r
-            System.out.println("XmlReplay ::"\r
-                            + "\r\n    xmlReplayBaseDir: "+xmlReplayBaseDir\r
-                            + "\r\n    xmlReplayBaseDir(resolved): "+xmlReplayBaseDirResolved\r
-                            + "\r\n    controlFilename: "+controlFilename\r
-                            + "\r\n    xmlReplayMaster: "+xmlReplayMaster\r
-                            + "\r\n    testGroupID: "+testGroupID\r
-                            + "\r\n    testID: "+testID\r
-                            + "\r\n    autoDeletePOSTS: "+bAutoDeletePOSTS\r
-                            + (Tools.notEmpty(xmlReplayMaster)\r
-                                       ? ("\r\n    will use master file: "+fMaster.getCanonicalPath())\r
-                                       : ("\r\n    will use control file: "+f.getCanonicalPath()) )\r
-                             );\r
-            \r
-            if (Tools.notEmpty(xmlReplayMaster)){\r
-                if (Tools.notEmpty(controlFilename)){\r
-                    System.out.println("WARN: controlFilename: "+controlFilename+" will not be used because master was specified.  Running master: "+xmlReplayMaster);\r
-                }\r
-                XmlReplay replay = new XmlReplay(xmlReplayBaseDirResolved, reportsDir);\r
-                replay.readOptionsFromMasterConfigFile(xmlReplayMaster);\r
-                replay.setAutoDeletePOSTS(bAutoDeletePOSTS);\r
-                Dump dumpFromMaster = replay.getDump();\r
-                dumpFromMaster.payloads = Tools.isTrue(dumpResults);\r
-                replay.setDump(dumpFromMaster);\r
-                replay.runMaster(xmlReplayMaster, false); //false, because we already just read the options, and override a few.\r
-            } else {\r
-                Dump dump = getDumpConfig();\r
-                dump.payloads = Tools.isTrue(dumpResults);\r
-                List<String> reportsList = new ArrayList<String>();\r
-                runXmlReplayFile(xmlReplayBaseDirResolved, controlFilename, testGroupID, testID, createResultsMap(), bAutoDeletePOSTS, dump, "", null, reportsList, reportsDir);\r
-                System.out.println("DEPRECATED: reportsList is generated, but not dumped: "+reportsList.toString());\r
-            }\r
-        } catch (ParseException exp) {\r
-            // oops, something went wrong\r
-            System.err.println("Cmd-line parsing failed.  Reason: " + exp.getMessage());\r
-            System.err.println(usage());\r
-        } catch (Exception e) {\r
-            System.out.println("Error : " + e.getMessage());\r
-            e.printStackTrace();\r
-        }\r
-    }\r
-\r
-}\r
+package org.collectionspace.services.IntegrationTests.xmlreplay;
+
+import org.apache.commons.cli.*;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.jexl2.JexlEngine;
+import org.collectionspace.services.common.api.Tools;
+import org.dom4j.*;
+import org.dom4j.io.SAXReader;
+
+import java.io.*;
+import java.util.*;
+
+/**  This class is used to replay a request to the Services layer, by sending the XML payload
+ *   in an appropriate Multipart request.
+ *   See example usage in calling class XmlReplayTest in services/IntegrationTests, and also in main() in this class.
+ *   @author Laramie Crocker
+ */
+public class XmlReplay {
+
+    public XmlReplay(String basedir, String reportsDir){
+        this.basedir = basedir;
+        this.serviceResultsMap = createResultsMap();
+        this.reportsList = new ArrayList<String>();
+        this.reportsDir = reportsDir;
+    }
+
+    public static final String DEFAULT_CONTROL = "xml-replay-control.xml";
+    public static final String DEFAULT_MASTER_CONTROL = "xml-replay-master.xml";
+    public static final String DEFAULT_DEV_MASTER_CONTROL = "dev-master.xml";
+
+    private String reportsDir = "";
+    public String getReportsDir(){
+        return reportsDir;
+    }
+    private String basedir = ".";  //set from constructor.
+    public String getBaseDir(){
+        return basedir;
+    }
+    
+    private String controlFileName = DEFAULT_CONTROL;
+    public String getControlFileName() {
+        return controlFileName;
+    }
+    public void setControlFileName(String controlFileName) {
+        this.controlFileName = controlFileName;
+    }
+
+    private String protoHostPort = "";
+    public String getProtoHostPort() {
+        return protoHostPort;
+    }
+    public void setProtoHostPort(String protoHostPort) {
+        this.protoHostPort = protoHostPort;
+    }
+
+    private boolean autoDeletePOSTS = true;
+    public boolean isAutoDeletePOSTS() {
+        return autoDeletePOSTS;
+    }
+    public void setAutoDeletePOSTS(boolean autoDeletePOSTS) {
+        this.autoDeletePOSTS = autoDeletePOSTS;
+    }
+
+    private Dump dump;
+    public Dump getDump() {
+        return dump;
+    }
+    public void setDump(Dump dump) {
+        this.dump = dump;
+    }
+
+    AuthsMap defaultAuthsMap;
+    public AuthsMap getDefaultAuthsMap(){
+        return defaultAuthsMap;
+    }
+    public void setDefaultAuthsMap(AuthsMap authsMap){
+        defaultAuthsMap = authsMap;
+    }
+
+    private Map<String, ServiceResult> serviceResultsMap;
+    public Map<String, ServiceResult> getServiceResultsMap(){
+        return serviceResultsMap;
+    }
+    public static Map<String, ServiceResult> createResultsMap(){
+        return new HashMap<String, ServiceResult>();
+    }
+
+    private List<String> reportsList;
+    public  List<String> getReportsList(){
+        return reportsList;
+    }
+
+    public String toString(){
+        return "XmlReplay{"+this.basedir+", "+this.defaultAuthsMap+", "+this.dump+", "+this.reportsDir+'}';
+    }
+
+    // ============== METHODS ===========================================================
+
+    /** Optional information method: call this method after instantiating this class using the constructor XmlReplay(String), which sets the basedir.  Then you
+     *   pass in your relative masterFilename to that basedir to this method, which will return true if the file is readable, valid xml, etc.
+     *   Do this in preference to  just seeing if File.exists(), because there are rules to finding the file relative to the maven test dir, yada, yada.
+     *   This method makes it easy to have a development test file that you don't check in, so that dev tests can be missing gracefully, etc.
+     */
+    public boolean masterConfigFileExists(String masterFilename){
+        try {
+            org.dom4j.Document doc = openMasterConfigFile(masterFilename);
+            if (doc == null){
+                return false;
+            }
+            return true;
+        } catch (Throwable t){
+            return false;
+        }
+    }
+
+    public org.dom4j.Document openMasterConfigFile(String masterFilename) throws FileNotFoundException {
+        String fullPath = Tools.glue(basedir, "/", masterFilename);
+        File f = new File(fullPath);
+        if (!f.exists()){
+            return null;
+        }
+        org.dom4j.Document document = getDocument(fullPath); //will check full path first, then checks relative to PWD.
+        if (document == null){
+            throw new FileNotFoundException("XmlReplay master control file ("+masterFilename+") not found in basedir: "+basedir+". Exiting test.");
+        }
+        return document;
+    }
+
+    /** specify the master config file, relative to getBaseDir(), but ignore any tests or testGroups in the master.
+     *  @return a Document object, which you don't need to use: all options will be stored in XmlReplay instance.
+     */
+    public org.dom4j.Document readOptionsFromMasterConfigFile(String masterFilename) throws FileNotFoundException {
+        org.dom4j.Document document = openMasterConfigFile(masterFilename);
+        if (document == null){
+            throw new FileNotFoundException(masterFilename);
+        }
+        protoHostPort = document.selectSingleNode("/xmlReplayMaster/protoHostPort").getText().trim();
+        AuthsMap authsMap = readAuths(document);
+        setDefaultAuthsMap(authsMap);
+        Dump dump = XmlReplay.readDumpOptions(document);
+        setDump(dump);
+        return document;
+    }
+
+    public List<List<ServiceResult>> runMaster(String masterFilename) throws Exception {
+        return runMaster(masterFilename, true);
+    }
+
+    /** Creates new instances of XmlReplay, one for each controlFile specified in the master,
+     *  and setting defaults from this instance, but not sharing ServiceResult objects or maps. */
+    public List<List<ServiceResult>> runMaster(String masterFilename, boolean readOptionsFromMaster) throws Exception {
+        List<List<ServiceResult>> list = new ArrayList<List<ServiceResult>>();
+        org.dom4j.Document document;
+        if (readOptionsFromMaster){
+            document = readOptionsFromMasterConfigFile(masterFilename);
+        } else {
+            document = openMasterConfigFile(masterFilename);
+        }
+        if (document==null){
+            throw new FileNotFoundException(masterFilename);
+        }
+        String controlFile, testGroup, test;
+        List<Node> runNodes;
+        runNodes = document.selectNodes("/xmlReplayMaster/run");
+        for (Node runNode : runNodes) {
+            controlFile = runNode.valueOf("@controlFile");
+            testGroup = runNode.valueOf("@testGroup");
+            test = runNode.valueOf("@test"); //may be empty
+
+            //Create a new instance and clone only config values, not any results maps.
+            XmlReplay replay = new XmlReplay(basedir, this.reportsDir);
+            replay.setControlFileName(controlFile);
+            replay.setProtoHostPort(protoHostPort);
+            replay.setAutoDeletePOSTS(isAutoDeletePOSTS());
+            replay.setDump(dump);
+            replay.setDefaultAuthsMap(getDefaultAuthsMap());
+
+            //Now run *that* instance.
+            List<ServiceResult> results = replay.runTests(testGroup, test);
+            list.add(results);
+            this.reportsList.addAll(replay.getReportsList());   //Add all the reports from the inner replay, to our master replay's reportsList, to generate the index.html file.
+        }
+        XmlReplayReport.saveIndexForMaster(basedir, reportsDir, masterFilename, this.reportsList);
+        return list;
+    }
+
+    /** Use this if you wish to run named tests within a testGroup, otherwise call runTestGroup(). */
+    public List<ServiceResult>  runTests(String testGroupID, String testID) throws Exception {
+        List<ServiceResult> result = runXmlReplayFile(this.basedir,
+                                this.controlFileName,
+                                testGroupID,
+                                testID,
+                                this.serviceResultsMap,
+                                this.autoDeletePOSTS,
+                                dump,
+                                this.protoHostPort,
+                                this.defaultAuthsMap,
+                                this.reportsList,
+                                this.reportsDir);
+        return result;
+    }
+
+    /** Use this if you wish to specify just ONE test to run within a testGroup, otherwise call runTestGroup(). */
+    public ServiceResult  runTest(String testGroupID, String testID) throws Exception {
+        List<ServiceResult> result = runXmlReplayFile(this.basedir,
+                                this.controlFileName,
+                                testGroupID,
+                                testID,
+                                this.serviceResultsMap,
+                                this.autoDeletePOSTS,
+                                dump,
+                                this.protoHostPort,
+                                this.defaultAuthsMap,
+                                this.reportsList,
+                                this.reportsDir);
+        if (result.size()>1){
+            throw new IndexOutOfBoundsException("Multiple ("+result.size()+") tests with ID='"+testID+"' were found within test group '"+testGroupID+"', but there should only be one test per ID attribute.");
+        }
+        return result.get(0);
+    }
+
+    /** Use this if you wish to run all tests within a testGroup.*/
+    public List<ServiceResult> runTestGroup(String testGroupID) throws Exception {
+        //NOTE: calling runTest with empty testID runs all tests in a test group, but don't expose this fact.
+        // Expose this method (runTestGroup) instead.
+        return runTests(testGroupID, "");
+    }
+
+    public List<ServiceResult>  autoDelete(String logName){
+        return autoDelete(this.serviceResultsMap, logName);
+    }
+
+    /** Use this method to clean up resources created on the server that returned CSIDs, if you have
+     *  specified autoDeletePOSTS==false, which means you are managing the cleanup yourself.
+     * @param serviceResultsMap a Map of ServiceResult objects, which will contain ServiceResult.deleteURL.
+     * @return a List<String> of debug info about which URLs could not be deleted.
+     */
+    public static List<ServiceResult> autoDelete(Map<String, ServiceResult> serviceResultsMap, String logName){
+        List<ServiceResult> results = new ArrayList<ServiceResult>();
+        for (ServiceResult pr : serviceResultsMap.values()){
+            try {
+                if (Tools.notEmpty(pr.deleteURL)){
+                    ServiceResult deleteResult = XmlReplayTransport.doDELETE(pr.deleteURL, pr.auth, pr.testID, "[autodelete:"+logName+"]");
+                    results.add(deleteResult);
+                } else {
+                    ServiceResult errorResult = new ServiceResult();
+                    errorResult.fullURL = pr.fullURL;
+                    errorResult.testGroupID = pr.testGroupID;
+                    errorResult.fromTestID = pr.fromTestID;
+                    errorResult.overrideGotExpectedResult();
+                    results.add(errorResult);
+                }
+            } catch (Throwable t){
+                String s = (pr!=null) ? "ERROR while cleaning up ServiceResult map: "+pr+" for "+pr.deleteURL+" :: "+t
+                                      : "ERROR while cleaning up ServiceResult map (null ServiceResult): "+t;
+                System.err.println(s);
+                ServiceResult errorResult = new ServiceResult();
+                errorResult.fullURL = pr.fullURL;
+                errorResult.testGroupID = pr.testGroupID;
+                errorResult.fromTestID = pr.fromTestID;
+                errorResult.error = s;
+                results.add(errorResult);
+            }
+        }
+        return results;
+    }
+
+    public static class AuthsMap {
+        Map<String,String> map;
+        String defaultID="";
+        public String getDefaultAuth(){
+            return map.get(defaultID);
+        }
+        public String toString(){
+            return "AuthsMap: {default='"+defaultID+"'; "+map.keySet()+'}';
+        }
+    }
+
+    public static AuthsMap readAuths(org.dom4j.Document document){
+    Map<String, String> map = new HashMap<String, String>();
+        List<Node> authNodes = document.selectNodes("//auths/auth");
+        for (Node auth : authNodes) {
+            map.put(auth.valueOf("@ID"), auth.getStringValue());
+        }
+        AuthsMap authsMap = new AuthsMap();
+        Node auths = document.selectSingleNode("//auths");
+        String defaultID = "";
+        if (auths != null){
+            defaultID = auths.valueOf("@default");
+        }
+        authsMap.map = map;
+        authsMap.defaultID = defaultID;
+        return authsMap;
+    }
+
+    public static class Dump {
+        public boolean payloads = false;
+        //public static final ServiceResult.DUMP_OPTIONS dumpServiceResultOptions = ServiceResult.DUMP_OPTIONS;
+        public ServiceResult.DUMP_OPTIONS dumpServiceResult = ServiceResult.DUMP_OPTIONS.minimal;
+        public String toString(){
+            return "payloads: "+payloads+" dumpServiceResult: "+dumpServiceResult;
+        }
+    }
+
+    public static Dump getDumpConfig(){
+        return new Dump();
+    }
+
+    public static Dump readDumpOptions(org.dom4j.Document document){
+        Dump dump = getDumpConfig();
+        Node dumpNode = document.selectSingleNode("//dump");
+        if (dumpNode != null){
+            dump.payloads = Tools.isTrue(dumpNode.valueOf("@payloads"));
+            String dumpServiceResultStr = dumpNode.valueOf("@dumpServiceResult");
+            if (Tools.notEmpty(dumpServiceResultStr)){
+                dump.dumpServiceResult = ServiceResult.DUMP_OPTIONS.valueOf(dumpServiceResultStr);
+            }
+        }
+        return dump;
+    }
+
+    private static class PartsStruct {
+        public List<Map<String,String>> varsList = new ArrayList<Map<String,String>>();
+        String responseFilename = "";
+        String overrideTestID = "";
+        String startElement = "";
+        String label = "";
+
+        public static PartsStruct readParts(Node testNode, final String testID, String xmlReplayBaseDir){
+            PartsStruct resultPartsStruct = new PartsStruct();
+            resultPartsStruct.responseFilename = testNode.valueOf("filename");
+            resultPartsStruct.startElement = testNode.valueOf("startElement");
+            resultPartsStruct.label = testNode.valueOf("label");
+            String responseFilename = testNode.valueOf("filename");
+            if (Tools.notEmpty(responseFilename)){
+                resultPartsStruct.responseFilename = xmlReplayBaseDir + '/' + responseFilename;
+                List<Node> varNodes = testNode.selectNodes("vars/var");
+                readVars(testNode, varNodes, resultPartsStruct);
+            }
+            return resultPartsStruct;
+        }
+
+        private static void readVars(Node testNode, List<Node> varNodes, PartsStruct resultPartsStruct){
+            Map<String,String> vars = new HashMap<String,String>();
+            resultPartsStruct.varsList.add(vars);
+            //System.out.println("### vars: "+vars.size()+" ########");
+            for (Node var: varNodes){
+                String ID = var.valueOf("@ID");
+                String value = var.getText();
+                //System.out.println("ID: "+ID+" value: "+value);
+                vars.put(ID, value); //vars is already part of resultPartsStruct.varsList
+            }
+            //System.out.println("### end-vars ########");
+        }
+    }
+
+
+
+    private static String fixupFullURL(String fullURL, String protoHostPort, String uri){
+        if ( ! uri.startsWith(protoHostPort)){
+            fullURL = Tools.glue(protoHostPort, "/", uri);
+        } else {
+            fullURL = uri;
+        }
+        return fullURL;
+    }
+
+    private static String fromTestID(String fullURL, Node testNode, Map<String, ServiceResult> serviceResultsMap){
+        String fromTestID = testNode.valueOf("fromTestID");
+        if (Tools.notEmpty(fromTestID)){
+            ServiceResult getPR = serviceResultsMap.get(fromTestID);
+            if (getPR != null){
+                fullURL = Tools.glue(fullURL, "/", getPR.location);
+            }
+        }
+        return fullURL;
+    }
+
+    private static String CSIDfromTestID(Node testNode, Map<String, ServiceResult> serviceResultsMap){
+        String result = "";
+        String fromTestID = testNode.valueOf("fromTestID");
+        if (Tools.notEmpty(fromTestID)){
+            ServiceResult getPR = serviceResultsMap.get(fromTestID);
+            if (getPR != null){
+                result = getPR.location;
+            }
+        }
+        return result;
+    }
+
+    public static org.dom4j.Document getDocument(String xmlFileName) {
+        org.dom4j.Document document = null;
+        SAXReader reader = new SAXReader();
+        try {
+            document = reader.read(xmlFileName);
+        } catch (DocumentException e) {
+            System.out.println("ERROR reading document: "+e);
+            //e.printStackTrace();
+        }
+        return document;
+    }
+
+    protected static String validateResponseSinglePayload(ServiceResult serviceResult,
+                                                 Map<String, ServiceResult> serviceResultsMap,
+                                                 PartsStruct expectedResponseParts,
+                                                 XmlReplayEval evalStruct)
+    throws Exception {
+        String OK = "";
+        byte[] b = FileUtils.readFileToByteArray(new File(expectedResponseParts.responseFilename));
+        String expectedPartContent = new String(b);
+        Map<String,String> vars = expectedResponseParts.varsList.get(0);  //just one part, so just one varsList.  Must be there, even if empty.
+        expectedPartContent = evalStruct.eval(expectedPartContent, serviceResultsMap, vars, evalStruct.jexl, evalStruct.jc);
+        serviceResult.expectedContentExpanded = expectedPartContent;
+        String label = "NOLABEL";
+        String leftID  = "{from expected part, label:"+label+" filename: "+expectedResponseParts.responseFilename+"}";
+        String rightID = "{from server, label:"+label
+                            +" fromTestID: "+serviceResult.fromTestID
+                            +" URL: "+serviceResult.fullURL
+                            +"}";
+        String startElement = expectedResponseParts.startElement;
+        String partLabel = expectedResponseParts.label;
+        if (Tools.isBlank(startElement)){
+            if (Tools.notBlank(partLabel))
+            startElement = "/document/*[local-name()='"+partLabel+"']";
+        }
+        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();
+        TreeWalkResults list =
+            XmlCompareJdom.compareParts(expectedPartContent,
+                                        leftID,
+                                        serviceResult.result,
+                                        rightID,
+                                        startElement,
+                                        matchSpec);
+        serviceResult.addPartSummary(label, list);
+        return OK;
+    }
+
+    protected static String validateResponse(ServiceResult serviceResult,
+                                             Map<String, ServiceResult> serviceResultsMap,
+                                             PartsStruct expectedResponseParts,
+                                             XmlReplayEval evalStruct){
+        String OK = "";
+        if (expectedResponseParts == null) return OK;
+        if (serviceResult == null) return OK;
+        if (serviceResult.result.length() == 0) return OK;
+        try {
+            return validateResponseSinglePayload(serviceResult, serviceResultsMap, expectedResponseParts, evalStruct);
+        } catch (Exception e){
+            String err = "ERROR in XmlReplay.validateResponse() : "+e;
+            return err  ;
+        }
+    }
+
+    //================= runXmlReplayFile ======================================================
+
+    public static List<ServiceResult> runXmlReplayFile(String xmlReplayBaseDir,
+                                          String controlFileName,
+                                          String testGroupID,
+                                          String oneTestID,
+                                          Map<String, ServiceResult> serviceResultsMap,
+                                          boolean param_autoDeletePOSTS,
+                                          Dump dump,
+                                          String protoHostPortParam,
+                                          AuthsMap defaultAuths,
+                                          List<String> reportsList,
+                                          String reportsDir)
+                                          throws Exception {
+        //Internally, we maintain two collections of ServiceResult:
+        //  the first is the return value of this method.
+        //  the second is the serviceResultsMap, which is used for keeping track of CSIDs created by POSTs, for later reference by DELETE, etc.
+        List<ServiceResult> results = new ArrayList<ServiceResult>();
+
+        XmlReplayReport report = new XmlReplayReport(reportsDir);
+
+        String controlFile = Tools.glue(xmlReplayBaseDir, "/", controlFileName);
+        org.dom4j.Document document;
+        document = getDocument(controlFile); //will check full path first, then checks relative to PWD.
+        if (document==null){
+            throw new FileNotFoundException("XmlReplay control file ("+controlFileName+") not found in basedir: "+xmlReplayBaseDir+" Exiting test.");
+        }
+        String protoHostPort;
+        if (Tools.isEmpty(protoHostPortParam)){
+            protoHostPort = document.selectSingleNode("/xmlReplay/protoHostPort").getText().trim();
+            System.out.println("DEPRECATED: Using protoHostPort ('"+protoHostPort+"') from xmlReplay file ('"+controlFile+"'), not master.");
+        } else {
+            protoHostPort = protoHostPortParam;
+        }
+        if (Tools.isEmpty(protoHostPort)){
+            throw new Exception("XmlReplay control file must have a protoHostPort element");
+        }
+
+        String authsMapINFO;
+        AuthsMap authsMap = readAuths(document);
+        if (authsMap.map.size()==0){
+            authsMap = defaultAuths;
+            authsMapINFO = "Using defaultAuths from master file: "+defaultAuths;
+        } else {
+            authsMapINFO = "Using AuthsMap from control file: "+authsMap;
+        }
+
+        report.addTestGroup(testGroupID, controlFileName);   //controlFileName is just the short name, without the full path.
+        String xmlReplayHeader = "========================================================================"
+                          +"\r\nXmlReplay running:"
+                          +"\r\n   controlFile: "+ (new File(controlFile).getCanonicalPath())
+                          +"\r\n   protoHostPort: "+protoHostPort
+                          +"\r\n   testGroup: "+testGroupID
+                          + (Tools.notEmpty(oneTestID) ? "\r\n   oneTestID: "+oneTestID : "")
+                          +"\r\n   AuthsMap: "+authsMapINFO
+                          +"\r\n   param_autoDeletePOSTS: "+param_autoDeletePOSTS
+                          +"\r\n   Dump info: "+dump
+                          +"\r\n========================================================================"
+                          +"\r\n";
+        report.addRunInfo(xmlReplayHeader);
+
+        System.out.println(xmlReplayHeader);
+
+        String autoDeletePOSTS = "";
+        List<Node> testgroupNodes;
+        if (Tools.notEmpty(testGroupID)){
+            testgroupNodes = document.selectNodes("//testGroup[@ID='"+testGroupID+"']");
+        } else {
+            testgroupNodes = document.selectNodes("//testGroup");
+        }
+
+        JexlEngine jexl = new JexlEngine();   // Used for expression language expansion from uri field.
+        XmlReplayEval evalStruct = new XmlReplayEval();
+        evalStruct.serviceResultsMap = serviceResultsMap;
+        evalStruct.jexl = jexl;
+
+        for (Node testgroup : testgroupNodes) {
+
+            XmlReplayEval.MapContextWKeys jc = new XmlReplayEval.MapContextWKeys();//MapContext();  //Get a new JexlContext for each test group.
+            evalStruct.jc = jc;
+
+            autoDeletePOSTS = testgroup.valueOf("@autoDeletePOSTS");
+            List<Node> tests;
+            if (Tools.notEmpty(oneTestID)){
+                tests = testgroup.selectNodes("test[@ID='"+oneTestID+"']");
+            } else {
+                tests = testgroup.selectNodes("test");
+            }
+            String authForTest = "";
+            int testElementIndex = -1;
+
+            for (Node testNode : tests) {
+                long startTime = System.currentTimeMillis();
+                try {
+                    testElementIndex++;
+                    String testID = testNode.valueOf("@ID");
+                    String testIDLabel = Tools.notEmpty(testID) ? (testGroupID+'.'+testID) : (testGroupID+'.'+testElementIndex);
+                    String method = testNode.valueOf("method");
+                    String uri = testNode.valueOf("uri");
+                    String fullURL = Tools.glue(protoHostPort, "/", uri);
+
+                    String authIDForTest = testNode.valueOf("@auth");
+                    String currentAuthForTest = authsMap.map.get(authIDForTest);
+                    if (Tools.notEmpty(currentAuthForTest)){
+                        authForTest = currentAuthForTest; //else just run with current from last loop;
+                    }
+                    if (Tools.isEmpty(authForTest)){
+                        authForTest = defaultAuths.getDefaultAuth();
+                    }
+
+                    if (uri.indexOf("$")>-1){
+                        uri = evalStruct.eval(uri, serviceResultsMap, null, jexl, jc);
+                    }
+                    fullURL = fixupFullURL(fullURL, protoHostPort, uri);
+
+                    List<Integer> expectedCodes = new ArrayList<Integer>();
+                    String expectedCodesStr = testNode.valueOf("expectedCodes");
+                    if (Tools.notEmpty(expectedCodesStr)){
+                         String[] codesArray = expectedCodesStr.split(",");
+                         for (String code : codesArray){
+                             expectedCodes.add(new Integer(code.trim()));
+                         }
+                    }
+
+                    Node responseNode = testNode.selectSingleNode("response");
+                    PartsStruct expectedResponseParts = null;
+                    if (responseNode!=null){
+                        expectedResponseParts = PartsStruct.readParts(responseNode, testID, xmlReplayBaseDir);
+                        //System.out.println("reponse parts: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+expectedResponseParts);
+                    }
+
+                    ServiceResult serviceResult;
+                    boolean isPOST = method.equalsIgnoreCase("POST");
+                    boolean isPUT =  method.equalsIgnoreCase("PUT");
+                    if ( isPOST || isPUT ) {
+                        PartsStruct parts = PartsStruct.readParts(testNode, testID, xmlReplayBaseDir);
+                        if (Tools.notEmpty(parts.overrideTestID)) {
+                            testID = parts.overrideTestID;
+                        }
+                        if (isPOST){
+                            String csid = CSIDfromTestID(testNode, serviceResultsMap);
+                            if (Tools.notEmpty(csid)) uri = Tools.glue(uri, "/", csid+"/items/");
+                        } else if (isPUT) {
+                            uri = fromTestID(uri, testNode, serviceResultsMap);
+                        }
+                        //vars only make sense in two contexts: POST/PUT, because you are submitting another file with internal expressions,
+                        // and in <response> nodes. For GET, DELETE, there is no payload, so all the URLs with potential expressions are right there in the testNode.
+                        Map<String,String> vars = null;
+                        if (parts.varsList.size()>0){
+                            vars = parts.varsList.get(0);
+                        }
+                        serviceResult = XmlReplayTransport.doPOST_PUTFromXML(parts.responseFilename, vars, protoHostPort, uri, method, XmlReplayTransport.APPLICATION_XML, evalStruct, authForTest, testIDLabel);
+                        if (vars!=null) {
+                            serviceResult.addVars(vars);
+                        }
+                        results.add(serviceResult);
+                        //if (isPOST){
+                            serviceResultsMap.put(testID, serviceResult);      //PUTs do not return a Location, so don't add PUTs to serviceResultsMap.
+                        //}
+                        fullURL = fixupFullURL(fullURL, protoHostPort, uri);
+                    } else if (method.equalsIgnoreCase("DELETE")){
+                        String fromTestID = testNode.valueOf("fromTestID");
+                        ServiceResult pr = serviceResultsMap.get(fromTestID);
+                        if (pr!=null){
+                            serviceResult = XmlReplayTransport.doDELETE(pr.deleteURL, authForTest, testIDLabel, fromTestID);
+                            serviceResult.fromTestID = fromTestID;
+                            if (expectedCodes.size()>0){
+                                serviceResult.expectedCodes = expectedCodes;
+                            }
+                            results.add(serviceResult);
+                            if (serviceResult.codeInSuccessRange(serviceResult.responseCode)){  //gotExpectedResult depends on serviceResult.expectedCodes.
+                                serviceResultsMap.remove(fromTestID);
+                            }
+                        } else {
+                            if (Tools.notEmpty(fromTestID)){
+                                serviceResult = new ServiceResult();
+                                serviceResult.responseCode = 0;
+                                serviceResult.error = "ID not found in element fromTestID: "+fromTestID;
+                                System.err.println("****\r\nServiceResult: "+serviceResult.error+". SKIPPING TEST. Full URL: "+fullURL);
+                            } else {
+                                serviceResult = XmlReplayTransport.doDELETE(fullURL, authForTest, testID, fromTestID);
+                            }
+                            serviceResult.fromTestID = fromTestID;
+                            results.add(serviceResult);
+                        }
+                    } else if (method.equalsIgnoreCase("GET")){
+                        fullURL = fromTestID(fullURL, testNode, serviceResultsMap);
+                        serviceResult = XmlReplayTransport.doGET(fullURL, authForTest, testIDLabel);
+                        results.add(serviceResult);
+                        serviceResultsMap.put(testID, serviceResult);
+                    } else if (method.equalsIgnoreCase("LIST")){
+                        fullURL = fixupFullURL(fullURL, protoHostPort, uri);
+                        String listQueryParams = ""; //TODO: empty for now, later may pick up from XML control file.
+                        serviceResult = XmlReplayTransport.doLIST(fullURL, listQueryParams, authForTest, testIDLabel);
+                        results.add(serviceResult);
+                        serviceResultsMap.put(testID, serviceResult);
+                    } else {
+                        throw new Exception("HTTP method not supported by XmlReplay: "+method);
+                    }
+
+                    serviceResult.testID = testID;
+                    serviceResult.fullURL = fullURL;
+                    serviceResult.auth = authForTest;
+                    serviceResult.method = method;
+                    if (expectedCodes.size()>0){
+                        serviceResult.expectedCodes = expectedCodes;
+                    }
+                    if (Tools.isEmpty(serviceResult.testID)) serviceResult.testID = testIDLabel;
+                    if (Tools.isEmpty(serviceResult.testGroupID)) serviceResult.testGroupID = testGroupID;
+
+                    Node expectedLevel = testNode.selectSingleNode("response/expected");
+                    if (expectedLevel!=null){
+                        String level = expectedLevel.valueOf("@level");
+                        serviceResult.payloadStrictness = level;
+                    }
+                    //=====================================================
+                    //  ALL VALIDATION FOR ALL REQUESTS IS DONE HERE:
+                    //=====================================================
+                    boolean hasError = false;
+                    String vError = validateResponse(serviceResult, serviceResultsMap, expectedResponseParts, evalStruct);
+                    if (Tools.notEmpty(vError)){
+                        serviceResult.error = vError;
+                        serviceResult.failureReason = " : VALIDATION ERROR; ";
+                        hasError = true;
+                    }
+                    if (hasError == false){
+                        hasError = ! serviceResult.gotExpectedResult();
+                    }
+
+                    boolean doingAuto = (dump.dumpServiceResult == ServiceResult.DUMP_OPTIONS.auto);
+                    String serviceResultRow = serviceResult.dump(dump.dumpServiceResult, hasError)+"; time:"+(System.currentTimeMillis()-startTime);
+                    String leader = (dump.dumpServiceResult == ServiceResult.DUMP_OPTIONS.detailed) ? "XmlReplay:"+testIDLabel+": ": "";
+
+                    report.addTestResult(serviceResult);
+
+                    if (   (dump.dumpServiceResult == ServiceResult.DUMP_OPTIONS.detailed)
+                        || (dump.dumpServiceResult == ServiceResult.DUMP_OPTIONS.full)         ){
+                        System.out.println("\r\n#---------------------#");
+                    }
+                    System.out.println(timeString()+" "+leader+serviceResultRow+"\r\n");
+                    if (dump.payloads || (doingAuto&&hasError) ) {
+                        if (Tools.notBlank(serviceResult.requestPayload)){
+                            System.out.println("\r\n========== request payload ===============");
+                            System.out.println(serviceResult.requestPayload);
+                            System.out.println("==========================================\r\n");
+                        }
+                    }
+                    if (dump.payloads || (doingAuto&&hasError)) {
+                        if (Tools.notBlank(serviceResult.result)){
+                            System.out.println("\r\n========== response payload ==============");
+                            System.out.println(serviceResult.result);
+                            System.out.println("==========================================\r\n");
+                        }
+                    }
+                } catch (Throwable t) {
+                    String msg = "ERROR: XmlReplay experienced an error in a test node: "+testNode+" Throwable: "+t;
+                    System.out.println(msg);
+                    System.out.println(Tools.getStackTrace(t));
+                    ServiceResult serviceResult = new ServiceResult();
+                    serviceResult.error = msg;
+                    serviceResult.failureReason = " : SYSTEM ERROR; ";
+                    results.add(serviceResult);
+                }
+            }
+            if (Tools.isTrue(autoDeletePOSTS)&&param_autoDeletePOSTS){
+                autoDelete(serviceResultsMap, "default");
+            }
+        }
+
+        //=== Now spit out the HTML report file ===
+        File m = new File(controlFileName);
+        String localName = m.getName();//don't instantiate, just use File to extract file name without directory.
+        String reportName = localName+'-'+testGroupID+".html";
+
+        File resultFile = report.saveReport(xmlReplayBaseDir, reportsDir, reportName);
+        if (resultFile!=null) {
+            String toc = report.getTOC(reportName);
+            reportsList.add(toc);
+        }
+        //================================
+
+        return results;
+    }
+
+               private static String timeString() {
+                       java.util.Date date= new java.util.Date();
+                       java.sql.Timestamp ts = new java.sql.Timestamp(date.getTime());
+                       return ts.toString();
+               }
+               
+
+    //======================== MAIN ===================================================================
+
+    private static Options createOptions() {
+        Options options = new Options();
+        options.addOption("xmlReplayBaseDir", true, "default/basedir");
+        return options;
+    }
+
+    public static String usage(){
+        String result = "org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay {args}\r\n"
+                        +"  -xmlReplayBaseDir <dir> \r\n"
+                        +" You may also override these with system args, e.g.: \r\n"
+                        +"   -DxmlReplayBaseDir=/path/to/dir \r\n"
+                        +" These may also be passed in via the POM.\r\n"
+                        +" You can also set these system args, e.g.: \r\n"
+                        +"  -DtestGroupID=<oneID> \r\n"
+                        +"  -DtestID=<one TestGroup ID>"
+                        +"  -DautoDeletePOSTS=<true|false> \r\n"
+                        +"    (note: -DautoDeletePOSTS won't force deletion if set to false in control file.";
+        return result;
+    }
+
+    private static String opt(CommandLine line, String option){
+        String result;
+        String fromProps = System.getProperty(option);
+        if (Tools.notEmpty(fromProps)){
+            return fromProps;
+        }
+        if (line==null){
+            return "";
+        }
+        result = line.getOptionValue(option);
+        if (result == null){
+            result = "";
+        }
+        return result;
+    }
+
+    public static void main(String[]args) throws Exception {
+        Options options = createOptions();
+        //System.out.println("System CLASSPATH: "+prop.getProperty("java.class.path", null));
+        CommandLineParser parser = new GnuParser();
+        try {
+            // parse the command line arguments
+            CommandLine line = parser.parse(options, args);
+
+            String xmlReplayBaseDir = opt(line, "xmlReplayBaseDir");
+            String reportsDir = opt(line, "reportsDir");
+            String testGroupID      = opt(line, "testGroupID");
+            String testID           = opt(line, "testID");
+            String autoDeletePOSTS  = opt(line, "autoDeletePOSTS");
+            String dumpResults      = opt(line, "dumpResults");
+            String controlFilename   = opt(line, "controlFilename");
+            String xmlReplayMaster  = opt(line, "xmlReplayMaster");
+
+            if (Tools.isBlank(reportsDir)){
+                reportsDir = xmlReplayBaseDir + XmlReplayTest.REPORTS_DIRNAME;
+            }
+            reportsDir = Tools.fixFilename(reportsDir);
+            xmlReplayBaseDir = Tools.fixFilename(xmlReplayBaseDir);
+            controlFilename = Tools.fixFilename(controlFilename);
+
+            boolean bAutoDeletePOSTS = true;
+            if (Tools.notEmpty(autoDeletePOSTS)) {
+                bAutoDeletePOSTS = Tools.isTrue(autoDeletePOSTS);
+            }
+            boolean bDumpResults = false;
+            if (Tools.notEmpty(dumpResults)) {
+                bDumpResults = Tools.isTrue(autoDeletePOSTS);
+            }
+            if (Tools.isEmpty(xmlReplayBaseDir)){
+                System.err.println("ERROR: xmlReplayBaseDir was not specified.");
+                return;
+            }
+            File f = new File(Tools.glue(xmlReplayBaseDir, "/", controlFilename));
+            if (Tools.isEmpty(xmlReplayMaster) && !f.exists()){
+                System.err.println("Control file not found: "+f.getCanonicalPath());
+                return;
+            }
+            File fMaster = new File(Tools.glue(xmlReplayBaseDir, "/", xmlReplayMaster));
+            if (Tools.notEmpty(xmlReplayMaster)  && !fMaster.exists()){
+                System.err.println("Master file not found: "+fMaster.getCanonicalPath());
+                return;
+            }
+
+            String xmlReplayBaseDirResolved = (new File(xmlReplayBaseDir)).getCanonicalPath();
+            System.out.println("XmlReplay ::"
+                            + "\r\n    xmlReplayBaseDir: "+xmlReplayBaseDir
+                            + "\r\n    xmlReplayBaseDir(resolved): "+xmlReplayBaseDirResolved
+                            + "\r\n    controlFilename: "+controlFilename
+                            + "\r\n    xmlReplayMaster: "+xmlReplayMaster
+                            + "\r\n    testGroupID: "+testGroupID
+                            + "\r\n    testID: "+testID
+                            + "\r\n    autoDeletePOSTS: "+bAutoDeletePOSTS
+                            + (Tools.notEmpty(xmlReplayMaster)
+                                       ? ("\r\n    will use master file: "+fMaster.getCanonicalPath())
+                                       : ("\r\n    will use control file: "+f.getCanonicalPath()) )
+                             );
+            
+            if (Tools.notEmpty(xmlReplayMaster)){
+                if (Tools.notEmpty(controlFilename)){
+                    System.out.println("WARN: controlFilename: "+controlFilename+" will not be used because master was specified.  Running master: "+xmlReplayMaster);
+                }
+                XmlReplay replay = new XmlReplay(xmlReplayBaseDirResolved, reportsDir);
+                replay.readOptionsFromMasterConfigFile(xmlReplayMaster);
+                replay.setAutoDeletePOSTS(bAutoDeletePOSTS);
+                Dump dumpFromMaster = replay.getDump();
+                dumpFromMaster.payloads = Tools.isTrue(dumpResults);
+                replay.setDump(dumpFromMaster);
+                replay.runMaster(xmlReplayMaster, false); //false, because we already just read the options, and override a few.
+            } else {
+                Dump dump = getDumpConfig();
+                dump.payloads = Tools.isTrue(dumpResults);
+                List<String> reportsList = new ArrayList<String>();
+                runXmlReplayFile(xmlReplayBaseDirResolved, controlFilename, testGroupID, testID, createResultsMap(), bAutoDeletePOSTS, dump, "", null, reportsList, reportsDir);
+                System.out.println("DEPRECATED: reportsList is generated, but not dumped: "+reportsList.toString());
+            }
+        } catch (ParseException exp) {
+            // oops, something went wrong
+            System.err.println("Cmd-line parsing failed.  Reason: " + exp.getMessage());
+            System.err.println(usage());
+        } catch (Exception e) {
+            System.out.println("Error : " + e.getMessage());
+            e.printStackTrace();
+        }
+    }
+
+}
index 1beebe5536c72daa89e9ac178d0574669e695379..fde549e783f1a51fd1dcc7b5316c61aea1e4a219 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.IntegrationTests.xmlreplay;\r
-\r
-import org.apache.commons.jexl2.Expression;\r
-import org.apache.commons.jexl2.JexlContext;\r
-import org.apache.commons.jexl2.JexlEngine;\r
-import org.apache.commons.jexl2.MapContext;\r
-\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Set;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class XmlReplayEval {\r
-    public Map<String, ServiceResult> serviceResultsMap;\r
-    public JexlEngine jexl;\r
-    public JexlContext jc;\r
-\r
-    /**\r
-     * You may pass in a Jexl 2 expression, e.g. ${foo.bar} and it will be eval'd for you.\r
-     * We are looking at some URI like so: ${newOrgAuthority.CSID}\r
-     * The idea here is that the XML control file may bind to this namespace, and\r
-     * this module may find those values and any future extensions, specifically\r
-     * when someone says "I want to bind to ${CSID} and ${SUBRESOURCE.CSID}\r
-     * The code here is easy to extend, but the test cases build up, so you don't\r
-     * want to break all the config files by not being backward compatible.  Binding\r
-     * to context variables like this makes it easy.\r
-     * EXAMPLE USAGE: <br />\r
-     * String uri = "/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/${Org1.CSID}";   <br />\r
-     * uri = eval(uri, serviceResultsMap, jexl, jc);  <br />\r
-     * RESULT:    "/cspace-services/orgauthorities/43a2739c-4f40-49c8-a6d5/items/"\r
-     */\r
-     public static String eval(String inputJexlExpression, Map<String, ServiceResult> serviceResultsMap, Map<String,String> vars, JexlEngine jexl, JexlContext jc) {\r
-        //System.out.println("\r\n---- REPLACE.init-uri:        "+inputJexlExpression);\r
-        String result;\r
-        try {\r
-             jc.set("itemCSID", "${itemCSID}"); //noiseless passthru.\r
-            //System.out.println("eval :: serviceResultsMap "+serviceResultsMap.size());\r
-            for (ServiceResult serviceResult : serviceResultsMap.values()) {\r
-                jc.set(serviceResult.testID, serviceResult);\r
-                //System.out.println("eval :: "+serviceResult.testID+"==>"+serviceResult.minimal());\r
-            }\r
-            if (vars!=null){\r
-                for (Map.Entry<String,String> entry: vars.entrySet()) {\r
-                    String value = entry.getValue();\r
-                    String key = entry.getKey();\r
-                    try {\r
-                        value = parse(value, jexl, jc);\r
-                        vars.put(key, value); //replace template value with actual value.\r
-                    } catch (Exception e){\r
-                        value = "ERROR: "+e;\r
-                    }\r
-                    jc.set(key, value);\r
-                }\r
-            }\r
-            result = parse(inputJexlExpression, jexl, jc);\r
-        } catch (Throwable t) {\r
-            System.err.println("ERROR: " + t);\r
-            result = "ERROR";\r
-        }\r
-        //System.out.println("---- REPLACE.uri:        "+result+"\r\n");\r
-        return result;\r
-    }\r
-\r
-    private static String parse(String in, JexlEngine jexl, JexlContext jc) {\r
-        StringBuffer result = new StringBuffer();\r
-        String s = in;\r
-        String var = "";\r
-        int start, end, len;\r
-        len = in.length();\r
-        start = 0;\r
-        int cursor = 0;\r
-        String front = "";\r
-        while (start < len) {\r
-            end = in.indexOf("}", start);\r
-            start = in.indexOf("${", start);\r
-            if (start < 0) {\r
-                String tail = in.substring(cursor);\r
-                result.append(tail);\r
-                break;\r
-            }\r
-            if (end < 0) {\r
-                return "ERROR: unbalanced ${} braces";\r
-            }\r
-            front = in.substring(cursor, start);\r
-            result.append(front);\r
-            cursor = end + 1;                   //bump past close brace\r
-            var = in.substring(start + 2, end);  //+2 bump past open brace ${ and then "end" is indexed just before the close brace }\r
-            //s   = s.substring(end+1);         //bump past close brace\r
-            start = cursor;\r
-\r
-            Expression expr = jexl.createExpression(var);\r
-            Object resultObj = expr.evaluate(jc); //REM - 5/9/2011 - Usually calls back to fields and methods in ServiceResult class to do the evaluation -e.g., the "got" method.\r
-            String resultStr;\r
-            if (null == resultObj){\r
-                //debug: System.out.println("null found while evaluationg variable: '"+var+"' Jexl context: "+dumpContext(jc));\r
-                resultStr = "${"+var+"}";\r
-            } else {\r
-                resultStr = resultObj.toString();\r
-\r
-            }\r
-            result.append(resultStr);\r
-        }\r
-        return result.toString();\r
-    }\r
-\r
-    protected static String dumpContext(JexlContext jc){\r
-        String result = "";\r
-        if (jc instanceof MapContextWKeys){\r
-            Set keys = ((MapContextWKeys)jc).getKeys();\r
-            result = keys.toString();\r
-        }  else {\r
-            result = jc.toString();\r
-        }\r
-        return result;\r
-    }\r
-\r
-    public static class MapContextWKeys extends MapContext implements JexlContext {\r
-        private Map<String,Object> map = new HashMap();\r
-        public Set getKeys(){\r
-            return this.map.keySet();\r
-        }\r
-    }\r
-\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.IntegrationTests.xmlreplay;
+
+import org.apache.commons.jexl2.Expression;
+import org.apache.commons.jexl2.JexlContext;
+import org.apache.commons.jexl2.JexlEngine;
+import org.apache.commons.jexl2.MapContext;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class XmlReplayEval {
+    public Map<String, ServiceResult> serviceResultsMap;
+    public JexlEngine jexl;
+    public JexlContext jc;
+
+    /**
+     * You may pass in a Jexl 2 expression, e.g. ${foo.bar} and it will be eval'd for you.
+     * We are looking at some URI like so: ${newOrgAuthority.CSID}
+     * The idea here is that the XML control file may bind to this namespace, and
+     * this module may find those values and any future extensions, specifically
+     * when someone says "I want to bind to ${CSID} and ${SUBRESOURCE.CSID}
+     * The code here is easy to extend, but the test cases build up, so you don't
+     * want to break all the config files by not being backward compatible.  Binding
+     * to context variables like this makes it easy.
+     * EXAMPLE USAGE: <br />
+     * String uri = "/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/${Org1.CSID}";   <br />
+     * uri = eval(uri, serviceResultsMap, jexl, jc);  <br />
+     * RESULT:    "/cspace-services/orgauthorities/43a2739c-4f40-49c8-a6d5/items/"
+     */
+     public static String eval(String inputJexlExpression, Map<String, ServiceResult> serviceResultsMap, Map<String,String> vars, JexlEngine jexl, JexlContext jc) {
+        //System.out.println("\r\n---- REPLACE.init-uri:        "+inputJexlExpression);
+        String result;
+        try {
+             jc.set("itemCSID", "${itemCSID}"); //noiseless passthru.
+            //System.out.println("eval :: serviceResultsMap "+serviceResultsMap.size());
+            for (ServiceResult serviceResult : serviceResultsMap.values()) {
+                jc.set(serviceResult.testID, serviceResult);
+                //System.out.println("eval :: "+serviceResult.testID+"==>"+serviceResult.minimal());
+            }
+            if (vars!=null){
+                for (Map.Entry<String,String> entry: vars.entrySet()) {
+                    String value = entry.getValue();
+                    String key = entry.getKey();
+                    try {
+                        value = parse(value, jexl, jc);
+                        vars.put(key, value); //replace template value with actual value.
+                    } catch (Exception e){
+                        value = "ERROR: "+e;
+                    }
+                    jc.set(key, value);
+                }
+            }
+            result = parse(inputJexlExpression, jexl, jc);
+        } catch (Throwable t) {
+            System.err.println("ERROR: " + t);
+            result = "ERROR";
+        }
+        //System.out.println("---- REPLACE.uri:        "+result+"\r\n");
+        return result;
+    }
+
+    private static String parse(String in, JexlEngine jexl, JexlContext jc) {
+        StringBuffer result = new StringBuffer();
+        String s = in;
+        String var = "";
+        int start, end, len;
+        len = in.length();
+        start = 0;
+        int cursor = 0;
+        String front = "";
+        while (start < len) {
+            end = in.indexOf("}", start);
+            start = in.indexOf("${", start);
+            if (start < 0) {
+                String tail = in.substring(cursor);
+                result.append(tail);
+                break;
+            }
+            if (end < 0) {
+                return "ERROR: unbalanced ${} braces";
+            }
+            front = in.substring(cursor, start);
+            result.append(front);
+            cursor = end + 1;                   //bump past close brace
+            var = in.substring(start + 2, end);  //+2 bump past open brace ${ and then "end" is indexed just before the close brace }
+            //s   = s.substring(end+1);         //bump past close brace
+            start = cursor;
+
+            Expression expr = jexl.createExpression(var);
+            Object resultObj = expr.evaluate(jc); //REM - 5/9/2011 - Usually calls back to fields and methods in ServiceResult class to do the evaluation -e.g., the "got" method.
+            String resultStr;
+            if (null == resultObj){
+                //debug: System.out.println("null found while evaluationg variable: '"+var+"' Jexl context: "+dumpContext(jc));
+                resultStr = "${"+var+"}";
+            } else {
+                resultStr = resultObj.toString();
+
+            }
+            result.append(resultStr);
+        }
+        return result.toString();
+    }
+
+    protected static String dumpContext(JexlContext jc){
+        String result = "";
+        if (jc instanceof MapContextWKeys){
+            Set keys = ((MapContextWKeys)jc).getKeys();
+            result = keys.toString();
+        }  else {
+            result = jc.toString();
+        }
+        return result;
+    }
+
+    public static class MapContextWKeys extends MapContext implements JexlContext {
+        private Map<String,Object> map = new HashMap();
+        public Set getKeys(){
+            return this.map.keySet();
+        }
+    }
+
+
+}
index 27d0fce30e94a24587cffefab5e53b46c402f416..6f7e462c38b416738477a66f0e4432c3db2cd1c3 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.IntegrationTests.xmlreplay;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.testng.Assert;\r
-\r
-import java.io.File;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-/** Subclass this test to programmatically control XmlReplay from a surefire test.  See example in IntegrationTests :: XmlReplaySelfTest\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class XmlReplayTest {\r
-\r
-    public static final String XMLREPLAY_REL_DIR_TO_MODULE = "/src/test/resources/test-data/xmlreplay";\r
-    public static final String REPORTS_DIRNAME = "xml-replay-reports";\r
-    public static final String XMLREPLAY_REL_DIR_REPORTS_TO_MODULE= "/target/"+REPORTS_DIRNAME;\r
-\r
-    /** To use this method, you should have a test repository of xml files in the path\r
-     *  defined by XMLREPLAY_REL_DIR_TO_MODULE, relative to your pom.xml file, but normally\r
-     *  you would use the central repository of tests, which live in services/IntegrationTests,\r
-     *  and which you can use by calling createXmlReplay() which calls createXmlReplayUsingIntegrationTestsModule() for you.\r
-     */\r
-    public static XmlReplay createXmlReplayForModule() throws Exception {\r
-        String pwd = (new File(".")).getCanonicalPath();\r
-        System.out.println("createXmlReplayForModule.pwd: "+pwd);\r
-        XmlReplay replay = new XmlReplay(pwd+XMLREPLAY_REL_DIR_TO_MODULE,\r
-                                                              pwd+XMLREPLAY_REL_DIR_REPORTS_TO_MODULE);\r
-        System.out.println("XmlReplay: "+replay);\r
-        return replay;\r
-    }\r
-\r
-    /** Use this method if your test xml files are stored in the central repository,\r
-     *   which is "services/IntegrationTests" + XMLREPLAY_REL_DIR_TO_MODULE\r
-     */\r
-    public static XmlReplay createXmlReplay() throws Exception {\r
-        return createXmlReplayUsingIntegrationTestsModule("../..");\r
-    }\r
-\r
-    /**\r
-     * @param relToServicesRoot is a Unix-like path from the calling module to the services root,\r
-     *        so if  if you are in services/dimension/client/\r
-     *        then relToServicesRoot is "../.." which is how most of the client tests are set up, or if you\r
-     *        are setting up your test repository relative to the main service, e.g. you are in\r
-     *        services/dimension/, then relToServicesRoot is ".."\r
-     */\r
-    public static XmlReplay createXmlReplayUsingIntegrationTestsModule(String relToServicesRoot) throws Exception {\r
-        String thisDir = Tools.glue(relToServicesRoot, "/", "IntegrationTests");\r
-        String pwd = (new File(thisDir)).getCanonicalPath();\r
-        //System.out.println("createXmlReplayUsingIntegrationTestsModule.pwd: "+pwd);\r
-        XmlReplay replay = new XmlReplay(pwd+XMLREPLAY_REL_DIR_TO_MODULE,\r
-                                                             pwd+XMLREPLAY_REL_DIR_REPORTS_TO_MODULE);\r
-        //System.out.println("XmlReplay: "+replay);\r
-        return replay;\r
-    }\r
-\r
-    public static void logTest(ServiceResult sresult, String testname){\r
-        ResultSummary summary = resultSummary(sresult, HTML);\r
-        org.testng.Reporter.log(summary.table);\r
-        Assert.assertEquals(summary.oks, summary.total, "Expected all "+summary.total+ " XmlReplay tests to pass.  See Output from test '"+testname+"'. "+summary.errorTests);\r
-    }\r
-\r
-    public static void logTest(List<ServiceResult> list, String testname){\r
-        ResultSummary summary = resultSummary(list, HTML);\r
-        org.testng.Reporter.log(summary.table);\r
-        Assert.assertEquals(summary.oks, summary.total, "Expected all "+summary.total+ " XmlReplay tests to pass.  See Output from test '"+testname+"'. "+summary.errorTests);\r
-    }\r
-\r
-    public static void logTestForGroup(List<List<ServiceResult>> list, String testname){\r
-        ResultSummary summary = resultSummaryForGroup(list, HTML);\r
-        org.testng.Reporter.log(summary.table);\r
-        ResultSummary textSummary = resultSummaryForGroup(list, TEXT);\r
-        System.out.println("SUMMARY: \r\n"+textSummary.table);\r
-        Assert.assertEquals(summary.oks, summary.total, "Expected all "+summary.total+ " XmlReplay tests to pass.  See Output from test '"+testname+"'. "+summary.errorTests);\r
-    }\r
-\r
-\r
-    //============== HELPERS AND FORMATTING =====================================================\r
-    public static class FORMAT {\r
-        private static final String TBLSTART = "";\r
-        private static final String ROWSTART = "\r\n       ";\r
-        private static final String ROWSTARTRED = "\r\n    ** ";\r
-        private static final String SEP = "  |  ";\r
-        private static final String ROWEND = "";\r
-        private static final String ROWENDRED = "";\r
-        private static final String TBLEND = "";\r
-\r
-    }\r
-    public static final FORMAT TEXT = new FORMAT();\r
-    public static class HTML_FORMAT extends FORMAT {\r
-        private static final String TBLSTART = "<table border='1'>";\r
-        private static final String ROWSTART = "<tr><td bgcolor='white'>";\r
-        private static final String ROWSTARTRED = "<tr><td bgcolor='red'><b>";\r
-        private static final String SEP = "</td><td>";\r
-        private static final String ROWEND = "</td></tr>";\r
-        private static final String ROWENDRED = "</b></td></tr>";\r
-        private static final String TBLEND = "</table>";\r
-    }\r
-    public static final FORMAT HTML = new HTML_FORMAT();\r
-\r
-    public static class ResultSummary {\r
-        public long oks = 0;\r
-        public long total = 0;\r
-        public String table = "";\r
-        public List<String> groups = new ArrayList<String>();\r
-        public List<String> errorTests = new ArrayList<String>();\r
-    }\r
-\r
-    public static ResultSummary resultSummaryForGroup(List<List<ServiceResult>> list, FORMAT format){\r
-        ResultSummary summary = new ResultSummary();\r
-        summary.oks = 0;\r
-        summary.total = 0;\r
-        StringBuffer buff = new StringBuffer();\r
-        buff.append(format.TBLSTART);\r
-        for (List<ServiceResult> serviceResults : list){\r
-            String groupID = "";\r
-            if (serviceResults.size()>0){\r
-                groupID = serviceResults.get(0).testGroupID;\r
-                summary.groups.add(groupID);\r
-            }\r
-            buff.append(format.ROWSTART+"XmlReplay testGroup "+groupID+format.ROWEND);\r
-            for (ServiceResult serviceResult : serviceResults){\r
-                summary.total++;\r
-                if (serviceResult.gotExpectedResult()){\r
-                    summary.oks++;\r
-                    buff.append(format.ROWSTART+serviceResult.minimal()+format.ROWEND);\r
-                } else {\r
-                    buff.append(format.ROWSTARTRED+serviceResult.minimal()+format.ROWENDRED);\r
-                    summary.errorTests.add(serviceResult.testGroupID+':'+serviceResult.testID+':'+serviceResult.fullURL);\r
-                }\r
-            }\r
-        }\r
-        buff.append(format.TBLEND);\r
-        summary.table = buff.toString();\r
-        return summary;\r
-    }\r
-\r
-    public static ResultSummary resultSummary(List<ServiceResult> serviceResults,  FORMAT format){\r
-        ResultSummary summary = new ResultSummary();\r
-        summary.oks = 0;\r
-        summary.total = 0;\r
-        StringBuffer buff = new StringBuffer();\r
-        buff.append(format.TBLSTART);\r
-        for (ServiceResult serviceResult : serviceResults){\r
-            summary.total++;\r
-            if (serviceResult.gotExpectedResult()){\r
-                summary.oks++;\r
-                buff.append(format.ROWSTART+serviceResult.minimal()+format.ROWEND);\r
-            } else {\r
-                buff.append(format.ROWSTARTRED+serviceResult.minimal()+format.ROWENDRED);\r
-            }\r
-        }\r
-        buff.append(format.TBLEND);\r
-        summary.table = buff.toString();\r
-        return summary;\r
-    }\r
-\r
-    public static ResultSummary resultSummary(ServiceResult serviceResult, FORMAT format){\r
-        ResultSummary summary = new ResultSummary();\r
-        summary.oks = 0;\r
-        summary.total = 1;\r
-        StringBuffer buff = new StringBuffer();\r
-        buff.append(format.TBLSTART);\r
-        if (serviceResult.gotExpectedResult()){\r
-            summary.oks = 1;\r
-            buff.append(format.ROWSTART+serviceResult.minimal()+format.ROWEND);\r
-        } else {\r
-            buff.append(format.ROWSTARTRED+serviceResult.minimal()+format.ROWENDRED);\r
-        }\r
-        buff.append(format.TBLEND);\r
-        summary.table = buff.toString();\r
-        return summary;\r
-    }\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.collectionspace.services.IntegrationTests.xmlreplay;
+
+import org.collectionspace.services.common.api.Tools;
+import org.testng.Assert;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/** Subclass this test to programmatically control XmlReplay from a surefire test.  See example in IntegrationTests :: XmlReplaySelfTest
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class XmlReplayTest {
+
+    public static final String XMLREPLAY_REL_DIR_TO_MODULE = "/src/test/resources/test-data/xmlreplay";
+    public static final String REPORTS_DIRNAME = "xml-replay-reports";
+    public static final String XMLREPLAY_REL_DIR_REPORTS_TO_MODULE= "/target/"+REPORTS_DIRNAME;
+
+    /** To use this method, you should have a test repository of xml files in the path
+     *  defined by XMLREPLAY_REL_DIR_TO_MODULE, relative to your pom.xml file, but normally
+     *  you would use the central repository of tests, which live in services/IntegrationTests,
+     *  and which you can use by calling createXmlReplay() which calls createXmlReplayUsingIntegrationTestsModule() for you.
+     */
+    public static XmlReplay createXmlReplayForModule() throws Exception {
+        String pwd = (new File(".")).getCanonicalPath();
+        System.out.println("createXmlReplayForModule.pwd: "+pwd);
+        XmlReplay replay = new XmlReplay(pwd+XMLREPLAY_REL_DIR_TO_MODULE,
+                                                              pwd+XMLREPLAY_REL_DIR_REPORTS_TO_MODULE);
+        System.out.println("XmlReplay: "+replay);
+        return replay;
+    }
+
+    /** Use this method if your test xml files are stored in the central repository,
+     *   which is "services/IntegrationTests" + XMLREPLAY_REL_DIR_TO_MODULE
+     */
+    public static XmlReplay createXmlReplay() throws Exception {
+        return createXmlReplayUsingIntegrationTestsModule("../..");
+    }
+
+    /**
+     * @param relToServicesRoot is a Unix-like path from the calling module to the services root,
+     *        so if  if you are in services/dimension/client/
+     *        then relToServicesRoot is "../.." which is how most of the client tests are set up, or if you
+     *        are setting up your test repository relative to the main service, e.g. you are in
+     *        services/dimension/, then relToServicesRoot is ".."
+     */
+    public static XmlReplay createXmlReplayUsingIntegrationTestsModule(String relToServicesRoot) throws Exception {
+        String thisDir = Tools.glue(relToServicesRoot, "/", "IntegrationTests");
+        String pwd = (new File(thisDir)).getCanonicalPath();
+        //System.out.println("createXmlReplayUsingIntegrationTestsModule.pwd: "+pwd);
+        XmlReplay replay = new XmlReplay(pwd+XMLREPLAY_REL_DIR_TO_MODULE,
+                                                             pwd+XMLREPLAY_REL_DIR_REPORTS_TO_MODULE);
+        //System.out.println("XmlReplay: "+replay);
+        return replay;
+    }
+
+    public static void logTest(ServiceResult sresult, String testname){
+        ResultSummary summary = resultSummary(sresult, HTML);
+        org.testng.Reporter.log(summary.table);
+        Assert.assertEquals(summary.oks, summary.total, "Expected all "+summary.total+ " XmlReplay tests to pass.  See Output from test '"+testname+"'. "+summary.errorTests);
+    }
+
+    public static void logTest(List<ServiceResult> list, String testname){
+        ResultSummary summary = resultSummary(list, HTML);
+        org.testng.Reporter.log(summary.table);
+        Assert.assertEquals(summary.oks, summary.total, "Expected all "+summary.total+ " XmlReplay tests to pass.  See Output from test '"+testname+"'. "+summary.errorTests);
+    }
+
+    public static void logTestForGroup(List<List<ServiceResult>> list, String testname){
+        ResultSummary summary = resultSummaryForGroup(list, HTML);
+        org.testng.Reporter.log(summary.table);
+        ResultSummary textSummary = resultSummaryForGroup(list, TEXT);
+        System.out.println("SUMMARY: \r\n"+textSummary.table);
+        Assert.assertEquals(summary.oks, summary.total, "Expected all "+summary.total+ " XmlReplay tests to pass.  See Output from test '"+testname+"'. "+summary.errorTests);
+    }
+
+
+    //============== HELPERS AND FORMATTING =====================================================
+    public static class FORMAT {
+        private static final String TBLSTART = "";
+        private static final String ROWSTART = "\r\n       ";
+        private static final String ROWSTARTRED = "\r\n    ** ";
+        private static final String SEP = "  |  ";
+        private static final String ROWEND = "";
+        private static final String ROWENDRED = "";
+        private static final String TBLEND = "";
+
+    }
+    public static final FORMAT TEXT = new FORMAT();
+    public static class HTML_FORMAT extends FORMAT {
+        private static final String TBLSTART = "<table border='1'>";
+        private static final String ROWSTART = "<tr><td bgcolor='white'>";
+        private static final String ROWSTARTRED = "<tr><td bgcolor='red'><b>";
+        private static final String SEP = "</td><td>";
+        private static final String ROWEND = "</td></tr>";
+        private static final String ROWENDRED = "</b></td></tr>";
+        private static final String TBLEND = "</table>";
+    }
+    public static final FORMAT HTML = new HTML_FORMAT();
+
+    public static class ResultSummary {
+        public long oks = 0;
+        public long total = 0;
+        public String table = "";
+        public List<String> groups = new ArrayList<String>();
+        public List<String> errorTests = new ArrayList<String>();
+    }
+
+    public static ResultSummary resultSummaryForGroup(List<List<ServiceResult>> list, FORMAT format){
+        ResultSummary summary = new ResultSummary();
+        summary.oks = 0;
+        summary.total = 0;
+        StringBuffer buff = new StringBuffer();
+        buff.append(format.TBLSTART);
+        for (List<ServiceResult> serviceResults : list){
+            String groupID = "";
+            if (serviceResults.size()>0){
+                groupID = serviceResults.get(0).testGroupID;
+                summary.groups.add(groupID);
+            }
+            buff.append(format.ROWSTART+"XmlReplay testGroup "+groupID+format.ROWEND);
+            for (ServiceResult serviceResult : serviceResults){
+                summary.total++;
+                if (serviceResult.gotExpectedResult()){
+                    summary.oks++;
+                    buff.append(format.ROWSTART+serviceResult.minimal()+format.ROWEND);
+                } else {
+                    buff.append(format.ROWSTARTRED+serviceResult.minimal()+format.ROWENDRED);
+                    summary.errorTests.add(serviceResult.testGroupID+':'+serviceResult.testID+':'+serviceResult.fullURL);
+                }
+            }
+        }
+        buff.append(format.TBLEND);
+        summary.table = buff.toString();
+        return summary;
+    }
+
+    public static ResultSummary resultSummary(List<ServiceResult> serviceResults,  FORMAT format){
+        ResultSummary summary = new ResultSummary();
+        summary.oks = 0;
+        summary.total = 0;
+        StringBuffer buff = new StringBuffer();
+        buff.append(format.TBLSTART);
+        for (ServiceResult serviceResult : serviceResults){
+            summary.total++;
+            if (serviceResult.gotExpectedResult()){
+                summary.oks++;
+                buff.append(format.ROWSTART+serviceResult.minimal()+format.ROWEND);
+            } else {
+                buff.append(format.ROWSTARTRED+serviceResult.minimal()+format.ROWENDRED);
+            }
+        }
+        buff.append(format.TBLEND);
+        summary.table = buff.toString();
+        return summary;
+    }
+
+    public static ResultSummary resultSummary(ServiceResult serviceResult, FORMAT format){
+        ResultSummary summary = new ResultSummary();
+        summary.oks = 0;
+        summary.total = 1;
+        StringBuffer buff = new StringBuffer();
+        buff.append(format.TBLSTART);
+        if (serviceResult.gotExpectedResult()){
+            summary.oks = 1;
+            buff.append(format.ROWSTART+serviceResult.minimal()+format.ROWEND);
+        } else {
+            buff.append(format.ROWSTARTRED+serviceResult.minimal()+format.ROWENDRED);
+        }
+        buff.append(format.TBLEND);
+        summary.table = buff.toString();
+        return summary;
+    }
+
+}
index 58ec12861f21f4e06ec9726c7668ad8dfd8f9e51..3d52e1793a7e71b50700163933f88111499a8a2c 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.IntegrationTests.xmlreplay;\r
-\r
-import org.apache.commons.httpclient.Header;\r
-import org.apache.commons.httpclient.HttpClient;\r
-import org.apache.commons.httpclient.methods.DeleteMethod;\r
-import org.apache.commons.httpclient.methods.GetMethod;\r
-import org.apache.commons.httpclient.methods.PostMethod;\r
-import org.apache.commons.io.FileUtils;\r
-\r
-import java.io.BufferedReader;\r
-import java.io.File;\r
-import java.io.InputStreamReader;\r
-import java.io.OutputStreamWriter;\r
-import java.net.HttpURLConnection;\r
-import java.net.URL;\r
-import java.util.Arrays;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-\r
-/**\r
- *   @author Laramie Crocker\r
- */\r
-public class XmlReplayTransport {\r
-\r
-    private static String BOUNDARY = "34d97c83-0d61-4958-80ab-6bf8d362290f";\r
-        private static String DD = "--";\r
-        private static String CRLF = "\r\n";\r
-\r
-    public static ServiceResult doGET(String urlString, String authForTest, String fromTestID) throws Exception {\r
-        ServiceResult pr = new ServiceResult();\r
-        pr.fromTestID = fromTestID;\r
-        pr.method = "GET";\r
-        //HACK for speed testing.\r
-        //pr.CSID = "2";\r
-        //pr.overrideGotExpectedResult();\r
-        //if (true) return pr;\r
-        //END-HACK\r
-        HttpClient client = new HttpClient();\r
-        GetMethod getMethod = new GetMethod(urlString);\r
-        getMethod.addRequestHeader("Accept", "multipart/mixed");\r
-        getMethod.addRequestHeader("Accept", "application/xml");\r
-        getMethod.setRequestHeader("Authorization", "Basic " + authForTest); //"dGVzdDp0ZXN0");\r
-        getMethod.setRequestHeader("X-XmlReplay-fromTestID", fromTestID);\r
-        try {\r
-            int statusCode1 = client.executeMethod(getMethod);\r
-            pr.responseCode = statusCode1;\r
-            pr.result = getMethod.getResponseBodyAsString();\r
-            pr.responseMessage = getMethod.getStatusText();\r
-            Header[] headers = getMethod.getResponseHeaders();\r
-            pr.responseHeaders = Arrays.copyOf(headers, headers.length);\r
-            Header hdr = getMethod.getResponseHeader("CONTENT-TYPE");\r
-            if (hdr!=null){\r
-                String hdrStr = hdr.toExternalForm();\r
-                pr.boundary = PayloadLogger.parseBoundary(hdrStr);\r
-            }\r
-            pr.contentLength = getMethod.getResponseContentLength();\r
-            getMethod.releaseConnection();\r
-        } catch (Throwable t){\r
-            //System.err.println("ERROR getting content from response: "+t);\r
-            pr.error = t.toString();\r
-        }\r
-        return pr;\r
-    }\r
-\r
-    public static ServiceResult doDELETE(String urlString, String authForTest, String testID, String fromTestID) throws Exception {\r
-        ServiceResult pr = new ServiceResult();\r
-        pr.failureReason = "";\r
-        pr.method = "DELETE";\r
-        pr.fullURL = urlString;\r
-        pr.fromTestID = fromTestID;\r
-        if (Tools.isEmpty(urlString)){\r
-            pr.error = "url was empty.  Check the result for fromTestID: "+fromTestID+". currentTest: "+testID;\r
-            return pr;\r
-        }\r
-        HttpClient client = new HttpClient();\r
-        DeleteMethod deleteMethod = new DeleteMethod(urlString);\r
-        deleteMethod.setRequestHeader("Accept", "multipart/mixed");\r
-        deleteMethod.addRequestHeader("Accept", "application/xml");\r
-        deleteMethod.setRequestHeader("Authorization", "Basic " + authForTest);\r
-        deleteMethod.setRequestHeader("X-XmlReplay-fromTestID", fromTestID);\r
-        int statusCode1 = 0;\r
-        String res = "";\r
-        try {\r
-            statusCode1 = client.executeMethod(deleteMethod);\r
-            pr.responseCode = statusCode1;\r
-            //System.out.println("statusCode: "+statusCode1+" statusLine ==>" + deleteMethod.getStatusLine());\r
-            pr.responseMessage = deleteMethod.getStatusText();\r
-            res = deleteMethod.getResponseBodyAsString();\r
-            deleteMethod.releaseConnection();\r
-        } catch (Throwable t){\r
-            pr.error = t.toString();\r
-        }\r
-        pr.result = res;\r
-        pr.responseCode = statusCode1;\r
-        return pr;\r
-    }\r
-\r
-    public static ServiceResult doLIST(String urlString, String listQueryParams, String authForTest, String fromTestID) throws Exception {\r
-        //String u = Tools.glue(urlString, "/", "items/");\r
-        if (Tools.notEmpty(listQueryParams)){\r
-            urlString = Tools.glue(urlString, "?", listQueryParams);\r
-        }\r
-        return doGET(urlString, authForTest, fromTestID);\r
-    }\r
-\r
-    public static final String MULTIPART_MIXED = "multipart/mixed";\r
-    public static final String APPLICATION_XML = "application/xml";\r
-\r
-    /** Use this overload for multipart messages. */\r
-    /**\r
-    public static ServiceResult doPOST_PUTFromXML_Multipart(List<String> filesList,\r
-                                                            List<String> partsList,\r
-                                                            List<Map<String,String>> varsList,\r
-                                                            String protoHostPort,\r
-                                                            String uri,\r
-                                                            String method,\r
-                                                            XmlReplayEval evalStruct,\r
-                                                            String authForTest,\r
-                                                            String fromTestID)\r
-                                                             throws Exception {\r
-        if (  filesList==null||filesList.size()==0\r
-            ||partsList==null||partsList.size()==0\r
-            ||(partsList.size() != filesList.size())){\r
-            throw new Exception("filesList and partsList must not be empty and must have the same number of items each.");\r
-        }\r
-        String content = DD + BOUNDARY;\r
-        Map<String, String> contentRaw = new HashMap<String, String>();\r
-        for (int i=0; i<partsList.size(); i++){\r
-            String fileName = filesList.get(i);\r
-            String commonPartName = partsList.get(i);\r
-            byte[] b = FileUtils.readFileToByteArray(new File(fileName));\r
-            String xmlString = new String(b);\r
-\r
-            xmlString = evalStruct.eval(xmlString, evalStruct.serviceResultsMap, varsList.get(i), evalStruct.jexl, evalStruct.jc);\r
-            contentRaw.put(commonPartName, xmlString);\r
-            content = content + CRLF + "label: "+commonPartName + CRLF\r
-                              + "Content-Type: application/xml" + CRLF\r
-                              + CRLF\r
-                              + xmlString + CRLF\r
-                              + DD + BOUNDARY;\r
-        }\r
-        content = content + DD;\r
-        String urlString = protoHostPort+uri;\r
-        return doPOST_PUT(urlString, content, contentRaw, BOUNDARY, method, MULTIPART_MIXED, authForTest, fromTestID); //method is POST or PUT.\r
-    }\r
-    */\r
-\r
-    /** Use this overload for NON-multipart messages, that is, regular POSTs. */\r
-    public static ServiceResult doPOST_PUTFromXML(String fileName,\r
-                                                      Map<String,String> vars,\r
-                                                      String protoHostPort,\r
-                                                      String uri,\r
-                                                      String method,\r
-                                                      String contentType,\r
-                                                      XmlReplayEval evalStruct,\r
-                                                      String authForTest,\r
-                                                      String fromTestID)\r
-    throws Exception {\r
-        byte[] b = FileUtils.readFileToByteArray(new File(fileName));\r
-        String xmlString = new String(b);\r
-        String contentRaw = xmlString;\r
-        xmlString = evalStruct.eval(xmlString, evalStruct.serviceResultsMap, vars, evalStruct.jexl, evalStruct.jc);\r
-        String urlString = protoHostPort+uri;\r
-        return doPOST_PUT(urlString, xmlString, contentRaw, BOUNDARY, method, contentType, authForTest, fromTestID); //method is POST or PUT.\r
-    }\r
-\r
-        //HACK for speed testing in doPOST_PUT.\r
-        //  Result: XmlReplay takes 9ms to process one test\r
-        // right up to the point of actually firing an HTTP request.\r
-        // or ~ 120 records per second.\r
-        //result.CSID = "2";\r
-        //result.overrideGotExpectedResult();\r
-        //if (true) return result;\r
-        //END-HACK\r
-\r
-    public static ServiceResult doPOST_PUT(String urlString,\r
-                                                                     String content,\r
-                                                                     String contentRaw,\r
-                                                                     String boundary,\r
-                                                                     String method,\r
-                                                                     String contentType,\r
-                                                                     String authForTest,\r
-                                                                     String fromTestID) throws Exception {\r
-        ServiceResult result = new ServiceResult();\r
-        result.method = method;\r
-        String deleteURL = "";\r
-        String location = "";\r
-        try {\r
-            URL url = new URL(urlString);\r
-            HttpURLConnection conn;\r
-            conn = (HttpURLConnection) url.openConnection();\r
-\r
-            if (MULTIPART_MIXED.equalsIgnoreCase(contentType)){\r
-                conn.setRequestProperty("Accept", "multipart/mixed");\r
-                conn.setRequestProperty("content-type", "multipart/mixed; boundary=" + boundary);\r
-            } else {\r
-                conn.setRequestProperty("Accept", "application/xml");\r
-                conn.setRequestProperty("content-type", contentType);\r
-            }\r
-            conn.setRequestProperty("Authorization", "Basic " + authForTest);  //TODO: remove test user : hard-coded as "dGVzdDp0ZXN0"\r
-            conn.setRequestProperty("Connection", "close");\r
-            conn.setRequestProperty("X-XmlReplay-fromTestID", fromTestID);\r
-            conn.setDoOutput(true);\r
-            conn.setDoInput(true);\r
-            conn.setRequestMethod(method); // "POST" or "PUT"\r
-            OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());\r
-            wr.write(content);\r
-            wr.flush();\r
-\r
-            try {\r
-                result.requestPayload = content;\r
-                result.requestPayloadsRaw = contentRaw;\r
-                result.responseCode = conn.getResponseCode();\r
-                //System.out.println("responseCode: "+result.responseCode);\r
-                if (400 <= result.responseCode && result.responseCode <= 499){\r
-                    return result;\r
-                }\r
-                readStream(conn, result);\r
-            } catch (Throwable t){\r
-                //System.err.println("ERROR getting content from response: "+t);\r
-                result.error = t.toString();\r
-            }\r
-            wr.close();\r
-\r
-            Map<String, List<String>> headers = conn.getHeaderFields();\r
-            List<String> locations = headers.get("Location");\r
-            if (locations != null){\r
-                String locationZero = locations.get(0);\r
-                if (locationZero != null){\r
-                    String[] segments = locationZero.split("/");\r
-                    location = segments[segments.length - 1];\r
-                    deleteURL = Tools.glue(urlString, "/", location);\r
-                }\r
-            }\r
-            result.location = location;\r
-            result.deleteURL = deleteURL;\r
-            result.CSID = location;\r
-        } catch (Throwable t2){\r
-            result.error = "ERROR in XmlReplayTransport: "+t2;\r
-        }\r
-        return result;\r
-    }\r
-\r
-    public static ServiceResult doPOST_PUT_PostMethod(String urlString, String content, Map<String,String> contentRaw,\r
-                                           String boundary, String method, String contentType,\r
-                                           String authForTest, String fromTestID) throws Exception {\r
-        ServiceResult result = new ServiceResult();\r
-        result.method = method;\r
-        String deleteURL = "";\r
-        String location = "";\r
-        try {\r
-            HttpClient client = new HttpClient();\r
-            PostMethod postMethod = new PostMethod(urlString);\r
-            postMethod.setRequestHeader("Accept", "multipart/mixed");\r
-            postMethod.addRequestHeader("Accept", "application/xml");\r
-            postMethod.setRequestHeader("Authorization", "Basic " + authForTest);\r
-            postMethod.setRequestHeader("X-XmlReplay-fromTestID", fromTestID);\r
-            //this method takes an array of params.  Not sure what they expect us to do with a raw post:\r
-            //   postMethod.setRequestBody();\r
-            int statusCode1 = 0;\r
-            String res = "";\r
-            try {\r
-                statusCode1 = client.executeMethod(postMethod);\r
-                result.responseCode = statusCode1;\r
-                //System.out.println("statusCode: "+statusCode1+" statusLine ==>" + postMethod.getStatusLine());\r
-                result.responseMessage = postMethod.getStatusText();\r
-                res = postMethod.getResponseBodyAsString();\r
-                Header[] headers = postMethod.getResponseHeaders("Location");\r
-                if (headers.length>0) {\r
-                    System.out.println("headers[0]:  "+headers[0]);\r
-                    String locationZero = headers[0].getValue();\r
-                    if (locationZero != null){\r
-                        String[] segments = locationZero.split("/");\r
-                        location = segments[segments.length - 1];\r
-                        deleteURL = Tools.glue(urlString, "/", location);\r
-                    }\r
-                }\r
-                postMethod.releaseConnection();\r
-            } catch (Throwable t){\r
-                result.error = t.toString();\r
-            }\r
-            result.result = res;\r
-            result.location = location;\r
-            result.deleteURL = deleteURL;\r
-            result.CSID = location;\r
-        } catch (Throwable t2){\r
-            result.error = "ERROR in XmlReplayTransport: "+t2;\r
-        }\r
-        return result;\r
-    }\r
-\r
-    private static void readStream(HttpURLConnection  conn, ServiceResult result) throws Throwable {\r
-        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));\r
-        try {\r
-                String line;\r
-                StringBuffer sb = new StringBuffer();\r
-                while ((line = rd.readLine()) != null) {\r
-                    sb.append(line).append("\r\n");\r
-                }\r
-                String msg = sb.toString();\r
-                result.result = msg;\r
-                result.boundary = PayloadLogger.parseBoundary(conn.getHeaderField("CONTENT-TYPE"));\r
-        } finally {\r
-            rd.close();\r
-        }\r
-    }\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.collectionspace.services.IntegrationTests.xmlreplay;
+
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.DeleteMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.collectionspace.services.common.api.Tools;
+
+/**
+ *   @author Laramie Crocker
+ */
+public class XmlReplayTransport {
+
+    private static String BOUNDARY = "34d97c83-0d61-4958-80ab-6bf8d362290f";
+        private static String DD = "--";
+        private static String CRLF = "\r\n";
+
+    public static ServiceResult doGET(String urlString, String authForTest, String fromTestID) throws Exception {
+        ServiceResult pr = new ServiceResult();
+        pr.fromTestID = fromTestID;
+        pr.method = "GET";
+        //HACK for speed testing.
+        //pr.CSID = "2";
+        //pr.overrideGotExpectedResult();
+        //if (true) return pr;
+        //END-HACK
+        HttpClient client = new HttpClient();
+        GetMethod getMethod = new GetMethod(urlString);
+        getMethod.addRequestHeader("Accept", "multipart/mixed");
+        getMethod.addRequestHeader("Accept", "application/xml");
+        getMethod.setRequestHeader("Authorization", "Basic " + authForTest); //"dGVzdDp0ZXN0");
+        getMethod.setRequestHeader("X-XmlReplay-fromTestID", fromTestID);
+        try {
+            int statusCode1 = client.executeMethod(getMethod);
+            pr.responseCode = statusCode1;
+            pr.result = getMethod.getResponseBodyAsString();
+            pr.responseMessage = getMethod.getStatusText();
+            Header[] headers = getMethod.getResponseHeaders();
+            pr.responseHeaders = Arrays.copyOf(headers, headers.length);
+            Header hdr = getMethod.getResponseHeader("CONTENT-TYPE");
+            if (hdr!=null){
+                String hdrStr = hdr.toExternalForm();
+                pr.boundary = PayloadLogger.parseBoundary(hdrStr);
+            }
+            pr.contentLength = getMethod.getResponseContentLength();
+            getMethod.releaseConnection();
+        } catch (Throwable t){
+            //System.err.println("ERROR getting content from response: "+t);
+            pr.error = t.toString();
+        }
+        return pr;
+    }
+
+    public static ServiceResult doDELETE(String urlString, String authForTest, String testID, String fromTestID) throws Exception {
+        ServiceResult pr = new ServiceResult();
+        pr.failureReason = "";
+        pr.method = "DELETE";
+        pr.fullURL = urlString;
+        pr.fromTestID = fromTestID;
+        if (Tools.isEmpty(urlString)){
+            pr.error = "url was empty.  Check the result for fromTestID: "+fromTestID+". currentTest: "+testID;
+            return pr;
+        }
+        HttpClient client = new HttpClient();
+        DeleteMethod deleteMethod = new DeleteMethod(urlString);
+        deleteMethod.setRequestHeader("Accept", "multipart/mixed");
+        deleteMethod.addRequestHeader("Accept", "application/xml");
+        deleteMethod.setRequestHeader("Authorization", "Basic " + authForTest);
+        deleteMethod.setRequestHeader("X-XmlReplay-fromTestID", fromTestID);
+        int statusCode1 = 0;
+        String res = "";
+        try {
+            statusCode1 = client.executeMethod(deleteMethod);
+            pr.responseCode = statusCode1;
+            //System.out.println("statusCode: "+statusCode1+" statusLine ==>" + deleteMethod.getStatusLine());
+            pr.responseMessage = deleteMethod.getStatusText();
+            res = deleteMethod.getResponseBodyAsString();
+            deleteMethod.releaseConnection();
+        } catch (Throwable t){
+            pr.error = t.toString();
+        }
+        pr.result = res;
+        pr.responseCode = statusCode1;
+        return pr;
+    }
+
+    public static ServiceResult doLIST(String urlString, String listQueryParams, String authForTest, String fromTestID) throws Exception {
+        //String u = Tools.glue(urlString, "/", "items/");
+        if (Tools.notEmpty(listQueryParams)){
+            urlString = Tools.glue(urlString, "?", listQueryParams);
+        }
+        return doGET(urlString, authForTest, fromTestID);
+    }
+
+    public static final String MULTIPART_MIXED = "multipart/mixed";
+    public static final String APPLICATION_XML = "application/xml";
+
+    /** Use this overload for multipart messages. */
+    /**
+    public static ServiceResult doPOST_PUTFromXML_Multipart(List<String> filesList,
+                                                            List<String> partsList,
+                                                            List<Map<String,String>> varsList,
+                                                            String protoHostPort,
+                                                            String uri,
+                                                            String method,
+                                                            XmlReplayEval evalStruct,
+                                                            String authForTest,
+                                                            String fromTestID)
+                                                             throws Exception {
+        if (  filesList==null||filesList.size()==0
+            ||partsList==null||partsList.size()==0
+            ||(partsList.size() != filesList.size())){
+            throw new Exception("filesList and partsList must not be empty and must have the same number of items each.");
+        }
+        String content = DD + BOUNDARY;
+        Map<String, String> contentRaw = new HashMap<String, String>();
+        for (int i=0; i<partsList.size(); i++){
+            String fileName = filesList.get(i);
+            String commonPartName = partsList.get(i);
+            byte[] b = FileUtils.readFileToByteArray(new File(fileName));
+            String xmlString = new String(b);
+
+            xmlString = evalStruct.eval(xmlString, evalStruct.serviceResultsMap, varsList.get(i), evalStruct.jexl, evalStruct.jc);
+            contentRaw.put(commonPartName, xmlString);
+            content = content + CRLF + "label: "+commonPartName + CRLF
+                              + "Content-Type: application/xml" + CRLF
+                              + CRLF
+                              + xmlString + CRLF
+                              + DD + BOUNDARY;
+        }
+        content = content + DD;
+        String urlString = protoHostPort+uri;
+        return doPOST_PUT(urlString, content, contentRaw, BOUNDARY, method, MULTIPART_MIXED, authForTest, fromTestID); //method is POST or PUT.
+    }
+    */
+
+    /** Use this overload for NON-multipart messages, that is, regular POSTs. */
+    public static ServiceResult doPOST_PUTFromXML(String fileName,
+                                                      Map<String,String> vars,
+                                                      String protoHostPort,
+                                                      String uri,
+                                                      String method,
+                                                      String contentType,
+                                                      XmlReplayEval evalStruct,
+                                                      String authForTest,
+                                                      String fromTestID)
+    throws Exception {
+        byte[] b = FileUtils.readFileToByteArray(new File(fileName));
+        String xmlString = new String(b);
+        String contentRaw = xmlString;
+        xmlString = evalStruct.eval(xmlString, evalStruct.serviceResultsMap, vars, evalStruct.jexl, evalStruct.jc);
+        String urlString = protoHostPort+uri;
+        return doPOST_PUT(urlString, xmlString, contentRaw, BOUNDARY, method, contentType, authForTest, fromTestID); //method is POST or PUT.
+    }
+
+        //HACK for speed testing in doPOST_PUT.
+        //  Result: XmlReplay takes 9ms to process one test
+        // right up to the point of actually firing an HTTP request.
+        // or ~ 120 records per second.
+        //result.CSID = "2";
+        //result.overrideGotExpectedResult();
+        //if (true) return result;
+        //END-HACK
+
+    public static ServiceResult doPOST_PUT(String urlString,
+                                                                     String content,
+                                                                     String contentRaw,
+                                                                     String boundary,
+                                                                     String method,
+                                                                     String contentType,
+                                                                     String authForTest,
+                                                                     String fromTestID) throws Exception {
+        ServiceResult result = new ServiceResult();
+        result.method = method;
+        String deleteURL = "";
+        String location = "";
+        try {
+            URL url = new URL(urlString);
+            HttpURLConnection conn;
+            conn = (HttpURLConnection) url.openConnection();
+
+            if (MULTIPART_MIXED.equalsIgnoreCase(contentType)){
+                conn.setRequestProperty("Accept", "multipart/mixed");
+                conn.setRequestProperty("content-type", "multipart/mixed; boundary=" + boundary);
+            } else {
+                conn.setRequestProperty("Accept", "application/xml");
+                conn.setRequestProperty("content-type", contentType);
+            }
+            conn.setRequestProperty("Authorization", "Basic " + authForTest);  //TODO: remove test user : hard-coded as "dGVzdDp0ZXN0"
+            conn.setRequestProperty("Connection", "close");
+            conn.setRequestProperty("X-XmlReplay-fromTestID", fromTestID);
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            conn.setRequestMethod(method); // "POST" or "PUT"
+            OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
+            wr.write(content);
+            wr.flush();
+
+            try {
+                result.requestPayload = content;
+                result.requestPayloadsRaw = contentRaw;
+                result.responseCode = conn.getResponseCode();
+                //System.out.println("responseCode: "+result.responseCode);
+                if (400 <= result.responseCode && result.responseCode <= 499){
+                    return result;
+                }
+                readStream(conn, result);
+            } catch (Throwable t){
+                //System.err.println("ERROR getting content from response: "+t);
+                result.error = t.toString();
+            }
+            wr.close();
+
+            Map<String, List<String>> headers = conn.getHeaderFields();
+            List<String> locations = headers.get("Location");
+            if (locations != null){
+                String locationZero = locations.get(0);
+                if (locationZero != null){
+                    String[] segments = locationZero.split("/");
+                    location = segments[segments.length - 1];
+                    deleteURL = Tools.glue(urlString, "/", location);
+                }
+            }
+            result.location = location;
+            result.deleteURL = deleteURL;
+            result.CSID = location;
+        } catch (Throwable t2){
+            result.error = "ERROR in XmlReplayTransport: "+t2;
+        }
+        return result;
+    }
+
+    public static ServiceResult doPOST_PUT_PostMethod(String urlString, String content, Map<String,String> contentRaw,
+                                           String boundary, String method, String contentType,
+                                           String authForTest, String fromTestID) throws Exception {
+        ServiceResult result = new ServiceResult();
+        result.method = method;
+        String deleteURL = "";
+        String location = "";
+        try {
+            HttpClient client = new HttpClient();
+            PostMethod postMethod = new PostMethod(urlString);
+            postMethod.setRequestHeader("Accept", "multipart/mixed");
+            postMethod.addRequestHeader("Accept", "application/xml");
+            postMethod.setRequestHeader("Authorization", "Basic " + authForTest);
+            postMethod.setRequestHeader("X-XmlReplay-fromTestID", fromTestID);
+            //this method takes an array of params.  Not sure what they expect us to do with a raw post:
+            //   postMethod.setRequestBody();
+            int statusCode1 = 0;
+            String res = "";
+            try {
+                statusCode1 = client.executeMethod(postMethod);
+                result.responseCode = statusCode1;
+                //System.out.println("statusCode: "+statusCode1+" statusLine ==>" + postMethod.getStatusLine());
+                result.responseMessage = postMethod.getStatusText();
+                res = postMethod.getResponseBodyAsString();
+                Header[] headers = postMethod.getResponseHeaders("Location");
+                if (headers.length>0) {
+                    System.out.println("headers[0]:  "+headers[0]);
+                    String locationZero = headers[0].getValue();
+                    if (locationZero != null){
+                        String[] segments = locationZero.split("/");
+                        location = segments[segments.length - 1];
+                        deleteURL = Tools.glue(urlString, "/", location);
+                    }
+                }
+                postMethod.releaseConnection();
+            } catch (Throwable t){
+                result.error = t.toString();
+            }
+            result.result = res;
+            result.location = location;
+            result.deleteURL = deleteURL;
+            result.CSID = location;
+        } catch (Throwable t2){
+            result.error = "ERROR in XmlReplayTransport: "+t2;
+        }
+        return result;
+    }
+
+    private static void readStream(HttpURLConnection  conn, ServiceResult result) throws Throwable {
+        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+        try {
+                String line;
+                StringBuffer sb = new StringBuffer();
+                while ((line = rd.readLine()) != null) {
+                    sb.append(line).append("\r\n");
+                }
+                String msg = sb.toString();
+                result.result = msg;
+                result.boundary = PayloadLogger.parseBoundary(conn.getHeaderField("CONTENT-TYPE"));
+        } finally {
+            rd.close();
+        }
+    }
+
+}
index 03e9ef27903d61d2f4c26fced56bef0c585ccfad..209cccf9f856e4ef42720bc32ca5fb5aa80fe86c 100644 (file)
-/**    \r
- * CollectionSpaceIntegrationTest.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.IntegrationTests.test;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-import javax.xml.bind.JAXBContext;\r
-import javax.xml.bind.Marshaller;\r
-\r
-import org.collectionspace.services.client.PayloadInputPart;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.collectionobject.CollectionobjectsCommon;\r
-import org.collectionspace.services.collectionobject.TitleGroup;\r
-import org.collectionspace.services.collectionobject.TitleGroupList;\r
-import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;\r
-import org.collectionspace.services.intake.IntakesCommon;\r
-import org.collectionspace.services.relation.RelationsCommon;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-/**\r
- * The Class CollectionSpaceIntegrationTest.\r
- */\r
-public abstract class CollectionSpaceIntegrationTest {\r
-\r
-       /*\r
-        * Package scoped methods.\r
-        */\r
-\r
-       /**\r
-        * Fill collection object.\r
-        * \r
-        * @param co the co\r
-        * @param identifier the identifier\r
-        */\r
-       void fillCollectionObject(CollectionobjectsCommon co, String identifier) {\r
-               fillCollectionObject(co, "objectNumber-" + identifier, "title-"\r
-                               + identifier);\r
-       }\r
-\r
-       /**\r
-        * Fill collection object.\r
-        * \r
-        * @param co the co\r
-        * @param objectNumber the object number\r
-        * @param title the object title\r
-        */\r
-       void fillCollectionObject(CollectionobjectsCommon co, String objectNumber,\r
-                       String title) {\r
-               co.setObjectNumber(objectNumber);\r
-                TitleGroupList titleGroupList = new TitleGroupList();\r
-                List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();\r
-                TitleGroup titleGroup = new TitleGroup();\r
-                titleGroup.setTitle(title);\r
-                titleGroups.add(titleGroup);\r
-                co.setTitleGroupList(titleGroupList);\r
-       }\r
-\r
-       /**\r
-        * Fill intake.\r
-        * \r
-        * @param theIntake the the intake\r
-        * @param identifier the identifier\r
-        */\r
-       void fillIntake(IntakesCommon theIntake, String identifier) {\r
-               String CURRENT_DATE_UTC = GregorianCalendarDateTimeUtils.currentDateUTC();\r
-               fillIntake(theIntake, "entryNumber-" + identifier, CURRENT_DATE_UTC);\r
-       }\r
-\r
-       /**\r
-        * Fill intake.\r
-        * \r
-        * @param theIntake the the intake\r
-        * @param entryNumber the entry number\r
-        * @param entryDate the entry date\r
-        */\r
-       void fillIntake(IntakesCommon theIntake, String entryNumber, String entryDate) {\r
-               theIntake.setEntryNumber(entryNumber);\r
-               theIntake.setEntryDate(entryDate);\r
-       }\r
-\r
-    /**\r
-     * Fill relation.\r
-     * \r
-     * @param relation the relation\r
-     * @param subjectCsid the document id1\r
-     * @param subjectDocumentType the document type1\r
-     * @param objectCsid the document id2\r
-     * @param objectDocumentType the document type2\r
-     * @param rt the rt\r
-     */\r
-    void fillRelation(RelationsCommon relation, \r
-            String subjectCsid, String subjectDocumentType,\r
-            String objectCsid, String objectDocumentType,\r
-            String rt)\r
-    {\r
-       relation.setSubjectCsid(subjectCsid);\r
-       relation.setSubjectDocumentType(subjectDocumentType);\r
-       relation.setObjectCsid(objectCsid);\r
-       relation.setObjectDocumentType(objectDocumentType);\r
-        \r
-        relation.setRelationshipType(rt);\r
-    }\r
-       \r
-       /**\r
-        * Creates the identifier.\r
-        * \r
-        * @return the string\r
-        */\r
-       String createIdentifier() {\r
-               long identifier = System.currentTimeMillis();\r
-               return Long.toString(identifier);\r
-       }\r
-\r
-       /**\r
-        * Extract id.\r
-        * \r
-        * @param res the res\r
-        * \r
-        * @return the string\r
-        */\r
-       String extractId(ClientResponse<Response> res) {\r
-               String result = null;\r
-               \r
-               MultivaluedMap mvm = res.getMetadata();\r
-               String uri = (String) ((ArrayList) mvm.get("Location")).get(0);\r
-               verbose("extractId:uri=" + uri);\r
-               String[] segments = uri.split("/");\r
-               result = segments[segments.length - 1];\r
-               verbose("id=" + result);\r
-               \r
-               return result;\r
-       }\r
-\r
-       /**\r
-        * Extract part.\r
-        * \r
-        * @param input\r
-        *            the input\r
-        * @param label\r
-        *            the label\r
-        * @param clazz\r
-        *            the clazz\r
-        * \r
-        * @return the object\r
-        * \r
-        * @throws Exception\r
-        *             the exception\r
-        */\r
-       static Object extractPart(PoxPayloadIn input, String label, Class clazz) {\r
-               Object obj = null;\r
-\r
-               PayloadInputPart payloadInputPart = input.getPart(label);\r
-               if (payloadInputPart != null) {\r
-                       obj = payloadInputPart.getBody();\r
-                               }\r
-\r
-               return obj;\r
-       }\r
-       \r
-       /**\r
-        * Verbose.\r
-        * \r
-        * @param msg the msg\r
-        */\r
-       void verbose(String msg) {\r
-               System.out.println(msg);\r
-       }\r
-\r
-       /**\r
-        * Verbose.\r
-        * \r
-        * @param msg the msg\r
-        * @param o the o\r
-        * @param clazz the clazz\r
-        */\r
-       void verbose(String msg, Object o, Class clazz) {\r
-               try {\r
-                       verbose(msg);\r
-                       JAXBContext jc = JAXBContext.newInstance(clazz);\r
-                       Marshaller m = jc.createMarshaller();\r
-                       m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);\r
-                       m.marshal(o, System.out);\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Verbose map.\r
-        * \r
-        * @param map the map\r
-        */\r
-       void verboseMap(MultivaluedMap map) {\r
-               for (Object entry : map.entrySet()) {\r
-                       MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry;\r
-                       verbose("  name=" + mentry.getKey() + " value=" + mentry.getValue());\r
-               }\r
-       }\r
-\r
-}\r
+/**    
+ * CollectionSpaceIntegrationTest.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.IntegrationTests.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+
+import org.collectionspace.services.client.PayloadInputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
+import org.collectionspace.services.collectionobject.TitleGroup;
+import org.collectionspace.services.collectionobject.TitleGroupList;
+import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
+import org.collectionspace.services.intake.IntakesCommon;
+import org.collectionspace.services.relation.RelationsCommon;
+import org.jboss.resteasy.client.ClientResponse;
+
+/**
+ * The Class CollectionSpaceIntegrationTest.
+ */
+public abstract class CollectionSpaceIntegrationTest {
+
+       /*
+        * Package scoped methods.
+        */
+
+       /**
+        * Fill collection object.
+        * 
+        * @param co the co
+        * @param identifier the identifier
+        */
+       void fillCollectionObject(CollectionobjectsCommon co, String identifier) {
+               fillCollectionObject(co, "objectNumber-" + identifier, "title-"
+                               + identifier);
+       }
+
+       /**
+        * Fill collection object.
+        * 
+        * @param co the co
+        * @param objectNumber the object number
+        * @param title the object title
+        */
+       void fillCollectionObject(CollectionobjectsCommon co, String objectNumber,
+                       String title) {
+               co.setObjectNumber(objectNumber);
+                TitleGroupList titleGroupList = new TitleGroupList();
+                List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();
+                TitleGroup titleGroup = new TitleGroup();
+                titleGroup.setTitle(title);
+                titleGroups.add(titleGroup);
+                co.setTitleGroupList(titleGroupList);
+       }
+
+       /**
+        * Fill intake.
+        * 
+        * @param theIntake the the intake
+        * @param identifier the identifier
+        */
+       void fillIntake(IntakesCommon theIntake, String identifier) {
+               String CURRENT_DATE_UTC = GregorianCalendarDateTimeUtils.currentDateUTC();
+               fillIntake(theIntake, "entryNumber-" + identifier, CURRENT_DATE_UTC);
+       }
+
+       /**
+        * Fill intake.
+        * 
+        * @param theIntake the the intake
+        * @param entryNumber the entry number
+        * @param entryDate the entry date
+        */
+       void fillIntake(IntakesCommon theIntake, String entryNumber, String entryDate) {
+               theIntake.setEntryNumber(entryNumber);
+               theIntake.setEntryDate(entryDate);
+       }
+
+    /**
+     * Fill relation.
+     * 
+     * @param relation the relation
+     * @param subjectCsid the document id1
+     * @param subjectDocumentType the document type1
+     * @param objectCsid the document id2
+     * @param objectDocumentType the document type2
+     * @param rt the rt
+     */
+    void fillRelation(RelationsCommon relation, 
+            String subjectCsid, String subjectDocumentType,
+            String objectCsid, String objectDocumentType,
+            String rt)
+    {
+       relation.setSubjectCsid(subjectCsid);
+       relation.setSubjectDocumentType(subjectDocumentType);
+       relation.setObjectCsid(objectCsid);
+       relation.setObjectDocumentType(objectDocumentType);
+        
+        relation.setRelationshipType(rt);
+    }
+       
+       /**
+        * Creates the identifier.
+        * 
+        * @return the string
+        */
+       String createIdentifier() {
+               long identifier = System.currentTimeMillis();
+               return Long.toString(identifier);
+       }
+
+       /**
+        * Extract id.
+        * 
+        * @param res the res
+        * 
+        * @return the string
+        */
+       String extractId(ClientResponse<Response> res) {
+               String result = null;
+               
+               MultivaluedMap mvm = res.getMetadata();
+               String uri = (String) ((ArrayList) mvm.get("Location")).get(0);
+               verbose("extractId:uri=" + uri);
+               String[] segments = uri.split("/");
+               result = segments[segments.length - 1];
+               verbose("id=" + result);
+               
+               return result;
+       }
+
+       /**
+        * Extract part.
+        * 
+        * @param input
+        *            the input
+        * @param label
+        *            the label
+        * @param clazz
+        *            the clazz
+        * 
+        * @return the object
+        * 
+        * @throws Exception
+        *             the exception
+        */
+       static Object extractPart(PoxPayloadIn input, String label, Class clazz) {
+               Object obj = null;
+
+               PayloadInputPart payloadInputPart = input.getPart(label);
+               if (payloadInputPart != null) {
+                       obj = payloadInputPart.getBody();
+                               }
+
+               return obj;
+       }
+       
+       /**
+        * Verbose.
+        * 
+        * @param msg the msg
+        */
+       void verbose(String msg) {
+               System.out.println(msg);
+       }
+
+       /**
+        * Verbose.
+        * 
+        * @param msg the msg
+        * @param o the o
+        * @param clazz the clazz
+        */
+       void verbose(String msg, Object o, Class clazz) {
+               try {
+                       verbose(msg);
+                       JAXBContext jc = JAXBContext.newInstance(clazz);
+                       Marshaller m = jc.createMarshaller();
+                       m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+                       m.marshal(o, System.out);
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       /**
+        * Verbose map.
+        * 
+        * @param map the map
+        */
+       void verboseMap(MultivaluedMap map) {
+               for (Object entry : map.entrySet()) {
+                       MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry;
+                       verbose("  name=" + mentry.getKey() + " value=" + mentry.getValue());
+               }
+       }
+
+}
index 634b96f566bba22cf8f620e6339fc2e835038353..b63dcbe87a11ae9f986dcef5fb3c293a4820154f 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.IntegrationTests.test;\r
-\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.TreeWalkResults;\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.XmlCompareJdom;\r
-import org.collectionspace.services.common.api.FileTools;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.testng.annotations.Test;\r
-\r
-import java.io.File;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class XmlCompareJdomRepeatingTest {\r
-\r
-    private static String getDirectory(){\r
-        String dataDir = "src/test/resources/test-data/xmlreplay/XmlCompareJdom";   // this dir lives under service/IntegrationTests\r
-        String pwd = ".";\r
-        try {\r
-            pwd = (new File(".")).getCanonicalPath();\r
-        } catch (Exception e){\r
-            System.err.println("Error trying to find current working directory: "+e);\r
-        }\r
-        String thisDir = Tools.glue(pwd, "/", dataDir);\r
-        return thisDir;\r
-    }\r
-\r
-    private void testBanner(String msg){\r
-        String BANNER ="-------------------------------------------------------";\r
-        String R = "\r\n";\r
-        System.out.println(BANNER\r
-                                     + R +" TEST CLASS: "+this.getClass().getName()\r
-                                     + R +" TEST NAME: "+msg\r
-                                     + R +" TEST DATA DIR: "+getDirectory()\r
-                                     + R\r
-                                     +BANNER);\r
-    }\r
-\r
-    @Test\r
-    public void testLeftAndRightSame(){\r
-        testBanner("testLeftAndRightSame");\r
-        String dir = getDirectory();\r
-        String expectedPartContent = FileTools.readFile(dir, "1-left.xml");\r
-        String fromServerContent = FileTools.readFile(dir, "1-right.xml");\r
-        String startPath = "/document/*[local-name()='relations-common-list']";\r
-        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();\r
-        TreeWalkResults results =\r
-            XmlCompareJdom.compareParts(expectedPartContent,\r
-                                        "expected",\r
-                                        fromServerContent,\r
-                                        "from-server",\r
-                                        startPath,\r
-                                        matchSpec);\r
-        XmlCompareJdomTest.assertTreeWalkResults(results,1,0,0,false, matchSpec);\r
-                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch\r
-    }\r
-\r
-    @Test\r
-    public void testLeftAndRightSameNoStartElement(){\r
-        testBanner("testLeftAndRightSameNoStartElement");\r
-        String dir = getDirectory();\r
-         String expectedPartContent = FileTools.readFile(dir, "2-left.xml");\r
-        String fromServerContent = FileTools.readFile(dir, "2-right.xml");\r
-        String startPath = "/document";\r
-        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();\r
-        TreeWalkResults results =\r
-            XmlCompareJdom.compareParts(expectedPartContent,\r
-                                        "expected",\r
-                                        fromServerContent,\r
-                                        "from-server",\r
-                                        startPath,\r
-                                        matchSpec);\r
-        XmlCompareJdomTest.assertTreeWalkResults(results,0,0,0,true,matchSpec);\r
-                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch\r
-    }\r
-\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.IntegrationTests.test;
+
+import org.collectionspace.services.IntegrationTests.xmlreplay.TreeWalkResults;
+import org.collectionspace.services.IntegrationTests.xmlreplay.XmlCompareJdom;
+import org.collectionspace.services.common.api.FileTools;
+import org.collectionspace.services.common.api.Tools;
+import org.testng.annotations.Test;
+
+import java.io.File;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class XmlCompareJdomRepeatingTest {
+
+    private static String getDirectory(){
+        String dataDir = "src/test/resources/test-data/xmlreplay/XmlCompareJdom";   // this dir lives under service/IntegrationTests
+        String pwd = ".";
+        try {
+            pwd = (new File(".")).getCanonicalPath();
+        } catch (Exception e){
+            System.err.println("Error trying to find current working directory: "+e);
+        }
+        String thisDir = Tools.glue(pwd, "/", dataDir);
+        return thisDir;
+    }
+
+    private void testBanner(String msg){
+        String BANNER ="-------------------------------------------------------";
+        String R = "\r\n";
+        System.out.println(BANNER
+                                     + R +" TEST CLASS: "+this.getClass().getName()
+                                     + R +" TEST NAME: "+msg
+                                     + R +" TEST DATA DIR: "+getDirectory()
+                                     + R
+                                     +BANNER);
+    }
+
+    @Test
+    public void testLeftAndRightSame(){
+        testBanner("testLeftAndRightSame");
+        String dir = getDirectory();
+        String expectedPartContent = FileTools.readFile(dir, "1-left.xml");
+        String fromServerContent = FileTools.readFile(dir, "1-right.xml");
+        String startPath = "/document/*[local-name()='relations-common-list']";
+        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();
+        TreeWalkResults results =
+            XmlCompareJdom.compareParts(expectedPartContent,
+                                        "expected",
+                                        fromServerContent,
+                                        "from-server",
+                                        startPath,
+                                        matchSpec);
+        XmlCompareJdomTest.assertTreeWalkResults(results,1,0,0,false, matchSpec);
+                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch
+    }
+
+    @Test
+    public void testLeftAndRightSameNoStartElement(){
+        testBanner("testLeftAndRightSameNoStartElement");
+        String dir = getDirectory();
+         String expectedPartContent = FileTools.readFile(dir, "2-left.xml");
+        String fromServerContent = FileTools.readFile(dir, "2-right.xml");
+        String startPath = "/document";
+        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();
+        TreeWalkResults results =
+            XmlCompareJdom.compareParts(expectedPartContent,
+                                        "expected",
+                                        fromServerContent,
+                                        "from-server",
+                                        startPath,
+                                        matchSpec);
+        XmlCompareJdomTest.assertTreeWalkResults(results,0,0,0,true,matchSpec);
+                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch
+    }
+
+
+}
index 93cb2343031843d6f5b991243e1b3364321c59b4..190fb64913e7f2eb3f6172109f9b44555d58c015 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.IntegrationTests.test;\r
-\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.TreeWalkResults;\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.XmlCompareJdom;\r
-import org.testng.Assert;\r
-import org.testng.annotations.Test;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class XmlCompareJdomTest {\r
-\r
-\r
-    private void testBanner(String msg){\r
-        String BANNER ="-------------------------------------------------------";\r
-        System.out.println(BANNER+"\r\n"+this.getClass().getName()+"\r\n"+msg+"\r\n"+BANNER);\r
-    }\r
-    public static void printTreeWalkResults(TreeWalkResults list){\r
-        for (TreeWalkResults.TreeWalkEntry entry : list){\r
-            System.out.println(entry.toString());\r
-        }\r
-    }\r
-\r
-    static void assertTrue(boolean stmt, String msg, TreeWalkResults results){\r
-        if (!stmt){\r
-            System.out.println("=====> Assertion Failed: "+msg);\r
-            printTreeWalkResults(results);\r
-        }\r
-        Assert.assertTrue(stmt, msg);\r
-    }\r
-    static void assertEquals(Object o1, Object o2, String msg, TreeWalkResults results){\r
-        if ( ! o1.equals(o2)) {\r
-            System.out.println("=====> Assertion Equals Failed: "+" o1: {"+o1+"} o2: {"+o2+"}"+"\r\n        "+msg);\r
-            printTreeWalkResults(results);\r
-        }\r
-       Assert.assertEquals(o1, o2, msg);\r
-    }\r
-\r
-    public  static void assertTreeWalkResults(TreeWalkResults results,\r
-                                                                      int addedRight,\r
-                                                                      int missingRight,\r
-                                                                      int textMismatches,\r
-                                                                      boolean strictMatch,\r
-                                                                      TreeWalkResults.MatchSpec matchSpec){\r
-        int addedr = results.countFor(TreeWalkResults.TreeWalkEntry.STATUS.R_ADDED);\r
-        int missingr = results.countFor(TreeWalkResults.TreeWalkEntry.STATUS.R_MISSING);\r
-        int tdiff = results.countFor(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT);\r
-        int badCount = results.getMismatchCount();\r
-        boolean strict = results.isStrictMatch();\r
-        boolean treeOK = results.treesMatch(matchSpec);\r
-\r
-        String expected = "\r\n        expected: addedRight:"+addedRight+",missingRight:"+missingRight+",textMismatches:"+textMismatches\r
-                              +",strictMatch:"+strictMatch+",matchSpec:"+matchSpec;\r
-\r
-        String actual   = "\r\n        actual:   addedRight:"+addedr+",missingRight:"+missingr+",textMismatches:"+tdiff\r
-                              +",strictMatch:"+strict+",matchSpec:"+matchSpec;\r
-        String exp_act = expected +"\r\n"+actual+"\r\n";\r
-        boolean done = false;\r
-        try {\r
-           assertEquals(addedr, addedRight, "assertTreeWalkResults:R_ADDED mismatch." + exp_act, results);\r
-            assertEquals(missingr, missingRight, "assertTreeWalkResults:R_MISSING mismatch." + exp_act, results);\r
-            assertEquals(tdiff, textMismatches, "assertTreeWalkResults:TEXT_DIFFERENT mismatch." + exp_act, results);\r
-            assertTrue((strict == strictMatch), "assertTreeWalkResults:strictMatch mismatch." + exp_act, results);\r
-            assertTrue((treeOK), "assertTreeWalkResults:treesMatch("+matchSpec+") returned false."+exp_act, results);\r
-            //System.out.println("SUCCESS: assertTreeWalkResults done.\r\n");\r
-            done = true;\r
-        } finally {\r
-            if (!done) System.out.println("FAILURE: assertTreeWalkResults failed an assertion. See surefire report.\r\n");\r
-        }\r
-    }\r
-\r
-    @Test\r
-    public void testXmlCompareJdom(){\r
-        testBanner("testXmlCompareJdom");\r
-        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();\r
-        TreeWalkResults results =\r
-                    XmlCompareJdom.compareParts(expectedPartContent,\r
-                                        "expected",\r
-                                        partFromServer,\r
-                                        "from-server",\r
-                                        exPARTNAME,\r
-                                        matchSpec);\r
-        assertTreeWalkResults(results,0,0,0,true,matchSpec);\r
-                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch\r
-    }\r
-\r
-    @Test\r
-    public void testTextContentDifferent(){\r
-        testBanner("testTextContentDifferent");\r
-        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();\r
-        matchSpec.removeErrorFromSpec(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT);\r
-        TreeWalkResults results =\r
-            XmlCompareJdom.compareParts(expectedPartContent,\r
-                                        "expected",\r
-                                        srvHEAD+srvEN2+srvDEPOSITOR+srvFOOT,\r
-                                        "from-server",\r
-                                        exPARTNAME,\r
-                                        matchSpec);\r
-        assertTreeWalkResults(results,0,0,1,false,matchSpec);\r
-                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch\r
-    }\r
-\r
-\r
-    @Test\r
-    public void testAddedR(){\r
-        testBanner("testAddedR");\r
-        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();\r
-        TreeWalkResults results =\r
-            XmlCompareJdom.compareParts(expectedPartContent,\r
-                                        "expected",\r
-                                        srvHEAD+srvEN+exNEWTREE+srvDEPOSITOR+exNEW+srvFOOT,\r
-                                        "from-server",\r
-                                        exPARTNAME,\r
-                                        matchSpec);\r
-        assertTreeWalkResults(results,2,0,0,false,matchSpec);\r
-                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch\r
-\r
-    }\r
-\r
-    @Test\r
-    public void testAddedL(){\r
-        testBanner("testAddedL");\r
-        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();\r
-        matchSpec.removeErrorFromSpec(TreeWalkResults.TreeWalkEntry.STATUS.R_MISSING);\r
-\r
-        TreeWalkResults results =\r
-            XmlCompareJdom.compareParts(exHEAD + exEN_WCH + exNEWTREE + exDEP  + exNEW + exFOOT,\r
-                                    "expected",\r
-                                    partFromServer,\r
-                                    "from-server",\r
-                                    exPARTNAME,\r
-                                    matchSpec);\r
-        assertTreeWalkResults(results,0,3,0,false,matchSpec);\r
-                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch\r
-    }\r
-\r
-    @Test\r
-    public void testChildrenReordered(){\r
-        testBanner("testChildrenReordered");\r
-        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();\r
-        TreeWalkResults results =\r
-            XmlCompareJdom.compareParts(exHEAD  + exDEP + exEN + exFOOT,\r
-                                    "expected",\r
-                                    partFromServer,\r
-                                    "from-server",\r
-                                    exPARTNAME,\r
-                                    matchSpec);\r
-        assertTreeWalkResults(results,0,0,0,true,matchSpec);\r
-                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch\r
-    }\r
-\r
-    // ============  expected part, will be used as LEFT tree ==========================================================\r
-    private static String exPARTNAME = "objectexit_common";\r
-\r
-    private static String exHEAD    ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"\r
-                                    +"<document name=\"objectexit\">"\r
-                                    +"<ns2:objectexit_common \r\n"\r
-                                    +"    xmlns:ns2=\"http://collectionspace.org/services/objectexit\" \r\n"\r
-                                    +"    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \r\n"\r
-                                    +"    xsi:schemaLocation=\"http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd\">\r\n";\r
-    private static String exEN      =" <exitNumber>objectexitNumber-1290026472360</exitNumber>\r\n";\r
-    private static String exEN_WCH  =" <exitNumber>objectexitNumber-1290026472360\r\n"\r
-                                    +"    <enChild>\r\n"\r
-                                    +"        enChild content\r\n"\r
-                                    +"    </enChild>\r\n"\r
-                                    +" </exitNumber>\r\n";\r
-    private static String exNEWTREE =" <first>\r\n"\r
-                                    +"    <second>\r\n"\r
-                                    +"        second content\r\n"\r
-                                    +"    </second>\r\n"\r
-                                    +" </first>\r\n";\r
-    private static String exDEP     =" <depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>\r\n";\r
-    private static String exNEW     =" <newField>objectexitNumber-1290026472360</newField>\r\n";\r
-    private static String exFOOT    ="</ns2:objectexit_common>"\r
-                                                     +"</document>";\r
-\r
-    private static String expectedPartContent = exHEAD + exEN + exDEP  + exFOOT;\r
-\r
-\r
-    // ============  from-server part, will be used as RIGHT tree ==========================================================\r
-\r
-    private static String srvHEAD =  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"\r
-                                    +"<document name=\"objectexit\">"\r
-                                    +"<ns2:objectexit_common xmlns:ns2=\"http://collectionspace.org/services/objectexit\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd\">\r\n";\r
-\r
-    private static String srvEN    = "<exitNumber>objectexitNumber-1290026472360</exitNumber>\r\n";\r
-    private static String srvEN2   = "<exitNumber>objectexitNumber-9999999999999</exitNumber>\r\n";\r
-    private static String srvDEPOSITOR  = "<depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>\r\n";\r
-    private static String srvFOOT =  "</ns2:objectexit_common>\r\n"\r
-                                                       +"</document>";\r
-\r
-    private static String partFromServer = srvHEAD+srvEN+srvDEPOSITOR+srvFOOT;\r
-\r
-\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.IntegrationTests.test;
+
+import org.collectionspace.services.IntegrationTests.xmlreplay.TreeWalkResults;
+import org.collectionspace.services.IntegrationTests.xmlreplay.XmlCompareJdom;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class XmlCompareJdomTest {
+
+
+    private void testBanner(String msg){
+        String BANNER ="-------------------------------------------------------";
+        System.out.println(BANNER+"\r\n"+this.getClass().getName()+"\r\n"+msg+"\r\n"+BANNER);
+    }
+    public static void printTreeWalkResults(TreeWalkResults list){
+        for (TreeWalkResults.TreeWalkEntry entry : list){
+            System.out.println(entry.toString());
+        }
+    }
+
+    static void assertTrue(boolean stmt, String msg, TreeWalkResults results){
+        if (!stmt){
+            System.out.println("=====> Assertion Failed: "+msg);
+            printTreeWalkResults(results);
+        }
+        Assert.assertTrue(stmt, msg);
+    }
+    static void assertEquals(Object o1, Object o2, String msg, TreeWalkResults results){
+        if ( ! o1.equals(o2)) {
+            System.out.println("=====> Assertion Equals Failed: "+" o1: {"+o1+"} o2: {"+o2+"}"+"\r\n        "+msg);
+            printTreeWalkResults(results);
+        }
+       Assert.assertEquals(o1, o2, msg);
+    }
+
+    public  static void assertTreeWalkResults(TreeWalkResults results,
+                                                                      int addedRight,
+                                                                      int missingRight,
+                                                                      int textMismatches,
+                                                                      boolean strictMatch,
+                                                                      TreeWalkResults.MatchSpec matchSpec){
+        int addedr = results.countFor(TreeWalkResults.TreeWalkEntry.STATUS.R_ADDED);
+        int missingr = results.countFor(TreeWalkResults.TreeWalkEntry.STATUS.R_MISSING);
+        int tdiff = results.countFor(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT);
+        int badCount = results.getMismatchCount();
+        boolean strict = results.isStrictMatch();
+        boolean treeOK = results.treesMatch(matchSpec);
+
+        String expected = "\r\n        expected: addedRight:"+addedRight+",missingRight:"+missingRight+",textMismatches:"+textMismatches
+                              +",strictMatch:"+strictMatch+",matchSpec:"+matchSpec;
+
+        String actual   = "\r\n        actual:   addedRight:"+addedr+",missingRight:"+missingr+",textMismatches:"+tdiff
+                              +",strictMatch:"+strict+",matchSpec:"+matchSpec;
+        String exp_act = expected +"\r\n"+actual+"\r\n";
+        boolean done = false;
+        try {
+           assertEquals(addedr, addedRight, "assertTreeWalkResults:R_ADDED mismatch." + exp_act, results);
+            assertEquals(missingr, missingRight, "assertTreeWalkResults:R_MISSING mismatch." + exp_act, results);
+            assertEquals(tdiff, textMismatches, "assertTreeWalkResults:TEXT_DIFFERENT mismatch." + exp_act, results);
+            assertTrue((strict == strictMatch), "assertTreeWalkResults:strictMatch mismatch." + exp_act, results);
+            assertTrue((treeOK), "assertTreeWalkResults:treesMatch("+matchSpec+") returned false."+exp_act, results);
+            //System.out.println("SUCCESS: assertTreeWalkResults done.\r\n");
+            done = true;
+        } finally {
+            if (!done) System.out.println("FAILURE: assertTreeWalkResults failed an assertion. See surefire report.\r\n");
+        }
+    }
+
+    @Test
+    public void testXmlCompareJdom(){
+        testBanner("testXmlCompareJdom");
+        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();
+        TreeWalkResults results =
+                    XmlCompareJdom.compareParts(expectedPartContent,
+                                        "expected",
+                                        partFromServer,
+                                        "from-server",
+                                        exPARTNAME,
+                                        matchSpec);
+        assertTreeWalkResults(results,0,0,0,true,matchSpec);
+                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch
+    }
+
+    @Test
+    public void testTextContentDifferent(){
+        testBanner("testTextContentDifferent");
+        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();
+        matchSpec.removeErrorFromSpec(TreeWalkResults.TreeWalkEntry.STATUS.TEXT_DIFFERENT);
+        TreeWalkResults results =
+            XmlCompareJdom.compareParts(expectedPartContent,
+                                        "expected",
+                                        srvHEAD+srvEN2+srvDEPOSITOR+srvFOOT,
+                                        "from-server",
+                                        exPARTNAME,
+                                        matchSpec);
+        assertTreeWalkResults(results,0,0,1,false,matchSpec);
+                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch
+    }
+
+
+    @Test
+    public void testAddedR(){
+        testBanner("testAddedR");
+        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();
+        TreeWalkResults results =
+            XmlCompareJdom.compareParts(expectedPartContent,
+                                        "expected",
+                                        srvHEAD+srvEN+exNEWTREE+srvDEPOSITOR+exNEW+srvFOOT,
+                                        "from-server",
+                                        exPARTNAME,
+                                        matchSpec);
+        assertTreeWalkResults(results,2,0,0,false,matchSpec);
+                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch
+
+    }
+
+    @Test
+    public void testAddedL(){
+        testBanner("testAddedL");
+        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();
+        matchSpec.removeErrorFromSpec(TreeWalkResults.TreeWalkEntry.STATUS.R_MISSING);
+
+        TreeWalkResults results =
+            XmlCompareJdom.compareParts(exHEAD + exEN_WCH + exNEWTREE + exDEP  + exNEW + exFOOT,
+                                    "expected",
+                                    partFromServer,
+                                    "from-server",
+                                    exPARTNAME,
+                                    matchSpec);
+        assertTreeWalkResults(results,0,3,0,false,matchSpec);
+                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch
+    }
+
+    @Test
+    public void testChildrenReordered(){
+        testBanner("testChildrenReordered");
+        TreeWalkResults.MatchSpec matchSpec = TreeWalkResults.MatchSpec.createDefault();
+        TreeWalkResults results =
+            XmlCompareJdom.compareParts(exHEAD  + exDEP + exEN + exFOOT,
+                                    "expected",
+                                    partFromServer,
+                                    "from-server",
+                                    exPARTNAME,
+                                    matchSpec);
+        assertTreeWalkResults(results,0,0,0,true,matchSpec);
+                                   // addedRight,missingRight,textMismatches,strictMatch,treesMatch
+    }
+
+    // ============  expected part, will be used as LEFT tree ==========================================================
+    private static String exPARTNAME = "objectexit_common";
+
+    private static String exHEAD    ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
+                                    +"<document name=\"objectexit\">"
+                                    +"<ns2:objectexit_common \r\n"
+                                    +"    xmlns:ns2=\"http://collectionspace.org/services/objectexit\" \r\n"
+                                    +"    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \r\n"
+                                    +"    xsi:schemaLocation=\"http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd\">\r\n";
+    private static String exEN      =" <exitNumber>objectexitNumber-1290026472360</exitNumber>\r\n";
+    private static String exEN_WCH  =" <exitNumber>objectexitNumber-1290026472360\r\n"
+                                    +"    <enChild>\r\n"
+                                    +"        enChild content\r\n"
+                                    +"    </enChild>\r\n"
+                                    +" </exitNumber>\r\n";
+    private static String exNEWTREE =" <first>\r\n"
+                                    +"    <second>\r\n"
+                                    +"        second content\r\n"
+                                    +"    </second>\r\n"
+                                    +" </first>\r\n";
+    private static String exDEP     =" <depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>\r\n";
+    private static String exNEW     =" <newField>objectexitNumber-1290026472360</newField>\r\n";
+    private static String exFOOT    ="</ns2:objectexit_common>"
+                                                     +"</document>";
+
+    private static String expectedPartContent = exHEAD + exEN + exDEP  + exFOOT;
+
+
+    // ============  from-server part, will be used as RIGHT tree ==========================================================
+
+    private static String srvHEAD =  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
+                                    +"<document name=\"objectexit\">"
+                                    +"<ns2:objectexit_common xmlns:ns2=\"http://collectionspace.org/services/objectexit\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd\">\r\n";
+
+    private static String srvEN    = "<exitNumber>objectexitNumber-1290026472360</exitNumber>\r\n";
+    private static String srvEN2   = "<exitNumber>objectexitNumber-9999999999999</exitNumber>\r\n";
+    private static String srvDEPOSITOR  = "<depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>\r\n";
+    private static String srvFOOT =  "</ns2:objectexit_common>\r\n"
+                                                       +"</document>";
+
+    private static String partFromServer = srvHEAD+srvEN+srvDEPOSITOR+srvFOOT;
+
+
+
+}
index eed0cfe656c993a66e0568a0000393ebddca534b..8ffe2d9e761bd9ab0d898cf3287ffc2510178661 100644 (file)
@@ -1,23 +1,23 @@
-package org.collectionspace.services.IntegrationTests.test;\r
-\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.ServiceResult;\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay;\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplayTest;\r
-import org.testng.annotations.Test;\r
-\r
-import java.util.List;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class XmlReplayMasterTest  extends XmlReplayTest {\r
-\r
-    @Test\r
-    public void runMaster() throws Exception {\r
-        XmlReplay replay = createXmlReplayUsingIntegrationTestsModule("..");\r
-        List<List<ServiceResult>> list = replay.runMaster(XmlReplay.DEFAULT_MASTER_CONTROL);\r
-        logTestForGroup(list, "XmlReplayMasterTest");\r
-    }\r
-}\r
+package org.collectionspace.services.IntegrationTests.test;
+
+import org.collectionspace.services.IntegrationTests.xmlreplay.ServiceResult;
+import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay;
+import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplayTest;
+import org.testng.annotations.Test;
+
+import java.util.List;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class XmlReplayMasterTest  extends XmlReplayTest {
+
+    @Test
+    public void runMaster() throws Exception {
+        XmlReplay replay = createXmlReplayUsingIntegrationTestsModule("..");
+        List<List<ServiceResult>> list = replay.runMaster(XmlReplay.DEFAULT_MASTER_CONTROL);
+        logTestForGroup(list, "XmlReplayMasterTest");
+    }
+}
index a4200fe7e00fc83bac924d4bd66d9605434ef215..fd32960bf0f59a46511768da3fd713ed6af6e302 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.IntegrationTests.test;\r
-\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.ServiceResult;\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay;\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplayTest;\r
-import org.testng.annotations.Test;\r
-\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-/**  The test cases in here also document the ways that XmlReplay was designed to be used programmatically.\r
- *   The most automated way to use XmlReplay is demonstrated in runMaster().  You just create a master file and a control\r
- *   file in the IntegrationTests xml replay repository, which is in services/IntegrationTests + XmlReplayTest.XMLREPLAY_REL_DIR_TO_MODULE.\r
- *\r
- *   If you choose to run from a module, you'll need to add a dependency to the IntegrationTests module:\r
- *   e.g.\r
- *    &lt;project ...>\r
- *    &lt;dependencies>\r
- *      &lt;dependency>\r
-            &lt;groupId>org.collectionspace.services&lt;/groupId>\r
-            &lt;artifactId>org.collectionspace.services.IntegrationTests&lt;/artifactId>\r
-            &lt;version>${project.version}&lt;/version>\r
-        &lt;/dependency>\r
- *\r
- *   User: laramie\r
- *   $LastChangedRevision:  $\r
- *   $LastChangedDate:  $\r
- */\r
-public class XmlReplaySelfTest extends XmlReplayTest {\r
-\r
-    public static XmlReplay createXmlReplay() throws Exception {\r
-        return XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("..");\r
-        //NOTE: this self-test lives in services/IntegrationTests, so relToServicesRoot is ".."\r
-        //      but if you were running from, say, services/dimension/client, then relToServicesRoot would be "../.."\r
-        //      so you would have to call XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("../..")\r
-        //      which is done for you if you just call XmlReplayTest.createXmlReplay().\r
-    }\r
-\r
-    @Test\r
-    public void runMaster() throws Exception {\r
-        XmlReplay replay = createXmlReplay();\r
-        List<List<ServiceResult>> list = replay.runMaster("xml-replay-master-self-test.xml");\r
-        logTestForGroup(list, "runMaster");\r
-    }\r
-\r
-    @Test\r
-    public void runTestGroup() throws Exception {\r
-        XmlReplay replay = createXmlReplay();\r
-        replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml"); //or use: XmlReplay.DEFAULT_MASTER_CONTROL as master filename;\r
-        replay.setControlFileName("xml-replay-self-test.xml");\r
-        List<ServiceResult> list = replay.runTestGroup("selftestGroup");\r
-        logTest(list, "runTestGroup");\r
-    }\r
-\r
-/*\r
-    @Test\r
-    public void runOneTest() throws Exception {\r
-        XmlReplay replay = createXmlReplay();\r
-        replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml");\r
-        replay.setControlFileName("xml-replay-self-test.xml");\r
-\r
-        ServiceResult res = replay.runTest("selftestGroup", "OrgAuth1");\r
-        logTest(res, "runOneTest");\r
-    }\r
-\r
-\r
-    @Test\r
-    public void runMultipleTestsManualCleanup() throws Exception {\r
-        XmlReplay replay = createXmlReplay();\r
-        replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml");\r
-        replay.setControlFileName("xml-replay-self-test.xml");\r
-        replay.setAutoDeletePOSTS(false);  //defaults to true, so turn it off to to it ourselves.\r
-\r
-        List<ServiceResult> testResultsList = new ArrayList<ServiceResult>();\r
-\r
-        ServiceResult res1 = replay.runTest("selftestGroup", "OrgAuth1");\r
-        testResultsList.add(res1);\r
-\r
-        ServiceResult res2 = replay.runTest("selftestGroup", "Org1");\r
-        testResultsList.add(res2);\r
-\r
-        ServiceResult res3 = replay.runTest("selftestGroup", "getOrg1");\r
-        testResultsList.add(res3);\r
-\r
-        //Now, clean up.  You may skip this if your tests do all the DELETEs.\r
-        List<ServiceResult> deleteList = replay.autoDelete("runMultipleTestsManualCleanup");\r
-\r
-        logTest(testResultsList, "runTwoTestsManualCleanup.tests");\r
-        logTest(deleteList, "runTwoTestsManualCleanup.cleanups");\r
-\r
-    }\r
-*/\r
-\r
-\r
-    @Test\r
-    public void runTestGroup_AllOptions() throws Exception {\r
-        XmlReplay replay = createXmlReplay();  //Use the central repository.\r
-        //You can also use your own xml replay repository in your module, like so:\r
-        //   XmlReplay replay = XmlReplayTest.createXmlReplayForModule(); if you are in your module\r
-        //You can also manually specify to use the central repository:\r
-        //   XmlReplay replay = XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("..");  if you are in a module such as dimension\r
-        //   XmlReplay replay = XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("../.."); if you are in a module such as dimension/client\r
-\r
-        //You may read Dump, Auths, and protoHostPort from the master file:\r
-        replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml"); //or use: XmlReplay.DEFAULT_MASTER_CONTROL as master filename;\r
-        //or you may set those options individually as shown next.\r
-        // Note that controlFileName is NOT set from calling readOptionsFromMasterConfigFile.\r
-        // If you run a master, it sets controlFileName, possibly in a loop.\r
-        // All of the Auths will be read from the master file, and may be referenced from your control file,\r
-        // or you may specify Auths in your control file.  There are also public methods to set the AuthsMap yourself.\r
-\r
-        //XmlReplay wants to know about two files: a master and a control file\r
-        //  The master references one to many control files.\r
-        //  If you don't call runMaster(), you must specify the control file:\r
-        replay.setControlFileName("xml-replay-self-test.xml");\r
-\r
-        //These option default sensibly, some of them from the master, but here's how to set them all:\r
-\r
-        //Dump determines how much goes to log, and how verbose.\r
-        XmlReplay.Dump dump = XmlReplay.getDumpConfig(); //static factory call.\r
-        dump.payloads = false;\r
-        dump.dumpServiceResult = ServiceResult.DUMP_OPTIONS.minimal;\r
-        replay.setDump(dump);\r
-\r
-        //use this if you must look it up from some other place.\r
-        // Default is to have it in xml-replay-master.xml\r
-        replay.setProtoHostPort("http://localhost:8180");\r
-\r
-        //Default is true, but you can override if you want to leave objects on server, or control the order of deletion.\r
-        replay.setAutoDeletePOSTS(false);\r
-\r
-        //You don't need this, but you can inspect what XmlReplay holds onto: a data structure of CSIDs\r
-        Map<String, ServiceResult> serviceResultsMap = replay.getServiceResultsMap();\r
-\r
-        // ****** RUN A GROUP ***********************************************\r
-        List<ServiceResult> list = replay.runTestGroup("selftestGroup");\r
-\r
-        // This runs a group called "organization" inside a control file named above, which happens to be called "organization.xml".\r
-        // You could also run just one test using these options by calling replay.runTest as shown above in XmlReplayTest.runOneTest()\r
-\r
-        //Now, since we set setAutoDeletePOSTS(false) above, you can clean up manually:\r
-        replay.autoDelete("runTestGroup_AllOptions"); //deletes everything in serviceResultsMap, which it hangs onto.\r
-\r
-        logTest(list, "runTestGroup_AllOptions");\r
-    }\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.collectionspace.services.IntegrationTests.test;
+
+import org.collectionspace.services.IntegrationTests.xmlreplay.ServiceResult;
+import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay;
+import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplayTest;
+import org.testng.annotations.Test;
+
+import java.util.List;
+import java.util.Map;
+
+/**  The test cases in here also document the ways that XmlReplay was designed to be used programmatically.
+ *   The most automated way to use XmlReplay is demonstrated in runMaster().  You just create a master file and a control
+ *   file in the IntegrationTests xml replay repository, which is in services/IntegrationTests + XmlReplayTest.XMLREPLAY_REL_DIR_TO_MODULE.
+ *
+ *   If you choose to run from a module, you'll need to add a dependency to the IntegrationTests module:
+ *   e.g.
+ *    &lt;project ...>
+ *    &lt;dependencies>
+ *      &lt;dependency>
+            &lt;groupId>org.collectionspace.services&lt;/groupId>
+            &lt;artifactId>org.collectionspace.services.IntegrationTests&lt;/artifactId>
+            &lt;version>${project.version}&lt;/version>
+        &lt;/dependency>
+ *
+ *   User: laramie
+ *   $LastChangedRevision:  $
+ *   $LastChangedDate:  $
+ */
+public class XmlReplaySelfTest extends XmlReplayTest {
+
+    public static XmlReplay createXmlReplay() throws Exception {
+        return XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("..");
+        //NOTE: this self-test lives in services/IntegrationTests, so relToServicesRoot is ".."
+        //      but if you were running from, say, services/dimension/client, then relToServicesRoot would be "../.."
+        //      so you would have to call XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("../..")
+        //      which is done for you if you just call XmlReplayTest.createXmlReplay().
+    }
+
+    @Test
+    public void runMaster() throws Exception {
+        XmlReplay replay = createXmlReplay();
+        List<List<ServiceResult>> list = replay.runMaster("xml-replay-master-self-test.xml");
+        logTestForGroup(list, "runMaster");
+    }
+
+    @Test
+    public void runTestGroup() throws Exception {
+        XmlReplay replay = createXmlReplay();
+        replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml"); //or use: XmlReplay.DEFAULT_MASTER_CONTROL as master filename;
+        replay.setControlFileName("xml-replay-self-test.xml");
+        List<ServiceResult> list = replay.runTestGroup("selftestGroup");
+        logTest(list, "runTestGroup");
+    }
+
+/*
+    @Test
+    public void runOneTest() throws Exception {
+        XmlReplay replay = createXmlReplay();
+        replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml");
+        replay.setControlFileName("xml-replay-self-test.xml");
+
+        ServiceResult res = replay.runTest("selftestGroup", "OrgAuth1");
+        logTest(res, "runOneTest");
+    }
+
+
+    @Test
+    public void runMultipleTestsManualCleanup() throws Exception {
+        XmlReplay replay = createXmlReplay();
+        replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml");
+        replay.setControlFileName("xml-replay-self-test.xml");
+        replay.setAutoDeletePOSTS(false);  //defaults to true, so turn it off to to it ourselves.
+
+        List<ServiceResult> testResultsList = new ArrayList<ServiceResult>();
+
+        ServiceResult res1 = replay.runTest("selftestGroup", "OrgAuth1");
+        testResultsList.add(res1);
+
+        ServiceResult res2 = replay.runTest("selftestGroup", "Org1");
+        testResultsList.add(res2);
+
+        ServiceResult res3 = replay.runTest("selftestGroup", "getOrg1");
+        testResultsList.add(res3);
+
+        //Now, clean up.  You may skip this if your tests do all the DELETEs.
+        List<ServiceResult> deleteList = replay.autoDelete("runMultipleTestsManualCleanup");
+
+        logTest(testResultsList, "runTwoTestsManualCleanup.tests");
+        logTest(deleteList, "runTwoTestsManualCleanup.cleanups");
+
+    }
+*/
+
+
+    @Test
+    public void runTestGroup_AllOptions() throws Exception {
+        XmlReplay replay = createXmlReplay();  //Use the central repository.
+        //You can also use your own xml replay repository in your module, like so:
+        //   XmlReplay replay = XmlReplayTest.createXmlReplayForModule(); if you are in your module
+        //You can also manually specify to use the central repository:
+        //   XmlReplay replay = XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("..");  if you are in a module such as dimension
+        //   XmlReplay replay = XmlReplayTest.createXmlReplayUsingIntegrationTestsModule("../.."); if you are in a module such as dimension/client
+
+        //You may read Dump, Auths, and protoHostPort from the master file:
+        replay.readOptionsFromMasterConfigFile("xml-replay-master-self-test.xml"); //or use: XmlReplay.DEFAULT_MASTER_CONTROL as master filename;
+        //or you may set those options individually as shown next.
+        // Note that controlFileName is NOT set from calling readOptionsFromMasterConfigFile.
+        // If you run a master, it sets controlFileName, possibly in a loop.
+        // All of the Auths will be read from the master file, and may be referenced from your control file,
+        // or you may specify Auths in your control file.  There are also public methods to set the AuthsMap yourself.
+
+        //XmlReplay wants to know about two files: a master and a control file
+        //  The master references one to many control files.
+        //  If you don't call runMaster(), you must specify the control file:
+        replay.setControlFileName("xml-replay-self-test.xml");
+
+        //These option default sensibly, some of them from the master, but here's how to set them all:
+
+        //Dump determines how much goes to log, and how verbose.
+        XmlReplay.Dump dump = XmlReplay.getDumpConfig(); //static factory call.
+        dump.payloads = false;
+        dump.dumpServiceResult = ServiceResult.DUMP_OPTIONS.minimal;
+        replay.setDump(dump);
+
+        //use this if you must look it up from some other place.
+        // Default is to have it in xml-replay-master.xml
+        replay.setProtoHostPort("http://localhost:8180");
+
+        //Default is true, but you can override if you want to leave objects on server, or control the order of deletion.
+        replay.setAutoDeletePOSTS(false);
+
+        //You don't need this, but you can inspect what XmlReplay holds onto: a data structure of CSIDs
+        Map<String, ServiceResult> serviceResultsMap = replay.getServiceResultsMap();
+
+        // ****** RUN A GROUP ***********************************************
+        List<ServiceResult> list = replay.runTestGroup("selftestGroup");
+
+        // This runs a group called "organization" inside a control file named above, which happens to be called "organization.xml".
+        // You could also run just one test using these options by calling replay.runTest as shown above in XmlReplayTest.runOneTest()
+
+        //Now, since we set setAutoDeletePOSTS(false) above, you can clean up manually:
+        replay.autoDelete("runTestGroup_AllOptions"); //deletes everything in serviceResultsMap, which it hangs onto.
+
+        logTest(list, "runTestGroup_AllOptions");
+    }
+
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index ae8665103b89354e4ef90d1d459daa93101f6acd..844436dc1de305cafb30fa9d3666b1564794ff0c 100644 (file)
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="acquisitions">\r
-<ns3:acquisitions_common\r
-  xmlns:ns2="http://collectionspace.org/services/jaxb"\r
-  xmlns:ns3="http://collectionspace.org/services/acquisition">\r
-  <acquisitionDates>\r
-    <acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>\r
-    <acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>\r
-  </acquisitionDates>\r
-  <acquisitionReferenceNumber>acquisitionReferenceNumber-1</acquisitionReferenceNumber>\r
-  <owners>\r
-    <owner>First Owner -1292275630222</owner>\r
-    <owner>Second Owner-1292275630222</owner>\r
-  </owners>\r
-  <acquisitionSources>\r
-    <acquisitionSource>NEW Museum Acquisition Source-333</acquisitionSource>\r
-    <acquisitionSource>Donor Acquisition Source-1292275630222</acquisitionSource>\r
-  </acquisitionSources>\r
-</ns3:acquisitions_common>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="acquisitions">
+<ns3:acquisitions_common
+  xmlns:ns2="http://collectionspace.org/services/jaxb"
+  xmlns:ns3="http://collectionspace.org/services/acquisition">
+  <acquisitionDates>
+    <acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>
+    <acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>
+  </acquisitionDates>
+  <acquisitionReferenceNumber>acquisitionReferenceNumber-1</acquisitionReferenceNumber>
+  <owners>
+    <owner>First Owner -1292275630222</owner>
+    <owner>Second Owner-1292275630222</owner>
+  </owners>
+  <acquisitionSources>
+    <acquisitionSource>NEW Museum Acquisition Source-333</acquisitionSource>
+    <acquisitionSource>Donor Acquisition Source-1292275630222</acquisitionSource>
+  </acquisitionSources>
+</ns3:acquisitions_common>
+</document>
+
+
index dfa99178c19ae44925c01651a4b863439869611d..d2d8db7625aba7146f985adf4c33c55065e93c43 100644 (file)
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="acquisitions">\r
-<ns3:acquisitions_common\r
-xmlns:ns2="http://collectionspace.org/services/jaxb"\r
-xmlns:ns3="http://collectionspace.org/services/acquisition">\r
-  <acquisitionDates>\r
-    <acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>\r
-    <acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>\r
-  </acquisitionDates>\r
-  <acquisitionReferenceNumber>acquisitionReferenceNumber-1292275631503</acquisitionReferenceNumber>\r
-  <owners>\r
-    <owner>Second Owner-1292275631503</owner>\r
-    <owner>First Owner -1292275631503</owner>\r
-  </owners>\r
-  <acquisitionSources>\r
-    <acquisitionSource>Museum Acquisition Source-1292275631503</acquisitionSource>\r
-    <acquisitionSource>Donor Acquisition Source-1292275631503</acquisitionSource>\r
-  </acquisitionSources>\r
-</ns3:acquisitions_common>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="acquisitions">
+<ns3:acquisitions_common
+xmlns:ns2="http://collectionspace.org/services/jaxb"
+xmlns:ns3="http://collectionspace.org/services/acquisition">
+  <acquisitionDates>
+    <acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>
+    <acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>
+  </acquisitionDates>
+  <acquisitionReferenceNumber>acquisitionReferenceNumber-1292275631503</acquisitionReferenceNumber>
+  <owners>
+    <owner>Second Owner-1292275631503</owner>
+    <owner>First Owner -1292275631503</owner>
+  </owners>
+  <acquisitionSources>
+    <acquisitionSource>Museum Acquisition Source-1292275631503</acquisitionSource>
+    <acquisitionSource>Donor Acquisition Source-1292275631503</acquisitionSource>
+  </acquisitionSources>
+</ns3:acquisitions_common>
+</document>
+
+
index 7848c8306f6facc2be08663726caccc4e3696e17..5f974a5c3ca3d46802ace17744f1ed6eb09130ce 100644 (file)
@@ -1,74 +1,74 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>\r
-    </auths>\r
-   \r
-    <testGroup ID="makeone" autoDeletePOSTS="true">\r
-       <test ID="ac1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/acquisitions/</uri>\r
-             <filename>acquisitions/ac1.xml</filename>\r
-         </test>\r
-        <test ID="ac1get">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/acquisitions/${ac1.CSID}</uri>\r
-            <response>\r
-                <expected level="TEXT" />\r
-                <label>acquisitions_common</label>\r
-                <filename>acquisitions/res/ac1.res.xml</filename>\r
-             </response>\r
-         </test>\r
-    </testGroup>       \r
-\r
-    <testGroup ID="testList" autoDeletePOSTS="true">\r
-         <test ID="ac1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/acquisitions/</uri>\r
-             <filename>acquisitions/ac1.xml</filename>\r
-         </test>\r
-         \r
-         <test ID="ac1get">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/acquisitions/${ac1.CSID}</uri>\r
-            <response>\r
-                <expected level="TEXT" />\r
-                <label>acquisitions_common</label>\r
-                               <filename>acquisitions/res/ac1.res.xml</filename>\r
-             </response>\r
-         </test>\r
-\r
-        <test ID="ac2"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/acquisitions/</uri>\r
-             <filename>acquisitions/ac2.xml</filename>\r
-         </test>\r
-         \r
-        <test ID="ac2get">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/acquisitions/${ac2.CSID}</uri>\r
-            <response>\r
-                <expected level="TEXT" />\r
-                <label>acquisitions_common</label>\r
-                               <filename>acquisitions/res/ac2.res.xml</filename>\r
-             </response>\r
-        </test>\r
-\r
-        <test ID="ac3list">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/acquisitions/?sortBy=&amp;pgNum=0&amp;pgSz=10</uri>\r
-            <response>\r
-                <expected level="TEXT" />\r
-                <label>acquisitions_common</label>\r
-                <filename>acquisitions/res/ac3list.res.xml</filename>\r
-             </response>\r
-        </test>\r
-        \r
-    </testGroup>\r
-     \r
-\r
-</xmlReplay>\r
-        \r
-        \r
+<?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@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
+    </auths>
+   
+    <testGroup ID="makeone" autoDeletePOSTS="true">
+       <test ID="ac1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/acquisitions/</uri>
+             <filename>acquisitions/ac1.xml</filename>
+         </test>
+        <test ID="ac1get">
+            <method>GET</method>
+            <uri>/cspace-services/acquisitions/${ac1.CSID}</uri>
+            <response>
+                <expected level="TEXT" />
+                <label>acquisitions_common</label>
+                <filename>acquisitions/res/ac1.res.xml</filename>
+             </response>
+         </test>
+    </testGroup>       
+
+    <testGroup ID="testList" autoDeletePOSTS="true">
+         <test ID="ac1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/acquisitions/</uri>
+             <filename>acquisitions/ac1.xml</filename>
+         </test>
+         
+         <test ID="ac1get">
+            <method>GET</method>
+            <uri>/cspace-services/acquisitions/${ac1.CSID}</uri>
+            <response>
+                <expected level="TEXT" />
+                <label>acquisitions_common</label>
+                               <filename>acquisitions/res/ac1.res.xml</filename>
+             </response>
+         </test>
+
+        <test ID="ac2"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/acquisitions/</uri>
+             <filename>acquisitions/ac2.xml</filename>
+         </test>
+         
+        <test ID="ac2get">
+            <method>GET</method>
+            <uri>/cspace-services/acquisitions/${ac2.CSID}</uri>
+            <response>
+                <expected level="TEXT" />
+                <label>acquisitions_common</label>
+                               <filename>acquisitions/res/ac2.res.xml</filename>
+             </response>
+        </test>
+
+        <test ID="ac3list">
+            <method>GET</method>
+            <uri>/cspace-services/acquisitions/?sortBy=&amp;pgNum=0&amp;pgSz=10</uri>
+            <response>
+                <expected level="TEXT" />
+                <label>acquisitions_common</label>
+                <filename>acquisitions/res/ac3list.res.xml</filename>
+             </response>
+        </test>
+        
+    </testGroup>
+     
+
+</xmlReplay>
+        
+        
index da16a0e1457949ebe432c998a168a26d9fa9f5f2..008c19a4c7071e0ebe8702f14455600f12e36527 100644 (file)
@@ -1,20 +1,20 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="acquisitions">\r
-<ns2:acquisitions_common xmlns:ns2="http://collectionspace.org/services/acquisition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/acquisition http://services.collectionspace.org/acquisition/acquisitions_common.xsd">\r
-<acquisitionReferenceNumber>acquisitionReferenceNumber-1</acquisitionReferenceNumber>\r
-<acquisitionFundingList/>\r
-<acquisitionDates>\r
-<acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>\r
-<acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>\r
-</acquisitionDates>\r
-<acquisitionSources>\r
-<acquisitionSource>Donor Acquisition Source-1292275630222</acquisitionSource>\r
-<acquisitionSource>Museum Acquisition Source-1292275630222</acquisitionSource>\r
-</acquisitionSources>\r
-<owners>\r
-<owner>First Owner -1292275630222</owner>\r
-<owner>Second Owner-1292275630222</owner>\r
-</owners>\r
-<fieldCollectionEventNames/>\r
-</ns2:acquisitions_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="acquisitions">
+<ns2:acquisitions_common xmlns:ns2="http://collectionspace.org/services/acquisition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/acquisition http://services.collectionspace.org/acquisition/acquisitions_common.xsd">
+<acquisitionReferenceNumber>acquisitionReferenceNumber-1</acquisitionReferenceNumber>
+<acquisitionFundingList/>
+<acquisitionDates>
+<acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>
+<acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>
+</acquisitionDates>
+<acquisitionSources>
+<acquisitionSource>Donor Acquisition Source-1292275630222</acquisitionSource>
+<acquisitionSource>Museum Acquisition Source-1292275630222</acquisitionSource>
+</acquisitionSources>
+<owners>
+<owner>First Owner -1292275630222</owner>
+<owner>Second Owner-1292275630222</owner>
+</owners>
+<fieldCollectionEventNames/>
+</ns2:acquisitions_common>
+</document>
index 9fa704a36f620064e59750f608f37cc91c6e298e..d80b19ccf8dc4205aa32f2cfd2c8412ff5b551ef 100644 (file)
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="acquisitions">\r
-<ns2:acquisitions_common xmlns:ns2="http://collectionspace.org/services/acquisition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/acquisition http://services.collectionspace.org/acquisition/acquisitions_common.xsd">\r
-<acquisitionReferenceNumber>acquisitionReferenceNumber-1292275631503</acquisitionReferenceNumber>\r
-<acquisitionFundingList/>\r
-<acquisitionDates>\r
-<acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>\r
-<acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>\r
-</acquisitionDates>\r
-<acquisitionSources>\r
-<acquisitionSource>Museum Acquisition Source-1292275631503</acquisitionSource>\r
-<acquisitionSource>Donor Acquisition Source-1292275631503</acquisitionSource>\r
-</acquisitionSources>\r
-<owners>\r
-<owner>Second Owner-1292275631503</owner>\r
-<owner>First Owner -1292275631503</owner>\r
-</owners>\r
-<fieldCollectionEventNames/>\r
-</ns2:acquisitions_common>\r
-</document>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="acquisitions">
+<ns2:acquisitions_common xmlns:ns2="http://collectionspace.org/services/acquisition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/acquisition http://services.collectionspace.org/acquisition/acquisitions_common.xsd">
+<acquisitionReferenceNumber>acquisitionReferenceNumber-1292275631503</acquisitionReferenceNumber>
+<acquisitionFundingList/>
+<acquisitionDates>
+<acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>
+<acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>
+</acquisitionDates>
+<acquisitionSources>
+<acquisitionSource>Museum Acquisition Source-1292275631503</acquisitionSource>
+<acquisitionSource>Donor Acquisition Source-1292275631503</acquisitionSource>
+</acquisitionSources>
+<owners>
+<owner>Second Owner-1292275631503</owner>
+<owner>First Owner -1292275631503</owner>
+</owners>
+<fieldCollectionEventNames/>
+</ns2:acquisitions_common>
+</document>
+
index ebe0bbfe88d06a46916deeb8609c37a52d2fd9b7..b281e264d542f79b26b700ad31566a1b69954a9b 100644 (file)
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="acquisitions">\r
-<ns2:acquisitions_common xmlns:ns2="http://collectionspace.org/services/acquisition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/acquisition http://services.collectionspace.org/acquisition/acquisitions_common.xsd">\r
-<acquisitionReferenceNumber>acquisitionReferenceNumber-1292275630222</acquisitionReferenceNumber>\r
-<acquisitionFundingList/>\r
-<acquisitionDates>\r
-<acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>\r
-<acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>\r
-</acquisitionDates>\r
-<acquisitionSources>\r
-<acquisitionSource>Donor Acquisition Source-1292275630222</acquisitionSource>\r
-<acquisitionSource>Museum Acquisition Source-1292275630222</acquisitionSource>\r
-</acquisitionSources>\r
-<owners>\r
-<owner>First Owner -1292275630222</owner>\r
-<owner>Second Owner-1292275630222</owner>\r
-</owners>\r
-<fieldCollectionEventNames/>\r
-</ns2:acquisitions_common>\r
-</document>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="acquisitions">
+<ns2:acquisitions_common xmlns:ns2="http://collectionspace.org/services/acquisition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/acquisition http://services.collectionspace.org/acquisition/acquisitions_common.xsd">
+<acquisitionReferenceNumber>acquisitionReferenceNumber-1292275630222</acquisitionReferenceNumber>
+<acquisitionFundingList/>
+<acquisitionDates>
+<acquisitionDate>2010-11-15T07:30:24Z</acquisitionDate>
+<acquisitionDate>2009-10-15T07:30:24Z</acquisitionDate>
+</acquisitionDates>
+<acquisitionSources>
+<acquisitionSource>Donor Acquisition Source-1292275630222</acquisitionSource>
+<acquisitionSource>Museum Acquisition Source-1292275630222</acquisitionSource>
+</acquisitionSources>
+<owners>
+<owner>First Owner -1292275630222</owner>
+<owner>Second Owner-1292275630222</owner>
+</owners>
+<fieldCollectionEventNames/>
+</ns2:acquisitions_common>
+</document>
+
index 9ab1c05834f6930764aec9e0b03f1e2dcfba71d5..617b494e221f8ae3fb9563f1e0c2bb13d4311570 100644 (file)
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="acquisitions">\r
-<ns3:acquisitions-common-list\r
-xmlns:ns2="http://collectionspace.org/services/jaxb"\r
-xmlns:ns3="http://collectionspace.org/services/acquisition">\r
-  <pageNum>0</pageNum>\r
-  <pageSize>10</pageSize>\r
-  <itemsInPage>2</itemsInPage>\r
-  <totalItems>2</totalItems>\r
-  <fieldsReturned>\r
-  acquisitionReferenceNumber|acquisitionSources|owners|uri|csid</fieldsReturned>\r
-  <acquisition-list-item>\r
-    <acquisitionReferenceNumber>acquisitionReferenceNumber-1292275631503</acquisitionReferenceNumber>\r
-    <acquisitionSource>Donor Acquisition Source-1292275631503</acquisitionSource>\r
-    <owner>First Owner -1292275631503</owner>\r
-    <uri>/acquisitions/bff1deb6-03af-457c-af98</uri>\r
-    <csid>bff1deb6-03af-457c-af98</csid>\r
-  </acquisition-list-item>\r
-  <acquisition-list-item>\r
-    <acquisitionReferenceNumber>acquisitionReferenceNumber-1292275630222</acquisitionReferenceNumber>\r
-    <acquisitionSource>Museum Acquisition Source-1292275630222</acquisitionSource>\r
-    <owner>Second Owner-1292275630222</owner>\r
-    <uri>/acquisitions/549dd907-01cd-4f20-aeb7</uri>\r
-    <csid>549dd907-01cd-4f20-aeb7</csid>\r
-  </acquisition-list-item>\r
-</ns3:acquisitions-common-list>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="acquisitions">
+<ns3:acquisitions-common-list
+xmlns:ns2="http://collectionspace.org/services/jaxb"
+xmlns:ns3="http://collectionspace.org/services/acquisition">
+  <pageNum>0</pageNum>
+  <pageSize>10</pageSize>
+  <itemsInPage>2</itemsInPage>
+  <totalItems>2</totalItems>
+  <fieldsReturned>
+  acquisitionReferenceNumber|acquisitionSources|owners|uri|csid</fieldsReturned>
+  <acquisition-list-item>
+    <acquisitionReferenceNumber>acquisitionReferenceNumber-1292275631503</acquisitionReferenceNumber>
+    <acquisitionSource>Donor Acquisition Source-1292275631503</acquisitionSource>
+    <owner>First Owner -1292275631503</owner>
+    <uri>/acquisitions/bff1deb6-03af-457c-af98</uri>
+    <csid>bff1deb6-03af-457c-af98</csid>
+  </acquisition-list-item>
+  <acquisition-list-item>
+    <acquisitionReferenceNumber>acquisitionReferenceNumber-1292275630222</acquisitionReferenceNumber>
+    <acquisitionSource>Museum Acquisition Source-1292275630222</acquisitionSource>
+    <owner>Second Owner-1292275630222</owner>
+    <uri>/acquisitions/549dd907-01cd-4f20-aeb7</uri>
+    <csid>549dd907-01cd-4f20-aeb7</csid>
+  </acquisition-list-item>
+</ns3:acquisitions-common-list>
+</document>
+
+
index 7f8e5c9eccfa2d3c64e6677f8181e03149291716..78c384bc1d9e4c03eb1f882717e7bf9e2e12a3de 100644 (file)
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="personauthorities">\r
-    <ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-        <displayName>${authDisplayName}</displayName>\r
-        <shortIdentifier>${authShortIdentifier}</shortIdentifier>\r
-        <vocabType>PersonAuthority</vocabType>\r
-        <description>This is a test Person Authority.</description>\r
-    </ns2:personauthorities_common>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="personauthorities">
+    <ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <displayName>${authDisplayName}</displayName>
+        <shortIdentifier>${authShortIdentifier}</shortIdentifier>
+        <vocabType>PersonAuthority</vocabType>
+        <description>This is a test Person Authority.</description>
+    </ns2:personauthorities_common>
+</document>
+
+
index 8204bb32fa1f348b7e517d0cdf4e8656db091cde..46032979598aeedd26bcf56876240ab547ed1737 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="persons">\r
-    <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-        <personTermGroupList>\r
-            <personTermGroup>\r
-                <termDisplayName>${itemDisplayName}</termDisplayName>\r
-            </personTermGroup>   \r
-        </personTermGroupList>\r
-        <shortIdentifier>${itemShortIdentifier}</shortIdentifier>\r
-        <bioNote>${itemBioNote}</bioNote>\r
-        <foreName>${itemDisplayName}</foreName>\r
-    </ns2:persons_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+    <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <personTermGroupList>
+            <personTermGroup>
+                <termDisplayName>${itemDisplayName}</termDisplayName>
+            </personTermGroup>   
+        </personTermGroupList>
+        <shortIdentifier>${itemShortIdentifier}</shortIdentifier>
+        <bioNote>${itemBioNote}</bioNote>
+        <foreName>${itemDisplayName}</foreName>
+    </ns2:persons_common>
+</document>
index 15cd5c2539afecfe5ac4fcf52bdac82c7e99f18c..05e038d45eb1a3e938325e0a8be01c52f053966e 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <pageNum>0</pageNum>\r
-    <pageSize>${numItems}</pageSize>\r
-    <itemsInPage>${numItems}</itemsInPage>\r
-</ns2:abstract-common-list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <pageNum>0</pageNum>
+    <pageSize>${numItems}</pageSize>
+    <itemsInPage>${numItems}</itemsInPage>
+</ns2:abstract-common-list>
+
index ddeb006533806fda1e5d1b2c6477d1d8688a9bdf..16424a357dc1f73bc15ab15ee4cad63645bfb532 100644 (file)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <totalItems>1</totalItems>\r
-    <list-item>\r
-        <shortIdentifier>${itemShortIdentifier}</shortIdentifier>\r
-    </list-item>\r
-</ns2:abstract-common-list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <totalItems>1</totalItems>
+    <list-item>
+        <shortIdentifier>${itemShortIdentifier}</shortIdentifier>
+    </list-item>
+</ns2:abstract-common-list>
+
index 15cd5c2539afecfe5ac4fcf52bdac82c7e99f18c..05e038d45eb1a3e938325e0a8be01c52f053966e 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <pageNum>0</pageNum>\r
-    <pageSize>${numItems}</pageSize>\r
-    <itemsInPage>${numItems}</itemsInPage>\r
-</ns2:abstract-common-list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <pageNum>0</pageNum>
+    <pageSize>${numItems}</pageSize>
+    <itemsInPage>${numItems}</itemsInPage>
+</ns2:abstract-common-list>
+
index 45892e451f65560ae4617c2455c2c01b56fa30e6..8d75fba8cdc53628e94d65c55855b64b722ed752 100644 (file)
@@ -1,27 +1,27 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <totalItems>3</totalItems>\r
-    <!--\r
-      Note that tests verifying this specific response may either fail, or\r
-      return a non-fatal NESTED_ERROR, if the order of the list items below\r
-      changes. (This response assumes that items are both returned in reverse\r
-      chronological order by update timestamp (collectionspace_core:updatedAt),\r
-      and that they are created in timestamp order by the order of tests in\r
-      the control file.)\r
-      \r
-      If the list items order changes, you can: reorder the following\r
-      list-items appropriately; remove those items entirely, relying solely\r
-      on the <totalItems> value and not on the actual items returned; or\r
-      rewrite the test and/or response using more sophisticated techniques.\r
-    -->\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item3</shortIdentifier>\r
-    </list-item>\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item2</shortIdentifier>\r
-    </list-item>\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item1</shortIdentifier>\r
-    </list-item>\r
-</ns2:abstract-common-list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <totalItems>3</totalItems>
+    <!--
+      Note that tests verifying this specific response may either fail, or
+      return a non-fatal NESTED_ERROR, if the order of the list items below
+      changes. (This response assumes that items are both returned in reverse
+      chronological order by update timestamp (collectionspace_core:updatedAt),
+      and that they are created in timestamp order by the order of tests in
+      the control file.)
+      
+      If the list items order changes, you can: reorder the following
+      list-items appropriately; remove those items entirely, relying solely
+      on the <totalItems> value and not on the actual items returned; or
+      rewrite the test and/or response using more sophisticated techniques.
+    -->
+    <list-item>
+        <shortIdentifier>${createPersonAuthority1.word1}item3</shortIdentifier>
+    </list-item>
+    <list-item>
+        <shortIdentifier>${createPersonAuthority1.word1}item2</shortIdentifier>
+    </list-item>
+    <list-item>
+        <shortIdentifier>${createPersonAuthority1.word1}item1</shortIdentifier>
+    </list-item>
+</ns2:abstract-common-list>
+
index e0c43540b356df44c4eb4bb290db5dec00a19308..54f8d48181c44a453ad2cc7c549489744795e783 100644 (file)
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <totalItems>2</totalItems>\r
-    <!--\r
-      Note that tests verifying this specific response may either fail, or\r
-      return a non-fatal NESTED_ERROR, if the order of the list items below\r
-      changes. (This response assumes that items are both returned in reverse\r
-      chronological order by update timestamp (collectionspace_core:updatedAt),\r
-      and that they are created in timestamp order by the order of tests in\r
-      the control file.)\r
-      \r
-      If the list items order changes, you can: reorder the following\r
-      list-items appropriately; remove those items entirely, relying solely\r
-      on the <totalItems> value and not on the actual items returned; or\r
-      rewrite the test and/or response using more sophisticated techniques.\r
-    -->\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item3</shortIdentifier>\r
-    </list-item>\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item1</shortIdentifier>\r
-    </list-item>\r
-</ns2:abstract-common-list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <totalItems>2</totalItems>
+    <!--
+      Note that tests verifying this specific response may either fail, or
+      return a non-fatal NESTED_ERROR, if the order of the list items below
+      changes. (This response assumes that items are both returned in reverse
+      chronological order by update timestamp (collectionspace_core:updatedAt),
+      and that they are created in timestamp order by the order of tests in
+      the control file.)
+      
+      If the list items order changes, you can: reorder the following
+      list-items appropriately; remove those items entirely, relying solely
+      on the <totalItems> value and not on the actual items returned; or
+      rewrite the test and/or response using more sophisticated techniques.
+    -->
+    <list-item>
+        <shortIdentifier>${createPersonAuthority1.word1}item3</shortIdentifier>
+    </list-item>
+    <list-item>
+        <shortIdentifier>${createPersonAuthority1.word1}item1</shortIdentifier>
+    </list-item>
+</ns2:abstract-common-list>
+
index 50f513dcecb0a245d8e3247f20738a7096659f43..fb035fcb4e0e19b74aab6bed065bce52a25cf8d7 100644 (file)
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <totalItems>1</totalItems>\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item2</shortIdentifier>\r
-    </list-item>\r
-</ns2:abstract-common-list>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <totalItems>1</totalItems>
+    <list-item>
+        <shortIdentifier>${createPersonAuthority1.word1}item2</shortIdentifier>
+    </list-item>
+</ns2:abstract-common-list>
+
+
index 414f53a51ab194e2cfedba5e089dc0f40d97cf49..ff361053f45a00b779a78865f23a60e6fa3cb20a 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-       <!-- \r
-                        testGroup ID="person" is not live.  It works, but may not clean up correctly. \r
-                        For now, use ID="updatePerson"\r
-       -->\r
-       <testGroup ID="AuthRefs" autoDeletePOSTS="true">\r
-               <test ID="PersonAuth1" auth="admin@core.collectionspace.org">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/personauthorities/</uri>\r
-                       <filename>authrefs/newPersonAuthority.xml</filename>\r
-               </test>\r
-               <test ID="Person1">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-                       <filename>authrefs/newPerson1.xml</filename>\r
-               </test>\r
-               <test ID="Person2">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-                       <filename>authrefs/newPerson2.xml</filename>\r
-               </test>\r
-\r
-        <test ID="GetPerson1">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>\r
-               </test>\r
-\r
-        <test ID="GetPerson2">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>\r
-               </test>\r
-\r
-               <test ID="loanout1" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">42</var>\r
-                               <var ID="person">${GetPerson1.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout2" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">102</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout3" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">103</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout4" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">104</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout5" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">105</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout6" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">106</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout7" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">107</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout8" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">108</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout9" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">109</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout10" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">110</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="UpdatePerson1">\r
-                       <method>PUT</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>\r
-                       <filename>authrefs/updatePerson1.xml</filename>\r
-               </test>\r
-\r
-               <test ID="UpdatePerson2">\r
-                       <method>PUT</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>\r
-                       <filename>authrefs/updatePerson2.xml</filename>\r
-               </test>\r
-\r
-        <test ID="GetFirstUpdatedPerson">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>authrefs/updatePerson1.xml</filename>\r
-                       </response>\r
-               </test>\r
-\r
-        <test ID="GetSecondUpdatedPerson">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>authrefs/updatePerson2.xml</filename>\r
-                       </response>\r
-               </test>\r
-\r
-               <test ID="afterUpdateGetLoan1">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/loansout/${loanout1.CSID}</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <label>loansout_common</label>\r
-                               <filename>authrefs/res/loanout.res.xml</filename>\r
-                               <vars>\r
-                                       <var ID="person">${GetFirstUpdatedPerson.got("//refName")}</var>\r
-                               </vars>\r
-                        </response>\r
-               </test>\r
-               \r
-               <test ID="afterUpdateGetLoan2">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/loansout/${loanout2.CSID}</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <label>loansout_common</label>\r
-                               <filename>authrefs/res/loanout.res.xml</filename>\r
-                               <vars>\r
-                                       <var ID="person">${GetSecondUpdatedPerson.got("//refName")}</var>\r
-                               </vars>\r
-                        </response>\r
-               </test>\r
-               <test ID="afterUpdateGetLoan5">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/loansout/${loanout5.CSID}</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <label>loansout_common</label>\r
-                               <filename>authrefs/res/loanout.res.xml</filename>\r
-                               <vars>\r
-                                       <var ID="person">${GetSecondUpdatedPerson.got("//refName")}</var>\r
-                               </vars>\r
-                        </response>\r
-               </test>\r
-               <test ID="afterUpdateGetLoan9">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/loansout/${loanout9.CSID}</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <label>loansout_common</label>\r
-                               <filename>authrefs/res/loanout.res.xml</filename>\r
-                               <vars>\r
-                                       <var ID="person">${GetSecondUpdatedPerson.got("//refName")}</var>\r
-                               </vars>\r
-                        </response>\r
-               </test>\r
-\r
-       </testGroup>\r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+       <!-- 
+                        testGroup ID="person" is not live.  It works, but may not clean up correctly. 
+                        For now, use ID="updatePerson"
+       -->
+       <testGroup ID="AuthRefs" autoDeletePOSTS="true">
+               <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/</uri>
+                       <filename>authrefs/newPersonAuthority.xml</filename>
+               </test>
+               <test ID="Person1">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+                       <filename>authrefs/newPerson1.xml</filename>
+               </test>
+               <test ID="Person2">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+                       <filename>authrefs/newPerson2.xml</filename>
+               </test>
+
+        <test ID="GetPerson1">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+               </test>
+
+        <test ID="GetPerson2">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
+               </test>
+
+               <test ID="loanout1" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">42</var>
+                               <var ID="person">${GetPerson1.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout2" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">102</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout3" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">103</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout4" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">104</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout5" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">105</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout6" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">106</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout7" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">107</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout8" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">108</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout9" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">109</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout10" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">110</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="UpdatePerson1">
+                       <method>PUT</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+                       <filename>authrefs/updatePerson1.xml</filename>
+               </test>
+
+               <test ID="UpdatePerson2">
+                       <method>PUT</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
+                       <filename>authrefs/updatePerson2.xml</filename>
+               </test>
+
+        <test ID="GetFirstUpdatedPerson">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <filename>authrefs/updatePerson1.xml</filename>
+                       </response>
+               </test>
+
+        <test ID="GetSecondUpdatedPerson">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <filename>authrefs/updatePerson2.xml</filename>
+                       </response>
+               </test>
+
+               <test ID="afterUpdateGetLoan1">
+                       <method>GET</method>
+                       <uri>/cspace-services/loansout/${loanout1.CSID}</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <label>loansout_common</label>
+                               <filename>authrefs/res/loanout.res.xml</filename>
+                               <vars>
+                                       <var ID="person">${GetFirstUpdatedPerson.got("//refName")}</var>
+                               </vars>
+                        </response>
+               </test>
+               
+               <test ID="afterUpdateGetLoan2">
+                       <method>GET</method>
+                       <uri>/cspace-services/loansout/${loanout2.CSID}</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <label>loansout_common</label>
+                               <filename>authrefs/res/loanout.res.xml</filename>
+                               <vars>
+                                       <var ID="person">${GetSecondUpdatedPerson.got("//refName")}</var>
+                               </vars>
+                        </response>
+               </test>
+               <test ID="afterUpdateGetLoan5">
+                       <method>GET</method>
+                       <uri>/cspace-services/loansout/${loanout5.CSID}</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <label>loansout_common</label>
+                               <filename>authrefs/res/loanout.res.xml</filename>
+                               <vars>
+                                       <var ID="person">${GetSecondUpdatedPerson.got("//refName")}</var>
+                               </vars>
+                        </response>
+               </test>
+               <test ID="afterUpdateGetLoan9">
+                       <method>GET</method>
+                       <uri>/cspace-services/loansout/${loanout9.CSID}</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <label>loansout_common</label>
+                               <filename>authrefs/res/loanout.res.xml</filename>
+                               <vars>
+                                       <var ID="person">${GetSecondUpdatedPerson.got("//refName")}</var>
+                               </vars>
+                        </response>
+               </test>
+
+       </testGroup>
+</xmlReplay>
index 6100d1feb5499b925145e750131515c05151b602..18f76bd43009ba4bde9ca97f7508554dba6f07bc 100644 (file)
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-       <!-- \r
-                        testGroup ID="person" is not live.  It works, but may not clean up correctly. \r
-                        For now, use ID="updatePerson"\r
-       -->\r
-       <testGroup ID="AuthRefsComplex" autoDeletePOSTS="true">\r
-               <test ID="intake1" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/intakes/</uri>\r
-                       <filename>authrefs/intake1.xml</filename>\r
-               </test>\r
-\r
-               <test ID="getIntakeAuthRefs">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/intakes/${intake1.CSID}/authorityrefs</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>authrefs/res/intakesAuthRefs.res.xml</filename>\r
-                        </response>\r
-               </test>\r
-\r
-       </testGroup>\r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+       <!-- 
+                        testGroup ID="person" is not live.  It works, but may not clean up correctly. 
+                        For now, use ID="updatePerson"
+       -->
+       <testGroup ID="AuthRefsComplex" autoDeletePOSTS="true">
+               <test ID="intake1" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/intakes/</uri>
+                       <filename>authrefs/intake1.xml</filename>
+               </test>
+
+               <test ID="getIntakeAuthRefs">
+                       <method>GET</method>
+                       <uri>/cspace-services/intakes/${intake1.CSID}/authorityrefs</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <filename>authrefs/res/intakesAuthRefs.res.xml</filename>
+                        </response>
+               </test>
+
+       </testGroup>
+</xmlReplay>
index 66adebb962fcf47a39925fca07c5a21aeeefc106..8f55a0d81e932b88239cb04a438e01741b5e0c73 100644 (file)
@@ -1,98 +1,98 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-       <!-- \r
-                        testGroup ID="person" is not live.  It works, but may not clean up correctly. \r
-                        For now, use ID="updatePerson"\r
-       -->\r
-       <testGroup ID="AuthRefsSimple" autoDeletePOSTS="true">\r
-               <test ID="PersonAuth1" auth="admin@core.collectionspace.org">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/personauthorities/</uri>\r
-                       <filename>authrefs/newPersonAuthority.xml</filename>\r
-               </test>\r
-               <test ID="Person1">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-                       <filename>authrefs/newPerson1.xml</filename>\r
-               </test>\r
-               <test ID="Person2">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-                       <filename>authrefs/newPerson2.xml</filename>\r
-               </test>\r
-\r
-        <test ID="GetPerson1">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>\r
-               </test>\r
-\r
-        <test ID="GetPerson2">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>\r
-               </test>\r
-\r
-               <test ID="loanout1" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">42</var>\r
-                               <var ID="person">${GetPerson1.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="loanout2" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansout/</uri>\r
-                       <filename>authrefs/loanout.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">102</var>\r
-                               <var ID="person">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="getLoan1AuthRefs">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/loansout/${loanout1.CSID}/authorityrefs</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>authrefs/res/foo.res.xml</filename>\r
-                        </response>\r
-               </test>\r
-\r
-               <test ID="getPerson1RefObjs">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>authrefs/res/refObjs.res.xml</filename>\r
-                        </response>\r
-               </test>\r
-\r
-               <test ID="OrganizationAuth1">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/orgauthorities/</uri>\r
-                       <filename>authrefs/orgauthorities_common.xml</filename>\r
-               </test>\r
\r
-               <test ID="Org1">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/</uri>\r
-                       <filename>authrefs/organizations_common.xml</filename>\r
-                       <vars>\r
-                               <var ID="person1">${GetPerson1.got("//refName")}</var>\r
-                               <var ID="person2">${GetPerson2.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="getOrg1AuthRefs">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Org1.CSID}/authorityrefs</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>authrefs/res/foo.res.xml</filename>\r
-                        </response>\r
-               </test>\r
-\r
-       </testGroup>\r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+       <!-- 
+                        testGroup ID="person" is not live.  It works, but may not clean up correctly. 
+                        For now, use ID="updatePerson"
+       -->
+       <testGroup ID="AuthRefsSimple" autoDeletePOSTS="true">
+               <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/</uri>
+                       <filename>authrefs/newPersonAuthority.xml</filename>
+               </test>
+               <test ID="Person1">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+                       <filename>authrefs/newPerson1.xml</filename>
+               </test>
+               <test ID="Person2">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+                       <filename>authrefs/newPerson2.xml</filename>
+               </test>
+
+        <test ID="GetPerson1">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+               </test>
+
+        <test ID="GetPerson2">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
+               </test>
+
+               <test ID="loanout1" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">42</var>
+                               <var ID="person">${GetPerson1.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="loanout2" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/loansout/</uri>
+                       <filename>authrefs/loanout.xml</filename>
+                       <vars>
+                               <var ID="loannum">102</var>
+                               <var ID="person">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="getLoan1AuthRefs">
+                       <method>GET</method>
+                       <uri>/cspace-services/loansout/${loanout1.CSID}/authorityrefs</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <filename>authrefs/res/foo.res.xml</filename>
+                        </response>
+               </test>
+
+               <test ID="getPerson1RefObjs">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <filename>authrefs/res/refObjs.res.xml</filename>
+                        </response>
+               </test>
+
+               <test ID="OrganizationAuth1">
+                       <method>POST</method>
+                       <uri>/cspace-services/orgauthorities/</uri>
+                       <filename>authrefs/orgauthorities_common.xml</filename>
+               </test>
+               <test ID="Org1">
+                       <method>POST</method>
+                       <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/</uri>
+                       <filename>authrefs/organizations_common.xml</filename>
+                       <vars>
+                               <var ID="person1">${GetPerson1.got("//refName")}</var>
+                               <var ID="person2">${GetPerson2.got("//refName")}</var>
+                       </vars>
+               </test>
+
+               <test ID="getOrg1AuthRefs">
+                       <method>GET</method>
+                       <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Org1.CSID}/authorityrefs</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <filename>authrefs/res/foo.res.xml</filename>
+                        </response>
+               </test>
+
+       </testGroup>
+</xmlReplay>
index 8fab390db97b82d6eb8d57eb4df6ce57e8f70857..e9e1925cbf7bffdb90c43421b5e2c8997d2e0d4e 100644 (file)
@@ -1,62 +1,62 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-       <!-- \r
-                        testGroup ID="person" is not live.  It works, but may not clean up correctly. \r
-                        For now, use ID="updatePerson"\r
-       -->\r
-       <testGroup ID="AuthRefsSimple2" autoDeletePOSTS="true">\r
-               <test ID="PersonAuth1" auth="admin@core.collectionspace.org">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/personauthorities/</uri>\r
-                       <filename>authrefs/newPersonAuthority.xml</filename>\r
-               </test>\r
-               <test ID="Person1">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-                       <filename>authrefs/newPerson1.xml</filename>\r
-               </test>\r
-\r
-        <test ID="GetPerson1">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>\r
-               </test>\r
-\r
-               <test ID="loanin1" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/loansin/</uri>\r
-                       <filename>authrefs/loanin.xml</filename>\r
-                       <vars>\r
-                               <var ID="loannum">42</var>\r
-                               <var ID="person">${GetPerson1.got("//refName")}</var>\r
-                       </vars>\r
-               </test>\r
-\r
-               <test ID="getloanin1" auth="test">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/loansin/${loanin1.CSID}/</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>authrefs/res/foo.res.xml</filename>\r
-                        </response>\r
-               </test>\r
-\r
-               <test ID="getLoan1AuthRefs">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/loansin/${loanin1.CSID}/authorityrefs</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>authrefs/res/foo.res.xml</filename>\r
-                        </response>\r
-               </test>\r
-\r
-               <test ID="getPerson1RefObjs">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>\r
-                       <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>authrefs/res/refObjs.res.xml</filename>\r
-                        </response>\r
-               </test>\r
-\r
-       </testGroup>\r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+       <!-- 
+                        testGroup ID="person" is not live.  It works, but may not clean up correctly. 
+                        For now, use ID="updatePerson"
+       -->
+       <testGroup ID="AuthRefsSimple2" autoDeletePOSTS="true">
+               <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/</uri>
+                       <filename>authrefs/newPersonAuthority.xml</filename>
+               </test>
+               <test ID="Person1">
+                       <method>POST</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+                       <filename>authrefs/newPerson1.xml</filename>
+               </test>
+
+        <test ID="GetPerson1">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+               </test>
+
+               <test ID="loanin1" 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="getloanin1" auth="test">
+                       <method>GET</method>
+                       <uri>/cspace-services/loansin/${loanin1.CSID}/</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <filename>authrefs/res/foo.res.xml</filename>
+                        </response>
+               </test>
+
+               <test ID="getLoan1AuthRefs">
+                       <method>GET</method>
+                       <uri>/cspace-services/loansin/${loanin1.CSID}/authorityrefs</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <filename>authrefs/res/foo.res.xml</filename>
+                        </response>
+               </test>
+
+               <test ID="getPerson1RefObjs">
+                       <method>GET</method>
+                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+                       <response>
+                               <expected level="ADDOK" />
+                               <filename>authrefs/res/refObjs.res.xml</filename>
+                        </response>
+               </test>
+
+       </testGroup>
+</xmlReplay>
index dc8d5f4f2830c1b48352d8c67e74875e2aeaf5d2..20321e13227d2cb1720d382217e525badb0e8e4f 100644 (file)
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="loansin">\r
-    <ns2:loansin_common xmlns:ns2="http://collectionspace.org/services/loanin"\r
-        xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-        <loanInNumber>loaninNumber-${loannum}</loanInNumber>\r
-        <lenderGroupList>\r
-            <lenderGroup>\r
-                <lendersAuthorizationDate>October 29, 2009</lendersAuthorizationDate>\r
-                <lender>${person}</lender>\r
-            </lenderGroup>\r
-        </lenderGroupList>\r
-        <loanPurpose>For Surfboards of the 1960s exhibition.</loanPurpose>\r
-        <loanInConditions>Loan in conditions.</loanInConditions>\r
-    </ns2:loansin_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="loansin">
+    <ns2:loansin_common xmlns:ns2="http://collectionspace.org/services/loanin"
+        xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <loanInNumber>loaninNumber-${loannum}</loanInNumber>
+        <lenderGroupList>
+            <lenderGroup>
+                <lendersAuthorizationDate>October 29, 2009</lendersAuthorizationDate>
+                <lender>${person}</lender>
+            </lenderGroup>
+        </lenderGroupList>
+        <loanPurpose>For Surfboards of the 1960s exhibition.</loanPurpose>
+        <loanInConditions>Loan in conditions.</loanInConditions>
+    </ns2:loansin_common>
+</document>
index 01634aa30979926dd3d9cc06879eead6c55eac92..b011e81226b139b94ec9bc1d431a88077c5616b2 100644 (file)
@@ -1,21 +1,21 @@
-<!--\r
-       THIS SEEMS TO BE UNUSED.  PLEASE VERIFY AND REMOVE THIS FILE FROM OUR SOURCE CONTROL REPOSITORY. \r
- -->\r
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-       <inAuthority>4a6dc8f3-3329-4c5d-a1a8</inAuthority>\r
-       <shortIdentifier>connieContactPerson</shortIdentifier>\r
-       <refName>urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth':person:name(connieContactPerson)</refName>\r
-       \r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>Connie ContactPerson</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>Connie ContactPerson</termDisplayName>\r
-                       <termStatus>${termStatus}</termStatus>\r
-                       <foreName>Connie</foreName>\r
-                       <surName>ContactPerson</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>\r
-       \r
+<!--
+       THIS SEEMS TO BE UNUSED.  PLEASE VERIFY AND REMOVE THIS FILE FROM OUR SOURCE CONTROL REPOSITORY. 
+ -->
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+       <inAuthority>4a6dc8f3-3329-4c5d-a1a8</inAuthority>
+       <shortIdentifier>connieContactPerson</shortIdentifier>
+       <refName>urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth':person:name(connieContactPerson)</refName>
+       
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>Connie ContactPerson</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>Connie ContactPerson</termDisplayName>
+                       <termStatus>${termStatus}</termStatus>
+                       <foreName>Connie</foreName>
+                       <surName>ContactPerson</surName>
+               </personTermGroup>
+       </personTermGroupList>
+       
 </ns2:persons_common>
\ No newline at end of file
index 308cf12152c07e5dea015ba8279bb417eca6598b..82b75401dc581aa766fa7539f29a8928e3d9b532 100644 (file)
@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="persons">\r
-       <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-               <shortIdentifier>connieContactPerson</shortIdentifier>\r
-       \r
-               <personTermGroupList>\r
-                       <personTermGroup>\r
-                               <termName>Connie ContactPerson</termName>\r
-                               <termPrefForLang>false</termPrefForLang>\r
-                               <termDisplayName>Connie ContactPerson</termDisplayName>\r
-                               <termStatus>${termStatus}</termStatus>\r
-                               <foreName>Connie</foreName>\r
-                               <surName>ContactPerson</surName>\r
-                       </personTermGroup>\r
-               </personTermGroupList>\r
-               \r
-       </ns2:persons_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+       <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <shortIdentifier>connieContactPerson</shortIdentifier>
+       
+               <personTermGroupList>
+                       <personTermGroup>
+                               <termName>Connie ContactPerson</termName>
+                               <termPrefForLang>false</termPrefForLang>
+                               <termDisplayName>Connie ContactPerson</termDisplayName>
+                               <termStatus>${termStatus}</termStatus>
+                               <foreName>Connie</foreName>
+                               <surName>ContactPerson</surName>
+                       </personTermGroup>
+               </personTermGroupList>
+               
+       </ns2:persons_common>
+</document>
index 610c72e45afc001c5c5ecf43bee92ac74c1bf8f5..16f889aa4c69cfdb09f7330cc568488485c90bcc 100644 (file)
@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="persons">\r
-       <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-       <shortIdentifier>debbieDoNothingPerson</shortIdentifier>\r
-       \r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>Debbie DoNothingPerson</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>Debbie DoNothingPerson</termDisplayName>\r
-                       <termStatus>${termStatus}</termStatus>\r
-                       <foreName>Debbie</foreName>\r
-                       <surName>DoNothingPerson</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>\r
-       \r
-       </ns2:persons_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+       <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+       <shortIdentifier>debbieDoNothingPerson</shortIdentifier>
+       
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>Debbie DoNothingPerson</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>Debbie DoNothingPerson</termDisplayName>
+                       <termStatus>${termStatus}</termStatus>
+                       <foreName>Debbie</foreName>
+                       <surName>DoNothingPerson</surName>
+               </personTermGroup>
+       </personTermGroupList>
+       
+       </ns2:persons_common>
+</document>
index 86f4d56be0a3855bf3a9a3e45cde48860138d961..86a8b4048f1e8ab3dc12cb5d0fe28e2d9068fdc6 100644 (file)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="personauthorities">\r
-       <ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-               <displayName>TestPersonAuth</displayName>\r
-               <shortIdentifier>TestPersonAuth</shortIdentifier>\r
-               <vocabType>PersonAuthority</vocabType>\r
-       </ns2:personauthorities_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="personauthorities">
+       <ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <displayName>TestPersonAuth</displayName>
+               <shortIdentifier>TestPersonAuth</shortIdentifier>
+               <vocabType>PersonAuthority</vocabType>
+       </ns2:personauthorities_common>
+</document>
index 0b392fdd4983d03e3757c99aeba9703ac06fff5c..54ba9261797a3a0d6ed302d90b77aad4b0acc715 100644 (file)
@@ -1,46 +1,46 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="organizations">\r
-       <ns2:organizations_common xmlns:ns2="http://collectionspace.org/services/organization"\r
-               xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-               <shortIdentifier>1288047801161</shortIdentifier>\r
-\r
-               <orgTermGroupList>\r
-                       <orgTermGroup>\r
-                               <additionsToName/>\r
-                               <termName>Test Organization-1288047801161</termName>\r
-                               <termSource/>\r
-                               <termSourceID/>\r
-                               <termSourceNote/>\r
-                               <termLanguage/>\r
-                               <termPrefForLang>false</termPrefForLang>\r
-                               <termDisplayName>Test Organization Name</termDisplayName>\r
-                               <termType/>\r
-                               <termStatus/>\r
-                               <termQualifier/>\r
-                               <termSourceDetail/>\r
-                       </orgTermGroup>\r
-               </orgTermGroupList>\r
-\r
-               <contactNames>\r
-                       <contactName>${person1}</contactName>\r
-                       <contactName>${person2}</contactName>\r
-               </contactNames>\r
-               <foundingPlace>Anytown, USA</foundingPlace>\r
-               <subBodies>\r
-                       <subBody>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161):organization:name(1288047803708)</subBody>\r
-               </subBodies>\r
-               <functions>\r
-                       <function>My new function</function>\r
-                       <function>My second function</function>\r
-               </functions>\r
-               <groups>\r
-                       <group>My new group</group>\r
-                       <group>My second group</group>\r
-                       <group>My third group</group>\r
-               </groups>\r
-               <description>This is a test Authority item</description>\r
-               <source>Some mythical book</source>\r
-               <sourcePage>Let's say page 39</sourcePage>\r
-\r
-       </ns2:organizations_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="organizations">
+       <ns2:organizations_common xmlns:ns2="http://collectionspace.org/services/organization"
+               xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <shortIdentifier>1288047801161</shortIdentifier>
+
+               <orgTermGroupList>
+                       <orgTermGroup>
+                               <additionsToName/>
+                               <termName>Test Organization-1288047801161</termName>
+                               <termSource/>
+                               <termSourceID/>
+                               <termSourceNote/>
+                               <termLanguage/>
+                               <termPrefForLang>false</termPrefForLang>
+                               <termDisplayName>Test Organization Name</termDisplayName>
+                               <termType/>
+                               <termStatus/>
+                               <termQualifier/>
+                               <termSourceDetail/>
+                       </orgTermGroup>
+               </orgTermGroupList>
+
+               <contactNames>
+                       <contactName>${person1}</contactName>
+                       <contactName>${person2}</contactName>
+               </contactNames>
+               <foundingPlace>Anytown, USA</foundingPlace>
+               <subBodies>
+                       <subBody>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161):organization:name(1288047803708)</subBody>
+               </subBodies>
+               <functions>
+                       <function>My new function</function>
+                       <function>My second function</function>
+               </functions>
+               <groups>
+                       <group>My new group</group>
+                       <group>My second group</group>
+                       <group>My third group</group>
+               </groups>
+               <description>This is a test Authority item</description>
+               <source>Some mythical book</source>
+               <sourcePage>Let's say page 39</sourcePage>
+
+       </ns2:organizations_common>
+</document>
index 0fef4cf3e34b4670c7da6590b1eea765409bfc63..9f13ff011bc09081ad818322f067625849c07f2f 100644 (file)
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="orgauthorities">\r
-       <ns2:orgauthorities_common xmlns:ns2="http://collectionspace.org/services/organization"\r
-               xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-               <shortIdentifier>1288047801161</shortIdentifier>\r
-               <displayName>TestOrgAuth-1288047801161</displayName>\r
-               <vocabType>OrgAuthority</vocabType>\r
-               <description>This is a test authority</description>\r
-               <source>Some mythical book</source>\r
-       </ns2:orgauthorities_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="orgauthorities">
+       <ns2:orgauthorities_common xmlns:ns2="http://collectionspace.org/services/organization"
+               xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <shortIdentifier>1288047801161</shortIdentifier>
+               <displayName>TestOrgAuth-1288047801161</displayName>
+               <vocabType>OrgAuthority</vocabType>
+               <description>This is a test authority</description>
+               <source>Some mythical book</source>
+       </ns2:orgauthorities_common>
+</document>
index 635f8dbe41e2107f5082349bf8dcf5cb838f8547..a0ae9e4974398a3d060471ba083520d44e14078c 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns3:authority-ref-doc-list xmlns:ns2="http://collectionspace.org/services/jaxb"\r
-    xmlns:ns3="http://collectionspace.org/services/common/authorityref">\r
-    <itemsInPage>1</itemsInPage>\r
-    <totalItems>1</totalItems>\r
-</ns3:authority-ref-doc-list>\r
+<?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>1</itemsInPage>
+    <totalItems>1</totalItems>
+</ns3:authority-ref-doc-list>
index ff4147715fe07a62173faee97b06a5fba3f6212d..f1730403fff88c4b85d28aa9a35ce8a0fefd499e 100644 (file)
@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="persons">\r
-       <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-               <shortIdentifier>connieContactPerson</shortIdentifier>\r
-               \r
-               <personTermGroupList>\r
-                       <personTermGroup>\r
-                               <termName>Connie ContactPerson</termName>\r
-                               <termPrefForLang>false</termPrefForLang>\r
-                               <termDisplayName>Connie ContactPerson</termDisplayName>\r
-                               <termStatus>${termStatus}</termStatus>\r
-                               <foreName>Connie</foreName>\r
-                               <surName>ContactPersonlity</surName>\r
-                       </personTermGroup>\r
-               </personTermGroupList>\r
-               \r
-       </ns2:persons_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+       <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <shortIdentifier>connieContactPerson</shortIdentifier>
+               
+               <personTermGroupList>
+                       <personTermGroup>
+                               <termName>Connie ContactPerson</termName>
+                               <termPrefForLang>false</termPrefForLang>
+                               <termDisplayName>Connie ContactPerson</termDisplayName>
+                               <termStatus>${termStatus}</termStatus>
+                               <foreName>Connie</foreName>
+                               <surName>ContactPersonlity</surName>
+                       </personTermGroup>
+               </personTermGroupList>
+               
+       </ns2:persons_common>
+</document>
index 89508b600d7fbb8d5c70f970890422acc48f04ad..824664b1c49b2af179c1f8d9d7e0de34f6dbd7b1 100644 (file)
@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="persons">\r
-       <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-               <shortIdentifier>debbieDoNothingPerson</shortIdentifier>\r
-       \r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>Debbie DoNothingPerson</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>Debbie DoNothingPerson</termDisplayName>\r
-                       <termStatus>${termStatus}</termStatus>\r
-                       <foreName>Debbie</foreName>\r
-                       <surName>Do Nothing Personality</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>\r
-       \r
-       </ns2:persons_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+       <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <shortIdentifier>debbieDoNothingPerson</shortIdentifier>
+       
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>Debbie DoNothingPerson</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>Debbie DoNothingPerson</termDisplayName>
+                       <termStatus>${termStatus}</termStatus>
+                       <foreName>Debbie</foreName>
+                       <surName>Do Nothing Personality</surName>
+               </personTermGroup>
+       </personTermGroupList>
+       
+       </ns2:persons_common>
+</document>
index c6253a472d4ca3f34858cda1003b98433cd2d4ff..8f0cfd6275cc04b30f1b1a948897e78b7912c32b 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="batch">\r
-    <ns2:batch_common\r
-        xmlns:ns2="http://collectionspace.org/services/batch"\r
-        xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-        <name>TestUpdateObjectLocationBatchJob</name>\r
-        <forDocTypes>\r
-            <forDocType>CollectionObject</forDocType>\r
-        </forDocTypes>\r
-        <supportsSingleDoc>true</supportsSingleDoc>\r
-        <supportsDocList>true</supportsDocList>\r
-        <supportsGroup>true</supportsGroup>\r
-        <supportsNoContext>true</supportsNoContext>\r
-        <createsNewFocus>false</createsNewFocus>\r
-        <className>org.collectionspace.services.batch.nuxeo.UpdateObjectLocationBatchJob</className>\r
-    </ns2:batch_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="batch">
+    <ns2:batch_common
+        xmlns:ns2="http://collectionspace.org/services/batch"
+        xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <name>TestUpdateObjectLocationBatchJob</name>
+        <forDocTypes>
+            <forDocType>CollectionObject</forDocType>
+        </forDocTypes>
+        <supportsSingleDoc>true</supportsSingleDoc>
+        <supportsDocList>true</supportsDocList>
+        <supportsGroup>true</supportsGroup>
+        <supportsNoContext>true</supportsNoContext>
+        <createsNewFocus>false</createsNewFocus>
+        <className>org.collectionspace.services.batch.nuxeo.UpdateObjectLocationBatchJob</className>
+    </ns2:batch_common>
+</document>
index 7e47ad68883ec6850613559217246104d1f032f8..b200bc950f66397aa5f8245e78c7a7ceb5368de0 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="batch">\r
-    <ns2:batch_common\r
-        xmlns:ns2="http://collectionspace.org/services/batch"\r
-        xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-        <name>TestUpdateObjectLocationBatchJob</name>\r
-        <forDocTypes>\r
-            <forDocType>CollectionObject</forDocType>\r
-        </forDocTypes>\r
-        <supportsSingleDoc>true</supportsSingleDoc>\r
-        <supportsDocList>true</supportsDocList>\r
-        <supportsGroup>true</supportsGroup>\r
-        <supportsNoContext>false</supportsNoContext>\r
-        <createsNewFocus>false</createsNewFocus>\r
-        <className>org.collectionspace.services.batch.nuxeo.UpdateObjectLocationBatchJob</className>\r
-    </ns2:batch_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="batch">
+    <ns2:batch_common
+        xmlns:ns2="http://collectionspace.org/services/batch"
+        xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <name>TestUpdateObjectLocationBatchJob</name>
+        <forDocTypes>
+            <forDocType>CollectionObject</forDocType>
+        </forDocTypes>
+        <supportsSingleDoc>true</supportsSingleDoc>
+        <supportsDocList>true</supportsDocList>
+        <supportsGroup>true</supportsGroup>
+        <supportsNoContext>false</supportsNoContext>
+        <createsNewFocus>false</createsNewFocus>
+        <className>org.collectionspace.services.batch.nuxeo.UpdateObjectLocationBatchJob</className>
+    </ns2:batch_common>
+</document>
index 9d060f20f8460db5468a2f0912e37fb07cbb737e..e763789eb388c72101fbc30b0f9b06801587ad56 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-    xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-    xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <mode>group</mode>\r
-    <docType>CollectionObject</docType>\r
-    <singleCSID></singleCSID>\r
-    <groupCSID>${groupCSID}</groupCSID>\r
-    <listCSIDs></listCSIDs>\r
-    <params></params>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+    xmlns:ns2="http://collectionspace.org/services/common/invocable"
+    xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <mode>group</mode>
+    <docType>CollectionObject</docType>
+    <singleCSID></singleCSID>
+    <groupCSID>${groupCSID}</groupCSID>
+    <listCSIDs></listCSIDs>
+    <params></params>
+</ns2:invocationContext>
+
+
index 4ca90476fe77d06e0e669b46205a4be300780370..d64d11039c82553affa4b04a608238f357cfb013 100644 (file)
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-    xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-    xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <mode>list</mode>\r
-    <docType>CollectionObject</docType>\r
-    <singleCSID></singleCSID>\r
-    <groupCSID></groupCSID>\r
-    <listCSIDs>\r
-        <csid>${collectionObject1CSID}</csid>\r
-        <csid>${collectionObject2CSID}</csid>\r
-    </listCSIDs>\r
-    <params>\r
-        <param>\r
-            <key>some key</key>\r
-            <value>some value</value>\r
-        </param>\r
-    </params>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+    xmlns:ns2="http://collectionspace.org/services/common/invocable"
+    xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <mode>list</mode>
+    <docType>CollectionObject</docType>
+    <singleCSID></singleCSID>
+    <groupCSID></groupCSID>
+    <listCSIDs>
+        <csid>${collectionObject1CSID}</csid>
+        <csid>${collectionObject2CSID}</csid>
+    </listCSIDs>
+    <params>
+        <param>
+            <key>some key</key>
+            <value>some value</value>
+        </param>
+    </params>
+</ns2:invocationContext>
+
+
index 74d7b17d78efcdae962ade6e58100c83051e4e77..7d191dfed5b071f9f9322d990c170fc5a7094655 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-    xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-    xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <mode>nocontext</mode>\r
-    <docType>CollectionObject</docType>\r
-    <singleCSID></singleCSID>\r
-    <groupCSID></groupCSID>\r
-    <listCSIDs></listCSIDs>\r
-    <params></params>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+    xmlns:ns2="http://collectionspace.org/services/common/invocable"
+    xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <mode>nocontext</mode>
+    <docType>CollectionObject</docType>
+    <singleCSID></singleCSID>
+    <groupCSID></groupCSID>
+    <listCSIDs></listCSIDs>
+    <params></params>
+</ns2:invocationContext>
+
+
index beb1ccfa12fb3d1959bc24cf9399612ae9a67fb2..4eba76d877f0e64cf3651281c48e45f4b8c45183 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-    xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-    xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <mode>single</mode>\r
-    <docType>CollectionObject</docType>\r
-    <singleCSID>${collectionObjectCSID}</singleCSID>\r
-    <groupCSID></groupCSID>\r
-    <listCSIDs></listCSIDs>\r
-    <params></params>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+    xmlns:ns2="http://collectionspace.org/services/common/invocable"
+    xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <mode>single</mode>
+    <docType>CollectionObject</docType>
+    <singleCSID>${collectionObjectCSID}</singleCSID>
+    <groupCSID></groupCSID>
+    <listCSIDs></listCSIDs>
+    <params></params>
+</ns2:invocationContext>
+
+
index 439cc9e4b68fe13acd93a239e37da2d65af69a94..ec9577b47b63fe5d98fc6845335a6594476c7467 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-        <auth ID="admin@lifesci.collectionspace.org">YWRtaW5AbGlmZXNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-    </auths>\r
-        \r
-    <!-- This tests the UpdateObjectLocationBatchJob -->\r
-    <!-- in various invocation modes -->\r
-        \r
-    <testGroup ID="invocationModeSingle" autoDeletePOSTS="true">\r
-        \r
-        <!-- Tests with CollectionObject->Movement relations -->\r
-            \r
-        <test ID="createBatchRecord">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch</uri>\r
-            <filename>batch/batch-create-updateobjloc.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-                \r
-        <test ID="createCollectionObject">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/collectionobjects</uri>\r
-            <filename>batch/collObj1.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Seattle1358215545509)'Seattle, WA, USA'</var>\r
-                <var ID="locationDate">1900-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- The currentLocation value of this Movement record, which -->\r
-        <!-- has the most recent locationDate value, should also be -->\r
-        <!-- reflected in the computedCurrentLocation value in the -->\r
-        <!-- CollectionObject record after invoking the batch job. -->\r
-        <test ID="createMovement2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Portland1358215545512)'Portland, OR, USA'</var>\r
-                <var ID="locationDate">2000-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement3">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Victoria1358215545515)'Victoria, BC, Canada'</var>\r
-                <var ID="locationDate">1800-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObjectToMovement1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement1.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObjectToMovement2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement2.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObjectToMovement3">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement3.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- This post of a batch job invocation request doesn't create a new record, -->\r
-        <!-- so we need to exclude it from the post-run auto-deletion of records. -->\r
-        <test ID="invokeBatch" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObjectCSID">${createCollectionObject.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-\r
-        <!-- Verify that, following the invocation of the batch job, the -->\r
-        <!-- computedCurrentLocation field in the CollectionObject record has -->\r
-        <!-- been updated to the appropriate value, reflecting the most recent -->\r
-        <!-- movement (e.g. the Movement record with the most recent locationDate). -->\r
-        <test ID="readUpdatedCollectionObjectRecord">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- Tests with Movement->CollectionObject relations -->\r
-        \r
-        <!-- The currentLocation value of this new Movement record, which now -->\r
-        <!-- has the most recent locationDate value, should also be -->\r
-        <!-- reflected in the computedCurrentLocation value in the -->\r
-        <!-- CollectionObject record after invoking the batch job a second time. -->\r
-        <test ID="createMovement4">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Vancouver1358215545518)'Vancouver, BC, Canada'</var>\r
-                <var ID="locationDate">2100-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- Note that this payload reflects a reversal of the subject-object directionality -->\r
-        <!-- of the relationship: this is a Movement->CollectionObject relationship, -->\r
-        <!-- rather than a CollectionObject->Movement relationship. -->\r
-        <test ID="relateMovement4ToCollectionObject">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createMovement4.CSID}</var>\r
-                <var ID="subjectDocumentType">Movement</var>\r
-                <var ID="objectCsid">${createCollectionObject.CSID}</var>\r
-                <var ID="objectDocumentType">CollectionObject</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="invokeBatchAfterAddingReverseRelation" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObjectCSID">${createCollectionObject.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="readUpdatedCollectionObjectRecordAfterAddingReverseRelation">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement4.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- Test with a soft-deleted related Movement record -->\r
-        \r
-        <test ID="softDeleteMovement4">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/movements/${createMovement4.CSID}/workflow/delete</uri>\r
-            <expectedCodes>200</expectedCodes>\r
-            <!-- XmlReplay appears to require a filename on PUT. -->\r
-            <!-- If not present, throws "java.io.FileNotFoundException: File '' does not exist" -->\r
-            <!-- The contents of that file, sent in the PUT payload, will be ignored by the services. -->\r
-            <!-- Note that the filename below is in a different module than -->\r
-            <!-- the present XmlReplay control file. -->\r
-            <filename>relation/res/workflowState.res.xml</filename>\r
-            <vars>\r
-                <var ID="workflowState">deleted</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="invokeBatchAfterSoftDeletingMovement" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObjectCSID">${createCollectionObject.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- After soft-deleting related Movement record 4, the computedCurrentLocation -->\r
-        <!-- value should have reverted to the currentLocation value of Movement record 2. -->\r
-        <test ID="readUpdatedCollectionObjectRecordAfterSoftDeletingMovement">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- Test with a soft-deleted CollectionObject record -->\r
-\r
-        <!-- After deleting Movement record 2 outright, the computedCurrentLocation -->\r
-        <!-- value should then be drawn from the currentLocation value of Movement record 1, -->\r
-        <!-- the next most-recent Movement record. -->\r
-        <test ID="deleteMovement2">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/movements/${createMovement2.CSID}</uri>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- However, now we soft-delete the CollectionObject record itself. -->\r
-        <test ID="softDeleteCollectionObject">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}/workflow/delete</uri>\r
-            <expectedCodes>200</expectedCodes>\r
-            <filename>relation/res/workflowState.res.xml</filename>\r
-            <vars>\r
-                <var ID="workflowState">deleted</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="invokeBatchAfterSoftDeletingCollectionObject" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObjectCSID">${createCollectionObject.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- On re-reading the CollectionObject, its computedCurrentLocation -->\r
-        <!-- value should remain at its value prior to its having been soft-deleted. -->\r
-        <test ID="readUpdatedCollectionObjectRecordAfterSoftDeletion">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-    </testGroup>\r
-    \r
-    <testGroup ID="invocationModeSingleWithTiebreaker" autoDeletePOSTS="true">\r
-                    \r
-        <test ID="createBatchRecordWithTiebreaker">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch</uri>\r
-            <filename>batch/batch-create-updateobjloc.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-                \r
-        <test ID="createCollectionObjectWithTiebreaker">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/collectionobjects</uri>\r
-            <filename>batch/collObj1.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement1WithTiebreaker">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Olympia1358215545521)'Olympia, WA, USA'</var>\r
-                <var ID="locationDate">1900-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement2WithTiebreaker">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Ottawa1358215545567)'Ottawa, ON, Canada'</var>\r
-                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement3WithTiebreaker">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Spokane1358215545524)'Spokane, WA, USA'</var>\r
-                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObjectToMovement1WithTiebreaker">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObjectWithTiebreaker.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement1WithTiebreaker.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObjectToMovement2WithTiebreaker">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObjectWithTiebreaker.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement2WithTiebreaker.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-         \r
-        <test ID="relateCollectionObjectToMovement3WithTiebreaker">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObjectWithTiebreaker.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement3WithTiebreaker.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-\r
-        <test ID="modifyMovement1WithTiebreaker">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/movements/${createMovement1WithTiebreaker.CSID}</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Guadalajara13582155455562)'Guadalajara, Mexico'</var>\r
-                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
\r
-        <test ID="invokeBatchAfterMovement1ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObjectCSID">${createCollectionObjectWithTiebreaker.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test> \r
-        \r
-        <!-- Verify that, following the invocation of the batch job, the -->\r
-        <!-- computedCurrentLocation field in the CollectionObject record has -->\r
-        <!-- been updated to the appropriate value, reflecting the most recent -->\r
-        <!-- movement (e.g. the Movement record with the most recent locationDate, -->\r
-        <!-- and, as in this test group - where two Movement records have identical -->\r
-        <!-- locationDate values - the Movement record that has been updated most recently. -->\r
-        <test ID="readCollectionObjectAfterMovement1ModificationWithTiebreaker">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObjectWithTiebreaker.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${modifyMovement1WithTiebreaker.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>      \r
-\r
-        <test ID="modifyMovement2WithTiebreaker">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/movements/${createMovement2WithTiebreaker.CSID}</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Ecatepec13582155455560)'Ecatepec, Mexico'</var>\r
-                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
\r
-        <test ID="invokeBatchAfterMovement2ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObjectCSID">${createCollectionObjectWithTiebreaker.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test> \r
-        \r
-        <test ID="readCollectionObjectRecordAfterMovement2ModificationWithTiebreaker">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObjectWithTiebreaker.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${modifyMovement2WithTiebreaker.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="modifyMovement3WithTiebreaker">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/movements/${createMovement3WithTiebreaker.CSID}</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Calgary1358215545564)'Calgary, AB, Canada'</var>\r
-                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
\r
-        <test ID="invokeBatchAfterMovement3ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObjectCSID">${createCollectionObjectWithTiebreaker.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test> \r
-        \r
-        <test ID="readCollectionObjectRecordAfterMovement3ModificationWithTiebreaker">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObjectWithTiebreaker.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${modifyMovement3WithTiebreaker.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-            \r
-    </testGroup>\r
-    \r
-    <testGroup ID="invocationModeList" autoDeletePOSTS="true">\r
-        \r
-        <test ID="createBatchRecord">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch</uri>\r
-            <filename>batch/batch-create-updateobjloc.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-                \r
-        <test ID="createCollectionObject1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/collectionobjects</uri>\r
-            <filename>batch/collObj1.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createCollectionObject2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/collectionobjects</uri>\r
-            <filename>batch/collObj1.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Winnipeg13582155455568)'Winnipeg, MB, Canada'</var>\r
-                <var ID="locationDate">1900-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Saskatoon13582155455570)'Saskatoon, SK, Canada'</var>\r
-                <var ID="locationDate">2000-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement3">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Montreal13582155455570)'Montreal, QC, Canada'</var>\r
-                <var ID="locationDate">1800-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObject1ToMovement1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement1.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollection1ObjectToMovement2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement2.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObject2ToMovement3">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject2.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement3.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="invokeBatchWithList" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-list.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObject1CSID">${createCollectionObject1.CSID}</var>\r
-                <var ID="collectionObject2CSID">${createCollectionObject2.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- This CollectionObject record's computedCurrentLocation field should -->\r
-        <!-- have been updated with the currentLocation value from Movement record 2 -->\r
-        <test ID="readUpdatedCollectionObjectRecord1">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- This CollectionObject record's computedCurrentLocation field should -->\r
-        <!-- have been updated with the currentLocation value from Movement record 3 -->\r
-        <test ID="readUpdatedCollectionObjectRecord2">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject2.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement3.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-\r
-    </testGroup>\r
-    \r
-    <testGroup ID="invocationModeGroup" autoDeletePOSTS="true">\r
-        \r
-        <test ID="createBatchRecord">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch</uri>\r
-            <filename>batch/batch-create-updateobjloc.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createCollectionObject1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/collectionobjects</uri>\r
-            <filename>batch/collObj1.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createCollectionObject2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/collectionobjects</uri>\r
-            <filename>batch/collObj1.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Eugene13582155455572)'Eugene, OR, USA'</var>\r
-                <var ID="locationDate">1900-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Salem13582155455574)'Salem, OR, USA'</var>\r
-                <var ID="locationDate">2000-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement3">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Gresham13582155455574)'Gresham, OR, USA'</var>\r
-                <var ID="locationDate">1800-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObject1ToMovement1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement1.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateMovement2toCollectionObject1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createMovement2.CSID}</var>\r
-                <var ID="subjectDocumentType">Movement</var>\r
-                <var ID="objectCsid">${createCollectionObject1.CSID}</var>\r
-                <var ID="objectDocumentType">CollectionObject</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObject2ToMovement3">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject2.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement3.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createGroup">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/groups</uri>\r
-            <filename>batch/group.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObject1ToGroup">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createGroup.CSID}</var>\r
-                <var ID="objectDocumentType">Group</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObject2ToGroup">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject2.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createGroup.CSID}</var>\r
-                <var ID="objectDocumentType">Group</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="invokeBatchWithGroup" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-group.xml</filename>\r
-            <vars>\r
-                <var ID="groupCSID">${createGroup.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- This CollectionObject record's computedCurrentLocation field should -->\r
-        <!-- have been updated with the currentLocation value from Movement record 2 -->\r
-        <test ID="readUpdatedCollectionObjectRecord1">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- This CollectionObject record's computedCurrentLocation field should -->\r
-        <!-- have been updated with the currentLocation value from Movement record 3 -->\r
-        <test ID="readUpdatedCollectionObjectRecord2">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject2.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement3.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-    </testGroup>\r
-    \r
-    <!-- These tests verify that updates to the computed current location values -->\r
-    <!-- in CollectionObject records succeed, even in tenants where Movement -->\r
-    <!-- records are configured to be versioned. See CSPACE-6188 for more details. -->    \r
-    <testGroup ID="invocationModeSingleInVersioningEnabledTenant" autoDeletePOSTS="true">\r
-        \r
-        <test ID="createBatchRecordInVersioningTenant" auth="admin@lifesci.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch</uri>\r
-            <filename>batch/batch-create-updateobjloc.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-\r
-        <test ID="createCollectionObjectInVersioningTenant" auth="admin@lifesci.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/collectionobjects</uri>\r
-            <filename>batch/collObj1.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Ecatepec13582155455560)'Ecatepec, Mexico'</var>\r
-                <var ID="locationDate">2000-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObjectToMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObjectInVersioningTenant.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovementInVersioningTenant.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- Posts of batch job invocation requests don't create new records, -->\r
-        <!-- so we need to exclude them from the post-run auto-deletion of records. -->\r
-        <test ID="invokeBatchAfterRelatingMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecordInVersioningTenant.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObjectCSID">${createCollectionObjectInVersioningTenant.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="readCollectionObjectAfterRelatingToMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObjectInVersioningTenant.CSID}</uri>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovementInVersioningTenant.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="modifyMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/movements/${createMovementInVersioningTenant.CSID}</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Guadalajara13582155455562)'Guadalajara, Mexico'</var>\r
-                <var ID="locationDate">2000-01-02</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="invokeBatchAfterModifyingMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecordInVersioningTenant.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
-            <vars>\r
-                <var ID="collectionObjectCSID">${createCollectionObjectInVersioningTenant.CSID}</var>\r
-            </vars>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="readCollectionObjectAfterModifyingMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObjectInVersioningTenant.CSID}</uri>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${modifyMovementInVersioningTenant.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-    </testGroup>\r
-    \r
-    <!--\r
-        WARNING: DANGER, WILL ROBINSON! This test group will process every active\r
-        CollectionObject record available to the batch job.\r
-        \r
-        This may:\r
-        * Update existing data, not just test-created data.\r
-        * Take a very long time.\r
-    \r
-        Uncomment this test group, and add a line to a control file invoking it\r
-        only at your peril.  Use ONLY during development. - ADR 2013-01-10\r
-    -->\r
-    \r
-    <!--\r
-    <testGroup ID="invocationModeNoContext" autoDeletePOSTS="true">\r
-        \r
-        <test ID="createBatchRecord">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch</uri>\r
-            <filename>batch/batch-create-updateobjloc-nocontext.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createCollectionObject1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/collectionobjects</uri>\r
-            <filename>batch/collObj1.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createCollectionObject2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/collectionobjects</uri>\r
-            <filename>batch/collObj1.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Hillsboro13582155455576)'Hillsboro, OR, USA'</var>\r
-                <var ID="locationDate">2050-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="createMovement2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/movements</uri>\r
-            <filename>batch/movement.xml</filename>\r
-            <vars>\r
-                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Beaverton13582155455578)'Beaverton, OR, USA'</var>\r
-                <var ID="locationDate">1950-01-01</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObject1ToMovement1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement1.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateCollectionObject1ToMovement2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>\r
-                <var ID="subjectDocumentType">CollectionObject</var>\r
-                <var ID="objectCsid">${createMovement2.CSID}</var>\r
-                <var ID="objectDocumentType">Movement</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="relateMovement2ToCollectionObject2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/relations</uri>\r
-            <filename>batch/relation.xml</filename>\r
-            <vars>\r
-                <var ID="subjectCsid">${createMovement2.CSID}</var>\r
-                <var ID="subjectDocumentType">Movement</var>\r
-                <var ID="objectCsid">${createCollectionObject2.CSID}</var>\r
-                <var ID="objectDocumentType">CollectionObject</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="invokeBatchWithNoContext" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc-nocontext.xml</filename>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="readUpdatedCollectionObject1Record">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement1.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <test ID="readUpdatedCollectionObject2Record">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/collectionobjects/${createCollectionObject2.CSID}</uri>\r
-            <filename>batch/updateobjloc.xml</filename>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>batch/res/collectionobject.res.xml</filename>\r
-                <vars>\r
-                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-    </testGroup>\r
-    -->\r
-    \r
-</xmlReplay>\r
-\r
+<?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@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+        <auth ID="admin@lifesci.collectionspace.org">YWRtaW5AbGlmZXNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+    </auths>
+        
+    <!-- This tests the UpdateObjectLocationBatchJob -->
+    <!-- in various invocation modes -->
+        
+    <testGroup ID="invocationModeSingle" autoDeletePOSTS="true">
+        
+        <!-- Tests with CollectionObject->Movement relations -->
+            
+        <test ID="createBatchRecord">
+            <method>POST</method>
+            <uri>/cspace-services/batch</uri>
+            <filename>batch/batch-create-updateobjloc.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+                
+        <test ID="createCollectionObject">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>batch/collObj1.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement1">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Seattle1358215545509)'Seattle, WA, USA'</var>
+                <var ID="locationDate">1900-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <!-- The currentLocation value of this Movement record, which -->
+        <!-- has the most recent locationDate value, should also be -->
+        <!-- reflected in the computedCurrentLocation value in the -->
+        <!-- CollectionObject record after invoking the batch job. -->
+        <test ID="createMovement2">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Portland1358215545512)'Portland, OR, USA'</var>
+                <var ID="locationDate">2000-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement3">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Victoria1358215545515)'Victoria, BC, Canada'</var>
+                <var ID="locationDate">1800-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObjectToMovement1">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement1.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObjectToMovement2">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement2.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObjectToMovement3">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement3.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <!-- This post of a batch job invocation request doesn't create a new record, -->
+        <!-- so we need to exclude it from the post-run auto-deletion of records. -->
+        <test ID="invokeBatch" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
+            <vars>
+                <var ID="collectionObjectCSID">${createCollectionObject.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+
+        <!-- Verify that, following the invocation of the batch job, the -->
+        <!-- computedCurrentLocation field in the CollectionObject record has -->
+        <!-- been updated to the appropriate value, reflecting the most recent -->
+        <!-- movement (e.g. the Movement record with the most recent locationDate). -->
+        <test ID="readUpdatedCollectionObjectRecord">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- Tests with Movement->CollectionObject relations -->
+        
+        <!-- The currentLocation value of this new Movement record, which now -->
+        <!-- has the most recent locationDate value, should also be -->
+        <!-- reflected in the computedCurrentLocation value in the -->
+        <!-- CollectionObject record after invoking the batch job a second time. -->
+        <test ID="createMovement4">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Vancouver1358215545518)'Vancouver, BC, Canada'</var>
+                <var ID="locationDate">2100-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <!-- Note that this payload reflects a reversal of the subject-object directionality -->
+        <!-- of the relationship: this is a Movement->CollectionObject relationship, -->
+        <!-- rather than a CollectionObject->Movement relationship. -->
+        <test ID="relateMovement4ToCollectionObject">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createMovement4.CSID}</var>
+                <var ID="subjectDocumentType">Movement</var>
+                <var ID="objectCsid">${createCollectionObject.CSID}</var>
+                <var ID="objectDocumentType">CollectionObject</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="invokeBatchAfterAddingReverseRelation" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
+            <vars>
+                <var ID="collectionObjectCSID">${createCollectionObject.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="readUpdatedCollectionObjectRecordAfterAddingReverseRelation">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement4.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- Test with a soft-deleted related Movement record -->
+        
+        <test ID="softDeleteMovement4">
+            <method>PUT</method>
+            <uri>/cspace-services/movements/${createMovement4.CSID}/workflow/delete</uri>
+            <expectedCodes>200</expectedCodes>
+            <!-- XmlReplay appears to require a filename on PUT. -->
+            <!-- If not present, throws "java.io.FileNotFoundException: File '' does not exist" -->
+            <!-- The contents of that file, sent in the PUT payload, will be ignored by the services. -->
+            <!-- Note that the filename below is in a different module than -->
+            <!-- the present XmlReplay control file. -->
+            <filename>relation/res/workflowState.res.xml</filename>
+            <vars>
+                <var ID="workflowState">deleted</var>
+            </vars>
+        </test>
+        
+        <test ID="invokeBatchAfterSoftDeletingMovement" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
+            <vars>
+                <var ID="collectionObjectCSID">${createCollectionObject.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- After soft-deleting related Movement record 4, the computedCurrentLocation -->
+        <!-- value should have reverted to the currentLocation value of Movement record 2. -->
+        <test ID="readUpdatedCollectionObjectRecordAfterSoftDeletingMovement">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- Test with a soft-deleted CollectionObject record -->
+
+        <!-- After deleting Movement record 2 outright, the computedCurrentLocation -->
+        <!-- value should then be drawn from the currentLocation value of Movement record 1, -->
+        <!-- the next most-recent Movement record. -->
+        <test ID="deleteMovement2">
+            <method>DELETE</method>
+            <uri>/cspace-services/movements/${createMovement2.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- However, now we soft-delete the CollectionObject record itself. -->
+        <test ID="softDeleteCollectionObject">
+            <method>PUT</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}/workflow/delete</uri>
+            <expectedCodes>200</expectedCodes>
+            <filename>relation/res/workflowState.res.xml</filename>
+            <vars>
+                <var ID="workflowState">deleted</var>
+            </vars>
+        </test>
+        
+        <test ID="invokeBatchAfterSoftDeletingCollectionObject" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
+            <vars>
+                <var ID="collectionObjectCSID">${createCollectionObject.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- On re-reading the CollectionObject, its computedCurrentLocation -->
+        <!-- value should remain at its value prior to its having been soft-deleted. -->
+        <test ID="readUpdatedCollectionObjectRecordAfterSoftDeletion">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+    </testGroup>
+    
+    <testGroup ID="invocationModeSingleWithTiebreaker" autoDeletePOSTS="true">
+                    
+        <test ID="createBatchRecordWithTiebreaker">
+            <method>POST</method>
+            <uri>/cspace-services/batch</uri>
+            <filename>batch/batch-create-updateobjloc.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+                
+        <test ID="createCollectionObjectWithTiebreaker">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>batch/collObj1.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement1WithTiebreaker">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Olympia1358215545521)'Olympia, WA, USA'</var>
+                <var ID="locationDate">1900-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement2WithTiebreaker">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Ottawa1358215545567)'Ottawa, ON, Canada'</var>
+                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement3WithTiebreaker">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Spokane1358215545524)'Spokane, WA, USA'</var>
+                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObjectToMovement1WithTiebreaker">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObjectWithTiebreaker.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement1WithTiebreaker.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObjectToMovement2WithTiebreaker">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObjectWithTiebreaker.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement2WithTiebreaker.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+         
+        <test ID="relateCollectionObjectToMovement3WithTiebreaker">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObjectWithTiebreaker.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement3WithTiebreaker.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+
+        <test ID="modifyMovement1WithTiebreaker">
+            <method>PUT</method>
+            <uri>/cspace-services/movements/${createMovement1WithTiebreaker.CSID}</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Guadalajara13582155455562)'Guadalajara, Mexico'</var>
+                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        <test ID="invokeBatchAfterMovement1ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
+            <vars>
+                <var ID="collectionObjectCSID">${createCollectionObjectWithTiebreaker.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test> 
+        
+        <!-- Verify that, following the invocation of the batch job, the -->
+        <!-- computedCurrentLocation field in the CollectionObject record has -->
+        <!-- been updated to the appropriate value, reflecting the most recent -->
+        <!-- movement (e.g. the Movement record with the most recent locationDate, -->
+        <!-- and, as in this test group - where two Movement records have identical -->
+        <!-- locationDate values - the Movement record that has been updated most recently. -->
+        <test ID="readCollectionObjectAfterMovement1ModificationWithTiebreaker">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObjectWithTiebreaker.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${modifyMovement1WithTiebreaker.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>      
+
+        <test ID="modifyMovement2WithTiebreaker">
+            <method>PUT</method>
+            <uri>/cspace-services/movements/${createMovement2WithTiebreaker.CSID}</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Ecatepec13582155455560)'Ecatepec, Mexico'</var>
+                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        <test ID="invokeBatchAfterMovement2ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
+            <vars>
+                <var ID="collectionObjectCSID">${createCollectionObjectWithTiebreaker.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test> 
+        
+        <test ID="readCollectionObjectRecordAfterMovement2ModificationWithTiebreaker">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObjectWithTiebreaker.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${modifyMovement2WithTiebreaker.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="modifyMovement3WithTiebreaker">
+            <method>PUT</method>
+            <uri>/cspace-services/movements/${createMovement3WithTiebreaker.CSID}</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Calgary1358215545564)'Calgary, AB, Canada'</var>
+                <var ID="locationDate">${createMovement1WithTiebreaker.locationDate}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        <test ID="invokeBatchAfterMovement3ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
+            <vars>
+                <var ID="collectionObjectCSID">${createCollectionObjectWithTiebreaker.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test> 
+        
+        <test ID="readCollectionObjectRecordAfterMovement3ModificationWithTiebreaker">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObjectWithTiebreaker.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${modifyMovement3WithTiebreaker.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+            
+    </testGroup>
+    
+    <testGroup ID="invocationModeList" autoDeletePOSTS="true">
+        
+        <test ID="createBatchRecord">
+            <method>POST</method>
+            <uri>/cspace-services/batch</uri>
+            <filename>batch/batch-create-updateobjloc.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+                
+        <test ID="createCollectionObject1">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>batch/collObj1.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createCollectionObject2">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>batch/collObj1.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement1">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Winnipeg13582155455568)'Winnipeg, MB, Canada'</var>
+                <var ID="locationDate">1900-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement2">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Saskatoon13582155455570)'Saskatoon, SK, Canada'</var>
+                <var ID="locationDate">2000-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement3">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Montreal13582155455570)'Montreal, QC, Canada'</var>
+                <var ID="locationDate">1800-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObject1ToMovement1">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement1.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollection1ObjectToMovement2">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement2.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObject2ToMovement3">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject2.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement3.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="invokeBatchWithList" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-list.xml</filename>
+            <vars>
+                <var ID="collectionObject1CSID">${createCollectionObject1.CSID}</var>
+                <var ID="collectionObject2CSID">${createCollectionObject2.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- This CollectionObject record's computedCurrentLocation field should -->
+        <!-- have been updated with the currentLocation value from Movement record 2 -->
+        <test ID="readUpdatedCollectionObjectRecord1">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- This CollectionObject record's computedCurrentLocation field should -->
+        <!-- have been updated with the currentLocation value from Movement record 3 -->
+        <test ID="readUpdatedCollectionObjectRecord2">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject2.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement3.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+
+    </testGroup>
+    
+    <testGroup ID="invocationModeGroup" autoDeletePOSTS="true">
+        
+        <test ID="createBatchRecord">
+            <method>POST</method>
+            <uri>/cspace-services/batch</uri>
+            <filename>batch/batch-create-updateobjloc.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createCollectionObject1">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>batch/collObj1.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createCollectionObject2">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>batch/collObj1.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement1">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Eugene13582155455572)'Eugene, OR, USA'</var>
+                <var ID="locationDate">1900-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement2">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Salem13582155455574)'Salem, OR, USA'</var>
+                <var ID="locationDate">2000-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement3">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Gresham13582155455574)'Gresham, OR, USA'</var>
+                <var ID="locationDate">1800-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObject1ToMovement1">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement1.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateMovement2toCollectionObject1">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createMovement2.CSID}</var>
+                <var ID="subjectDocumentType">Movement</var>
+                <var ID="objectCsid">${createCollectionObject1.CSID}</var>
+                <var ID="objectDocumentType">CollectionObject</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObject2ToMovement3">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject2.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement3.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createGroup">
+            <method>POST</method>
+            <uri>/cspace-services/groups</uri>
+            <filename>batch/group.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObject1ToGroup">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createGroup.CSID}</var>
+                <var ID="objectDocumentType">Group</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObject2ToGroup">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject2.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createGroup.CSID}</var>
+                <var ID="objectDocumentType">Group</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="invokeBatchWithGroup" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-group.xml</filename>
+            <vars>
+                <var ID="groupCSID">${createGroup.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- This CollectionObject record's computedCurrentLocation field should -->
+        <!-- have been updated with the currentLocation value from Movement record 2 -->
+        <test ID="readUpdatedCollectionObjectRecord1">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- This CollectionObject record's computedCurrentLocation field should -->
+        <!-- have been updated with the currentLocation value from Movement record 3 -->
+        <test ID="readUpdatedCollectionObjectRecord2">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject2.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement3.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+    </testGroup>
+    
+    <!-- These tests verify that updates to the computed current location values -->
+    <!-- in CollectionObject records succeed, even in tenants where Movement -->
+    <!-- records are configured to be versioned. See CSPACE-6188 for more details. -->    
+    <testGroup ID="invocationModeSingleInVersioningEnabledTenant" autoDeletePOSTS="true">
+        
+        <test ID="createBatchRecordInVersioningTenant" auth="admin@lifesci.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/batch</uri>
+            <filename>batch/batch-create-updateobjloc.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+
+        <test ID="createCollectionObjectInVersioningTenant" auth="admin@lifesci.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>batch/collObj1.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Ecatepec13582155455560)'Ecatepec, Mexico'</var>
+                <var ID="locationDate">2000-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObjectToMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObjectInVersioningTenant.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovementInVersioningTenant.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <!-- Posts of batch job invocation requests don't create new records, -->
+        <!-- so we need to exclude them from the post-run auto-deletion of records. -->
+        <test ID="invokeBatchAfterRelatingMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecordInVersioningTenant.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
+            <vars>
+                <var ID="collectionObjectCSID">${createCollectionObjectInVersioningTenant.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="readCollectionObjectAfterRelatingToMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObjectInVersioningTenant.CSID}</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovementInVersioningTenant.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="modifyMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">
+            <method>PUT</method>
+            <uri>/cspace-services/movements/${createMovementInVersioningTenant.CSID}</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Guadalajara13582155455562)'Guadalajara, Mexico'</var>
+                <var ID="locationDate">2000-01-02</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="invokeBatchAfterModifyingMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecordInVersioningTenant.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
+            <vars>
+                <var ID="collectionObjectCSID">${createCollectionObjectInVersioningTenant.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="readCollectionObjectAfterModifyingMovementInVersioningTenant" auth="admin@lifesci.collectionspace.org">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObjectInVersioningTenant.CSID}</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${modifyMovementInVersioningTenant.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+    </testGroup>
+    
+    <!--
+        WARNING: DANGER, WILL ROBINSON! This test group will process every active
+        CollectionObject record available to the batch job.
+        
+        This may:
+        * Update existing data, not just test-created data.
+        * Take a very long time.
+    
+        Uncomment this test group, and add a line to a control file invoking it
+        only at your peril.  Use ONLY during development. - ADR 2013-01-10
+    -->
+    
+    <!--
+    <testGroup ID="invocationModeNoContext" autoDeletePOSTS="true">
+        
+        <test ID="createBatchRecord">
+            <method>POST</method>
+            <uri>/cspace-services/batch</uri>
+            <filename>batch/batch-create-updateobjloc-nocontext.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createCollectionObject1">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>batch/collObj1.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createCollectionObject2">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>batch/collObj1.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement1">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Hillsboro13582155455576)'Hillsboro, OR, USA'</var>
+                <var ID="locationDate">2050-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="createMovement2">
+            <method>POST</method>
+            <uri>/cspace-services/movements</uri>
+            <filename>batch/movement.xml</filename>
+            <vars>
+                <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Beaverton13582155455578)'Beaverton, OR, USA'</var>
+                <var ID="locationDate">1950-01-01</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObject1ToMovement1">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement1.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateCollectionObject1ToMovement2">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createCollectionObject1.CSID}</var>
+                <var ID="subjectDocumentType">CollectionObject</var>
+                <var ID="objectCsid">${createMovement2.CSID}</var>
+                <var ID="objectDocumentType">Movement</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="relateMovement2ToCollectionObject2">
+            <method>POST</method>
+            <uri>/cspace-services/relations</uri>
+            <filename>batch/relation.xml</filename>
+            <vars>
+                <var ID="subjectCsid">${createMovement2.CSID}</var>
+                <var ID="subjectDocumentType">Movement</var>
+                <var ID="objectCsid">${createCollectionObject2.CSID}</var>
+                <var ID="objectDocumentType">CollectionObject</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <test ID="invokeBatchWithNoContext" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
+            <filename>batch/batch-invoke-updateobjloc-nocontext.xml</filename>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="readUpdatedCollectionObject1Record">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement1.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="readUpdatedCollectionObject2Record">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${createCollectionObject2.CSID}</uri>
+            <filename>batch/updateobjloc.xml</filename>
+            <response>
+                <expected level="ADDOK" />
+                <filename>batch/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+    </testGroup>
+    -->
+    
+</xmlReplay>
+
index 91c22683c7955f0be8c468a7c75a059ffca73748..59981205a7d931628afc46f05d1f4dc9e824035f 100644 (file)
@@ -1,79 +1,79 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-       <auths>\r
-               <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-               <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-       </auths>\r
-       <testGroup ID="testSingle" autoDeletePOSTS="true">\r
-               <test ID="createBatch1" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/batch/</uri>\r
-                       <filename>batch/batch1.xml</filename>\r
-               </test>\r
-               <test ID="createBatch2" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/batch/</uri>\r
-                       <filename>batch/batch1.xml</filename>\r
-               </test>\r
-               <test ID="createBatch" auth="test">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/collectionobjects/</uri>\r
-                       <filename>batch/collObj1.xml</filename>\r
-               </test>\r
-               <test ID="testInvokeSingle" auth="test" autoDeletePOSTS="false">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/batch/${createBatch1.CSID}</uri>\r
-                       <filename>batch/batchInvContextSingle.xml</filename>\r
-                       <vars>\r
-                               <var ID="CollObj1">${createBatch.CSID}</var>\r
-                       </vars>\r
-               </test>\r
-               <test ID="testInvokeList" auth="test" autoDeletePOSTS="false">\r
-                       <method>POST</method>\r
-                       <uri>/cspace-services/batch/${createBatch1.CSID}</uri>\r
-                       <filename>batch/batchInvContextList.xml</filename>\r
-                       <vars>\r
-                               <var ID="CollObj1">${createBatch.CSID}</var>\r
-                       </vars>\r
-               </test>\r
-               <test ID="testBadInvoke" auth="test" autoDeletePOSTS="false">\r
-                       <method>POST</method>\r
-                       <expectedCodes>400</expectedCodes>\r
-                       <uri>/cspace-services/batch/${createBatch1.CSID}</uri>\r
-                       <filename>batch/batchBadInvContext.xml</filename>\r
-                       <vars>\r
-                               <var ID="CollObj1">${createBatch.CSID}</var>\r
-                       </vars>\r
-               </test>\r
-               <test ID="testInvokeEmptyList" auth="test" autoDeletePOSTS="false">\r
-                       <method>POST</method>\r
-                       <expectedCodes>400</expectedCodes>\r
-                       <uri>/cspace-services/batch/${createBatch1.CSID}</uri>\r
-                       <filename>batch/batchBadInvContextList.xml</filename>\r
-                       <vars>\r
-                               <var ID="CollObj1">${createBatch.CSID}</var>\r
-                       </vars>\r
-               </test>\r
-               <test ID="testFilteredList1" auth="test">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/batch?doctype=CollectionObject&amp;inv=single</uri>\r
-               </test>\r
-               <test ID="testFilteredList2" auth="test">\r
-                       <method>GET</method>\r
-                       <uri>/cspace-services/batch?doctype=Intake&amp;inv=group</uri>\r
-               </test>\r
-       </testGroup>\r
-       <!-- \r
-     <testGroup ID="cleanup" autoDeletePOSTS="true">\r
-         <test ID="cl1"  auth="test">\r
-             <method>DELETE</method>\r
-             <uri>/cspace-services/batch/${createBatch1.CSID}</uri>\r
-         </test>\r
-         <test ID="cl2"  auth="test">\r
-             <method>DELETE</method>\r
-             <uri>/cspace-services/collectionobjects/${createBatch.CSID}</uri>\r
-         </test>\r
-                        </testGroup>\r
-                        -->\r
-</xmlReplay>\r
-\r
+<?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@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+       </auths>
+       <testGroup ID="testSingle" autoDeletePOSTS="true">
+               <test ID="createBatch1" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/batch/</uri>
+                       <filename>batch/batch1.xml</filename>
+               </test>
+               <test ID="createBatch2" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/batch/</uri>
+                       <filename>batch/batch1.xml</filename>
+               </test>
+               <test ID="createBatch" auth="test">
+                       <method>POST</method>
+                       <uri>/cspace-services/collectionobjects/</uri>
+                       <filename>batch/collObj1.xml</filename>
+               </test>
+               <test ID="testInvokeSingle" auth="test" autoDeletePOSTS="false">
+                       <method>POST</method>
+                       <uri>/cspace-services/batch/${createBatch1.CSID}</uri>
+                       <filename>batch/batchInvContextSingle.xml</filename>
+                       <vars>
+                               <var ID="CollObj1">${createBatch.CSID}</var>
+                       </vars>
+               </test>
+               <test ID="testInvokeList" auth="test" autoDeletePOSTS="false">
+                       <method>POST</method>
+                       <uri>/cspace-services/batch/${createBatch1.CSID}</uri>
+                       <filename>batch/batchInvContextList.xml</filename>
+                       <vars>
+                               <var ID="CollObj1">${createBatch.CSID}</var>
+                       </vars>
+               </test>
+               <test ID="testBadInvoke" auth="test" autoDeletePOSTS="false">
+                       <method>POST</method>
+                       <expectedCodes>400</expectedCodes>
+                       <uri>/cspace-services/batch/${createBatch1.CSID}</uri>
+                       <filename>batch/batchBadInvContext.xml</filename>
+                       <vars>
+                               <var ID="CollObj1">${createBatch.CSID}</var>
+                       </vars>
+               </test>
+               <test ID="testInvokeEmptyList" auth="test" autoDeletePOSTS="false">
+                       <method>POST</method>
+                       <expectedCodes>400</expectedCodes>
+                       <uri>/cspace-services/batch/${createBatch1.CSID}</uri>
+                       <filename>batch/batchBadInvContextList.xml</filename>
+                       <vars>
+                               <var ID="CollObj1">${createBatch.CSID}</var>
+                       </vars>
+               </test>
+               <test ID="testFilteredList1" auth="test">
+                       <method>GET</method>
+                       <uri>/cspace-services/batch?doctype=CollectionObject&amp;inv=single</uri>
+               </test>
+               <test ID="testFilteredList2" auth="test">
+                       <method>GET</method>
+                       <uri>/cspace-services/batch?doctype=Intake&amp;inv=group</uri>
+               </test>
+       </testGroup>
+       <!-- 
+     <testGroup ID="cleanup" autoDeletePOSTS="true">
+         <test ID="cl1"  auth="test">
+             <method>DELETE</method>
+             <uri>/cspace-services/batch/${createBatch1.CSID}</uri>
+         </test>
+         <test ID="cl2"  auth="test">
+             <method>DELETE</method>
+             <uri>/cspace-services/collectionobjects/${createBatch.CSID}</uri>
+         </test>
+                        </testGroup>
+                        -->
+</xmlReplay>
+
index 6c66e7717e3c77a85368a9c1c215b288c4516575..bc3cc1093b8daca02d97e6a1c2f25400ea14e6df 100644 (file)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="batch">\r
-       <ns2:batch_common\r
-       xmlns:ns2="http://collectionspace.org/services/batch"\r
-       xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-               <name>TestCreateAndLinkLoanOutBatchJob</name>\r
-               <notes>This should be interesting</notes>\r
-               <forDocTypes>\r
-                 <forDocType>CollectionObject</forDocType>\r
-               </forDocTypes>\r
-               <supportsSingleDoc>true</supportsSingleDoc>\r
-               <supportsDocList>true</supportsDocList>\r
-               <createsNewFocus>true</createsNewFocus>\r
-               <className>org.collectionspace.services.batch.nuxeo.CreateAndLinkLoanOutBatchJob</className>\r
-       </ns2:batch_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="batch">
+       <ns2:batch_common
+       xmlns:ns2="http://collectionspace.org/services/batch"
+       xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <name>TestCreateAndLinkLoanOutBatchJob</name>
+               <notes>This should be interesting</notes>
+               <forDocTypes>
+                 <forDocType>CollectionObject</forDocType>
+               </forDocTypes>
+               <supportsSingleDoc>true</supportsSingleDoc>
+               <supportsDocList>true</supportsDocList>
+               <createsNewFocus>true</createsNewFocus>
+               <className>org.collectionspace.services.batch.nuxeo.CreateAndLinkLoanOutBatchJob</className>
+       </ns2:batch_common>
+</document>
index fb3ac7bb6c7a05ac9b18b5691e0bc6fa886a80c6..dc262c48f345f8e163b789ffb743d9fd18bb7485 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <mode>single</mode>\r
-       <docType>CollectionObject</docType>\r
-       <singleCSID>${CollObj1}</singleCSID>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+xmlns:ns2="http://collectionspace.org/services/common/invocable"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <mode>single</mode>
+       <docType>CollectionObject</docType>
+       <singleCSID>${CollObj1}</singleCSID>
+</ns2:invocationContext>
+
+
index f07f708900e95dd17a4e54d2a07d0eeb0c7a944f..6374d63a2268e4083c05496f4d1cf97531392ebe 100644 (file)
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <mode>garbage</mode>\r
-       <docType>CollectionObject</docType>\r
-       <listCSIDs>\r
-               <csids>${CollObj1}</csids>\r
-       </listCSIDs>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+xmlns:ns2="http://collectionspace.org/services/common/invocable"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <mode>garbage</mode>
+       <docType>CollectionObject</docType>
+       <listCSIDs>
+               <csids>${CollObj1}</csids>
+       </listCSIDs>
+</ns2:invocationContext>
+
+
index 007b010bc6898eb54d8141be604eb3c881dd3c7b..4da3e959edac10be7cd46167fbc3dfe81885c878 100644 (file)
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <mode>list</mode>\r
-       <docType>CollectionObject</docType>\r
-       <listCSIDs>\r
-       </listCSIDs>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+xmlns:ns2="http://collectionspace.org/services/common/invocable"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <mode>list</mode>
+       <docType>CollectionObject</docType>
+       <listCSIDs>
+       </listCSIDs>
+</ns2:invocationContext>
+
+
index 26b00693a18bdb8cbd74e071161eda33e99cfd90..cb25db6d29c81db3028fbbcdf3bd8f1c20e64af3 100644 (file)
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <mode>list</mode>\r
-       <docType>CollectionObject</docType>\r
-       <listCSIDs>\r
-               <csid>${CollObj1}</csid>\r
-       </listCSIDs>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+xmlns:ns2="http://collectionspace.org/services/common/invocable"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <mode>list</mode>
+       <docType>CollectionObject</docType>
+       <listCSIDs>
+               <csid>${CollObj1}</csid>
+       </listCSIDs>
+</ns2:invocationContext>
+
+
index fb3ac7bb6c7a05ac9b18b5691e0bc6fa886a80c6..dc262c48f345f8e163b789ffb743d9fd18bb7485 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <mode>single</mode>\r
-       <docType>CollectionObject</docType>\r
-       <singleCSID>${CollObj1}</singleCSID>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+xmlns:ns2="http://collectionspace.org/services/common/invocable"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <mode>single</mode>
+       <docType>CollectionObject</docType>
+       <singleCSID>${CollObj1}</singleCSID>
+</ns2:invocationContext>
+
+
index ff06d2f624ad4684fdbaba1ddc1e31558aceb1a8..9ee621bd0d51dc19421461ac34169948ce49c6c7 100644 (file)
@@ -1 +1 @@
- âº  , 0 1The  Î² Source of All  Ïˆ Acquisitions\r
+ âº  , 0 1The  Î² Source of All  Ïˆ Acquisitions
index 765ff9abc9e6aae5d5ed941a6996ccfd5246b631..190becb5217d8fd90ebf56a9c9bd4b6f1d45f2a9 100644 (file)
@@ -1,27 +1,27 @@
-Here are the steps we tried:\r
-\r
-On nightly.collectionspace.org, which is running Nuxeo 5.3 with mysql\r
-\r
-    Update a record through Nuxeo Web GUI, inserting a greek psi character. \r
-    ==> failure: able to edit record, but on read and edit again, character is tranformed into question mark.\r
-    \r
-On nightly, we ran a SQL update and then a SQL dump on a table, and got the UTF8 non-Latin1 characters back. \r
-    ==> success: full round trip, from file.sql to MySQL to file.out .\r
-    Note that we used the UTF8 option on the command line:\r
-     \r
-      mysql  -u cspace_user -p  --default_character_set utf8 nuxeo < ~/acq.sql\r
-     \r
-      mysqldump -u cspace_user -p nuxeo acquisitions_common_acquisitionsources > acq.out\r
-     \r
-On localhost which is running the older version of Nuxeo with mysql\r
-\r
-    Update a record through Nuxeo Web GUI, inserting a greek psi character. \r
-    ==> success: able to read and edit record and see character.\r
-    \r
-    \r
-    \r
-Notes:\r
-  Check the encoding of the DB:\r
-    mysql> SHOW VARIABLES LIKE 'character_set_database';      \r
-\r
-\r
+Here are the steps we tried:
+
+On nightly.collectionspace.org, which is running Nuxeo 5.3 with mysql
+
+    Update a record through Nuxeo Web GUI, inserting a greek psi character. 
+    ==> failure: able to edit record, but on read and edit again, character is tranformed into question mark.
+    
+On nightly, we ran a SQL update and then a SQL dump on a table, and got the UTF8 non-Latin1 characters back. 
+    ==> success: full round trip, from file.sql to MySQL to file.out .
+    Note that we used the UTF8 option on the command line:
+     
+      mysql  -u cspace_user -p  --default_character_set utf8 nuxeo < ~/acq.sql
+     
+      mysqldump -u cspace_user -p nuxeo acquisitions_common_acquisitionsources > acq.out
+     
+On localhost which is running the older version of Nuxeo with mysql
+
+    Update a record through Nuxeo Web GUI, inserting a greek psi character. 
+    ==> success: able to read and edit record and see character.
+    
+    
+    
+Notes:
+  Check the encoding of the DB:
+    mysql> SHOW VARIABLES LIKE 'character_set_database';      
+
+
index 534d65f8f590be7f3706732cd1db74c527008f54..0037268a1829393335f2e2887168cb49dba1f098 100644 (file)
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <protoHostPort>http://localhost:8280</protoHostPort>\r
-    <testGroup ID="nonlatin" autoDeletePOSTS="false">\r
-        <test ID="1001">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/acquisitions/</uri>\r
-            <part>\r
-                <label>acquisitions_common</label>\r
-                <filename>acq19-mod.xml</filename>\r
-            </part>\r
-        </test>\r
-        <test>\r
-            <method>GET</method>\r
-            <uri>/cspace-services/acquisitions/</uri>\r
-            <fromTestID>1001</fromTestID>\r
-        </test>\r
-     </testGroup>\r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+    <protoHostPort>http://localhost:8280</protoHostPort>
+    <testGroup ID="nonlatin" autoDeletePOSTS="false">
+        <test ID="1001">
+            <method>POST</method>
+            <uri>/cspace-services/acquisitions/</uri>
+            <part>
+                <label>acquisitions_common</label>
+                <filename>acq19-mod.xml</filename>
+            </part>
+        </test>
+        <test>
+            <method>GET</method>
+            <uri>/cspace-services/acquisitions/</uri>
+            <fromTestID>1001</fromTestID>
+        </test>
+     </testGroup>
+</xmlReplay>
index 765ff9abc9e6aae5d5ed941a6996ccfd5246b631..190becb5217d8fd90ebf56a9c9bd4b6f1d45f2a9 100644 (file)
@@ -1,27 +1,27 @@
-Here are the steps we tried:\r
-\r
-On nightly.collectionspace.org, which is running Nuxeo 5.3 with mysql\r
-\r
-    Update a record through Nuxeo Web GUI, inserting a greek psi character. \r
-    ==> failure: able to edit record, but on read and edit again, character is tranformed into question mark.\r
-    \r
-On nightly, we ran a SQL update and then a SQL dump on a table, and got the UTF8 non-Latin1 characters back. \r
-    ==> success: full round trip, from file.sql to MySQL to file.out .\r
-    Note that we used the UTF8 option on the command line:\r
-     \r
-      mysql  -u cspace_user -p  --default_character_set utf8 nuxeo < ~/acq.sql\r
-     \r
-      mysqldump -u cspace_user -p nuxeo acquisitions_common_acquisitionsources > acq.out\r
-     \r
-On localhost which is running the older version of Nuxeo with mysql\r
-\r
-    Update a record through Nuxeo Web GUI, inserting a greek psi character. \r
-    ==> success: able to read and edit record and see character.\r
-    \r
-    \r
-    \r
-Notes:\r
-  Check the encoding of the DB:\r
-    mysql> SHOW VARIABLES LIKE 'character_set_database';      \r
-\r
-\r
+Here are the steps we tried:
+
+On nightly.collectionspace.org, which is running Nuxeo 5.3 with mysql
+
+    Update a record through Nuxeo Web GUI, inserting a greek psi character. 
+    ==> failure: able to edit record, but on read and edit again, character is tranformed into question mark.
+    
+On nightly, we ran a SQL update and then a SQL dump on a table, and got the UTF8 non-Latin1 characters back. 
+    ==> success: full round trip, from file.sql to MySQL to file.out .
+    Note that we used the UTF8 option on the command line:
+     
+      mysql  -u cspace_user -p  --default_character_set utf8 nuxeo < ~/acq.sql
+     
+      mysqldump -u cspace_user -p nuxeo acquisitions_common_acquisitionsources > acq.out
+     
+On localhost which is running the older version of Nuxeo with mysql
+
+    Update a record through Nuxeo Web GUI, inserting a greek psi character. 
+    ==> success: able to read and edit record and see character.
+    
+    
+    
+Notes:
+  Check the encoding of the DB:
+    mysql> SHOW VARIABLES LIKE 'character_set_database';      
+
+
index b017bdc5b44f4b8b0ec8f4bd7c8477f9c8aa81c0..2e34a4715ffae048740a8789afc12d25ca75301e 100644 (file)
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="collectionobjects">\r
-<ns2:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/collectionobject" >\r
-       <objectNumber>1-1001</objectNumber>\r
-       <catalogNumber>PLS-2011.1</catalogNumber>\r
-       <responsibleDepartments>\r
-               <responsibleDepartment>ethnography</responsibleDepartment>\r
-       </responsibleDepartments>\r
-       <ownershipAccess>open</ownershipAccess>\r
-       <objectProductionOrganizationGroupList>\r
-               <objectProductionOrganizationGroup>\r
-                       <objectProductionOrganizationRole>Sponsor</objectProductionOrganizationRole>\r
-                       <objectProductionOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(ucberkeley)'UC Berkeley'</objectProductionOrganization>\r
-               </objectProductionOrganizationGroup>\r
-               <objectProductionOrganizationGroup>\r
-                       <objectProductionOrganizationRole>Coding</objectProductionOrganizationRole>\r
-                       <objectProductionOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(ucberkeleyist)'UCB IST'</objectProductionOrganization>\r
-               </objectProductionOrganizationGroup>\r
-       </objectProductionOrganizationGroupList>\r
-       <objectProductionPersonGroupList>\r
-               <objectProductionPersonGroup>\r
-                       <objectProductionPersonRole/>\r
-                       <objectProductionPerson>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(pschmitz)'Patrick Schmitz'</objectProductionPerson>\r
-               </objectProductionPersonGroup>\r
-       </objectProductionPersonGroupList>\r
-       <comments>\r
-               <comment>A virtual object to check authRefs</comment>\r
-       </comments>\r
-    <nonTextualInscriptionGroupList>\r
-        <nonTextualInscriptionGroup>\r
-            <inscriptionDescriptionInscriber>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(pmadry)'Penelope Madry'</inscriptionDescriptionInscriber>\r
-        </nonTextualInscriptionGroup>\r
-    </nonTextualInscriptionGroup>nonTextualInscriptionGroupList>\r
-</ns2:collectionobjects_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="collectionobjects">
+<ns2:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/collectionobject" >
+       <objectNumber>1-1001</objectNumber>
+       <catalogNumber>PLS-2011.1</catalogNumber>
+       <responsibleDepartments>
+               <responsibleDepartment>ethnography</responsibleDepartment>
+       </responsibleDepartments>
+       <ownershipAccess>open</ownershipAccess>
+       <objectProductionOrganizationGroupList>
+               <objectProductionOrganizationGroup>
+                       <objectProductionOrganizationRole>Sponsor</objectProductionOrganizationRole>
+                       <objectProductionOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(ucberkeley)'UC Berkeley'</objectProductionOrganization>
+               </objectProductionOrganizationGroup>
+               <objectProductionOrganizationGroup>
+                       <objectProductionOrganizationRole>Coding</objectProductionOrganizationRole>
+                       <objectProductionOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(ucberkeleyist)'UCB IST'</objectProductionOrganization>
+               </objectProductionOrganizationGroup>
+       </objectProductionOrganizationGroupList>
+       <objectProductionPersonGroupList>
+               <objectProductionPersonGroup>
+                       <objectProductionPersonRole/>
+                       <objectProductionPerson>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(pschmitz)'Patrick Schmitz'</objectProductionPerson>
+               </objectProductionPersonGroup>
+       </objectProductionPersonGroupList>
+       <comments>
+               <comment>A virtual object to check authRefs</comment>
+       </comments>
+    <nonTextualInscriptionGroupList>
+        <nonTextualInscriptionGroup>
+            <inscriptionDescriptionInscriber>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(pmadry)'Penelope Madry'</inscriptionDescriptionInscriber>
+        </nonTextualInscriptionGroup>
+    </nonTextualInscriptionGroup>nonTextualInscriptionGroupList>
+</ns2:collectionobjects_common>
+</document>
index e11b3e34bdcbc9ae7143cace45753f80100522b6..a19c9322662a79ee583aa422fb09aa6ca2ca314b 100644 (file)
@@ -1,47 +1,47 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns3:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/collectionobject">\r
-<objectNumber>objectNumber-1285644709375</objectNumber>\r
-<otherNumberList>\r
-<otherNumber>\r
-<numberValue>101.objectName-1285644709375</numberValue>\r
-<numberType>integer</numberType>\r
-</otherNumber>\r
-<otherNumber>\r
-<numberValue>101.502.23.456.objectName-1285644709375</numberValue>\r
-<numberType>ipaddress</numberType>\r
-</otherNumber>\r
-</otherNumberList>\r
-<briefDescriptions>\r
-<briefDescription>Papier mache bird cow mask with horns, painted red with black and yellow spots. Puerto Rico. ca. 8&amp;quot; high, 6&amp;quot; wide, projects 10&amp;quot; (with horns).</briefDescription>\r
-<briefDescription>Acrylic rabbit mask with wings, painted red with green and aquamarine spots. Puerto Rico. ca. 8&amp;quot; high, 6&amp;quot; wide, projects 10&amp;quot; (with wings).</briefDescription>\r
-</briefDescriptions>\r
-<objectNameList>\r
-<objectNameGroup>\r
-<objectName>an object name</objectName>\r
-</objectNameGroup>\r
-</objectNameList>\r
-<responsibleDepartments>\r
-<responsibleDepartment>urn:org.collectionspace.services.department:Registrar</responsibleDepartment>\r
-<responsibleDepartment>urn:org.walkerart.department:Fine Art</responsibleDepartment>\r
-</responsibleDepartments>\r
-<titleGroupList><titleGroup><title>title</title></titleGroup></titleGroupList>\r
-<age>\r
-</age>\r
-<dimensions>\r
-<dimensionGroup>\r
-<dimension>length</dimension>\r
-<measuredPart>head</measuredPart>\r
-<measurementUnit>cm</measurementUnit>\r
-<value>30</value>\r
-</dimensionGroup>\r
-<dimensionGroup>\r
-<dimension>width</dimension>\r
-<measuredPart>leg</measuredPart>\r
-<measurementUnit>m</measurementUnit>\r
-<value>2.57</value>\r
-<valueQualifier>\r
-</valueQualifier>\r
-</dimensionGroup>\r
-</dimensions>\r
-</ns3:collectionobjects_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns3:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/collectionobject">
+<objectNumber>objectNumber-1285644709375</objectNumber>
+<otherNumberList>
+<otherNumber>
+<numberValue>101.objectName-1285644709375</numberValue>
+<numberType>integer</numberType>
+</otherNumber>
+<otherNumber>
+<numberValue>101.502.23.456.objectName-1285644709375</numberValue>
+<numberType>ipaddress</numberType>
+</otherNumber>
+</otherNumberList>
+<briefDescriptions>
+<briefDescription>Papier mache bird cow mask with horns, painted red with black and yellow spots. Puerto Rico. ca. 8&amp;quot; high, 6&amp;quot; wide, projects 10&amp;quot; (with horns).</briefDescription>
+<briefDescription>Acrylic rabbit mask with wings, painted red with green and aquamarine spots. Puerto Rico. ca. 8&amp;quot; high, 6&amp;quot; wide, projects 10&amp;quot; (with wings).</briefDescription>
+</briefDescriptions>
+<objectNameList>
+<objectNameGroup>
+<objectName>an object name</objectName>
+</objectNameGroup>
+</objectNameList>
+<responsibleDepartments>
+<responsibleDepartment>urn:org.collectionspace.services.department:Registrar</responsibleDepartment>
+<responsibleDepartment>urn:org.walkerart.department:Fine Art</responsibleDepartment>
+</responsibleDepartments>
+<titleGroupList><titleGroup><title>title</title></titleGroup></titleGroupList>
+<age>
+</age>
+<dimensions>
+<dimensionGroup>
+<dimension>length</dimension>
+<measuredPart>head</measuredPart>
+<measurementUnit>cm</measurementUnit>
+<value>30</value>
+</dimensionGroup>
+<dimensionGroup>
+<dimension>width</dimension>
+<measuredPart>leg</measuredPart>
+<measurementUnit>m</measurementUnit>
+<value>2.57</value>
+<valueQualifier>
+</valueQualifier>
+</dimensionGroup>
+</dimensions>
+</ns3:collectionobjects_common>
+
index 1debb2a30531a00149d5e451348b93c3175b3c53..991be259a362224ff18b9dc3e7ee1e019168ab54 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:collectionobjects_naturalhistory xmlns:ns2="http://collectionspace.org/services/collectionobject/domain/naturalhistory">\r
-<nh-string>test-string</nh-string>\r
-<nh-int>999</nh-int>\r
-<nh-long>9999</nh-long>\r
-</ns2:collectionobjects_naturalhistory>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:collectionobjects_naturalhistory xmlns:ns2="http://collectionspace.org/services/collectionobject/domain/naturalhistory">
+<nh-string>test-string</nh-string>
+<nh-int>999</nh-int>
+<nh-long>9999</nh-long>
+</ns2:collectionobjects_naturalhistory>
index a3850b9fac20f7f9f67b93cafc298c6056afa692..601562f7970ba887b907931d307ba5c69dc58a82 100644 (file)
@@ -1,96 +1,96 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplayMaster>\r
-    <!-- \r
-    This file contains all possible tests, in various stages of readiness, \r
-       as noted below in comments.  Files not commented out should work.\r
-     \r
-     Important.  You can't run or source this file.  It is just for reference \r
-        and a storage place to put these tests, so they can be copied into dev-master.xml\r
-        \r
-     Keep this file updated with all possible tests, so that dev-master.xml can be clean.\r
-     \r
-     Keep xml-replay-master.xml updated with all tests that should run on nightly.\r
-   -->\r
-   <!--\r
-    <run controlFile="loanin/loanin.xml" testGroup="makeone" />\r
-    \r
-    <run controlFile="objectexit/object-exit.xml" testGroup="CRUDL" />   \r
-    <run controlFile="objectexit/object-exit.xml" testGroup="domwalk" />\r
-    <run controlFile="objectexit/object-exit.xml" testGroup="repeat" />\r
-    <run controlFile="objectexit/object-exit.xml" testGroup="domlist" />\r
-    <run controlFile="objectexit/object-exit.xml" testGroup="authrefs" />\r
-    <run controlFile="objectexit/object-exit.xml" testGroup="cleanup" />\r
-    <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />\r
-    \r
-    <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />\r
-    <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />\r
-    \r
-    <run controlFile="media/media.xml" testGroup="authrefs" />\r
-    \r
-    <run controlFile="objectexit/object-exit.xml" testGroup="authrefs" />\r
-    <run controlFile="objectexit/object-exit.xml" testGroup="authrefs" />\r
-    <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />\r
-    -->\r
-    \r
-    \r
-    <!--\r
-      Used to verify CSPACE-3178\r
-    <run controlFile="objectexit/object-exit-display.xml" testGroup="refNameDisplayNameOnly" />\r
-    -->\r
-    \r
-    <!--\r
-      Used to measure timings of 1000 records for  CSPACE-3553\r
-    <run controlFile="objectexit/object-exit-LOOP.xml" testGroup="LOOP" />\r
-    -->\r
-     \r
-    <!--\r
-    <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />\r
-    <run controlFile="relation/relation.xml" testGroup="makeRelations" />\r
-    <run controlFile="person/person.xml" testGroup="person" />\r
-    <run controlFile="person/person.xml" testGroup="addOnePerson" />\r
-    \r
-    <run controlFile="person/person.xml" testGroup="updatePerson" />\r
-    <run controlFile="person/person.xml" testGroup="updatePerson" />\r
-    <run controlFile="relation/relation.xml" testGroup="makeRelations" />\r
-   \r
-    <run controlFile="person/person.xml" testGroup="updatePerson" autoDeletePOSTS="true"  />\r
-    <run controlFile="person/person.xml" testGroup="updatePerson" autoDeletePOSTS="true"  />\r
-     \r
-    <run controlFile="person/person.xml" testGroup="postPerson" />\r
-    <run controlFile="relation/relation.xml" testGroup="makeRelationsNested" />\r
-    -->\r
-    \r
-    <!-- TODO: this almost works now:\r
-    <run controlFile="./security.xml" testGroup="security" />\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="relation/relation.xml" testGroup="r2only" />\r
-    <run controlFile="person/person.xml" testGroup="postPerson" />\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
-    <run controlFile="person/person.xml" testGroup="postPerson" />\r
-    \r
-    <run controlFile="relation/relation.xml" testGroup="makeRelations" />\r
-    <run controlFile="relation/relation.xml" testGroup="r2only" />\r
-    <run controlFile="person/person.xml" testGroup="postPerson" />\r
-    <run controlFile="person/person.xml" testGroup="updatePerson" />\r
-    <run controlFile="organization/organization-hierarchy.xml" testGroup="HierarchicOrganization" />\r
-    <run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />\r
-    <run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />\r
-    <run controlFile="location/location-2-authorities.xml" testGroup="HierarchicLocation" />\r
-    <run controlFile="location/location-mixed-hierarchy.xml" testGroup="HierarchicLocation" />\r
-    <run controlFile="batch/batch.xml" />\r
-    <run controlFile="vocabulary/vocabulary.xml" testGroup="TestOrder" />\r
-    \r
-</xmlReplayMaster>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplayMaster>
+    <!-- 
+    This file contains all possible tests, in various stages of readiness, 
+       as noted below in comments.  Files not commented out should work.
+     
+     Important.  You can't run or source this file.  It is just for reference 
+        and a storage place to put these tests, so they can be copied into dev-master.xml
+        
+     Keep this file updated with all possible tests, so that dev-master.xml can be clean.
+     
+     Keep xml-replay-master.xml updated with all tests that should run on nightly.
+   -->
+   <!--
+    <run controlFile="loanin/loanin.xml" testGroup="makeone" />
+    
+    <run controlFile="objectexit/object-exit.xml" testGroup="CRUDL" />   
+    <run controlFile="objectexit/object-exit.xml" testGroup="domwalk" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="repeat" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="domlist" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="authrefs" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="cleanup" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />
+    
+    <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />
+    <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />
+    
+    <run controlFile="media/media.xml" testGroup="authrefs" />
+    
+    <run controlFile="objectexit/object-exit.xml" testGroup="authrefs" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="authrefs" />
+    <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />
+    -->
+    
+    
+    <!--
+      Used to verify CSPACE-3178
+    <run controlFile="objectexit/object-exit-display.xml" testGroup="refNameDisplayNameOnly" />
+    -->
+    
+    <!--
+      Used to measure timings of 1000 records for  CSPACE-3553
+    <run controlFile="objectexit/object-exit-LOOP.xml" testGroup="LOOP" />
+    -->
+     
+    <!--
+    <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />
+    <run controlFile="relation/relation.xml" testGroup="makeRelations" />
+    <run controlFile="person/person.xml" testGroup="person" />
+    <run controlFile="person/person.xml" testGroup="addOnePerson" />
+    
+    <run controlFile="person/person.xml" testGroup="updatePerson" />
+    <run controlFile="person/person.xml" testGroup="updatePerson" />
+    <run controlFile="relation/relation.xml" testGroup="makeRelations" />
+   
+    <run controlFile="person/person.xml" testGroup="updatePerson" autoDeletePOSTS="true"  />
+    <run controlFile="person/person.xml" testGroup="updatePerson" autoDeletePOSTS="true"  />
+     
+    <run controlFile="person/person.xml" testGroup="postPerson" />
+    <run controlFile="relation/relation.xml" testGroup="makeRelationsNested" />
+    -->
+    
+    <!-- TODO: this almost works now:
+    <run controlFile="./security.xml" testGroup="security" />
+    --> 
+    
+    
+    <!-- TODO: make this an override: autoDeletePOSTS="true"-->
+
+    
+    <!--  These all work with POX: -->
+    <run controlFile="./security.xml" testGroup="deleteBug" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />
+    <run controlFile="relation/relation.xml" testGroup="r2only" />
+    <run controlFile="person/person.xml" testGroup="postPerson" />
+       <run controlFile="objectexit/object-exit-display.xml" testGroup="refNameDisplayNameOnly" />
+    <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />
+    <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />
+    <run controlFile="loanout/loanout.xml" testGroup="makeone" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="checkList" />
+    <run controlFile="person/person.xml" testGroup="postPerson" />
+    
+    <run controlFile="relation/relation.xml" testGroup="makeRelations" />
+    <run controlFile="relation/relation.xml" testGroup="r2only" />
+    <run controlFile="person/person.xml" testGroup="postPerson" />
+    <run controlFile="person/person.xml" testGroup="updatePerson" />
+    <run controlFile="organization/organization-hierarchy.xml" testGroup="HierarchicOrganization" />
+    <run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />
+    <run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />
+    <run controlFile="location/location-2-authorities.xml" testGroup="HierarchicLocation" />
+    <run controlFile="location/location-mixed-hierarchy.xml" testGroup="HierarchicLocation" />
+    <run controlFile="batch/batch.xml" />
+    <run controlFile="vocabulary/vocabulary.xml" testGroup="TestOrder" />
+    
+</xmlReplayMaster>
+
index 437b4058d580832ce904c35ff52a1e9160badc37..77912f62ff7a79d4db711249d5204b5ecae99a8f 100644 (file)
@@ -1,48 +1,48 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplayMaster>\r
-<!-- Use this file to drive local testing.  \r
-\r
-     To run this file, copy the checked-in file to your own local version of the correct name\r
-     in the same location.  If it is named dev-master.xml, then XmlReplayDevTest will pick it up.\r
-     If it is not there, XmlReplayDevTest will skip it, which is what we want for production, since \r
-     production runs XmlReplayMasterTest which calls xml-replay-master.xml\r
-     \r
-         cd trunk/services/IntegrationTests/src/test/resources/test-data/xmlreplay/\r
-         cp dev-master-example.xml dev-master.xml\r
-\r
-     IMPORTANT :: DO NOT CHECK IN YOUR LOCAL COPY, CALLED dev-master.xml\r
-                  EITHER LEAVE IT AROUND AND IGNORE THE SVN UNVERSIONED FILE MESSAGE, \r
-                    OR DELETE IT IF IT BOTHERS YOU.\r
-     \r
-     Then, to run this file, you can execute the following: \r
-     \r
-          cd trunk/services/IntegrationTests\r
-          mvn test -Dtest=XmlReplayDevTest\r
-\r
-     Maven surefire will kick off XmlReplayDevTest.\r
-     \r
-                  \r
-     This file can be used to point at a controlFile \r
-                 and a testGroup, so you can test just one thing at a time, or a limited suite.\r
-     \r
-     You can find other tests to run in two places:\r
-       The tests that get run on nightly: \r
-        xml-replay-master.xml\r
-       The set of possible tests, including ones that don't work:\r
-         dev-all.xml\r
--->\r
-    <protoHostPort>http://localhost:8180</protoHostPort>\r
-    \r
-    <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->\r
-    <dump payloads="false" dumpServiceResult="detailed" />\r
-    \r
-    <auths default="admin@core.collectionspace.org">\r
-       <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-    </auths>\r
-    \r
-       <!-- EXAMPLES. JUST UNCOMMENT THEM, AND RUN AS SHOWN ABOVE.\r
-       <run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />\r
-       <run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />\r
-    -->\r
-</xmlReplayMaster>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplayMaster>
+<!-- Use this file to drive local testing.  
+
+     To run this file, copy the checked-in file to your own local version of the correct name
+     in the same location.  If it is named dev-master.xml, then XmlReplayDevTest will pick it up.
+     If it is not there, XmlReplayDevTest will skip it, which is what we want for production, since 
+     production runs XmlReplayMasterTest which calls xml-replay-master.xml
+     
+         cd trunk/services/IntegrationTests/src/test/resources/test-data/xmlreplay/
+         cp dev-master-example.xml dev-master.xml
+
+     IMPORTANT :: DO NOT CHECK IN YOUR LOCAL COPY, CALLED dev-master.xml
+                  EITHER LEAVE IT AROUND AND IGNORE THE SVN UNVERSIONED FILE MESSAGE, 
+                    OR DELETE IT IF IT BOTHERS YOU.
+     
+     Then, to run this file, you can execute the following: 
+     
+          cd trunk/services/IntegrationTests
+          mvn test -Dtest=XmlReplayDevTest
+
+     Maven surefire will kick off XmlReplayDevTest.
+     
+                  
+     This file can be used to point at a controlFile 
+                 and a testGroup, so you can test just one thing at a time, or a limited suite.
+     
+     You can find other tests to run in two places:
+       The tests that get run on nightly: 
+        xml-replay-master.xml
+       The set of possible tests, including ones that don't work:
+         dev-all.xml
+-->
+    <protoHostPort>http://localhost:8180</protoHostPort>
+    
+    <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->
+    <dump payloads="false" dumpServiceResult="detailed" />
+    
+    <auths default="admin@core.collectionspace.org">
+       <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+    </auths>
+    
+       <!-- EXAMPLES. JUST UNCOMMENT THEM, AND RUN AS SHOWN ABOVE.
+       <run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />
+       <run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />
+    -->
+</xmlReplayMaster>
+
index ba2ed1dd8b2f203a03140cba1fe8c2236876adc8..8950382a837d4185903829ca8b1c3b1955a847ab 100644 (file)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplayMaster>\r
-    <protoHostPort>http://localhost:8180</protoHostPort>\r
-    \r
-    <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->\r
-    <dump payloads="false" dumpServiceResult="auto" />\r
-    \r
-    <auths default="admin@core.collectionspace.org">\r
-       <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-    </auths>\r
-\r
-    \r
-    <!--\r
-    <run controlFile="./dimension.xml" testGroup="dimensionTestGroup" />\r
-    -->\r
-\r
-    <!--\r
-    <run controlFile="./dimension.xml" testGroup="dimensionCRUDGroup" />\r
-    -->\r
-\r
-    \r
-</xmlReplayMaster>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplayMaster>
+    <protoHostPort>http://localhost:8180</protoHostPort>
+    
+    <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->
+    <dump payloads="false" dumpServiceResult="auto" />
+    
+    <auths default="admin@core.collectionspace.org">
+       <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+    </auths>
+
+    
+    <!--
+    <run controlFile="./dimension.xml" testGroup="dimensionTestGroup" />
+    -->
+
+    <!--
+    <run controlFile="./dimension.xml" testGroup="dimensionCRUDGroup" />
+    -->
+
+    
+</xmlReplayMaster>
+
index 7f0220dd06fd549e3b2c4097189d85d239bc5704..17e18715351ae87688f3851594f4e215b6f9a991 100644 (file)
@@ -1,76 +1,76 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="admin@core.collectionspace.org">59PnafP1k9rcuGNMxbCfyQ3TphxKBqecsJI2Yv5vrms=</auth>\r
-        <auth ID="bigbird2010">YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=</auth>\r
-    </auths>\r
-    \r
-   <!-- ================================================================================ -->\r
-    \r
-   <testGroup ID="dimensionTestGroup" autoDeletePOSTS="false">\r
-        <!-- should fail on auth="bigbird2010" since bigbird2010 is not defined on back end. -->\r
-        <test ID="dimension1"  auth="bigbird2010">\r
-            <expectedCodes>401,403</expectedCodes>\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <part>\r
-                <label>dimensions_common</label>\r
-                <filename>dimension/1.xml</filename>\r
-            </part>\r
-        </test>\r
-\r
-        <!-- should succeed on auth="test" since test is admin user. -->\r
-        <test ID="dimension2"  auth="admin@core.collectionspace.org">\r
-            <!-- actually, this one should succeed since "test" is admin, but it fails now. -->\r
-            <expectedCodes>201,403</expectedCodes>\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <part>\r
-                <label>dimensions_common</label>\r
-                <filename>dimension/1.xml</filename>\r
-            </part>\r
-        </test>\r
-\r
-        \r
-    </testGroup>\r
-\r
-    <testGroup ID="dimensionCRUDGroup" autoDeletePOSTS="true">\r
-         <!-- should succeed on auth="test" since test is admin user. -->\r
-         <test ID="dimPOST"  auth="admin@core.collectionspace.org">\r
-             <!-- actually, this one should succeed since "test" is admin, but it fails now. -->\r
-             <expectedCodes>201</expectedCodes>\r
-             <method>POST</method>\r
-             <uri>/cspace-services/dimensions/</uri>\r
-             <part>\r
-                 <label>dimensions_common</label>\r
-                 <filename>dimension/1.xml</filename>\r
-             </part>\r
-         </test>\r
-\r
-        <test ID="dimGET"  auth="admin@core.collectionspace.org">\r
-            <!-- actually, this one should succeed since "test" is admin, but it fails now. -->\r
-            <method>GET</method>\r
-            <uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>\r
-        </test>\r
-\r
-        <test ID="dimPUT"  auth="admin@core.collectionspace.org">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>\r
-            <part>\r
-                <label>dimensions_common</label>\r
-                <filename>dimension/2-put.xml</filename>\r
-            </part>\r
-        </test>\r
-\r
-        <test ID="dimGET2"  auth="admin@core.collectionspace.org">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>\r
-        </test>\r
-\r
-\r
-     </testGroup>\r
-\r
-</xmlReplay>\r
-        \r
-        \r
+<?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@core.collectionspace.org">59PnafP1k9rcuGNMxbCfyQ3TphxKBqecsJI2Yv5vrms=</auth>
+        <auth ID="bigbird2010">YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=</auth>
+    </auths>
+    
+   <!-- ================================================================================ -->
+    
+   <testGroup ID="dimensionTestGroup" autoDeletePOSTS="false">
+        <!-- should fail on auth="bigbird2010" since bigbird2010 is not defined on back end. -->
+        <test ID="dimension1"  auth="bigbird2010">
+            <expectedCodes>401,403</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <part>
+                <label>dimensions_common</label>
+                <filename>dimension/1.xml</filename>
+            </part>
+        </test>
+
+        <!-- should succeed on auth="test" since test is admin user. -->
+        <test ID="dimension2"  auth="admin@core.collectionspace.org">
+            <!-- actually, this one should succeed since "test" is admin, but it fails now. -->
+            <expectedCodes>201,403</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <part>
+                <label>dimensions_common</label>
+                <filename>dimension/1.xml</filename>
+            </part>
+        </test>
+
+        
+    </testGroup>
+
+    <testGroup ID="dimensionCRUDGroup" autoDeletePOSTS="true">
+         <!-- should succeed on auth="test" since test is admin user. -->
+         <test ID="dimPOST"  auth="admin@core.collectionspace.org">
+             <!-- actually, this one should succeed since "test" is admin, but it fails now. -->
+             <expectedCodes>201</expectedCodes>
+             <method>POST</method>
+             <uri>/cspace-services/dimensions/</uri>
+             <part>
+                 <label>dimensions_common</label>
+                 <filename>dimension/1.xml</filename>
+             </part>
+         </test>
+
+        <test ID="dimGET"  auth="admin@core.collectionspace.org">
+            <!-- actually, this one should succeed since "test" is admin, but it fails now. -->
+            <method>GET</method>
+            <uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>
+        </test>
+
+        <test ID="dimPUT"  auth="admin@core.collectionspace.org">
+            <method>PUT</method>
+            <uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>
+            <part>
+                <label>dimensions_common</label>
+                <filename>dimension/2-put.xml</filename>
+            </part>
+        </test>
+
+        <test ID="dimGET2"  auth="admin@core.collectionspace.org">
+            <method>GET</method>
+            <uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>
+        </test>
+
+
+     </testGroup>
+
+</xmlReplay>
+        
+        
index 5c84204daa2e6e734d55e758bf36ccf64f4f1e8f..2e9afdc0fb07716e4f63a3b8a73b3834678d65b1 100644 (file)
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="dimensions">\r
-       <ns2:dimensions_common\r
-       xmlns:ns2="http://collectionspace.org/services/dimension"\r
-       xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-         <dimension>dimensionType-1288727556164</dimension>\r
-         <value>entryNumber-1288727556164</value>\r
-         <valueDate>entryDate-1288727556164</valueDate>\r
-       </ns2:dimensions_common>\r
-</document>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="dimensions">
+       <ns2:dimensions_common
+       xmlns:ns2="http://collectionspace.org/services/dimension"
+       xmlns:ns3="http://collectionspace.org/services/jaxb">
+         <dimension>dimensionType-1288727556164</dimension>
+         <value>entryNumber-1288727556164</value>
+         <valueDate>entryDate-1288727556164</valueDate>
+       </ns2:dimensions_common>
+</document>
+
index 2edfa4eb5e74b3f6af6bf0b20e57633beaedd4d0..68213b4575839780f437de18f482ccbda5ef37d7 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="dimensions">\r
-       <ns2:dimensions_common\r
-       xmlns:ns2="http://collectionspace.org/services/dimension"\r
-       xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-         <dimension>dimensionType-1288727552274</dimension>\r
-         <value>updated-entryNumber-1288727552274</value>\r
-         <valueDate>updated-entryDate-1288727552274</valueDate>\r
-       </ns2:dimensions_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="dimensions">
+       <ns2:dimensions_common
+       xmlns:ns2="http://collectionspace.org/services/dimension"
+       xmlns:ns3="http://collectionspace.org/services/jaxb">
+         <dimension>dimensionType-1288727552274</dimension>
+         <value>updated-entryNumber-1288727552274</value>
+         <valueDate>updated-entryDate-1288727552274</valueDate>
+       </ns2:dimensions_common>
+</document>
index 612ed1b2089f6d47f1b00e9ed3c6fa9a175bab1e..caa0f1cef084966d884be4f010e9ccd9ee434516 100644 (file)
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="objectexit">\r
-<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-      <exitNote>This is an exit note written by Sebastián (a-acute accent) and Barnes,\r
-which includes a pleasant façade (c-cedilla) and this cast of additional characters:\r
-Δ : Greek capital letter Delta (U+0394)\r
-Ж : Cyrillic capital letter Zhe with breve (U+04C1)\r
-Ŵ : Latin capital letter W with circumflex (U+0174)\r
-Ω : Greek capital letter Omega (U+03A9)\r
-月 : Han (CJK) character 'moon; month' ((U+6708)</exitNote>\r
-      <exitNumber>OE-IMPORT-TEST-1999.2</exitNumber>\r
-</ns2:objectexit_common>\r
-</document>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="objectexit">
+<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+      <exitNote>This is an exit note written by Sebastián (a-acute accent) and Barnes,
+which includes a pleasant façade (c-cedilla) and this cast of additional characters:
+Δ : Greek capital letter Delta (U+0394)
+Ж : Cyrillic capital letter Zhe with breve (U+04C1)
+Ŵ : Latin capital letter W with circumflex (U+0174)
+Ω : Greek capital letter Omega (U+03A9)
+月 : Han (CJK) character 'moon; month' ((U+6708)</exitNote>
+      <exitNumber>OE-IMPORT-TEST-1999.2</exitNumber>
+</ns2:objectexit_common>
+</document>
+
index d7695200bbef6ca867fc950e4e7b6a969a6a0d05..34c60309df1371e42855897eb2bbff79a84904c6 100644 (file)
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:loansin_common\r
-xmlns:ns2="http://collectionspace.org/services/loanin"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <loanInNumber>loaninNumber-4</loanInNumber>\r
-  <lenderGroupList>\r
-    <lenderGroup>\r
-        <lendersAuthorizer>An Authorizer</lendersAuthorizer>\r
-        <lendersContact>A Contact</lendersContact>\r
-        <lendersAuthorizationDate>October 29, 2009</lendersAuthorizationDate>\r
-        <lender>urn:cspace:org.collectionspace.demo:orgauthority:id(2a6dcf2e-2ec6-47ca-a460):organization:id(b53b23c9-81bf-447b-838f)'Bing+Crosby+Ice+Cream+Sales%2C+Inc.'</lender>\r
-    </lenderGroup>\r
-    <lenderGroup>\r
-        <lendersAuthorizer>An Authorizer 2</lendersAuthorizer>\r
-        <lendersContact>A Contact 2</lendersContact>\r
-        <lendersAuthorizationDate>October 30, 2009</lendersAuthorizationDate>\r
-        <lender>urn:cspace:org.collectionspace.demo:orgauthority:id(2a6dcf2e-2ec6-47ca-a460):organization:id(b53b23c9-81bf-447b-838f)'Another Lender'</lender>\r
-    </lenderGroup>\r
-  </lenderGroupList>\r
-  <loanReturnDate>returnDate-1292347312955</loanReturnDate>\r
-  <loanPurpose>For Surfboards of the 1960s exhibition.</loanPurpose>\r
-  <loanInConditions>Loan in conditions.</loanInConditions>\r
-</ns2:loansin_common>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:loansin_common
+xmlns:ns2="http://collectionspace.org/services/loanin"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <loanInNumber>loaninNumber-4</loanInNumber>
+  <lenderGroupList>
+    <lenderGroup>
+        <lendersAuthorizer>An Authorizer</lendersAuthorizer>
+        <lendersContact>A Contact</lendersContact>
+        <lendersAuthorizationDate>October 29, 2009</lendersAuthorizationDate>
+        <lender>urn:cspace:org.collectionspace.demo:orgauthority:id(2a6dcf2e-2ec6-47ca-a460):organization:id(b53b23c9-81bf-447b-838f)'Bing+Crosby+Ice+Cream+Sales%2C+Inc.'</lender>
+    </lenderGroup>
+    <lenderGroup>
+        <lendersAuthorizer>An Authorizer 2</lendersAuthorizer>
+        <lendersContact>A Contact 2</lendersContact>
+        <lendersAuthorizationDate>October 30, 2009</lendersAuthorizationDate>
+        <lender>urn:cspace:org.collectionspace.demo:orgauthority:id(2a6dcf2e-2ec6-47ca-a460):organization:id(b53b23c9-81bf-447b-838f)'Another Lender'</lender>
+    </lenderGroup>
+  </lenderGroupList>
+  <loanReturnDate>returnDate-1292347312955</loanReturnDate>
+  <loanPurpose>For Surfboards of the 1960s exhibition.</loanPurpose>
+  <loanInConditions>Loan in conditions.</loanInConditions>
+</ns2:loansin_common>
+
+
index 94a9fe10909a6116683da8c1c34c79234965b2e8..7df8f2059bafd25248df3c0ab8d6abcfbe2d468a 100644 (file)
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>\r
-    </auths>\r
-   \r
-    <testGroup ID="makeone" autoDeletePOSTS="false">\r
-       <test ID="ac1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/loansin/</uri>\r
-             <part>\r
-                 <label>loansin_common</label>\r
-                 <filename>loanin/li1.xml</filename>\r
-             </part>\r
-         </test>\r
-     </testGroup>       \r
-\r
-     <testGroup ID="cleanup" autoDeletePOSTS="true">\r
-         <test ID="ac1"  auth="test">\r
-             <method>DELETE</method>\r
-             <uri>/cspace-services/loansin/8080b6b8-393a-4e8a-b823</uri>\r
-         </test>\r
-     </testGroup>\r
-    \r
-\r
-</xmlReplay>\r
+<?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@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
+    </auths>
+   
+    <testGroup ID="makeone" autoDeletePOSTS="false">
+       <test ID="ac1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/loansin/</uri>
+             <part>
+                 <label>loansin_common</label>
+                 <filename>loanin/li1.xml</filename>
+             </part>
+         </test>
+     </testGroup>       
+
+     <testGroup ID="cleanup" autoDeletePOSTS="true">
+         <test ID="ac1"  auth="test">
+             <method>DELETE</method>
+             <uri>/cspace-services/loansin/8080b6b8-393a-4e8a-b823</uri>
+         </test>
+     </testGroup>
+    
+
+</xmlReplay>
index 7c81f5f66bca5bd67648342d363dfa462d1bc831..3acab5b083ce7977ba213ae569e6f3e568d766fd 100644 (file)
@@ -1,86 +1,86 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="locations">\r
-  <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <!-- <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-               <refName>urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier})'${name}'</refName> -->\r
-\r
-       <locTermGroupList>\r
-           <locTermGroup>\r
-               <termPrefForLang>false</termPrefForLang>\r
-               <termName>${name}</termName>\r
-               <termDisplayName>${name}</termDisplayName>\r
-               <termStatus>Approved</termStatus>\r
-           </locTermGroup>\r
-       </locTermGroupList>\r
-           \r
-  </ns2:locations_common>\r
-  <!-- \r
-       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. \r
-          It passes through and then the service deals with it.\r
-  -->\r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${itemCSID}</csid>\r
-                       <!-- <documentType>Locationitem</documentType> -->\r
-               </subject>\r
-               <object>\r
-                 <csid>${parentCSID}</csid>\r
-                       <!-- <uri>${parentUri}</uri>\r
-                       <documentType>Locationitem</documentType> -->\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${childCSID}</csid>\r
-                       <!-- <uri>${childUri}</uri>\r
-                 <documentType>Locationitem</documentType>\r
-                 <name>Child1</name>\r
-                       <number>2200</number> -->\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                       <!-- <documentType>Locationitem</documentType>\r
-                 <name>Item</name>\r
-                       <number>1111</number> -->\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${child2CSID}</csid>\r
-                 <!-- <uri>${child2Uri}</uri>\r
-                 <documentType>Locationitem</documentType>\r
-                 <name>Child2</name>\r
-                 <number>2222</number> -->\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <!-- <documentType>Locationitem</documentType>\r
-                 <name>Item</name>\r
-                       <number>1111</number> -->\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${child3CSID}</csid>\r
-                 <!-- <uri>${child3Uri}</uri>\r
-                 <documentType>Locationitem</documentType>\r
-                 <name>Child3</name>\r
-                       <number>3333</number> -->\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <!-- <documentType>Locationitem</documentType>\r
-                 <name>Item</name>\r
-                       <number>1111</number> -->\r
-               </object>\r
-       </relation-list-item>\r
-  </ns3:relations-common-list>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="locations">
+  <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <!-- <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+               <refName>urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier})'${name}'</refName> -->
+
+       <locTermGroupList>
+           <locTermGroup>
+               <termPrefForLang>false</termPrefForLang>
+               <termName>${name}</termName>
+               <termDisplayName>${name}</termDisplayName>
+               <termStatus>Approved</termStatus>
+           </locTermGroup>
+       </locTermGroupList>
+           
+  </ns2:locations_common>
+  <!-- 
+       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. 
+          It passes through and then the service deals with it.
+  -->
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${itemCSID}</csid>
+                       <!-- <documentType>Locationitem</documentType> -->
+               </subject>
+               <object>
+                 <csid>${parentCSID}</csid>
+                       <!-- <uri>${parentUri}</uri>
+                       <documentType>Locationitem</documentType> -->
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${childCSID}</csid>
+                       <!-- <uri>${childUri}</uri>
+                 <documentType>Locationitem</documentType>
+                 <name>Child1</name>
+                       <number>2200</number> -->
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                       <!-- <documentType>Locationitem</documentType>
+                 <name>Item</name>
+                       <number>1111</number> -->
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${child2CSID}</csid>
+                 <!-- <uri>${child2Uri}</uri>
+                 <documentType>Locationitem</documentType>
+                 <name>Child2</name>
+                 <number>2222</number> -->
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <!-- <documentType>Locationitem</documentType>
+                 <name>Item</name>
+                       <number>1111</number> -->
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${child3CSID}</csid>
+                 <!-- <uri>${child3Uri}</uri>
+                 <documentType>Locationitem</documentType>
+                 <name>Child3</name>
+                       <number>3333</number> -->
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <!-- <documentType>Locationitem</documentType>
+                 <name>Item</name>
+                       <number>1111</number> -->
+               </object>
+       </relation-list-item>
+  </ns3:relations-common-list>
+</document>
+
+
index 43d1b38a2cd8abac6e515d74fd541608371bbb0d..3a64676ac16687203aee03a8414f482f85345086 100644 (file)
@@ -1,44 +1,44 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="locations">\r
-  <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier})'${name}'</refName>\r
-\r
-       <locTermGroupList>\r
-           <locTermGroup>\r
-               <termPrefForLang>false</termPrefForLang>\r
-               <termName>${name}</termName>\r
-               <termDisplayName>${name}</termDisplayName>\r
-               <termStatus>Approved</termStatus>\r
-           </locTermGroup>\r
-       </locTermGroupList>\r
-           \r
-  </ns2:locations_common>\r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${childCSID}</csid>\r
-                 <documentType>Locationitem</documentType>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Locationitem</documentType>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${child2CSID}</csid>\r
-                 <documentType>Locationitem</documentType>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Locationitem</documentType>\r
-               </object>\r
-       </relation-list-item>\r
-  </ns3:relations-common-list>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="locations">
+  <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <refName>urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier})'${name}'</refName>
+
+       <locTermGroupList>
+           <locTermGroup>
+               <termPrefForLang>false</termPrefForLang>
+               <termName>${name}</termName>
+               <termDisplayName>${name}</termDisplayName>
+               <termStatus>Approved</termStatus>
+           </locTermGroup>
+       </locTermGroupList>
+           
+  </ns2:locations_common>
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${childCSID}</csid>
+                 <documentType>Locationitem</documentType>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Locationitem</documentType>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${child2CSID}</csid>
+                 <documentType>Locationitem</documentType>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Locationitem</documentType>
+               </object>
+       </relation-list-item>
+  </ns3:relations-common-list>
+</document>
+
+
index 2306f9ca54c05c4c7c85fa26fe4df8841326cfc8..6367888ed886d61a3bbdaa5c9e0a59b769e5cc62 100644 (file)
@@ -1,61 +1,61 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="locations">\r
-  <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-\r
-       <locTermGroupList>\r
-           <locTermGroup>\r
-               <termPrefForLang>false</termPrefForLang>\r
-               <termName>${name}</termName>\r
-               <termDisplayName>${name}</termDisplayName>\r
-               <termStatus>Approved</termStatus>\r
-           </locTermGroup>\r
-       </locTermGroupList>\r
-           \r
-  </ns2:locations_common>\r
-  <!-- \r
-       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. \r
-          It passes through and then the service deals with it.\r
-  -->\r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${itemCSID}</csid>\r
-               </subject>\r
-               <object>\r
-                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Aisle3)'Aisle 3'</refName>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Shelf1)'Shelf 1'</refName>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Shelf2)'Shelf 2'</refName>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Shelf3)'Shelf 3'</refName>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-               </object>\r
-       </relation-list-item>\r
-  </ns3:relations-common-list>\r
-</document>\r
-\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="locations">
+  <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+
+       <locTermGroupList>
+           <locTermGroup>
+               <termPrefForLang>false</termPrefForLang>
+               <termName>${name}</termName>
+               <termDisplayName>${name}</termDisplayName>
+               <termStatus>Approved</termStatus>
+           </locTermGroup>
+       </locTermGroupList>
+           
+  </ns2:locations_common>
+  <!-- 
+       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. 
+          It passes through and then the service deals with it.
+  -->
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${itemCSID}</csid>
+               </subject>
+               <object>
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Aisle3)'Aisle 3'</refName>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Shelf1)'Shelf 1'</refName>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Shelf2)'Shelf 2'</refName>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Shelf3)'Shelf 3'</refName>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+               </object>
+       </relation-list-item>
+  </ns3:relations-common-list>
+</document>
+
+
+
index 586103dd1899b73a0e2eeb6bbcb9ac620762badb..9b77b3bb608b56e7ba1feec9941af3694a61266e 100644 (file)
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-\r
-<testGroup ID="authrefs" autoDeletePOSTS="false">\r
-        <test ID="oe9">\r
-         <method>POST</method>\r
-         <uri>/cspace-services/personauthorities/</uri>\r
-         <part>\r
-             <label>personauthorities_common</label>\r
-             <filename>media/oe9.xml</filename>\r
-         </part>\r
-      </test>\r
-      <test ID="oe11">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>\r
-             <part>\r
-                 <label>persons_common</label>\r
-                 <filename>media/oe11.xml</filename>\r
-             </part>\r
-        </test>\r
-        <test ID="oe15">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/media/</uri>\r
-             <part>\r
-                 <label>media_common</label>\r
-                 <filename>media/oe15.xml</filename>\r
-             </part>\r
-        </test>\r
-       <test ID="authorityrefs">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/media/${oe15.CSID}/authorityrefs</uri>\r
-        </test>\r
-        <test ID="refObjs">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}/refObjs</uri>\r
-        </test>\r
-    </testGroup>\r
-\r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+
+<testGroup ID="authrefs" autoDeletePOSTS="false">
+        <test ID="oe9">
+         <method>POST</method>
+         <uri>/cspace-services/personauthorities/</uri>
+         <part>
+             <label>personauthorities_common</label>
+             <filename>media/oe9.xml</filename>
+         </part>
+      </test>
+      <test ID="oe11">
+             <method>POST</method>
+             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+             <part>
+                 <label>persons_common</label>
+                 <filename>media/oe11.xml</filename>
+             </part>
+        </test>
+        <test ID="oe15">
+             <method>POST</method>
+             <uri>/cspace-services/media/</uri>
+             <part>
+                 <label>media_common</label>
+                 <filename>media/oe15.xml</filename>
+             </part>
+        </test>
+       <test ID="authorityrefs">
+             <method>GET</method>
+             <uri>/cspace-services/media/${oe15.CSID}/authorityrefs</uri>
+        </test>
+        <test ID="refObjs">
+             <method>GET</method>
+             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}/refObjs</uri>
+        </test>
+    </testGroup>
+
+</xmlReplay>
index e40aa5d41463590da9ff544ce7565c56de76f0d4..1be238962e6781f46e6334571848787184fb0c91 100644 (file)
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:persons_common\r
-xmlns:ns2="http://collectionspace.org/services/person"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <!--<inAuthority>7f441679-ab83-4832-85f9</inAuthority>-->\r
-  <shortIdentifier>owenCurOwner2</shortIdentifier>\r
-  <refName>urn:cspace:org.collectionspace.demo:personauthority:name(MediaPersonAuth2)'MediaPersonAuth2':person:name(owenCurOwner2)</refName>\r
-  <displayNameComputed>true</displayNameComputed>\r
-  <shortDisplayNameComputed>true</shortDisplayNameComputed>\r
-  <foreName>Owen the Cur</foreName>\r
-  <surName>Owner</surName>\r
-</ns2:persons_common>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:persons_common
+xmlns:ns2="http://collectionspace.org/services/person"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <!--<inAuthority>7f441679-ab83-4832-85f9</inAuthority>-->
+  <shortIdentifier>owenCurOwner2</shortIdentifier>
+  <refName>urn:cspace:org.collectionspace.demo:personauthority:name(MediaPersonAuth2)'MediaPersonAuth2':person:name(owenCurOwner2)</refName>
+  <displayNameComputed>true</displayNameComputed>
+  <shortDisplayNameComputed>true</shortDisplayNameComputed>
+  <foreName>Owen the Cur</foreName>
+  <surName>Owner</surName>
+</ns2:persons_common>
+
+
index 600802c720b6b9784cede67b88163992e246ce1e..bd44810d135d6d16c7c77edced9639bd1d643f52 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:media_common\r
-xmlns:ns2="http://collectionspace.org/services/media"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <contributor>urn:cspace:org.collectionspace.demo:personauthority:name(MediaPersonAuth2)'MediaPersonAuth2':person:name(owenCurOwner2)</contributor>\r
-  <title>title new authority</title>\r
-  <source>source 1</source>\r
-</ns2:media_common>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:media_common
+xmlns:ns2="http://collectionspace.org/services/media"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <contributor>urn:cspace:org.collectionspace.demo:personauthority:name(MediaPersonAuth2)'MediaPersonAuth2':person:name(owenCurOwner2)</contributor>
+  <title>title new authority</title>
+  <source>source 1</source>
+</ns2:media_common>
+
+
index 41a99e04a6a6132071f371d1c24369868242dd97..8f580d091da4bf925fe0abbe9a2aeb7b305a85c5 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:personauthorities_common\r
-xmlns:ns2="http://collectionspace.org/services/person"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <displayName>MediaPersonAuth2</displayName>\r
-  <shortIdentifier>MediaPersonAuth2</shortIdentifier>\r
-  <refName>urn:cspace:org.collectionspace.demo:personauthority:name(MediaPersonAuth2)'MediaPersonAuth2'</refName>\r
-  <vocabType>PersonAuthority</vocabType>\r
-</ns2:personauthorities_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:personauthorities_common
+xmlns:ns2="http://collectionspace.org/services/person"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <displayName>MediaPersonAuth2</displayName>
+  <shortIdentifier>MediaPersonAuth2</shortIdentifier>
+  <refName>urn:cspace:org.collectionspace.demo:personauthority:name(MediaPersonAuth2)'MediaPersonAuth2'</refName>
+  <vocabType>PersonAuthority</vocabType>
+</ns2:personauthorities_common>
+
index 20e2375b56b60f73c458390c762a645b14a35558..7d377c40a72e58712eba82c8de8eebe61ba47a57 100644 (file)
@@ -1,53 +1,53 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>\r
-    </auths>\r
-\r
-    <!-- \r
-    ========================================================\r
-            testGroup :: refNameDisplayNameOnly\r
-              Creates a record using only displayName and not shortIdentifier. \r
-    ======================================================== \r
-    -->\r
-    \r
-    <testGroup ID="refNameDisplayNameOnly" autoDeletePOSTS="false">\r
-        <test ID="oePersonauthority">  \r
-             <method>POST</method>\r
-             <uri>/cspace-services/personauthorities/</uri>\r
-             <filename>objectexit/oePersonauthority.xml</filename>\r
-        </test>\r
-        <test ID="oePerson">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}/items/</uri>\r
-             <filename>objectexit/oePersonDisplayOnly.xml</filename>\r
-             <vars>\r
-                <var ID="displayName">Finbar the DisplayName</var>\r
-                <var ID="shortIdentifier">Finbar_the_shortIdentifier</var>\r
-             </vars>\r
-        </test>\r
-        <test ID="oePersonGET">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}/items/${oePerson.CSID}</uri>\r
-            <response>\r
-                <expected level="ADDOK" /><!--server adds the csid -->\r
-                <label>persons_common</label>\r
-                <filename>objectexit/res/oePersonDisplayGET.res.xml</filename>\r
-                <vars>\r
-                    <!-- TODO: .got is not namespace aware yet, so you must make the xpath work around it for now.-->\r
-                    <var ID="csidGot">${oePersonGET.got("//csid")}</var>                      \r
-                    <var ID="inAuthority">${oePersonauthority.CSID}</var>\r
-                    <var ID="inAuthorityShortIdentifier">${oePersonauthority.sent("//shortIdentifier")}</var>\r
-                       <var ID="displayName">${oePerson.sent("//displayName")}</var>\r
-                       <var ID="shortIdentifier">${oePerson.sent("//shortIdentifier")}</var>\r
-                    <var ID="refName">urn:cspace:core.collectionspace.org:personauthorities:name(${inAuthorityShortIdentifier}):item:name(${shortIdentifier})'${displayName}'</var>\r
-                </vars>\r
-             </response>\r
-        </test>\r
-    </testGroup>\r
-\r
-</xmlReplay>\r
-        \r
-        \r
+<?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@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
+    </auths>
+
+    <!-- 
+    ========================================================
+            testGroup :: refNameDisplayNameOnly
+              Creates a record using only displayName and not shortIdentifier. 
+    ======================================================== 
+    -->
+    
+    <testGroup ID="refNameDisplayNameOnly" autoDeletePOSTS="false">
+        <test ID="oePersonauthority">  
+             <method>POST</method>
+             <uri>/cspace-services/personauthorities/</uri>
+             <filename>objectexit/oePersonauthority.xml</filename>
+        </test>
+        <test ID="oePerson">
+             <method>POST</method>
+             <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}/items/</uri>
+             <filename>objectexit/oePersonDisplayOnly.xml</filename>
+             <vars>
+                <var ID="displayName">Finbar the DisplayName</var>
+                <var ID="shortIdentifier">Finbar_the_shortIdentifier</var>
+             </vars>
+        </test>
+        <test ID="oePersonGET">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${oePersonauthority.CSID}/items/${oePerson.CSID}</uri>
+            <response>
+                <expected level="ADDOK" /><!--server adds the csid -->
+                <label>persons_common</label>
+                <filename>objectexit/res/oePersonDisplayGET.res.xml</filename>
+                <vars>
+                    <!-- TODO: .got is not namespace aware yet, so you must make the xpath work around it for now.-->
+                    <var ID="csidGot">${oePersonGET.got("//csid")}</var>                      
+                    <var ID="inAuthority">${oePersonauthority.CSID}</var>
+                    <var ID="inAuthorityShortIdentifier">${oePersonauthority.sent("//shortIdentifier")}</var>
+                       <var ID="displayName">${oePerson.sent("//displayName")}</var>
+                       <var ID="shortIdentifier">${oePerson.sent("//shortIdentifier")}</var>
+                    <var ID="refName">urn:cspace:core.collectionspace.org:personauthorities:name(${inAuthorityShortIdentifier}):item:name(${shortIdentifier})'${displayName}'</var>
+                </vars>
+             </response>
+        </test>
+    </testGroup>
+
+</xmlReplay>
+        
+        
index 6f572089e8b4c196001aec24ca09dd50c624a45c..ad84ffdd714c15b6b4f8d05448bdd0753c264d86 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>\r
-    </auths>\r
-   \r
-    <!-- ============= authrefs ============================================== -->\r
-    <!-- run this group with autoDeletePOSTS="false" and then you can hit\r
-      http://nightly.collectionspace.org:8180/cspace-services/objectexit/\r
-    then grab a CSID, and paste it in here:\r
-      http://nightly.collectionspace.org:8180/cspace-services/objectexit/d781aed4-2e2c-45e2-ad8d/authorityrefs\r
-    -->\r
-    <testGroup ID="authrefs" autoDeletePOSTS="false">\r
-        <test ID="oe9">\r
-         <method>POST</method>\r
-         <uri>/cspace-services/personauthorities/</uri>\r
-         <part>\r
-             <label>personauthorities_common</label>\r
-             <filename>objectexit/oe9.xml</filename>\r
-         </part>\r
-      </test>\r
-      <test ID="oe11">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>\r
-             <part>\r
-                 <label>persons_common</label>\r
-                 <filename>objectexit/oe11.xml</filename>\r
-             </part>\r
-        </test>\r
-        <test ID="oe15">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe15.xml</filename>\r
-             </part>\r
-        </test>\r
-    </testGroup>\r
-     \r
-    <testGroup ID="makeone" autoDeletePOSTS="false">\r
-         <test ID="oe1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>objectexit/oe1.xml</filename>\r
-         </test>\r
-        <test ID="oe2">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>objectexit/res/oe2.res.xml</filename>\r
-                <label>objectexit_common</label>\r
-             </response>\r
-        </test>\r
-    </testGroup>\r
-    \r
-    <testGroup ID="testStartName" autoDeletePOSTS="false">\r
-         <test ID="oe1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>objectexit/oe1.xml</filename>\r
-         </test>\r
-        <test ID="oe2">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>objectexit/res/oe2.res.xml</filename>\r
-                <!-- startElement wins over partName.  partName adorns the partName with /document/*[local-name()='$partName']  where $partName is the element value. -->\r
-                <startElement>/document/*[local-name()='objectexit_common']</startElement>\r
-             </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="targetCSID">${oe35.CSID}</var>\r
-               </vars>\r
-                <!--\r
-                   Look for one <list-item> with the <exitNumber> that\r
-                    we set in the POST, and see if it is in the response\r
-                -->\r
-                <startElement>//list-item[./exitNumber='checkList-1234']</startElement>\r
-             </response>\r
-        </test>\r
-    </testGroup>\r
-\r
-    <testGroup ID="cleanup" autoDeletePOSTS="true">\r
-         <test ID="oe1"  auth="test">\r
-             <method>DELETE</method>\r
-             <uri>/cspace-services/objectexit/065aa56e-a4f5-44b7-955e</uri>\r
-         </test>\r
-         <test ID="oe1"  auth="test">\r
-             <method>DELETE</method>\r
-             <uri>/cspace-services/objectexit/1735327c-f9bb-42c7-959b</uri>\r
-         </test>\r
-         <test ID="oe1"  auth="test">\r
-             <method>DELETE</method>\r
-             <uri>/cspace-services/objectexit/106cb53d-ee79-44e3-8665</uri>\r
-         </test>\r
-    </testGroup>\r
-    \r
-    <testGroup ID="domwalk" autoDeletePOSTS="false">\r
-         <test ID="oe1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe1.xml</filename>\r
-             </part>\r
-         </test>\r
-        <test ID="oe2">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>\r
-            <response>\r
-                <expected level="TEXT" />\r
-                <label>objectexit_common</label>\r
-                <filename>objectexit/res/oe2.res.xml</filename>\r
-             </response>\r
-        </test>\r
-    </testGroup>\r
-\r
-    <!-- ================================================================================ -->\r
-\r
-\r
-    <testGroup ID="repeat" autoDeletePOSTS="true">\r
-        <test ID="oeRepeat"  auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/objectexit/</uri>\r
-            <part>\r
-                <label>objectexit_common</label>\r
-                <filename>objectexit/oeRepeat.xml</filename>\r
-            </part>\r
-        </test>\r
-    </testGroup>\r
-\r
-    <!-- ================================================================================ -->\r
-\r
-     <testGroup ID="CRUDL" autoDeletePOSTS="true">\r
-         <test ID="oe1"  auth="admin@core.collectionspace.org">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe1.xml</filename>\r
-             </part>\r
-         </test>\r
-        <test ID="oe2">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>\r
-            <response>\r
-                <label>objectexit_common</label>\r
-                <filename>objectexit/res/oe2.res.xml</filename>\r
-             </response>\r
-        </test>\r
-        <test ID="oe3">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe3.xml</filename>\r
-             </part>\r
-         </test>\r
-        <test ID="oe4">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe4.xml</filename>\r
-             </part>\r
-         </test>\r
-         <test ID="oe5">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe5.xml</filename>\r
-             </part>\r
-         </test>\r
-         <!--\r
-         <test ID="oe6">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/</uri>\r
-            <response>\r
-                <expected level="ADDOK" />\r
-                <filename>objectexit/res/oe6.res.xml</filename>\r
-             </response>\r
-         -->\r
-            <!-- response>oe6.res.xml</response -->\r
-            <!--response elements will need parts, too, e.g. personauthorities_common -->\r
-            <!-- inside oe6.res.xml, there is a CSID which will change every time, and should be ref'd as 6f7a1e3e-5821-4ef2-bfcf ==> ${oe1.CSID} -->\r
-        <!--\r
-        </test>\r
-         -->\r
-         <test ID="oe7">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/9223372036854775807</uri>\r
-            <expectedCodes>404</expectedCodes>\r
-        </test>\r
-        <test ID="oe8">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>\r
-            <reponse>oe8.res.xml</reponse>\r
-        </test>\r
-         <test ID="oe9">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/personauthorities/</uri>\r
-             <part>\r
-                 <label>personauthorities_common</label>\r
-                 <filename>objectexit/oe9.xml</filename>\r
-             </part>\r
-         </test>\r
-         <test ID="oe10">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${oe9.CSID}</uri>\r
-        </test>\r
-       \r
-        <test ID="oe11">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>\r
-             <part>\r
-                 <label>persons_common</label>\r
-                 <filename>objectexit/oe11.xml</filename>\r
-             </part>\r
-        </test>\r
-        <test ID="oe12">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>\r
-        </test>\r
-        <test ID="oe13">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>\r
-             <part>\r
-                 <label>persons_common</label>\r
-                 <filename>objectexit/oe13.xml</filename>\r
-             </part>\r
-        </test>\r
-        <test ID="oe14">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${oe11.CSID}/items/${oe13.CSID}</uri>\r
-        </test>\r
-        <test ID="oe15">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe15.xml</filename>\r
-             </part>\r
-        </test>\r
-        <test ID="oe16">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/${oe15.CSID}</uri>\r
-        </test>\r
-        <test ID="oe17">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/${oe15.CSID}/authorityrefs/</uri>\r
-        </test>\r
-        <test ID="oe18">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>\r
-        </test>\r
\r
-        <test ID="oe19">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe13.CSID}</uri>\r
-        </test>\r
-        <test ID="oe20">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/personauthorities/${oe9.CSID}</uri>\r
-        </test>\r
-        <test ID="oe21">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/objectexit/${oe15.CSID}</uri>\r
-        </test>\r
-        <test ID="oe22">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>\r
-        </test>\r
-        <test ID="oe23">\r
-             <method>PUT</method>\r
-             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe23.xml</filename>\r
-             </part>\r
-        </test>\r
-        <test ID="oe24">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>\r
-        </test>\r
-        <test ID="oe25">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/objectexit/9223372036854775807</uri>\r
-            <expectedCodes>404</expectedCodes>\r
-        </test>\r
-       <test ID="oe26">\r
-             <method>PUT</method>\r
-             <uri>/cspace-services/objectexit/9223372036854775807</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe23.xml</filename><!-- won't be found, so just re-using older post file as payload.-->\r
-             </part>\r
-             <expectedCodes>404</expectedCodes>\r
-        </test>\r
-        <test ID="oe27">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/?sortBy=&amp;pgNum=0&amp;pgSz=1</uri>\r
-        </test>\r
-        <test ID="oe28">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/?sortBy=&amp;pgNum=0&amp;pgSz=1</uri>\r
-        </test>\r
-        <test ID="oe29">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/?sortBy=&amp;pgNum=1&amp;pgSz=1</uri>\r
-        </test>\r
-        <test ID="oe30">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/?sortBy=&amp;pgNum=2&amp;pgSz=1</uri>\r
-        </test>\r
-        <test ID="oe31">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>\r
-            <expectedCodes>404</expectedCodes>\r
-        </test>\r
-        <test ID="oe32">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/objectexit/${oe3.CSID}</uri>\r
-        </test>\r
-        <test ID="oe33">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/objectexit/${oe4.CSID}</uri>\r
-        </test>\r
-        <test ID="oe34">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/objectexit/${oe5.CSID}</uri>\r
-        </test>\r
-\r
-     </testGroup>\r
-\r
-    <!-- =========== domlist Walk a DOM ================================================ -->\r
-\r
-    <testGroup ID="domlist" autoDeletePOSTS="true">\r
-         <test ID="oe1"  auth="admin@core.collectionspace.org">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe1.xml</filename>\r
-             </part>\r
-         </test>\r
-        <test ID="oe3">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe3.xml</filename>\r
-             </part>\r
-         </test>\r
-        <test ID="oe4">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe4.xml</filename>\r
-             </part>\r
-         </test>\r
-         <test ID="oe5">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <part>\r
-                 <label>objectexit_common</label>\r
-                 <filename>objectexit/oe5.xml</filename>\r
-             </part>\r
-         </test>\r
-         <test ID="oe6">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/objectexit/</uri>\r
-            <response>\r
-                <expected level="TEXT" />\r
-                <filename>objectexit/res/oe6.res.xml</filename>\r
-             </response>\r
-        </test>\r
-    </testGroup>\r
-    \r
-\r
-</xmlReplay>\r
-        \r
-        \r
+<?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@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
+    </auths>
+   
+    <!-- ============= authrefs ============================================== -->
+    <!-- run this group with autoDeletePOSTS="false" and then you can hit
+      http://nightly.collectionspace.org:8180/cspace-services/objectexit/
+    then grab a CSID, and paste it in here:
+      http://nightly.collectionspace.org:8180/cspace-services/objectexit/d781aed4-2e2c-45e2-ad8d/authorityrefs
+    -->
+    <testGroup ID="authrefs" autoDeletePOSTS="false">
+        <test ID="oe9">
+         <method>POST</method>
+         <uri>/cspace-services/personauthorities/</uri>
+         <part>
+             <label>personauthorities_common</label>
+             <filename>objectexit/oe9.xml</filename>
+         </part>
+      </test>
+      <test ID="oe11">
+             <method>POST</method>
+             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+             <part>
+                 <label>persons_common</label>
+                 <filename>objectexit/oe11.xml</filename>
+             </part>
+        </test>
+        <test ID="oe15">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe15.xml</filename>
+             </part>
+        </test>
+    </testGroup>
+     
+    <testGroup ID="makeone" autoDeletePOSTS="false">
+         <test ID="oe1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>objectexit/oe1.xml</filename>
+         </test>
+        <test ID="oe2">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>objectexit/res/oe2.res.xml</filename>
+                <label>objectexit_common</label>
+             </response>
+        </test>
+    </testGroup>
+    
+    <testGroup ID="testStartName" autoDeletePOSTS="false">
+         <test ID="oe1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>objectexit/oe1.xml</filename>
+         </test>
+        <test ID="oe2">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>objectexit/res/oe2.res.xml</filename>
+                <!-- startElement wins over partName.  partName adorns the partName with /document/*[local-name()='$partName']  where $partName is the element value. -->
+                <startElement>/document/*[local-name()='objectexit_common']</startElement>
+             </response>
+        </test>
+    </testGroup>
+    
+    <testGroup ID="checkList" autoDeletePOSTS="true">
+        <test ID="oe35"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <vars>
+               <var ID="exitNumber">checkList-1234</var>
+            </vars>
+            <filename>objectexit/oe35.xml</filename>
+        </test>
+        <test ID="o36">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>objectexit/res/oe35.res.xml</filename>
+                <vars>
+                 <var ID="targetCSID">${oe35.CSID}</var>
+               </vars>
+                <!--
+                   Look for one <list-item> with the <exitNumber> that
+                    we set in the POST, and see if it is in the response
+                -->
+                <startElement>//list-item[./exitNumber='checkList-1234']</startElement>
+             </response>
+        </test>
+    </testGroup>
+
+    <testGroup ID="cleanup" autoDeletePOSTS="true">
+         <test ID="oe1"  auth="test">
+             <method>DELETE</method>
+             <uri>/cspace-services/objectexit/065aa56e-a4f5-44b7-955e</uri>
+         </test>
+         <test ID="oe1"  auth="test">
+             <method>DELETE</method>
+             <uri>/cspace-services/objectexit/1735327c-f9bb-42c7-959b</uri>
+         </test>
+         <test ID="oe1"  auth="test">
+             <method>DELETE</method>
+             <uri>/cspace-services/objectexit/106cb53d-ee79-44e3-8665</uri>
+         </test>
+    </testGroup>
+    
+    <testGroup ID="domwalk" autoDeletePOSTS="false">
+         <test ID="oe1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe1.xml</filename>
+             </part>
+         </test>
+        <test ID="oe2">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+            <response>
+                <expected level="TEXT" />
+                <label>objectexit_common</label>
+                <filename>objectexit/res/oe2.res.xml</filename>
+             </response>
+        </test>
+    </testGroup>
+
+    <!-- ================================================================================ -->
+
+
+    <testGroup ID="repeat" autoDeletePOSTS="true">
+        <test ID="oeRepeat"  auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oeRepeat.xml</filename>
+            </part>
+        </test>
+    </testGroup>
+
+    <!-- ================================================================================ -->
+
+     <testGroup ID="CRUDL" autoDeletePOSTS="true">
+         <test ID="oe1"  auth="admin@core.collectionspace.org">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe1.xml</filename>
+             </part>
+         </test>
+        <test ID="oe2">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+            <response>
+                <label>objectexit_common</label>
+                <filename>objectexit/res/oe2.res.xml</filename>
+             </response>
+        </test>
+        <test ID="oe3">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe3.xml</filename>
+             </part>
+         </test>
+        <test ID="oe4">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe4.xml</filename>
+             </part>
+         </test>
+         <test ID="oe5">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe5.xml</filename>
+             </part>
+         </test>
+         <!--
+         <test ID="oe6">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>objectexit/res/oe6.res.xml</filename>
+             </response>
+         -->
+            <!-- response>oe6.res.xml</response -->
+            <!--response elements will need parts, too, e.g. personauthorities_common -->
+            <!-- inside oe6.res.xml, there is a CSID which will change every time, and should be ref'd as 6f7a1e3e-5821-4ef2-bfcf ==> ${oe1.CSID} -->
+        <!--
+        </test>
+         -->
+         <test ID="oe7">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/9223372036854775807</uri>
+            <expectedCodes>404</expectedCodes>
+        </test>
+        <test ID="oe8">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+            <reponse>oe8.res.xml</reponse>
+        </test>
+         <test ID="oe9">
+             <method>POST</method>
+             <uri>/cspace-services/personauthorities/</uri>
+             <part>
+                 <label>personauthorities_common</label>
+                 <filename>objectexit/oe9.xml</filename>
+             </part>
+         </test>
+         <test ID="oe10">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${oe9.CSID}</uri>
+        </test>
+       
+        <test ID="oe11">
+             <method>POST</method>
+             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+             <part>
+                 <label>persons_common</label>
+                 <filename>objectexit/oe11.xml</filename>
+             </part>
+        </test>
+        <test ID="oe12">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>
+        </test>
+        <test ID="oe13">
+             <method>POST</method>
+             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+             <part>
+                 <label>persons_common</label>
+                 <filename>objectexit/oe13.xml</filename>
+             </part>
+        </test>
+        <test ID="oe14">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${oe11.CSID}/items/${oe13.CSID}</uri>
+        </test>
+        <test ID="oe15">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe15.xml</filename>
+             </part>
+        </test>
+        <test ID="oe16">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/${oe15.CSID}</uri>
+        </test>
+        <test ID="oe17">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/${oe15.CSID}/authorityrefs/</uri>
+        </test>
+        <test ID="oe18">
+            <method>DELETE</method>
+            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>
+        </test>
+        <test ID="oe19">
+            <method>DELETE</method>
+            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe13.CSID}</uri>
+        </test>
+        <test ID="oe20">
+            <method>DELETE</method>
+            <uri>/cspace-services/personauthorities/${oe9.CSID}</uri>
+        </test>
+        <test ID="oe21">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/${oe15.CSID}</uri>
+        </test>
+        <test ID="oe22">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+        </test>
+        <test ID="oe23">
+             <method>PUT</method>
+             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe23.xml</filename>
+             </part>
+        </test>
+        <test ID="oe24">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+        </test>
+        <test ID="oe25">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/9223372036854775807</uri>
+            <expectedCodes>404</expectedCodes>
+        </test>
+       <test ID="oe26">
+             <method>PUT</method>
+             <uri>/cspace-services/objectexit/9223372036854775807</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe23.xml</filename><!-- won't be found, so just re-using older post file as payload.-->
+             </part>
+             <expectedCodes>404</expectedCodes>
+        </test>
+        <test ID="oe27">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/?sortBy=&amp;pgNum=0&amp;pgSz=1</uri>
+        </test>
+        <test ID="oe28">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/?sortBy=&amp;pgNum=0&amp;pgSz=1</uri>
+        </test>
+        <test ID="oe29">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/?sortBy=&amp;pgNum=1&amp;pgSz=1</uri>
+        </test>
+        <test ID="oe30">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/?sortBy=&amp;pgNum=2&amp;pgSz=1</uri>
+        </test>
+        <test ID="oe31">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+            <expectedCodes>404</expectedCodes>
+        </test>
+        <test ID="oe32">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/${oe3.CSID}</uri>
+        </test>
+        <test ID="oe33">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/${oe4.CSID}</uri>
+        </test>
+        <test ID="oe34">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/${oe5.CSID}</uri>
+        </test>
+
+     </testGroup>
+
+    <!-- =========== domlist Walk a DOM ================================================ -->
+
+    <testGroup ID="domlist" autoDeletePOSTS="true">
+         <test ID="oe1"  auth="admin@core.collectionspace.org">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe1.xml</filename>
+             </part>
+         </test>
+        <test ID="oe3">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe3.xml</filename>
+             </part>
+         </test>
+        <test ID="oe4">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe4.xml</filename>
+             </part>
+         </test>
+         <test ID="oe5">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <part>
+                 <label>objectexit_common</label>
+                 <filename>objectexit/oe5.xml</filename>
+             </part>
+         </test>
+         <test ID="oe6">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <response>
+                <expected level="TEXT" />
+                <filename>objectexit/res/oe6.res.xml</filename>
+             </response>
+        </test>
+    </testGroup>
+    
+
+</xmlReplay>
+        
+        
index 78ee566930a38c3c2e3319d3306fd25cf98ad552..1e94f2838eb9545205d043e30209baaa3a8b64df 100644 (file)
@@ -1,10 +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>objectexitNumber-1290026472360</exitNumber>\r
-    </ns2:objectexit_common>\r
-</document>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="objectexit">
+    <ns2:objectexit_common
+            xmlns:ns2="http://collectionspace.org/services/objectexit"
+            xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>
+        <exitNumber>objectexitNumber-1290026472360</exitNumber>
+    </ns2:objectexit_common>
+</document>
+
index fac5fb04e1770a5274f01ce6d147e43d510f9d55..2b55fdd122fda2677fcebfa6a0bda145a29913e7 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><inAuthority>7f441679-ab83-4832-85f9</inAuthority><shortIdentifier>owenCurOwner</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(owenCurOwner)</refName><displayNameComputed>true</displayNameComputed><shortDisplayNameComputed>true</shortDisplayNameComputed><foreName>Owen the Cur</foreName><surName>Owner</surName></ns2:persons_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><inAuthority>7f441679-ab83-4832-85f9</inAuthority><shortIdentifier>owenCurOwner</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(owenCurOwner)</refName><displayNameComputed>true</displayNameComputed><shortDisplayNameComputed>true</shortDisplayNameComputed><foreName>Owen the Cur</foreName><surName>Owner</surName></ns2:persons_common>
+
index 94beedf9e00016849c80c38aac31ab4582cad79c..6dfd4603d7c2f7513e494634b3145e8b9b9616c6 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><inAuthority>7f441679-ab83-4832-85f9</inAuthority><shortIdentifier>davenportDepositor</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</refName><displayNameComputed>true</displayNameComputed><shortDisplayNameComputed>true</shortDisplayNameComputed><foreName>Davenport</foreName><surName>Depositor</surName></ns2:persons_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><inAuthority>7f441679-ab83-4832-85f9</inAuthority><shortIdentifier>davenportDepositor</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</refName><displayNameComputed>true</displayNameComputed><shortDisplayNameComputed>true</shortDisplayNameComputed><foreName>Davenport</foreName><surName>Depositor</surName></ns2:persons_common>
+
index 4c156cd2040cc5b5238bfbd5f027d06703437581..3c358d87a3b279e4241177081fdb865bfd5b94eb 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</depositor><exitDate>exitDate-1290026474563</exitDate><exitNumber>exitNumber-1290026474563</exitNumber></ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</depositor><exitDate>exitDate-1290026474563</exitDate><exitNumber>exitNumber-1290026474563</exitNumber></ns2:objectexit_common>
+
index ce7491206e804f26a2f805c797c47200f80e7e6c..01e31df124b85fd5dcc67c62e9fc66b13b2ab28e 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor><exitNumber>updated-objectexitNumber-1290026472360</exitNumber></ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor><exitNumber>updated-objectexitNumber-1290026472360</exitNumber></ns2:objectexit_common>
+
index 3f59daaa0c0d9dd63a61705f86a3da5eafd7c6d2..44d98316fab1473033d268826ed3f31fbb3debb7 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor><exitNumber>objectexitNumber-1290026473391</exitNumber></ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor><exitNumber>objectexitNumber-1290026473391</exitNumber></ns2:objectexit_common>
+
index a707148dc6c9dfa99ac0b54b43457240aa56bffd..988c995d49d7ced5bff5cece14e4bdf6b9efee96 100644 (file)
@@ -1,10 +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
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="objectexit">
+    <ns2:objectexit_common
+            xmlns:ns2="http://collectionspace.org/services/objectexit"
+            xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>
+        <exitNumber>${exitNumber}</exitNumber>
+    </ns2:objectexit_common>
+</document>
+
index cc92b72d9bd67ffa0ad0bc91eb465738a56b511a..2554e28592a30bea34226f2996ffb6668786063d 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor><exitNumber>objectexitNumber-1290026473626</exitNumber></ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor><exitNumber>objectexitNumber-1290026473626</exitNumber></ns2:objectexit_common>
+
index b7c110026f7e1b4a5f694ec0d2e31e9e183be537..5d82a1e2bc899076e44b3ccfd243add02dfb882c 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor><exitNumber>objectexitNumber-1290026473860</exitNumber></ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor><exitNumber>objectexitNumber-1290026473860</exitNumber></ns2:objectexit_common>
+
index de0c7cc4b49d04398cf07600a1719f32bb7460bb..41fbedd9a14b5cb03f43a286d3a97e7aa6eadd5a 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><displayName>ObjectexitPersonAuth</displayName><shortIdentifier>ObjectexitPersonAuth</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth'</refName><vocabType>PersonAuthority</vocabType></ns2:personauthorities_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><displayName>ObjectexitPersonAuth</displayName><shortIdentifier>ObjectexitPersonAuth</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth'</refName><vocabType>PersonAuthority</vocabType></ns2:personauthorities_common>
+
index 17acce70aa7baad603c77984ed3222658ed06662..2db2785ce456bbbc6f8ae99995fa3c95fba833a7 100644 (file)
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:objectexit_common\r
-xmlns:ns2="http://collectionspace.org/services/objectexit"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <depositor>${depositor}</depositor>\r
-  <currentOwner>${currentOwner}</currentOwner>\r
-  <exitDate>exitDate-1290026474563</exitDate>\r
-  <exitNumber>${exitNumber}</exitNumber>\r
-</ns2:objectexit_common>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:objectexit_common
+xmlns:ns2="http://collectionspace.org/services/objectexit"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <depositor>${depositor}</depositor>
+  <currentOwner>${currentOwner}</currentOwner>
+  <exitDate>exitDate-1290026474563</exitDate>
+  <exitNumber>${exitNumber}</exitNumber>
+</ns2:objectexit_common>
index 28e4a7b008e049f4ca74ffd54fdfb0b6e1057f8a..ab6ff8be224a042a8ad3d69fe5c5e59a9bf03be7 100644 (file)
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="persons">\r
-       <ns2:persons_common\r
-       xmlns:ns2="http://collectionspace.org/services/person"\r
-       xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-               <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-               <personTermGroupList>\r
-                       <personTermGroup>\r
-                               <termName>${displayName}</termName>\r
-                               <termPrefForLang>false</termPrefForLang>\r
-                               <termDisplayName>${displayName}</termDisplayName>\r
-                       </personTermGroup>\r
-               </personTermGroupList>  \r
-       </ns2:persons_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+       <ns2:persons_common
+       xmlns:ns2="http://collectionspace.org/services/person"
+       xmlns:ns3="http://collectionspace.org/services/jaxb">
+               <shortIdentifier>${shortIdentifier}</shortIdentifier>
+               <personTermGroupList>
+                       <personTermGroup>
+                               <termName>${displayName}</termName>
+                               <termPrefForLang>false</termPrefForLang>
+                               <termDisplayName>${displayName}</termDisplayName>
+                       </personTermGroup>
+               </personTermGroupList>  
+       </ns2:persons_common>
+</document>
index b66c80abc8f4176a7d8a152165e584de40a04e95..0fd40a5888fc13b96564aa0815a477387bdb9fca 100644 (file)
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="personauthorities">\r
-<ns2:personauthorities_common\r
-xmlns:ns2="http://collectionspace.org/services/person"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <displayName>Default Person Authority</displayName>\r
-  <shortIdentifier>defaultPersonAuthority</shortIdentifier>\r
-  <vocabType>PersonAuthority</vocabType>\r
-</ns2:personauthorities_common>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="personauthorities">
+<ns2:personauthorities_common
+xmlns:ns2="http://collectionspace.org/services/person"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <displayName>Default Person Authority</displayName>
+  <shortIdentifier>defaultPersonAuthority</shortIdentifier>
+  <vocabType>PersonAuthority</vocabType>
+</ns2:personauthorities_common>
+</document>
+
+
index 5ea3b5c6c68521f2862c1912613f6fe19608e471..38eeff9a3edfa6b7197504ad88615df2ef494695 100644 (file)
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\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>objectexitNumber-1290026472360</exitNumber>\r
-  <exitMethods>\r
-      <exitMethods>courier</exitMethods>\r
-  </exitMethods>\r
-</ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:objectexit_common
+xmlns:ns2="http://collectionspace.org/services/objectexit"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>
+  <exitNumber>objectexitNumber-1290026472360</exitNumber>
+  <exitMethods>
+      <exitMethods>courier</exitMethods>
+  </exitMethods>
+</ns2:objectexit_common>
+
index 20ae40fd4d4a9b85b72d6e6fb1878ae5d833d388..de123420aba5d964887a1356d4a6e1bd19324f5d 100644 (file)
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/personauthorities_common.xsd">\r
-<shortIdentifier>ObjectexitPersonAuth</shortIdentifier>\r
-<refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth'</refName>\r
-<csid>${oe9.CSID}</csid>\r
-<displayName>ObjectexitPersonAuth</displayName>\r
-<vocabType>PersonAuthority</vocabType>\r
-</ns2:personauthorities_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/personauthorities_common.xsd">
+<shortIdentifier>ObjectexitPersonAuth</shortIdentifier>
+<refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth'</refName>
+<csid>${oe9.CSID}</csid>
+<displayName>ObjectexitPersonAuth</displayName>
+<vocabType>PersonAuthority</vocabType>
+</ns2:personauthorities_common>
+
index 61e1d7447f444d54c9b4e0e9f184a4bb6fec03ed..3103f4568d469dca96fcae88913f28aeecbabe34 100644 (file)
@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/persons_common.xsd">\r
-<surName>Owner</surName>\r
-<nationalities/>\r
-<shortIdentifier>owenCurOwner</shortIdentifier>\r
-<shortDisplayName>Owen the Cur Owner</shortDisplayName>\r
-<schoolsOrStyles/>\r
-<foreName>Owen the Cur</foreName>\r
-<groups/>\r
-<occupations/>\r
-<displayNameComputed>true</displayNameComputed>\r
-<csid>${oe11.CSID}</csid>\r
-<shortDisplayNameComputed>true</shortDisplayNameComputed>\r
-<inAuthority>${oe9.CSID}</inAuthority>\r
-<refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(owenCurOwner)</refName>\r
-<displayName>Owen the Cur Owner</displayName>\r
-</ns2:persons_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/persons_common.xsd">
+<surName>Owner</surName>
+<nationalities/>
+<shortIdentifier>owenCurOwner</shortIdentifier>
+<shortDisplayName>Owen the Cur Owner</shortDisplayName>
+<schoolsOrStyles/>
+<foreName>Owen the Cur</foreName>
+<groups/>
+<occupations/>
+<displayNameComputed>true</displayNameComputed>
+<csid>${oe11.CSID}</csid>
+<shortDisplayNameComputed>true</shortDisplayNameComputed>
+<inAuthority>${oe9.CSID}</inAuthority>
+<refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(owenCurOwner)</refName>
+<displayName>Owen the Cur Owner</displayName>
+</ns2:persons_common>
+
index ba4aaee509bec62d13ddc5656403d9a332dbc453..8137c6ffe3d403c7bd570c8c335f20d4d018fa33 100644 (file)
@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/persons_common.xsd">\r
-<surName>Depositor</surName>\r
-<nationalities/>\r
-<shortIdentifier>davenportDepositor</shortIdentifier>\r
-<shortDisplayName>Davenport Depositor</shortDisplayName>\r
-<schoolsOrStyles/>\r
-<foreName>Davenport</foreName>\r
-<groups/>\r
-<occupations/>\r
-<displayNameComputed>true</displayNameComputed>\r
-<csid>${oe13.CSID}</csid>\r
-<shortDisplayNameComputed>true</shortDisplayNameComputed>\r
-<inAuthority>${oe9.CSID}</inAuthority>\r
-<refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</refName>\r
-<displayName>Davenport Depositor</displayName>\r
-</ns2:persons_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/persons_common.xsd">
+<surName>Depositor</surName>
+<nationalities/>
+<shortIdentifier>davenportDepositor</shortIdentifier>
+<shortDisplayName>Davenport Depositor</shortDisplayName>
+<schoolsOrStyles/>
+<foreName>Davenport</foreName>
+<groups/>
+<occupations/>
+<displayNameComputed>true</displayNameComputed>
+<csid>${oe13.CSID}</csid>
+<shortDisplayNameComputed>true</shortDisplayNameComputed>
+<inAuthority>${oe9.CSID}</inAuthority>
+<refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</refName>
+<displayName>Davenport Depositor</displayName>
+</ns2:persons_common>
+
index d79e702f7ed1992ff05552bc2a304f48cdc0f0fb..f683e10da8153b7156ece0dffd191a8416958a6a 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">\r
-<exitDate>exitDate-1290026474563</exitDate>\r
-<exitNumber>exitNumber-1290026474563</exitNumber>\r
-<depositor>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</depositor>\r
-</ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">
+<exitDate>exitDate-1290026474563</exitDate>
+<exitNumber>exitNumber-1290026474563</exitNumber>
+<depositor>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</depositor>
+</ns2:objectexit_common>
+
index 97c4e2d9bae6c58524c80788dd1352819b60750b..f08d1208697ebd6ef4eb541aca6eaa6bd8905cac 100644 (file)
@@ -1,14 +1,14 @@
-<?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
+<?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>
+
index d690617d73adb86ec5052f9f40e7164cd6cf191c..d8dc4c1a522c3aaad1a73ccdd90ec0611195acc5 100644 (file)
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="objectexit">\r
-<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-    <exitMethods/>\r
-    <exitNumber>objectexitNumber-1290026472360</exitNumber>\r
-    <depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'\r
-    </depositor>\r
-</ns2:objectexit_common>\r
-<ns2:collectionspace_core xmlns:ns2="http://collectionspace.org/collectionspace_core/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-    <tenantId>1</tenantId>\r
-</ns2:collectionspace_core>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="objectexit">
+<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <exitMethods/>
+    <exitNumber>objectexitNumber-1290026472360</exitNumber>
+    <depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'
+    </depositor>
+</ns2:objectexit_common>
+<ns2:collectionspace_core xmlns:ns2="http://collectionspace.org/collectionspace_core/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <tenantId>1</tenantId>
+</ns2:collectionspace_core>
+</document>
+
+
index ce5931731ba823d1334694de242552c053516548..b56a2b0020e25129404dc1deadda19fefe8411f0 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">\r
-<exitNumber>objectexitNumber-1290026472360</exitNumber>\r
-<depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>\r
-</ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">
+<exitNumber>objectexitNumber-1290026472360</exitNumber>
+<depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>
+</ns2:objectexit_common>
+
index 31e03b825f5d81437b9a8b5e88f3db0baf932676..0721d6ada6b1fd53014321e306fa18a653acba69 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">\r
-<exitNumber>updated-objectexitNumber-1290026472360</exitNumber>\r
-<depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>\r
-</ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">
+<exitNumber>updated-objectexitNumber-1290026472360</exitNumber>
+<depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>
+</ns2:objectexit_common>
+
index 7c21e3e3bae378c2ec4cd6e3e14bca00c9929acd..7e48d15b18530b47c84c7843adb1ab88b8dc6988 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common_list xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><pageNum>0</pageNum><pageSize>1</pageSize><itemsInPage>1</itemsInPage><totalItems>3</totalItems><fieldsReturned>currentOwner|depositor|exitDate|exitMethod|exitNote|exitNumber|exitReason|packingNote|uri|csid</fieldsReturned><objectexit_list_item><exitNumber>objectexitNumber-1290026473391</exitNumber><uri>/objectexit/${oe3.CSID}</uri><csid>${oe3.CSID}</csid></objectexit_list_item></ns2:objectexit_common_list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common_list xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><pageNum>0</pageNum><pageSize>1</pageSize><itemsInPage>1</itemsInPage><totalItems>3</totalItems><fieldsReturned>currentOwner|depositor|exitDate|exitMethod|exitNote|exitNumber|exitReason|packingNote|uri|csid</fieldsReturned><objectexit_list_item><exitNumber>objectexitNumber-1290026473391</exitNumber><uri>/objectexit/${oe3.CSID}</uri><csid>${oe3.CSID}</csid></objectexit_list_item></ns2:objectexit_common_list>
+
index 7c21e3e3bae378c2ec4cd6e3e14bca00c9929acd..7e48d15b18530b47c84c7843adb1ab88b8dc6988 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common_list xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><pageNum>0</pageNum><pageSize>1</pageSize><itemsInPage>1</itemsInPage><totalItems>3</totalItems><fieldsReturned>currentOwner|depositor|exitDate|exitMethod|exitNote|exitNumber|exitReason|packingNote|uri|csid</fieldsReturned><objectexit_list_item><exitNumber>objectexitNumber-1290026473391</exitNumber><uri>/objectexit/${oe3.CSID}</uri><csid>${oe3.CSID}</csid></objectexit_list_item></ns2:objectexit_common_list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common_list xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><pageNum>0</pageNum><pageSize>1</pageSize><itemsInPage>1</itemsInPage><totalItems>3</totalItems><fieldsReturned>currentOwner|depositor|exitDate|exitMethod|exitNote|exitNumber|exitReason|packingNote|uri|csid</fieldsReturned><objectexit_list_item><exitNumber>objectexitNumber-1290026473391</exitNumber><uri>/objectexit/${oe3.CSID}</uri><csid>${oe3.CSID}</csid></objectexit_list_item></ns2:objectexit_common_list>
+
index f66fb74fa97f0f13cc253199a2b2ba12ecd6217e..f0d63b3635f9cfbbb33caa0becd6c490dd5cdbe6 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common_list xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><pageNum>1</pageNum><pageSize>1</pageSize><itemsInPage>1</itemsInPage><totalItems>3</totalItems><fieldsReturned>currentOwner|depositor|exitDate|exitMethod|exitNote|exitNumber|exitReason|packingNote|uri|csid</fieldsReturned><objectexit_list_item><exitNumber>objectexitNumber-1290026473626</exitNumber><uri>/objectexit/${oe4.CSID}</uri><csid>${oe4.CSID}</csid></objectexit_list_item></ns2:objectexit_common_list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common_list xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><pageNum>1</pageNum><pageSize>1</pageSize><itemsInPage>1</itemsInPage><totalItems>3</totalItems><fieldsReturned>currentOwner|depositor|exitDate|exitMethod|exitNote|exitNumber|exitReason|packingNote|uri|csid</fieldsReturned><objectexit_list_item><exitNumber>objectexitNumber-1290026473626</exitNumber><uri>/objectexit/${oe4.CSID}</uri><csid>${oe4.CSID}</csid></objectexit_list_item></ns2:objectexit_common_list>
+
index 72cdfbf2bdf5bf5a9a41390d1a37900332575a29..99cd58d3d4cf23debc8f677e1499ad1a7f3aec19 100644 (file)
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common_list xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><pageNum>2</pageNum><pageSize>1</pageSize><itemsInPage>1</itemsInPage><totalItems>3</totalItems><fieldsReturned>currentOwner|depositor|exitDate|exitMethod|exitNote|exitNumber|exitReason|packingNote|uri|csid</fieldsReturned><objectexit_list_item><exitNumber>objectexitNumber-1290026473860</exitNumber><uri>/objectexit/${oe5.CSID}</uri><csid>${oe5.CSID}</csid></objectexit_list_item></ns2:objectexit_common_list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common_list xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><pageNum>2</pageNum><pageSize>1</pageSize><itemsInPage>1</itemsInPage><totalItems>3</totalItems><fieldsReturned>currentOwner|depositor|exitDate|exitMethod|exitNote|exitNumber|exitReason|packingNote|uri|csid</fieldsReturned><objectexit_list_item><exitNumber>objectexitNumber-1290026473860</exitNumber><uri>/objectexit/${oe5.CSID}</uri><csid>${oe5.CSID}</csid></objectexit_list_item></ns2:objectexit_common_list>
+
index 0704abb0cfa2cfb07ccd1ec336dcf52574f71678..0518b77ee580512062c031e000e04cf32fc2e5f3 100644 (file)
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:objectexit_common_list\r
-xmlns:ns2="http://collectionspace.org/services/objectexit"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <pageNum>0</pageNum>\r
-  <pageSize>40</pageSize>\r
-  <itemsInPage>4</itemsInPage>\r
-  <totalItems>4</totalItems>\r
-  <fieldsReturned>exitNumber|currentOwner|uri|csid</fieldsReturned>\r
-\r
-  <objectexit_list_item ID="e1-oe5">\r
-    <exitNumber>objectexitNumber-1290026473860</exitNumber>\r
-    <uri>/objectexit/${oe5.CSID}</uri>\r
-    <csid>${oe5.CSID}</csid>\r
-  </objectexit_list_item>\r
-  \r
-  <objectexit_list_item ID="e2-oe3">\r
-    <exitNumber>objectexitNumber-1290026473391</exitNumber>\r
-    <uri>/objectexit/${oe3.CSID}</uri>\r
-    <csid>${oe3.CSID}</csid>\r
-  </objectexit_list_item>\r
-  \r
-  <objectexit_list_item ID="e3-oe4">\r
-    <exitNumber>objectexitNumber-1290026473626</exitNumber>\r
-    <uri>/objectexit/${oe4.CSID}</uri>\r
-    <csid>${oe4.CSID}</csid>\r
-  </objectexit_list_item>\r
-\r
-  <objectexit_list_item ID="e4-oe1">\r
-    <exitNumber>objectexitNumber-1290026472360</exitNumber>\r
-    <uri>/objectexit/${oe1.CSID}</uri>\r
-    <csid>${oe1.CSID}</csid>\r
-  </objectexit_list_item>\r
-  </ns2:objectexit_common_list>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:objectexit_common_list
+xmlns:ns2="http://collectionspace.org/services/objectexit"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <pageNum>0</pageNum>
+  <pageSize>40</pageSize>
+  <itemsInPage>4</itemsInPage>
+  <totalItems>4</totalItems>
+  <fieldsReturned>exitNumber|currentOwner|uri|csid</fieldsReturned>
+
+  <objectexit_list_item ID="e1-oe5">
+    <exitNumber>objectexitNumber-1290026473860</exitNumber>
+    <uri>/objectexit/${oe5.CSID}</uri>
+    <csid>${oe5.CSID}</csid>
+  </objectexit_list_item>
+  
+  <objectexit_list_item ID="e2-oe3">
+    <exitNumber>objectexitNumber-1290026473391</exitNumber>
+    <uri>/objectexit/${oe3.CSID}</uri>
+    <csid>${oe3.CSID}</csid>
+  </objectexit_list_item>
+  
+  <objectexit_list_item ID="e3-oe4">
+    <exitNumber>objectexitNumber-1290026473626</exitNumber>
+    <uri>/objectexit/${oe4.CSID}</uri>
+    <csid>${oe4.CSID}</csid>
+  </objectexit_list_item>
+
+  <objectexit_list_item ID="e4-oe1">
+    <exitNumber>objectexitNumber-1290026472360</exitNumber>
+    <uri>/objectexit/${oe1.CSID}</uri>
+    <csid>${oe1.CSID}</csid>
+  </objectexit_list_item>
+  </ns2:objectexit_common_list>
+
+
index ce5931731ba823d1334694de242552c053516548..b56a2b0020e25129404dc1deadda19fefe8411f0 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">\r
-<exitNumber>objectexitNumber-1290026472360</exitNumber>\r
-<depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>\r
-</ns2:objectexit_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/objectexit http://services.collectionspace.org/objectexit/objectexit_common.xsd">
+<exitNumber>objectexitNumber-1290026472360</exitNumber>
+<depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>
+</ns2:objectexit_common>
+
index 27d07505d64b19c89b8ddefb95a104b928870501..b4661808e328ab6d66e3d6f7d8f5f672b09b9ac0 100644 (file)
@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <testGroup ID="organization" autoDeletePOSTS="true">\r
-        <test ID="OrgAuth1" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/orgauthorities/</uri>\r
-            <part>\r
-                <label>orgauthorities_common</label>\r
-                <filename>organization/orgauthorities_common.xml</filename>\r
-            </part>\r
-        </test>\r
-        <test ID="Org1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/</uri>\r
-            <part>\r
-                <label>organizations_common</label>\r
-                <filename>organization/organizations_common.xml</filename>\r
-            </part>\r
-        </test>\r
-        <test>\r
-            <method>GET</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/${Org1.CSID}</uri>\r
-        </test>\r
-        <test>\r
-            <method>GET</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}</uri>\r
-        </test>\r
-        <test ID="oneOrg">\r
-            <method>LIST</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}</uri>\r
-        </test>\r
-        <test ID="organizationList2">\r
-            <method>LIST</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/</uri>\r
-        </test>\r
-    </testGroup>\r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+    <testGroup ID="organization" autoDeletePOSTS="true">
+        <test ID="OrgAuth1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/orgauthorities/</uri>
+            <part>
+                <label>orgauthorities_common</label>
+                <filename>organization/orgauthorities_common.xml</filename>
+            </part>
+        </test>
+        <test ID="Org1">
+            <method>POST</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/</uri>
+            <part>
+                <label>organizations_common</label>
+                <filename>organization/organizations_common.xml</filename>
+            </part>
+        </test>
+        <test>
+            <method>GET</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/${Org1.CSID}</uri>
+        </test>
+        <test>
+            <method>GET</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}</uri>
+        </test>
+        <test ID="oneOrg">
+            <method>LIST</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}</uri>
+        </test>
+        <test ID="organizationList2">
+            <method>LIST</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/</uri>
+        </test>
+    </testGroup>
+</xmlReplay>
index 16bb193149e4c6d015655fcae3c31b5890f66c2e..7185bbd8fd2a575d3a67e14656b6ab8509c16bbf 100644 (file)
@@ -1,83 +1,83 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="organizations">\r
-  <ns2:organizations_common xmlns:ns2="http://collectionspace.org/services/organization" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:organizationauthority:name(${authShortIdentifier}):organization:name(${shortIdentifier})'${name}'</refName>\r
-\r
-       <orgTermGroupList>\r
-               <orgTermGroup>\r
-                       <additionsToName/>\r
-                       <termName>${name}</termName>\r
-                       <termSource/>\r
-                       <termSourceID/>\r
-                       <termSourceNote/>\r
-                       <termLanguage/>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>${name}</termDisplayName>\r
-                       <termType/>\r
-                       <mainBodyName>The real test official test organization</mainBodyName>\r
-                       <termStatus/>\r
-                       <termQualifier/>\r
-                       <termSourceDetail/>\r
-               </orgTermGroup>\r
-       </orgTermGroupList>\r
-\r
-  </ns2:organizations_common>\r
-  <!-- \r
-       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. \r
-          It passes through and then the service deals with it.\r
-  -->\r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Organization</documentType>\r
-               </subject>\r
-               <object>\r
-                 <csid>${parentCSID}</csid>\r
-                 <uri>${parentUri}</uri>\r
-                 <documentType>Organization</documentType>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${childCSID}</csid>\r
-                 <uri>${childUri}</uri>\r
-                 <documentType>Organization</documentType>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Organization</documentType>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <uri>${child2Uri}</uri>\r
-                 <csid>${child2CSID}</csid>\r
-                 <documentType>Organization</documentType>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Organization</documentType>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <uri>${child3Uri}</uri>\r
-                 <csid>${child3CSID}</csid>\r
-                 <documentType>Organization</documentType>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Organization</documentType>\r
-               </object>\r
-       </relation-list-item>\r
-  </ns3:relations-common-list>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="organizations">
+  <ns2:organizations_common xmlns:ns2="http://collectionspace.org/services/organization" xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <refName>urn:cspace:org.collectionspace.demo:organizationauthority:name(${authShortIdentifier}):organization:name(${shortIdentifier})'${name}'</refName>
+
+       <orgTermGroupList>
+               <orgTermGroup>
+                       <additionsToName/>
+                       <termName>${name}</termName>
+                       <termSource/>
+                       <termSourceID/>
+                       <termSourceNote/>
+                       <termLanguage/>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>${name}</termDisplayName>
+                       <termType/>
+                       <mainBodyName>The real test official test organization</mainBodyName>
+                       <termStatus/>
+                       <termQualifier/>
+                       <termSourceDetail/>
+               </orgTermGroup>
+       </orgTermGroupList>
+
+  </ns2:organizations_common>
+  <!-- 
+       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. 
+          It passes through and then the service deals with it.
+  -->
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Organization</documentType>
+               </subject>
+               <object>
+                 <csid>${parentCSID}</csid>
+                 <uri>${parentUri}</uri>
+                 <documentType>Organization</documentType>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${childCSID}</csid>
+                 <uri>${childUri}</uri>
+                 <documentType>Organization</documentType>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Organization</documentType>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <uri>${child2Uri}</uri>
+                 <csid>${child2CSID}</csid>
+                 <documentType>Organization</documentType>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Organization</documentType>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <uri>${child3Uri}</uri>
+                 <csid>${child3CSID}</csid>
+                 <documentType>Organization</documentType>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Organization</documentType>
+               </object>
+       </relation-list-item>
+  </ns3:relations-common-list>
+</document>
+
+
index 1e12090bc735cfd0d3047b28b7d08363f80fd3e3..0f6494c87008e52e9721f040c37c5cf7671ebf7c 100644 (file)
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:organizations_common\r
-xmlns:ns2="http://collectionspace.org/services/organization"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <shortIdentifier>1288047801161</shortIdentifier>\r
-  <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161):organization:name(1288047801161)</refName>\r
-  <displayNameComputed>true</displayNameComputed>\r
-  <shortDisplayNameComputed>true</shortDisplayNameComputed>\r
-  <shortName>Test Organization-1288047801161</shortName>\r
-  <longName>Test Organization Name</longName>\r
-  <contactNames>\r
-    <contactName>urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth':person:name(charlieOrgcontact)</contactName>\r
-    <contactName>urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth':person:name(chelsieContact)</contactName>\r
-  </contactNames>\r
-  <foundingPlace>Anytown, USA</foundingPlace>\r
-  <subBodies>\r
-    <subBody>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161):organization:name(1288047803708)</subBody>\r
-  </subBodies>\r
-  <functions>\r
-    <function>My new function</function>\r
-    <function>My second function</function>\r
-  </functions>\r
-  <groups>\r
-      <group>My new group</group>\r
-      <group>My second group</group>\r
-      <group>My third group</group>\r
-  </groups>\r
-    <description>This is a test Authority item</description>\r
-    <source>Some mythical book</source>\r
-               <sourcePage>Let's say page 39</sourcePage>\r
-  \r
-</ns2:organizations_common>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:organizations_common
+xmlns:ns2="http://collectionspace.org/services/organization"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <shortIdentifier>1288047801161</shortIdentifier>
+  <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161):organization:name(1288047801161)</refName>
+  <displayNameComputed>true</displayNameComputed>
+  <shortDisplayNameComputed>true</shortDisplayNameComputed>
+  <shortName>Test Organization-1288047801161</shortName>
+  <longName>Test Organization Name</longName>
+  <contactNames>
+    <contactName>urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth':person:name(charlieOrgcontact)</contactName>
+    <contactName>urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth)'TestPersonAuth':person:name(chelsieContact)</contactName>
+  </contactNames>
+  <foundingPlace>Anytown, USA</foundingPlace>
+  <subBodies>
+    <subBody>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161):organization:name(1288047803708)</subBody>
+  </subBodies>
+  <functions>
+    <function>My new function</function>
+    <function>My second function</function>
+  </functions>
+  <groups>
+      <group>My new group</group>
+      <group>My second group</group>
+      <group>My third group</group>
+  </groups>
+    <description>This is a test Authority item</description>
+    <source>Some mythical book</source>
+               <sourcePage>Let's say page 39</sourcePage>
+  
+</ns2:organizations_common>
+
+
index df7ba5f885fb1319ecbf39ecca759c48f36ec16b..57b95fdcec91c8905a38f19b5f80b0e58ce98ebd 100644 (file)
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="organizations">\r
-<ns2:organizations_common xmlns:ns2="http://collectionspace.org/services/organization" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-       <shortIdentifier>ucberkeley</shortIdentifier>\r
-       <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(testorgauth):organization:name(ucberkeley)'UC Berkeley'</refName>\r
-       <displayNameComputed>false</displayNameComputed>\r
-       <shortDisplayNameComputed>false</shortDisplayNameComputed>\r
-       <shortName>U.C. Berkeley</shortName>\r
-       <longName>University of California, Berkeley</longName>\r
-       <foundingPlace>Berkeley, CA</foundingPlace>\r
-       <subBodies>\r
-               <subBody>urn:cspace:org.collectionspace.demo:orgauthority:name(testorgauth):organization:name(ucberkeleyist)'UCB IST'</subBody>\r
-       </subBodies>\r
-    <description>This is a test Authority item</description>\r
-    <source>Some mythical book</source>\r
-               <sourcePage>Let's say page 39</sourcePage>\r
-</ns2:organizations_common>\r
-</document>\r
-       \r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="organizations">
+<ns2:organizations_common xmlns:ns2="http://collectionspace.org/services/organization" xmlns:ns3="http://collectionspace.org/services/jaxb">
+       <shortIdentifier>ucberkeley</shortIdentifier>
+       <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(testorgauth):organization:name(ucberkeley)'UC Berkeley'</refName>
+       <displayNameComputed>false</displayNameComputed>
+       <shortDisplayNameComputed>false</shortDisplayNameComputed>
+       <shortName>U.C. Berkeley</shortName>
+       <longName>University of California, Berkeley</longName>
+       <foundingPlace>Berkeley, CA</foundingPlace>
+       <subBodies>
+               <subBody>urn:cspace:org.collectionspace.demo:orgauthority:name(testorgauth):organization:name(ucberkeleyist)'UCB IST'</subBody>
+       </subBodies>
+    <description>This is a test Authority item</description>
+    <source>Some mythical book</source>
+               <sourcePage>Let's say page 39</sourcePage>
+</ns2:organizations_common>
+</document>
+       
index 0e9656fff907cc7b9f0ba59e2f805f16d3915afd..2124b17aa24fce1ebd219ebf569c6b75960cf1fc 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="organizations">\r
-<ns2:organizations_common xmlns:ns2="http://collectionspace.org/services/organization" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-       <shortIdentifier>ucberkeley</shortIdentifier>\r
-       <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(testorgauth):organization:name(ucberkeleyist)'UCB IST'</refName>\r
-       <displayNameComputed>false</displayNameComputed>\r
-       <shortDisplayNameComputed>false</shortDisplayNameComputed>\r
-       <shortName>U.C. Berkeley IST</shortName>\r
-       <longName>University of California, Berkeley Information Systems and Technology</longName>\r
-       <foundingPlace>Berkeley, CA</foundingPlace>\r
-</ns2:organizations_common>\r
-</document>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="organizations">
+<ns2:organizations_common xmlns:ns2="http://collectionspace.org/services/organization" xmlns:ns3="http://collectionspace.org/services/jaxb">
+       <shortIdentifier>ucberkeley</shortIdentifier>
+       <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(testorgauth):organization:name(ucberkeleyist)'UCB IST'</refName>
+       <displayNameComputed>false</displayNameComputed>
+       <shortDisplayNameComputed>false</shortDisplayNameComputed>
+       <shortName>U.C. Berkeley IST</shortName>
+       <longName>University of California, Berkeley Information Systems and Technology</longName>
+       <foundingPlace>Berkeley, CA</foundingPlace>
+</ns2:organizations_common>
+</document>
+
index eebc48d9f17837041ae493feab6d4b93118d6a03..8fc112b37926ebf603055cc7a2c0113b9cd70302 100644 (file)
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:orgauthorities_common\r
-xmlns:ns2="http://collectionspace.org/services/organization"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <shortIdentifier>1288047801161</shortIdentifier>\r
-  <displayName>TestOrgAuth-1288047801161</displayName>\r
-  <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161)'TestOrgAuth-1288047801161'</refName>\r
-  <vocabType>OrgAuthority</vocabType>\r
-    <description>This is a test authority</description>\r
-    <source>Some mythical book</source>\r
-</ns2:orgauthorities_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:orgauthorities_common
+xmlns:ns2="http://collectionspace.org/services/organization"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <shortIdentifier>1288047801161</shortIdentifier>
+  <displayName>TestOrgAuth-1288047801161</displayName>
+  <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047801161)'TestOrgAuth-1288047801161'</refName>
+  <vocabType>OrgAuthority</vocabType>
+    <description>This is a test authority</description>
+    <source>Some mythical book</source>
+</ns2:orgauthorities_common>
+
index 6cdaf95befd10465d251368953426d7cde852fc3..7056f450d0fd99f69857496e44827c2283cc1031 100644 (file)
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:orgauthorities_common\r
-xmlns:ns2="http://collectionspace.org/services/organization"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <shortIdentifier>testorgauth</shortIdentifier>\r
-  <displayName>Test Org Authority</displayName>\r
-  <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(testorgauth)'Test Org Authority'</refName>\r
-  <vocabType>OrgAuthority</vocabType>\r
-    <description>This is a test authority</description>\r
-    <source>Some mythical book</source>\r
-</ns2:orgauthorities_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:orgauthorities_common
+xmlns:ns2="http://collectionspace.org/services/organization"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <shortIdentifier>testorgauth</shortIdentifier>
+  <displayName>Test Org Authority</displayName>
+  <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(testorgauth)'Test Org Authority'</refName>
+  <vocabType>OrgAuthority</vocabType>
+    <description>This is a test authority</description>
+    <source>Some mythical book</source>
+</ns2:orgauthorities_common>
+
index 7a85a0740c1ad65885b32528a5ae99b018a1e6d6..fd41cef36842249b28062d72ddb9e9f80922383b 100644 (file)
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:orgauthorities_common\r
-     xmlns:ns2="http://collectionspace.org/services/organization"\r
-     xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <shortIdentifier>1288047805974</shortIdentifier>\r
-  <displayName>displayName-1288047805974</displayName>\r
-  <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047805974)'displayName-1288047805974'</refName>\r
-  <vocabType>OrgAuthority</vocabType>\r
-</ns2:orgauthorities_common>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:orgauthorities_common
+     xmlns:ns2="http://collectionspace.org/services/organization"
+     xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <shortIdentifier>1288047805974</shortIdentifier>
+  <displayName>displayName-1288047805974</displayName>
+  <refName>urn:cspace:org.collectionspace.demo:orgauthority:name(1288047805974)'displayName-1288047805974'</refName>
+  <vocabType>OrgAuthority</vocabType>
+</ns2:orgauthorities_common>
+
+
index 99b43a029becec1cdb9ad4ee831a5f64e5abdd3e..6ff2193ae7d15ab414b8a35ee798bdb287c7cf7f 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <!-- \r
-         testGroup ID="person" is not live.  It works, but may not clean up correctly. \r
-         For now, use ID="updatePerson"\r
-    -->\r
-    <testGroup ID="person" autoDeletePOSTS="true">\r
-        <test ID="PersonAuth1" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/</uri>\r
-            <filename>person/personauthorities_common.xml</filename>\r
-            <vars>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-            </vars>\r
-        </test>\r
-        <test ID="Person1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActor1</var>\r
-            </vars>\r
-        </test>\r
-        <test ID="Person2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActor2</var>\r
-            </vars>\r
-        </test>\r
-        <test>\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)</uri>\r
-        </test>\r
-        \r
-        <test>\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>\r
-        </test>\r
-        <test>\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}</uri>\r
-        </test>\r
-        <test ID="authorityList">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/</uri>\r
-        </test>\r
-        <test ID="personList">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-        </test>\r
-        \r
-        <test ID="relatePersons"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-             <filename>relation/r-1.xml</filename>\r
-             <vars>\r
-                <var ID="subjectCsid">${Person1.CSID}</var>\r
-                <var ID="objectCsid">${Person2.CSID}</var>\r
-                <var ID="subjectDocumentType">Persons</var>\r
-                <var ID="objectDocumentType">Persons</var>\r
-                <var ID="relationshipType">hasBroader</var>\r
-             </vars>\r
-        </test>\r
-        \r
-        <test ID="relatePersonsInverse"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-             <filename>relation/r-1.xml</filename>\r
-             <vars>\r
-             <!-- Person2 and Person1 are switched in this record. \r
-                  Ultimately we don't want any hasNarrower actually stored.\r
-             -->\r
-                <var ID="subjectCsid">${Person2.CSID}</var>\r
-                <var ID="objectCsid">${Person1.CSID}</var>\r
-                <var ID="subjectDocumentType">Persons</var>\r
-                <var ID="objectDocumentType">Persons</var>\r
-                <var ID="relationshipType">hasNarrower</var>\r
-             </vars>\r
-         </test>\r
-        \r
-   </testGroup>\r
-   \r
-   <testGroup ID="addOnePerson" autoDeletePOSTS="false">\r
-        <test ID="Person1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common_w_relations.xml</filename>\r
-            <vars>\r
-               <!--<var ID="inAuthority">${PersonAuth1.CSID}</var>-->\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-            </vars>\r
-        </test>\r
-        \r
-       </testGroup>\r
-       \r
-       <testGroup ID="updatePerson" autoDeletePOSTS="true">\r
-           <test ID="PersonAuth1" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/</uri>\r
-            <filename>person/personauthorities_common.xml</filename>\r
-            <vars>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="Person1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActor</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonParent">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorParent</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonChild">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorChild</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonChild2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorChild2</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        \r
-           <test ID="PersonPUT_1p2c">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>\r
-            <filename>person/persons_common_w_relations.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActor</var>\r
-               <var ID="myCSID">${Person1.CSID}</var>\r
-               <var ID="parentCSID">${PersonParent.CSID}</var>\r
-               <var ID="childCSID">${PersonChild.CSID}</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="GETPersonPUT_1p2c">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>\r
-        </test>\r
-        \r
-        <test ID="GETPersonPUT_siblings">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true</uri>\r
-        </test>\r
-         \r
-        \r
-           <test ID="PersonPUT_1p">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>\r
-            <filename>person/persons_common_w_relations_2.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActor</var>\r
-               <var ID="myCSID">${Person1.CSID}</var>\r
-               <var ID="parentCSID">${PersonParent.CSID}</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="GETPersonPUT_1p">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>\r
-        </test>\r
-        \r
-      \r
-        <test ID="PersonPUT_1p1c">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>\r
-            <filename>person/persons_common_w_relations.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActor</var>\r
-               <var ID="myCSID">${Person1.CSID}</var>\r
-               <var ID="parentCSID">${PersonParent.CSID}</var>\r
-               <var ID="childCSID">${PersonChild.CSID}</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="GETPersonPUT_1p1c">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>\r
-        </test>\r
-      \r
-           <test ID="PersonPUT_2c">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>\r
-            <filename>person/persons_common_w_relations_3.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActor</var>\r
-               <var ID="myCSID">${Person1.CSID}</var>\r
-               <var ID="childCSID">${PersonChild.CSID}</var>\r
-               <var ID="child2CSID">${PersonChild2.CSID}</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="GETPersonPUT_2c">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>\r
-        </test>\r
-       </testGroup>\r
-       \r
-       !-- ========================= POST a person ===================================================== -->\r
-       \r
-       <testGroup ID="postPerson" autoDeletePOSTS="true">\r
-           <test ID="PersonAuth1" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/</uri>\r
-            <filename>person/personauthorities_common.xml</filename>\r
-            <vars>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonParent">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorParent</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonChild">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorChild</var>\r
-               <var ID="termDisplayNameSuffix">actorChild1</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonChild2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorChild2</var>\r
-               <var ID="termDisplayNameSuffix">actorChild2</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonChild3">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorChild3</var>\r
-               <var ID="termDisplayNameSuffix">actorChild3</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="Person1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common_w_relations_POST.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActor</var>\r
-               <!--var ID="targetCSID">${itemCSID}</var-->\r
-               <var ID="parentCSID">${PersonParent.CSID}</var>\r
-               <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>\r
-               <var ID="childCSID">${PersonChild.CSID}</var>\r
-               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>\r
-               <var ID="child2CSID">${PersonChild2.CSID}</var>\r
-               <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>\r
-               <var ID="child3CSID">${PersonChild3.CSID}</var>\r
-               <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>\r
-            </vars>\r
-        </test>\r
-        \r
-           <test ID="GETpostPerson">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>\r
-        </test>\r
-        \r
-        <test ID="GETpostPerson_siblings">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true</uri>\r
-            <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>person/res/GETpostPerson_siblings.res.xml</filename>\r
-                               <vars>\r
-                                       <var ID="personCSID">${Person1.CSID}</var>\r
-                                       <var ID="childCSID">${PersonChild.CSID}</var>\r
-                                       <var ID="child2CSID">${PersonChild2.CSID}</var>\r
-                                       <var ID="child3CSID">${PersonChild3.CSID}</var>\r
-                                       <var ID="termDisplayNameSuffix2">${PersonChild2.termDisplayNameSuffix}</var>\r
-                                       <var ID="termDisplayNameSuffix3">${PersonChild3.termDisplayNameSuffix}</var>\r
-                               </vars>\r
-                               <startElement>/document/*[local-name()='relations-common-list']</startElement>\r
-                </response>\r
-               </test>\r
-        \r
-        <test ID="GETpostPerson_allRelations">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true</uri>\r
-            <response>\r
-                               <expected level="ADDOK" />\r
-                               <filename>person/res/showAllRelations.res.xml</filename>\r
-                               <!-- NOTE: vars are referenced in showAllRelations.res.xml\r
-                                    from tests in this test group, e.g. \r
-                                    PersonParent.CSID :: ${PersonParent.CSID} \r
-                                    These vars are all in the expression context while this group is active,\r
-                                    because we hang onto all ServiceResult objects for the duration of the group,\r
-                                    and ServiceObjects keep their vars.\r
-                               -->\r
-                               <startElement>/document/*[local-name()='relations-common-list']</startElement>\r
-                        </response>\r
-                        \r
-               </test>\r
-               \r
-         <test ID="relationsGET">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-         </test>\r
-         \r
-         <test ID="relations_sbj">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations?sbj=${PersonAuth1.CSID}</uri>\r
-         </test>\r
-         \r
-         <test ID="relations_obj">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations?obj=${PersonAuth1.CSID}</uri>\r
-         </test>\r
-        \r
-       </testGroup>\r
-       \r
-       <testGroup ID="PersonAddRelsDeleteRels" autoDeletePOSTS="true">\r
-           <test ID="PersonAuth1" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/</uri>\r
-            <filename>person/personauthorities_common.xml</filename>\r
-            <vars>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonParent">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorParent</var>\r
-            </vars>\r
-        </test>\r
-\r
-        \r
-        <test ID="PersonChild">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorChild</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonChild2">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorChild2</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        <test ID="PersonChild3">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActorChild3</var>\r
-            </vars>\r
-        </test>\r
-        \r
-        \r
-        <test ID="Person1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-            <filename>person/persons_common_w_relations_POST.xml</filename>\r
-            <vars>\r
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-               <var ID="shortIdentifier">johnWayneActor</var>\r
-               <var ID="parentCSID">${PersonParent.CSID}</var>\r
-               <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>\r
-               <var ID="childCSID">${PersonChild.CSID}</var>\r
-               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>\r
-               <var ID="child2CSID">${PersonChild2.CSID}</var>\r
-               <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>\r
-               <var ID="child3CSID">${PersonChild3.CSID}</var>\r
-               <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>\r
-            </vars>\r
-        </test>\r
-        \r
-           <test ID="GETpostPerson">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true</uri>\r
-        </test>\r
-    \r
-               <test ID="GETPersonAuthorityList">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>\r
-        </test>\r
-    \r
-               <test ID="Person1DeleteRels">\r
-                       <method>PUT</method>\r
-                       <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>\r
-                       <filename>person/persons_common_delete_relations_PUT.xml</filename>\r
-                       <vars>\r
-                               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-                               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-                               <var ID="shortIdentifier">johnWayneActor</var>\r
-                               <var ID="childCSID">${PersonChild.CSID}</var>\r
-                               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>\r
-                       </vars>\r
-               </test>\r
-               \r
-               <test ID="GETPerson_afterDeleteOneChild">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true</uri>\r
-        </test>\r
-    \r
-               \r
-               <test ID="Person1DeleteAllRels">\r
-                       <method>PUT</method>\r
-                       <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>\r
-                       <filename>person/persons_common_delete_all_relations_PUT.xml</filename>\r
-                       <vars>\r
-                               <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
-                               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
-                               <var ID="shortIdentifier">johnWayneActor</var>\r
-                       </vars>\r
-               </test>\r
-               \r
-               <test ID="GETPerson_afterDeleteAllRelations">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>\r
-        </test>\r
-    \r
-               \r
-\r
-    </testGroup>\r
-    \r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+    <!-- 
+         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@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <filename>person/personauthorities_common.xml</filename>
+            <vars>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+            </vars>
+        </test>
+        <test ID="Person1">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActor1</var>
+            </vars>
+        </test>
+        <test ID="Person2">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActor2</var>
+            </vars>
+        </test>
+        <test>
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)</uri>
+        </test>
+        
+        <test>
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+        </test>
+        <test>
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}</uri>
+        </test>
+        <test ID="authorityList">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/</uri>
+        </test>
+        <test ID="personList">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+        </test>
+        
+        <test ID="relatePersons"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/relations/</uri>
+             <filename>relation/r-1.xml</filename>
+             <vars>
+                <var ID="subjectCsid">${Person1.CSID}</var>
+                <var ID="objectCsid">${Person2.CSID}</var>
+                <var ID="subjectDocumentType">Persons</var>
+                <var ID="objectDocumentType">Persons</var>
+                <var ID="relationshipType">hasBroader</var>
+             </vars>
+        </test>
+        
+        <test ID="relatePersonsInverse"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/relations/</uri>
+             <filename>relation/r-1.xml</filename>
+             <vars>
+             <!-- Person2 and Person1 are switched in this record. 
+                  Ultimately we don't want any hasNarrower actually stored.
+             -->
+                <var ID="subjectCsid">${Person2.CSID}</var>
+                <var ID="objectCsid">${Person1.CSID}</var>
+                <var ID="subjectDocumentType">Persons</var>
+                <var ID="objectDocumentType">Persons</var>
+                <var ID="relationshipType">hasNarrower</var>
+             </vars>
+         </test>
+        
+   </testGroup>
+   
+   <testGroup ID="addOnePerson" autoDeletePOSTS="false">
+        <test ID="Person1">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common_w_relations.xml</filename>
+            <vars>
+               <!--<var ID="inAuthority">${PersonAuth1.CSID}</var>-->
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+            </vars>
+        </test>
+        
+       </testGroup>
+       
+       <testGroup ID="updatePerson" autoDeletePOSTS="true">
+           <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <filename>person/personauthorities_common.xml</filename>
+            <vars>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+            </vars>
+        </test>
+        
+        <test ID="Person1">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActor</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonParent">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorParent</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonChild">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorChild</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonChild2">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorChild2</var>
+            </vars>
+        </test>
+        
+        
+           <test ID="PersonPUT_1p2c">
+            <method>PUT</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+            <filename>person/persons_common_w_relations.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActor</var>
+               <var ID="myCSID">${Person1.CSID}</var>
+               <var ID="parentCSID">${PersonParent.CSID}</var>
+               <var ID="childCSID">${PersonChild.CSID}</var>
+            </vars>
+        </test>
+        
+        <test ID="GETPersonPUT_1p2c">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
+        </test>
+        
+        <test ID="GETPersonPUT_siblings">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true</uri>
+        </test>
+         
+        
+           <test ID="PersonPUT_1p">
+            <method>PUT</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+            <filename>person/persons_common_w_relations_2.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActor</var>
+               <var ID="myCSID">${Person1.CSID}</var>
+               <var ID="parentCSID">${PersonParent.CSID}</var>
+            </vars>
+        </test>
+        
+        <test ID="GETPersonPUT_1p">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
+        </test>
+        
+      
+        <test ID="PersonPUT_1p1c">
+            <method>PUT</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+            <filename>person/persons_common_w_relations.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActor</var>
+               <var ID="myCSID">${Person1.CSID}</var>
+               <var ID="parentCSID">${PersonParent.CSID}</var>
+               <var ID="childCSID">${PersonChild.CSID}</var>
+            </vars>
+        </test>
+        
+        <test ID="GETPersonPUT_1p1c">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
+        </test>
+      
+           <test ID="PersonPUT_2c">
+            <method>PUT</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+            <filename>person/persons_common_w_relations_3.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActor</var>
+               <var ID="myCSID">${Person1.CSID}</var>
+               <var ID="childCSID">${PersonChild.CSID}</var>
+               <var ID="child2CSID">${PersonChild2.CSID}</var>
+            </vars>
+        </test>
+        
+        <test ID="GETPersonPUT_2c">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
+        </test>
+       </testGroup>
+       
+       !-- ========================= POST a person ===================================================== -->
+       
+       <testGroup ID="postPerson" autoDeletePOSTS="true">
+           <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <filename>person/personauthorities_common.xml</filename>
+            <vars>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonParent">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorParent</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonChild">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorChild</var>
+               <var ID="termDisplayNameSuffix">actorChild1</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonChild2">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorChild2</var>
+               <var ID="termDisplayNameSuffix">actorChild2</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonChild3">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorChild3</var>
+               <var ID="termDisplayNameSuffix">actorChild3</var>
+            </vars>
+        </test>
+        
+        <test ID="Person1">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common_w_relations_POST.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActor</var>
+               <!--var ID="targetCSID">${itemCSID}</var-->
+               <var ID="parentCSID">${PersonParent.CSID}</var>
+               <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
+               <var ID="childCSID">${PersonChild.CSID}</var>
+               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
+               <var ID="child2CSID">${PersonChild2.CSID}</var>
+               <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
+               <var ID="child3CSID">${PersonChild3.CSID}</var>
+               <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
+            </vars>
+        </test>
+        
+           <test ID="GETpostPerson">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
+        </test>
+        
+        <test ID="GETpostPerson_siblings">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true</uri>
+            <response>
+                               <expected level="ADDOK" />
+                               <filename>person/res/GETpostPerson_siblings.res.xml</filename>
+                               <vars>
+                                       <var ID="personCSID">${Person1.CSID}</var>
+                                       <var ID="childCSID">${PersonChild.CSID}</var>
+                                       <var ID="child2CSID">${PersonChild2.CSID}</var>
+                                       <var ID="child3CSID">${PersonChild3.CSID}</var>
+                                       <var ID="termDisplayNameSuffix2">${PersonChild2.termDisplayNameSuffix}</var>
+                                       <var ID="termDisplayNameSuffix3">${PersonChild3.termDisplayNameSuffix}</var>
+                               </vars>
+                               <startElement>/document/*[local-name()='relations-common-list']</startElement>
+                </response>
+               </test>
+        
+        <test ID="GETpostPerson_allRelations">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true</uri>
+            <response>
+                               <expected level="ADDOK" />
+                               <filename>person/res/showAllRelations.res.xml</filename>
+                               <!-- NOTE: vars are referenced in showAllRelations.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="relationsGET">
+             <method>GET</method>
+             <uri>/cspace-services/relations/</uri>
+         </test>
+         
+         <test ID="relations_sbj">
+             <method>GET</method>
+             <uri>/cspace-services/relations?sbj=${PersonAuth1.CSID}</uri>
+         </test>
+         
+         <test ID="relations_obj">
+             <method>GET</method>
+             <uri>/cspace-services/relations?obj=${PersonAuth1.CSID}</uri>
+         </test>
+        
+       </testGroup>
+       
+       <testGroup ID="PersonAddRelsDeleteRels" autoDeletePOSTS="true">
+           <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <filename>person/personauthorities_common.xml</filename>
+            <vars>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonParent">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorParent</var>
+            </vars>
+        </test>
+
+        
+        <test ID="PersonChild">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorChild</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonChild2">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorChild2</var>
+            </vars>
+        </test>
+        
+        <test ID="PersonChild3">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActorChild3</var>
+            </vars>
+        </test>
+        
+        
+        <test ID="Person1">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+            <filename>person/persons_common_w_relations_POST.xml</filename>
+            <vars>
+               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+               <var ID="shortIdentifier">johnWayneActor</var>
+               <var ID="parentCSID">${PersonParent.CSID}</var>
+               <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
+               <var ID="childCSID">${PersonChild.CSID}</var>
+               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
+               <var ID="child2CSID">${PersonChild2.CSID}</var>
+               <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
+               <var ID="child3CSID">${PersonChild3.CSID}</var>
+               <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
+            </vars>
+        </test>
+        
+           <test ID="GETpostPerson">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true</uri>
+        </test>
+    
+               <test ID="GETPersonAuthorityList">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
+        </test>
+    
+               <test ID="Person1DeleteRels">
+                       <method>PUT</method>
+                       <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+                       <filename>person/persons_common_delete_relations_PUT.xml</filename>
+                       <vars>
+                               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                               <var ID="shortIdentifier">johnWayneActor</var>
+                               <var ID="childCSID">${PersonChild.CSID}</var>
+                               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
+                       </vars>
+               </test>
+               
+               <test ID="GETPerson_afterDeleteOneChild">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true</uri>
+        </test>
+    
+               
+               <test ID="Person1DeleteAllRels">
+                       <method>PUT</method>
+                       <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+                       <filename>person/persons_common_delete_all_relations_PUT.xml</filename>
+                       <vars>
+                               <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                               <var ID="shortIdentifier">johnWayneActor</var>
+                       </vars>
+               </test>
+               
+               <test ID="GETPerson_afterDeleteAllRelations">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
+        </test>
+    
+               
+
+    </testGroup>
+    
+</xmlReplay>
index 4999518249a3319702f92311010c2fc733f85f55..964f8e3dcc6e712a39641cec28876042b89ce217 100644 (file)
@@ -1,83 +1,83 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <!-- \r
-         testGroup ID="person" is not live.  It works, but may not clean up correctly. \r
-         For now, use ID="updatePerson"\r
-    -->\r
-    <testGroup ID="personTermStatus" autoDeletePOSTS="true">\r
-        <test ID="PersonAuth1" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/</uri>\r
-            <filename>person/personauthorities_common.xml</filename>\r
-            <vars>\r
-                <var ID="authShortIdentifier">TermStatusTestAuth</var>\r
-            </vars>\r
-        </test>\r
-        <test ID="Patrick">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-            <filename>person/person_pschmitz.xml</filename>\r
-            <vars>\r
-                <var ID="termStatus">Approved</var>\r
-            </vars>\r
-        </test>\r
-        <test ID="Penelope">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>\r
-            <filename>person/person_pmadry.xml</filename>\r
-            <vars>\r
-                <var ID="termStatus">Inactive</var>\r
-            </vars>\r
-        </test>\r
-\r
-        <test ID="GetAll">\r
-            <method>GET</method>\r
-                                               <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items</uri>\r
-                                               <response>\r
-                                                       <expected level="ADDOK"/>\r
-                                                       <filename>person/res/personlistAll.res.xml</filename>\r
-                                               </response>\r
-        </test>\r
-        <test ID="GetActive">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?ts=Inactive</uri>\r
-                                               <response>\r
-                                                       <expected level="ADDOK"/>\r
-                                                       <filename>person/res/personlistActive.res.xml</filename>\r
-                                               </response>\r
-        </test>\r
-        <test ID="GetBogus">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?ts=Garbage</uri>\r
-                                               <response>\r
-                                                       <expected level="ADDOK"/>\r
-                                                       <filename>person/res/personlistAll.res.xml</filename>\r
-                                               </response>\r
-        </test>\r
-        <test ID="GetNone">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?ts=Inactive%7CApproved</uri>\r
-                                               <response>\r
-                                                       <expected level="ADDOK"/>\r
-                                                       <filename>person/res/personlistNone.res.xml</filename>\r
-                                               </response>\r
-        </test>\r
-                               <test ID="GetPartial">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?pt=Patrick</uri>\r
-                                               <response>\r
-                                                       <expected level="ADDOK"/>\r
-                                                       <filename>person/res/personlistActive.res.xml</filename>\r
-                                               </response>\r
-        </test>\r
-                               <test ID="GetPartialNone">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?pt=Patrick&amp;ts=Approved</uri>\r
-                                               <response>\r
-                                                       <expected level="ADDOK"/>\r
-                                                       <filename>person/res/personlistNone.res.xml</filename>\r
-                                               </response>\r
-        </test>\r
-   </testGroup>\r
-\r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+    <!-- 
+         testGroup ID="person" is not live.  It works, but may not clean up correctly. 
+         For now, use ID="updatePerson"
+    -->
+    <testGroup ID="personTermStatus" autoDeletePOSTS="true">
+        <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <filename>person/personauthorities_common.xml</filename>
+            <vars>
+                <var ID="authShortIdentifier">TermStatusTestAuth</var>
+            </vars>
+        </test>
+        <test ID="Patrick">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+            <filename>person/person_pschmitz.xml</filename>
+            <vars>
+                <var ID="termStatus">Approved</var>
+            </vars>
+        </test>
+        <test ID="Penelope">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+            <filename>person/person_pmadry.xml</filename>
+            <vars>
+                <var ID="termStatus">Inactive</var>
+            </vars>
+        </test>
+
+        <test ID="GetAll">
+            <method>GET</method>
+                                               <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items</uri>
+                                               <response>
+                                                       <expected level="ADDOK"/>
+                                                       <filename>person/res/personlistAll.res.xml</filename>
+                                               </response>
+        </test>
+        <test ID="GetActive">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?ts=Inactive</uri>
+                                               <response>
+                                                       <expected level="ADDOK"/>
+                                                       <filename>person/res/personlistActive.res.xml</filename>
+                                               </response>
+        </test>
+        <test ID="GetBogus">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?ts=Garbage</uri>
+                                               <response>
+                                                       <expected level="ADDOK"/>
+                                                       <filename>person/res/personlistAll.res.xml</filename>
+                                               </response>
+        </test>
+        <test ID="GetNone">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?ts=Inactive%7CApproved</uri>
+                                               <response>
+                                                       <expected level="ADDOK"/>
+                                                       <filename>person/res/personlistNone.res.xml</filename>
+                                               </response>
+        </test>
+                               <test ID="GetPartial">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?pt=Patrick</uri>
+                                               <response>
+                                                       <expected level="ADDOK"/>
+                                                       <filename>person/res/personlistActive.res.xml</filename>
+                                               </response>
+        </test>
+                               <test ID="GetPartialNone">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items?pt=Patrick&amp;ts=Approved</uri>
+                                               <response>
+                                                       <expected level="ADDOK"/>
+                                                       <filename>person/res/personlistNone.res.xml</filename>
+                                               </response>
+        </test>
+   </testGroup>
+
+</xmlReplay>
index a5f9d98885339ec4f8028c8bf89ca426c4169e7e..e21bbc8d9d19dea303f7b82cb52f298bf1d43a57 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="persons">\r
-  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-       <shortIdentifier>pmadry</shortIdentifier>\r
-       \r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>Penelope Madry, New York</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>Penelope Madry, New York</termDisplayName>\r
-                       <termStatus>${termStatus}</termStatus>\r
-               </personTermGroup>\r
-       </personTermGroupList>  \r
-       \r
-       <bioNote>Project Manager for CollectionSpace</bioNote>\r
-  </ns2:persons_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+       <shortIdentifier>pmadry</shortIdentifier>
+       
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>Penelope Madry, New York</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>Penelope Madry, New York</termDisplayName>
+                       <termStatus>${termStatus}</termStatus>
+               </personTermGroup>
+       </personTermGroupList>  
+       
+       <bioNote>Project Manager for CollectionSpace</bioNote>
+  </ns2:persons_common>
+</document>
index d7f2cb81ca1367e7a58fad0324ff79b1d546cb6e..ce468209637b3466d15298519942d91ce03f94ce 100644 (file)
@@ -1,20 +1,20 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="persons">\r
-  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-       <shortIdentifier>pschmitz</shortIdentifier>\r
-\r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>Patrick Schmitz, Berkeley</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>Patrick Schmitz, Berkeley</termDisplayName>\r
-                       <termStatus>${termStatus}</termStatus>\r
-               </personTermGroup>\r
-       </personTermGroupList>  \r
-    \r
-       <bioNote>Technical Lead for CollectionSpace</bioNote>\r
-    <description>This is a test PersonAuthority item</description>\r
-    <source>Some mythical book</source>\r
-    <sourcePage>Let's say page 39</sourcePage>\r
-  </ns2:persons_common>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+       <shortIdentifier>pschmitz</shortIdentifier>
+
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>Patrick Schmitz, Berkeley</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>Patrick Schmitz, Berkeley</termDisplayName>
+                       <termStatus>${termStatus}</termStatus>
+               </personTermGroup>
+       </personTermGroupList>  
+    
+       <bioNote>Technical Lead for CollectionSpace</bioNote>
+    <description>This is a test PersonAuthority item</description>
+    <source>Some mythical book</source>
+    <sourcePage>Let's say page 39</sourcePage>
+  </ns2:persons_common>
+</document>
index 8a108d6f35e480b024002a37d0d8d2c05b69ce68..93d0d58edd91a38b5ea477f23a531df6610756ee 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="personauthorities">\r
-<ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-<displayName>${authShortIdentifier}</displayName>\r
-<shortIdentifier>${authShortIdentifier}</shortIdentifier>\r
-<refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier})'${authShortIdentifier}'</refName>\r
-<vocabType>PersonAuthority</vocabType>\r
-    <description>This is a test authority</description>\r
-    <source>Some mythical book</source>\r
-</ns2:personauthorities_common>\r
-</document>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="personauthorities">
+<ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+<displayName>${authShortIdentifier}</displayName>
+<shortIdentifier>${authShortIdentifier}</shortIdentifier>
+<refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier})'${authShortIdentifier}'</refName>
+<vocabType>PersonAuthority</vocabType>
+    <description>This is a test authority</description>
+    <source>Some mythical book</source>
+</ns2:personauthorities_common>
+</document>
+
+
index e3792f9bf52c8e45d6b0e77f7e16f23e38a4dce9..a14ed9ac94f9a4a6c8f1ff5a880c86312cf74b19 100644 (file)
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<document name="personauthorities">\r
-<ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <shortIdentifier>testpersonauth</shortIdentifier>\r
-  <displayName>Test Person Authority</displayName>\r
-  <refName>urn:cspace:org.collectionspace.demo:personauthority:name(testpersonauth)'Test Person Authority'</refName>\r
-  <vocabType>PersonAuthority</vocabType>\r
-    <description>This is a test authority</description>\r
-    <source>Some mythical book</source>\r
-</ns2:personauthorities_common>\r
-</document>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="personauthorities">
+<ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <shortIdentifier>testpersonauth</shortIdentifier>
+  <displayName>Test Person Authority</displayName>
+  <refName>urn:cspace:org.collectionspace.demo:personauthority:name(testpersonauth)'Test Person Authority'</refName>
+  <vocabType>PersonAuthority</vocabType>
+    <description>This is a test authority</description>
+    <source>Some mythical book</source>
+</ns2:personauthorities_common>
+</document>
+
index 5e6765c98caec4b982e36098e23452f0538195d1..614269c8d07e5bf31189dd06477e0ca958f513ef 100644 (file)
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="persons">\r
-  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>\r
-        \r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>John Wayne</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>John Wayne${termDisplayNameSuffix}</termDisplayName>\r
-                   <foreName>John</foreName>\r
-                   <surName>Wayne</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>  \r
-        \r
-    <birthDate>May 26, 1907</birthDate>\r
-    <deathDate>June 11, 1979</deathDate>\r
-    <birthPlace>Winterset, Iowa</birthPlace>\r
-    <groups>\r
-      <group>Irish</group>\r
-      <group>Scottish</group>\r
-    </groups>\r
-    <gender>male</gender>\r
-    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive\r
-    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>\r
-    <description>This is a test Authority item</description>\r
-    <source>Some mythical book</source>\r
-               <sourcePage>Let's say page 39</sourcePage>\r
-       </ns2:persons_common>\r
-</document>\r
-\r
-\r
+<?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">
+    <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>
+        
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>John Wayne</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>John Wayne${termDisplayNameSuffix}</termDisplayName>
+                   <foreName>John</foreName>
+                   <surName>Wayne</surName>
+               </personTermGroup>
+       </personTermGroupList>  
+        
+    <birthDate>May 26, 1907</birthDate>
+    <deathDate>June 11, 1979</deathDate>
+    <birthPlace>Winterset, Iowa</birthPlace>
+    <groups>
+      <group>Irish</group>
+      <group>Scottish</group>
+    </groups>
+    <gender>male</gender>
+    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive
+    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>
+    <description>This is a test Authority item</description>
+    <source>Some mythical book</source>
+               <sourcePage>Let's say page 39</sourcePage>
+       </ns2:persons_common>
+</document>
+
+
index 4a36bf057d9d38abe30abc3c037d837af10cc284..c48d74f3995608914cee8dafbe103ec953c61fde 100644 (file)
@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="persons">\r
-  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>\r
-\r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>John Wayne</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>John Wayne</termDisplayName>\r
-                   <foreName>John</foreName>\r
-                   <surName>Wayne</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>  \r
-    \r
-    <birthDate>May 26, 1907</birthDate>\r
-    <deathDate>June 11, 1979</deathDate>\r
-    <birthPlace>Winterset, Iowa</birthPlace>\r
-    <groups>\r
-      <group>Irish</group>\r
-      <group>Scottish</group>\r
-    </groups>\r
-    <gender>male</gender>\r
-    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive\r
-    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>\r
-  </ns2:persons_common>\r
-  <!-- \r
-       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. \r
-          It passes through and then the service deals with it.\r
-  -->\r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-  </ns3:relations-common-list>\r
-</document>\r
-\r
-\r
+<?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">
+    <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>
+
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>John Wayne</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>John Wayne</termDisplayName>
+                   <foreName>John</foreName>
+                   <surName>Wayne</surName>
+               </personTermGroup>
+       </personTermGroupList>  
+    
+    <birthDate>May 26, 1907</birthDate>
+    <deathDate>June 11, 1979</deathDate>
+    <birthPlace>Winterset, Iowa</birthPlace>
+    <groups>
+      <group>Irish</group>
+      <group>Scottish</group>
+    </groups>
+    <gender>male</gender>
+    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive
+    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>
+  </ns2:persons_common>
+  <!-- 
+       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. 
+          It passes through and then the service deals with it.
+  -->
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+  </ns3:relations-common-list>
+</document>
+
+
index 820d7ad38d20bd99d20e4c105bd3c4299b491deb..f766062553637828bcc84809bf78304f5feabe81 100644 (file)
@@ -1,53 +1,53 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="persons">\r
-  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>\r
-\r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>John Wayne</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>John Wayne</termDisplayName>\r
-                   <foreName>John</foreName>\r
-                   <surName>Wayne</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>  \r
-    \r
-    <birthDate>May 26, 1907</birthDate>\r
-    <deathDate>June 11, 1979</deathDate>\r
-    <birthPlace>Winterset, Iowa</birthPlace>\r
-    <groups>\r
-      <group>Irish</group>\r
-      <group>Scottish</group>\r
-    </groups>\r
-    <gender>male</gender>\r
-    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive\r
-    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>\r
-  </ns2:persons_common>\r
-  <!-- \r
-       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. \r
-          It passes through and then the service deals with it.\r
-  -->\r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${childCSID}</csid>\r
-                 <uri>${childUri}</uri>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 1, the evil twin, child</name>\r
-                 <number>2222</number>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne</name>\r
-                 <number>1111</number>\r
-               </object>\r
-       </relation-list-item>\r
-  </ns3:relations-common-list>\r
-</document>\r
-\r
-\r
+<?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">
+    <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>
+
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>John Wayne</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>John Wayne</termDisplayName>
+                   <foreName>John</foreName>
+                   <surName>Wayne</surName>
+               </personTermGroup>
+       </personTermGroupList>  
+    
+    <birthDate>May 26, 1907</birthDate>
+    <deathDate>June 11, 1979</deathDate>
+    <birthPlace>Winterset, Iowa</birthPlace>
+    <groups>
+      <group>Irish</group>
+      <group>Scottish</group>
+    </groups>
+    <gender>male</gender>
+    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive
+    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>
+  </ns2:persons_common>
+  <!-- 
+       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. 
+          It passes through and then the service deals with it.
+  -->
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${childCSID}</csid>
+                 <uri>${childUri}</uri>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 1, the evil twin, child</name>
+                 <number>2222</number>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne</name>
+                 <number>1111</number>
+               </object>
+       </relation-list-item>
+  </ns3:relations-common-list>
+</document>
+
+
index 1564a871ad5a5e24c3848124e34e4606e6e4d317..d68c5487a06d50f072f436008d1b75187d6df1f8 100644 (file)
@@ -1,79 +1,79 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="persons">\r
-  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>\r
-\r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>John Wayne</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>John Wayne</termDisplayName>\r
-                   <foreName>John</foreName>\r
-                   <surName>Wayne</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>  \r
-    \r
-    <birthDate>May 26, 1907</birthDate>\r
-    <deathDate>June 11, 1979</deathDate>\r
-    <birthPlace>Winterset, Iowa</birthPlace>\r
-    <groups>\r
-      <group>Irish</group>\r
-      <group>Scottish</group>\r
-    </groups>\r
-    <gender>male</gender>\r
-    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive\r
-    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>\r
-  </ns2:persons_common>\r
-  \r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <pageNum>0</pageNum>\r
-    <pageSize>40</pageSize>\r
-    <itemsInPage>1</itemsInPage>\r
-    <totalItems>1</totalItems>\r
-    <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>\r
-    <relation-list-item>\r
-               <subjectCsid>${myCSID}</subjectCsid>\r
-               <subjectDocumentType>Person</subjectDocumentType>\r
-               <objectDocumentType>Person</objectDocumentType>\r
-               <relationshipType>hasBroader</relationshipType>\r
-               <predicate>hasBroader</predicate>\r
-               <predicateDisplayName>hasBroader</predicateDisplayName>\r
-               <objectCsid>${parentCSID}</objectCsid>\r
-               <subject>\r
-                 <csid>${myCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne, Me</name>\r
-               </subject>\r
-               <object>\r
-                 <csid>${parentCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 2, the evil twin, Parent</name>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <subjectCsid>${childCSID}</subjectCsid>\r
-               <subjectDocumentType>Person</subjectDocumentType>\r
-               <objectDocumentType>Person</objectDocumentType>\r
-               <relationshipType>hasBroader</relationshipType>\r
-               <predicate>hasBroader</predicate>\r
-               <predicateDisplayName>hasBroader</predicateDisplayName>\r
-               <objectCsid>${myCSID}</objectCsid>\r
-               <subject>\r
-                 <csid>${childCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 2, the evil twin, child</name>\r
-               </subject>\r
-               <object>\r
-                 <csid>${myCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne</name>\r
-               </object>\r
-       </relation-list-item>\r
-  </ns3:relations-common-list>\r
-\r
-  \r
-</document>\r
-\r
-\r
+<?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">
+    <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>
+
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>John Wayne</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>John Wayne</termDisplayName>
+                   <foreName>John</foreName>
+                   <surName>Wayne</surName>
+               </personTermGroup>
+       </personTermGroupList>  
+    
+    <birthDate>May 26, 1907</birthDate>
+    <deathDate>June 11, 1979</deathDate>
+    <birthPlace>Winterset, Iowa</birthPlace>
+    <groups>
+      <group>Irish</group>
+      <group>Scottish</group>
+    </groups>
+    <gender>male</gender>
+    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive
+    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>
+  </ns2:persons_common>
+  
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <pageNum>0</pageNum>
+    <pageSize>40</pageSize>
+    <itemsInPage>1</itemsInPage>
+    <totalItems>1</totalItems>
+    <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>
+    <relation-list-item>
+               <subjectCsid>${myCSID}</subjectCsid>
+               <subjectDocumentType>Person</subjectDocumentType>
+               <objectDocumentType>Person</objectDocumentType>
+               <relationshipType>hasBroader</relationshipType>
+               <predicate>hasBroader</predicate>
+               <predicateDisplayName>hasBroader</predicateDisplayName>
+               <objectCsid>${parentCSID}</objectCsid>
+               <subject>
+                 <csid>${myCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne, Me</name>
+               </subject>
+               <object>
+                 <csid>${parentCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 2, the evil twin, Parent</name>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <subjectCsid>${childCSID}</subjectCsid>
+               <subjectDocumentType>Person</subjectDocumentType>
+               <objectDocumentType>Person</objectDocumentType>
+               <relationshipType>hasBroader</relationshipType>
+               <predicate>hasBroader</predicate>
+               <predicateDisplayName>hasBroader</predicateDisplayName>
+               <objectCsid>${myCSID}</objectCsid>
+               <subject>
+                 <csid>${childCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 2, the evil twin, child</name>
+               </subject>
+               <object>
+                 <csid>${myCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne</name>
+               </object>
+       </relation-list-item>
+  </ns3:relations-common-list>
+
+  
+</document>
+
+
index a257f38c885cb75d3dd5b0125e6dac012d196673..6c8a740b319152d46bedf4c9936fc5dbbf8462df 100644 (file)
@@ -1,60 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="persons">\r
-  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>\r
-\r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>John Wayne</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>John Wayne</termDisplayName>\r
-                   <foreName>John</foreName>\r
-                   <surName>Wayne</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>  \r
-    \r
-    <birthDate>May 26, 1907</birthDate>\r
-    <deathDate>June 11, 1979</deathDate>\r
-    <birthPlace>Winterset, Iowa</birthPlace>\r
-    <groups>\r
-      <group>Irish</group>\r
-      <group>Scottish</group>\r
-    </groups>\r
-    <gender>male</gender>\r
-    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive\r
-    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>\r
-  </ns2:persons_common>\r
-  \r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <pageNum>0</pageNum>\r
-    <pageSize>40</pageSize>\r
-    <itemsInPage>1</itemsInPage>\r
-    <totalItems>1</totalItems>\r
-    <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>\r
-    <relation-list-item>\r
-               <subjectCsid>${myCSID}</subjectCsid>\r
-               <subjectDocumentType>Person</subjectDocumentType>\r
-               <objectDocumentType>Person</objectDocumentType>\r
-               <relationshipType>hasBroader</relationshipType>\r
-               <predicate>hasBroader</predicate>\r
-               <predicateDisplayName>hasBroader</predicateDisplayName>\r
-               <objectCsid>${parentCSID}</objectCsid>\r
-               <subject>\r
-                 <csid>${myCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne, Me</name>\r
-               </subject>\r
-               <object>\r
-                 <csid>${parentCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 2, the evil twin, Parent</name>\r
-               </object>\r
-       </relation-list-item>\r
-  </ns3:relations-common-list>\r
-\r
-  \r
-</document>\r
-\r
-\r
+<?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">
+    <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>
+
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>John Wayne</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>John Wayne</termDisplayName>
+                   <foreName>John</foreName>
+                   <surName>Wayne</surName>
+               </personTermGroup>
+       </personTermGroupList>  
+    
+    <birthDate>May 26, 1907</birthDate>
+    <deathDate>June 11, 1979</deathDate>
+    <birthPlace>Winterset, Iowa</birthPlace>
+    <groups>
+      <group>Irish</group>
+      <group>Scottish</group>
+    </groups>
+    <gender>male</gender>
+    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive
+    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>
+  </ns2:persons_common>
+  
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <pageNum>0</pageNum>
+    <pageSize>40</pageSize>
+    <itemsInPage>1</itemsInPage>
+    <totalItems>1</totalItems>
+    <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>
+    <relation-list-item>
+               <subjectCsid>${myCSID}</subjectCsid>
+               <subjectDocumentType>Person</subjectDocumentType>
+               <objectDocumentType>Person</objectDocumentType>
+               <relationshipType>hasBroader</relationshipType>
+               <predicate>hasBroader</predicate>
+               <predicateDisplayName>hasBroader</predicateDisplayName>
+               <objectCsid>${parentCSID}</objectCsid>
+               <subject>
+                 <csid>${myCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne, Me</name>
+               </subject>
+               <object>
+                 <csid>${parentCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 2, the evil twin, Parent</name>
+               </object>
+       </relation-list-item>
+  </ns3:relations-common-list>
+
+  
+</document>
+
+
index cc6175557e7f1704ebf4d5ae83585b0996b589ec..49132258a49f10c4a416525b5797198254e69f54 100644 (file)
@@ -1,79 +1,79 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="persons">\r
-  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>\r
-\r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>John Wayne</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>John Wayne</termDisplayName>\r
-                   <foreName>John</foreName>\r
-                   <surName>Wayne</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>  \r
-    \r
-    <birthDate>May 26, 1907</birthDate>\r
-    <deathDate>June 11, 1979</deathDate>\r
-    <birthPlace>Winterset, Iowa</birthPlace>\r
-    <groups>\r
-      <group>Irish</group>\r
-      <group>Scottish</group>\r
-    </groups>\r
-    <gender>male</gender>\r
-    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive\r
-    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>\r
-  </ns2:persons_common>\r
-  \r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <pageNum>0</pageNum>\r
-    <pageSize>40</pageSize>\r
-    <itemsInPage>1</itemsInPage>\r
-    <totalItems>1</totalItems>\r
-    <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>\r
-   <relation-list-item>\r
-               <subjectCsid>${childCSID}</subjectCsid>\r
-               <subjectDocumentType>Person</subjectDocumentType>\r
-               <objectDocumentType>Person</objectDocumentType>\r
-               <relationshipType>hasBroader</relationshipType>\r
-               <predicate>hasBroader</predicate>\r
-               <predicateDisplayName>hasBroader</predicateDisplayName>\r
-               <objectCsid>${myCSID}</objectCsid>\r
-               <subject>\r
-                 <csid>${childCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 2, the evil twin, child</name>\r
-               </subject>\r
-               <object>\r
-                 <csid>${myCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne</name>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <subjectCsid>${child2CSID}</subjectCsid>\r
-               <subjectDocumentType>Person</subjectDocumentType>\r
-               <objectDocumentType>Person</objectDocumentType>\r
-               <relationshipType>hasBroader</relationshipType>\r
-               <predicate>hasBroader</predicate>\r
-               <predicateDisplayName>hasBroader</predicateDisplayName>\r
-               <objectCsid>${myCSID}</objectCsid>\r
-               <subject>\r
-                 <csid>${child2CSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 2, the evil twin, child</name>\r
-               </subject>\r
-               <object>\r
-                 <csid>${myCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne</name>\r
-               </object>\r
-       </relation-list-item>\r
-  </ns3:relations-common-list>\r
-\r
-  \r
-</document>\r
-\r
-\r
+<?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">
+    <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>
+
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>John Wayne</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>John Wayne</termDisplayName>
+                   <foreName>John</foreName>
+                   <surName>Wayne</surName>
+               </personTermGroup>
+       </personTermGroupList>  
+    
+    <birthDate>May 26, 1907</birthDate>
+    <deathDate>June 11, 1979</deathDate>
+    <birthPlace>Winterset, Iowa</birthPlace>
+    <groups>
+      <group>Irish</group>
+      <group>Scottish</group>
+    </groups>
+    <gender>male</gender>
+    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive
+    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>
+  </ns2:persons_common>
+  
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <pageNum>0</pageNum>
+    <pageSize>40</pageSize>
+    <itemsInPage>1</itemsInPage>
+    <totalItems>1</totalItems>
+    <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>
+   <relation-list-item>
+               <subjectCsid>${childCSID}</subjectCsid>
+               <subjectDocumentType>Person</subjectDocumentType>
+               <objectDocumentType>Person</objectDocumentType>
+               <relationshipType>hasBroader</relationshipType>
+               <predicate>hasBroader</predicate>
+               <predicateDisplayName>hasBroader</predicateDisplayName>
+               <objectCsid>${myCSID}</objectCsid>
+               <subject>
+                 <csid>${childCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 2, the evil twin, child</name>
+               </subject>
+               <object>
+                 <csid>${myCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne</name>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <subjectCsid>${child2CSID}</subjectCsid>
+               <subjectDocumentType>Person</subjectDocumentType>
+               <objectDocumentType>Person</objectDocumentType>
+               <relationshipType>hasBroader</relationshipType>
+               <predicate>hasBroader</predicate>
+               <predicateDisplayName>hasBroader</predicateDisplayName>
+               <objectCsid>${myCSID}</objectCsid>
+               <subject>
+                 <csid>${child2CSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 2, the evil twin, child</name>
+               </subject>
+               <object>
+                 <csid>${myCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne</name>
+               </object>
+       </relation-list-item>
+  </ns3:relations-common-list>
+
+  
+</document>
+
+
index 0d05a76115beeb02646a72a2bf95f46fcb47f22e..0443f1d3680054d4083c69c49aff1971869a5bc2 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="persons">\r
-  <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
-    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>\r
-\r
-       <personTermGroupList>\r
-               <personTermGroup>\r
-                       <termName>John Wayne</termName>\r
-                       <termPrefForLang>false</termPrefForLang>\r
-                       <termDisplayName>John Wayne</termDisplayName>\r
-                   <foreName>John</foreName>\r
-                   <surName>Wayne</surName>\r
-               </personTermGroup>\r
-       </personTermGroupList>  \r
-    \r
-    <birthDate>May 26, 1907</birthDate>\r
-    <deathDate>June 11, 1979</deathDate>\r
-    <birthPlace>Winterset, Iowa</birthPlace>\r
-    <groups>\r
-      <group>Irish</group>\r
-      <group>Scottish</group>\r
-    </groups>\r
-    <gender>male</gender>\r
-    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive\r
-    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>\r
-  </ns2:persons_common>\r
-  <!-- \r
-       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. \r
-          It passes through and then the service deals with it.\r
-  -->\r
-  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <pageNum>0</pageNum>\r
-    <pageSize>40</pageSize>\r
-    <itemsInPage>1</itemsInPage>\r
-    <totalItems>1</totalItems>\r
-    <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>\r
-    <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne, Me</name>\r
-                 <number>1111</number>\r
-               </subject>\r
-               <object>\r
-                 <csid>${parentCSID}</csid>\r
-                 <uri>${parentUri}</uri>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 2, the evil twin, Parent</name>\r
-                 <number>0000</number>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <csid>${childCSID}</csid>\r
-                 <uri>${childUri}</uri>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 1, the evil twin, child</name>\r
-                 <number>1100</number>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne</name>\r
-                 <number>1111</number>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <uri>${child2Uri}</uri>\r
-                 <csid>${child2CSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 2, the evil twin, child</name>\r
-                 <number>2222</number>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne</name>\r
-                 <number>1111</number>\r
-               </object>\r
-       </relation-list-item>\r
-       <relation-list-item>\r
-               <predicate>hasBroader</predicate>\r
-               <subject>\r
-                 <uri>${child3Uri}</uri>\r
-                 <csid>${child3CSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne 3, the evil twin, child</name>\r
-                 <number>3333</number>\r
-               </subject>\r
-               <object>\r
-                 <csid>${itemCSID}</csid>\r
-                 <documentType>Person</documentType>\r
-                 <name>John Wayne</name>\r
-                 <number>1111</number>\r
-                 \r
-               </object>\r
-       </relation-list-item>\r
-  </ns3:relations-common-list>\r
-</document>\r
-\r
-\r
+<?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">
+    <inAuthority>${inAuthority}</inAuthority>
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>
+    <refName>urn:cspace:org.collectionspace.demo:personauthority:name(${authShortIdentifier}):person:name(${shortIdentifier})'John Wayne'</refName>
+
+       <personTermGroupList>
+               <personTermGroup>
+                       <termName>John Wayne</termName>
+                       <termPrefForLang>false</termPrefForLang>
+                       <termDisplayName>John Wayne</termDisplayName>
+                   <foreName>John</foreName>
+                   <surName>Wayne</surName>
+               </personTermGroup>
+       </personTermGroupList>  
+    
+    <birthDate>May 26, 1907</birthDate>
+    <deathDate>June 11, 1979</deathDate>
+    <birthPlace>Winterset, Iowa</birthPlace>
+    <groups>
+      <group>Irish</group>
+      <group>Scottish</group>
+    </groups>
+    <gender>male</gender>
+    <bioNote>born Marion Robert Morrison and betterknown by his stage name John Wayne, was an American film actor, director and producer. He epitomized rugged masculinity and has become an enduring American icon. He is famous for his distinctive
+    voice, walk and height. He was also known for his conservative political views and his support in the 1950s for anti-communist positions.</bioNote>
+  </ns2:persons_common>
+  <!-- 
+       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. 
+          It passes through and then the service deals with it.
+  -->
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <pageNum>0</pageNum>
+    <pageSize>40</pageSize>
+    <itemsInPage>1</itemsInPage>
+    <totalItems>1</totalItems>
+    <fieldsReturned>subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object</fieldsReturned>
+    <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne, Me</name>
+                 <number>1111</number>
+               </subject>
+               <object>
+                 <csid>${parentCSID}</csid>
+                 <uri>${parentUri}</uri>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 2, the evil twin, Parent</name>
+                 <number>0000</number>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <csid>${childCSID}</csid>
+                 <uri>${childUri}</uri>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 1, the evil twin, child</name>
+                 <number>1100</number>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne</name>
+                 <number>1111</number>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <uri>${child2Uri}</uri>
+                 <csid>${child2CSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 2, the evil twin, child</name>
+                 <number>2222</number>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne</name>
+                 <number>1111</number>
+               </object>
+       </relation-list-item>
+       <relation-list-item>
+               <predicate>hasBroader</predicate>
+               <subject>
+                 <uri>${child3Uri}</uri>
+                 <csid>${child3CSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne 3, the evil twin, child</name>
+                 <number>3333</number>
+               </subject>
+               <object>
+                 <csid>${itemCSID}</csid>
+                 <documentType>Person</documentType>
+                 <name>John Wayne</name>
+                 <number>1111</number>
+                 
+               </object>
+       </relation-list-item>
+  </ns3:relations-common-list>
+</document>
+
+
index bcc759c166f23826e5a7c90b757e3db8aed5d929..f42f8401ac995c4013b23cc1f7cc17c0f2bf0936 100644 (file)
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <pageNum>0</pageNum>\r
-    <pageSize>40</pageSize>\r
-               <itemsInPage>1</itemsInPage>\r
-    <fieldsReturned>csid|uri|refName|updatedAt|displayName|shortIdentifier|termStatus</fieldsReturned>\r
-    <list-item>\r
-        <shortIdentifier>pschmitz</shortIdentifier>\r
-    </list-item>\r
-</ns2:abstract-common-list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <pageNum>0</pageNum>
+    <pageSize>40</pageSize>
+               <itemsInPage>1</itemsInPage>
+    <fieldsReturned>csid|uri|refName|updatedAt|displayName|shortIdentifier|termStatus</fieldsReturned>
+    <list-item>
+        <shortIdentifier>pschmitz</shortIdentifier>
+    </list-item>
+</ns2:abstract-common-list>
+
index 12e22f1494788fef5daca2aef5a3578ee4a9aa7e..34ab1f3ea8fa24e9f044679f178294a50a2f8973 100644 (file)
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <pageNum>0</pageNum>\r
-    <pageSize>40</pageSize>\r
-               <itemsInPage>2</itemsInPage>\r
-    <fieldsReturned>csid|uri|refName|updatedAt|displayName|shortIdentifier|termStatus</fieldsReturned>\r
-    <list-item>\r
-        <shortIdentifier>pschmitz</shortIdentifier>\r
-    </list-item>\r
-    <list-item>\r
-        <shortIdentifier>pmadry</shortIdentifier>\r
-    </list-item>\r
-</ns2:abstract-common-list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <pageNum>0</pageNum>
+    <pageSize>40</pageSize>
+               <itemsInPage>2</itemsInPage>
+    <fieldsReturned>csid|uri|refName|updatedAt|displayName|shortIdentifier|termStatus</fieldsReturned>
+    <list-item>
+        <shortIdentifier>pschmitz</shortIdentifier>
+    </list-item>
+    <list-item>
+        <shortIdentifier>pmadry</shortIdentifier>
+    </list-item>
+</ns2:abstract-common-list>
+
index 5b230c091768666dd0f36733722d79cdf5294966..4f6c0ac69207cfae5fbf951e5c30eeb9b37d2281 100644 (file)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <pageNum>0</pageNum>\r
-    <pageSize>40</pageSize>\r
-               <itemsInPage>0</itemsInPage>\r
-    <fieldsReturned>csid|uri|refName|updatedAt|displayName|shortIdentifier|termStatus</fieldsReturned>\r
-</ns2:abstract-common-list>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+    <pageNum>0</pageNum>
+    <pageSize>40</pageSize>
+               <itemsInPage>0</itemsInPage>
+    <fieldsReturned>csid|uri|refName|updatedAt|displayName|shortIdentifier|termStatus</fieldsReturned>
+</ns2:abstract-common-list>
+
index 78ee566930a38c3c2e3319d3306fd25cf98ad552..1e94f2838eb9545205d043e30209baaa3a8b64df 100644 (file)
@@ -1,10 +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>objectexitNumber-1290026472360</exitNumber>\r
-    </ns2:objectexit_common>\r
-</document>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="objectexit">
+    <ns2:objectexit_common
+            xmlns:ns2="http://collectionspace.org/services/objectexit"
+            xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <depositor>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'</depositor>
+        <exitNumber>objectexitNumber-1290026472360</exitNumber>
+    </ns2:objectexit_common>
+</document>
+
index 76150204d0e6c818406720138d19d4caf3223ecc..bce5372a34b6c1a1607271b5e31a25b9787e1e76 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-    </auths>\r
-   \r
-    <testGroup ID="makeRelations" autoDeletePOSTS="true">\r
-         <test ID="oe1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>relation/oe1.xml</filename>\r
-         </test>\r
-         <test ID="oe2"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>relation/oe1.xml</filename>\r
-         </test>\r
-         <test ID="relate1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-             <filename>relation/r-1.xml</filename>\r
-             <vars>\r
-                <var ID="subjectCsid">${oe1.CSID}</var>\r
-                <var ID="objectCsid">${oe2.CSID}</var>\r
-                <var ID="subjectDocumentType">objectexit</var>\r
-                <var ID="objectDocumentType">objectexit</var>\r
-                <var ID="relationshipType">hasBroader</var>\r
-             </vars>\r
-         </test>\r
-         <test ID="relate2"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-             <filename>relation/r-1.xml</filename>\r
-             <vars>\r
-                <!-- switched oe2 and oe1 on this -->\r
-                <var ID="subjectCsid">${oe2.CSID}</var>\r
-                <var ID="objectCsid">${oe1.CSID}</var>\r
-                <var ID="subjectDocumentType">objectexit</var>\r
-                <var ID="objectDocumentType">objectexit</var>\r
-                <var ID="relationshipType">hasBroader</var>\r
-             </vars>\r
-         </test>\r
-         <test ID="relationsGET"  auth="test">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-         </test>\r
-         \r
-         <!--\r
-         <test>\r
-            <method>GET</method>\r
-            <uri>/cspace-services/personauthorities/${OrgAuth1.CSID}/items/${Org1.CSID}</uri>\r
-        </test>\r
-        -->\r
-    </testGroup>\r
-    \r
-    <testGroup ID="makeRelationsNested" autoDeletePOSTS="true">\r
-         <test ID="oe1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>relation/oe1.xml</filename>\r
-         </test>\r
-         <test ID="oe2"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>relation/oe1.xml</filename>\r
-         </test>\r
-         <test ID="relate1"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-             <filename>relation/r-2.xml</filename>\r
-             <vars>\r
-                <var ID="subjectCsid">${oe1.CSID}</var>\r
-                <var ID="objectCsid">${itemCSID}</var>\r
-                <var ID="subjectDocumentType">ObjectExit</var>\r
-                <var ID="objectDocumentType">ObjectExit</var>\r
-                <var ID="relationshipType">hasBroader</var>\r
-             </vars>\r
-         </test>\r
-         <test ID="relationsGET"  auth="test">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-         </test>\r
-    </testGroup>\r
-         \r
-    <testGroup ID="r2only" autoDeletePOSTS="true">\r
-         <test ID="relate"  auth="test">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-             <filename>relation/r-2.xml</filename>\r
-             <vars>\r
-                <var ID="subjectCsid">1234-5678</var>\r
-                <var ID="objectCsid">${itemCSID}</var>\r
-                <var ID="subjectDocumentType">ObjectExit</var>\r
-                <var ID="objectDocumentType">ObjectExit</var>\r
-                <var ID="relationshipType">hasBroader</var>\r
-             </vars>\r
-         </test>\r
-         <test ID="relationsGET"  auth="test">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/</uri>\r
-         </test>\r
-    </testGroup>\r
-    \r
-    <!-- Test whether a relation is automatically soft deleted -->\r
-    <!-- when a subject of the relation is deleted --> \r
-    <testGroup ID="cascadeDeleteRelationsOnSubjectDelete" autoDeletePOSTS="true">\r
-         <test ID="createSubject">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>relation/oe1.xml</filename>\r
-             <expectedCodes>201</expectedCodes>\r
-         </test>\r
-         <test ID="createObject">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>relation/oe1.xml</filename>\r
-             <expectedCodes>201</expectedCodes>\r
-         </test>\r
-         <test ID="createRelation">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/relations</uri>\r
-             <filename>relation/r-1.xml</filename>\r
-             <vars>\r
-                <var ID="subjectCsid">${createSubject.CSID}</var>\r
-                <var ID="objectCsid">${createObject.CSID}</var>\r
-                <var ID="subjectDocumentType">objectexit</var>\r
-                <var ID="objectDocumentType">objectexit</var>\r
-                <var ID="relationshipType">affects</var>\r
-             </vars>\r
-             <expectedCodes>201</expectedCodes>\r
-         </test>\r
-         <test ID="getRelationWorkflowStateBeforeDelete">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/${createRelation.CSID}/workflow</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/workflowState.res.xml</filename>\r
-                <vars>\r
-                    <var ID="workflowState">project</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="getRelationListBeforeDelete">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations?sbj=${createSubject.CSID}&amp;wf_deleted=false</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/relationsList.res.xml</filename>\r
-                <vars>\r
-                    <var ID="totalItemsValue">1</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="softDeleteSubject">\r
-             <method>PUT</method>\r
-             <uri>/cspace-services/objectexit/${createSubject.CSID}/workflow/delete</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <!-- XmlReplay appears to require a filename on PUT. -->\r
-             <!-- If not present, throws "java.io.FileNotFoundException: File '' does not exist" -->\r
-             <!-- The contents of that file, sent in the PUT payload, will be ignored by the services. -->\r
-             <filename>relation/res/workflowState.res.xml</filename>\r
-             <vars>\r
-                 <var ID="workflowState">deleted</var>\r
-             </vars>\r
-         </test>\r
-         <test ID="verifySubjectIsSoftDeleted">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/objectexit/${createSubject.CSID}/workflow</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/workflowState.res.xml</filename>\r
-                <vars>\r
-                    <var ID="workflowState">deleted</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="verifyRelationIsSoftDeleted">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/${createRelation.CSID}/workflow</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/workflowState.res.xml</filename>\r
-                <vars>\r
-                    <var ID="workflowState">deleted</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="getRelationListAfterDelete">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations?sbj=${createSubject.CSID}&amp;wf_deleted=false</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/relationsList.res.xml</filename>\r
-                <vars>\r
-                    <var ID="totalItemsValue">0</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-    </testGroup>\r
-    \r
-    <!-- Test whether multiple relations are automatically soft deleted -->\r
-    <!-- when an object of the relation is soft deleted. -->\r
-    <testGroup ID="cascadeDeleteMultipleRelationsOnObjectDelete" autoDeletePOSTS="true">\r
-         <test ID="createSubject1">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>relation/oe1.xml</filename>\r
-             <expectedCodes>201</expectedCodes>\r
-         </test>\r
-         <test ID="createSubject2">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>relation/oe1.xml</filename>\r
-             <expectedCodes>201</expectedCodes>\r
-         </test>\r
-         <test ID="createObject">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/objectexit/</uri>\r
-             <filename>relation/oe1.xml</filename>\r
-             <expectedCodes>201</expectedCodes>\r
-         </test>\r
-         <test ID="createRelation1">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/relations</uri>\r
-             <filename>relation/r-1.xml</filename>\r
-             <vars>\r
-                <var ID="subjectCsid">${createSubject1.CSID}</var>\r
-                <var ID="objectCsid">${createObject.CSID}</var>\r
-                <var ID="subjectDocumentType">objectexit</var>\r
-                <var ID="objectDocumentType">objectexit</var>\r
-                <var ID="relationshipType">affects</var>\r
-             </vars>\r
-             <expectedCodes>201</expectedCodes>\r
-         </test>\r
-         <test ID="createRelation2">\r
-             <method>POST</method>\r
-             <uri>/cspace-services/relations</uri>\r
-             <filename>relation/r-1.xml</filename>\r
-             <vars>\r
-                <var ID="subjectCsid">${createSubject2.CSID}</var>\r
-                <var ID="objectCsid">${createObject.CSID}</var>\r
-                <var ID="subjectDocumentType">objectexit</var>\r
-                <var ID="objectDocumentType">objectexit</var>\r
-                <var ID="relationshipType">affects</var>\r
-             </vars>\r
-             <expectedCodes>201</expectedCodes>\r
-         </test>\r
-         <test ID="getRelation1WorkflowStateBeforeDelete">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/${createRelation1.CSID}/workflow</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/workflowState.res.xml</filename>\r
-                <vars>\r
-                    <var ID="workflowState">project</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="getRelation2WorkflowStateBeforeDelete">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/${createRelation2.CSID}/workflow</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/workflowState.res.xml</filename>\r
-                <vars>\r
-                    <var ID="workflowState">project</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="getRelationListBeforeDelete">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations?obj=${createObject.CSID}&amp;wf_deleted=false</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/relationsList.res.xml</filename>\r
-                <vars>\r
-                    <var ID="totalItemsValue">2</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="softDeleteObject">\r
-             <method>PUT</method>\r
-             <uri>/cspace-services/objectexit/${createObject.CSID}/workflow/delete</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <!-- XmlReplay appears to require a filename on PUT. -->\r
-             <!-- If not present, throws "java.io.FileNotFoundException: File '' does not exist" -->\r
-             <!-- The contents of that file, sent in the PUT payload, will be ignored by the services. -->\r
-             <filename>relation/res/workflowState.res.xml</filename>\r
-             <vars>\r
-                 <var ID="workflowState">deleted</var>\r
-             </vars>\r
-         </test>\r
-         <test ID="verifyObjectIsSoftDeleted">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/objectexit/${createObject.CSID}/workflow</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/workflowState.res.xml</filename>\r
-                <vars>\r
-                    <var ID="workflowState">deleted</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="verifyRelation1IsSoftDeleted">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/${createRelation1.CSID}/workflow</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/workflowState.res.xml</filename>\r
-                <vars>\r
-                    <var ID="workflowState">deleted</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="verifyRelation2IsSoftDeleted">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations/${createRelation2.CSID}/workflow</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/workflowState.res.xml</filename>\r
-                <vars>\r
-                    <var ID="workflowState">deleted</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-         <test ID="getRelationListAfterDelete">\r
-             <method>GET</method>\r
-             <uri>/cspace-services/relations?obj=${createObject.CSID}&amp;wf_deleted=false</uri>\r
-             <expectedCodes>200</expectedCodes>\r
-             <response>\r
-                <expected level="ADDOK" />\r
-                <filename>relation/res/relationsList.res.xml</filename>\r
-                <vars>\r
-                    <var ID="totalItemsValue">0</var>\r
-                </vars>\r
-             </response>\r
-         </test>\r
-    </testGroup>\r
-         \r
-</xmlReplay>\r
-        \r
-        \r
+<?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@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+    </auths>
+   
+    <testGroup ID="makeRelations" autoDeletePOSTS="true">
+         <test ID="oe1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+         </test>
+         <test ID="oe2"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+         </test>
+         <test ID="relate1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/relations/</uri>
+             <filename>relation/r-1.xml</filename>
+             <vars>
+                <var ID="subjectCsid">${oe1.CSID}</var>
+                <var ID="objectCsid">${oe2.CSID}</var>
+                <var ID="subjectDocumentType">objectexit</var>
+                <var ID="objectDocumentType">objectexit</var>
+                <var ID="relationshipType">hasBroader</var>
+             </vars>
+         </test>
+         <test ID="relate2"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/relations/</uri>
+             <filename>relation/r-1.xml</filename>
+             <vars>
+                <!-- switched oe2 and oe1 on this -->
+                <var ID="subjectCsid">${oe2.CSID}</var>
+                <var ID="objectCsid">${oe1.CSID}</var>
+                <var ID="subjectDocumentType">objectexit</var>
+                <var ID="objectDocumentType">objectexit</var>
+                <var ID="relationshipType">hasBroader</var>
+             </vars>
+         </test>
+         <test ID="relationsGET"  auth="test">
+             <method>GET</method>
+             <uri>/cspace-services/relations/</uri>
+         </test>
+         
+         <!--
+         <test>
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${OrgAuth1.CSID}/items/${Org1.CSID}</uri>
+        </test>
+        -->
+    </testGroup>
+    
+    <testGroup ID="makeRelationsNested" autoDeletePOSTS="true">
+         <test ID="oe1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+         </test>
+         <test ID="oe2"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+         </test>
+         <test ID="relate1"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/relations/</uri>
+             <filename>relation/r-2.xml</filename>
+             <vars>
+                <var ID="subjectCsid">${oe1.CSID}</var>
+                <var ID="objectCsid">${itemCSID}</var>
+                <var ID="subjectDocumentType">ObjectExit</var>
+                <var ID="objectDocumentType">ObjectExit</var>
+                <var ID="relationshipType">hasBroader</var>
+             </vars>
+         </test>
+         <test ID="relationsGET"  auth="test">
+             <method>GET</method>
+             <uri>/cspace-services/relations/</uri>
+         </test>
+    </testGroup>
+         
+    <testGroup ID="r2only" autoDeletePOSTS="true">
+         <test ID="relate"  auth="test">
+             <method>POST</method>
+             <uri>/cspace-services/relations/</uri>
+             <filename>relation/r-2.xml</filename>
+             <vars>
+                <var ID="subjectCsid">1234-5678</var>
+                <var ID="objectCsid">${itemCSID}</var>
+                <var ID="subjectDocumentType">ObjectExit</var>
+                <var ID="objectDocumentType">ObjectExit</var>
+                <var ID="relationshipType">hasBroader</var>
+             </vars>
+         </test>
+         <test ID="relationsGET"  auth="test">
+             <method>GET</method>
+             <uri>/cspace-services/relations/</uri>
+         </test>
+    </testGroup>
+    
+    <!-- Test whether a relation is automatically soft deleted -->
+    <!-- when a subject of the relation is deleted --> 
+    <testGroup ID="cascadeDeleteRelationsOnSubjectDelete" autoDeletePOSTS="true">
+         <test ID="createSubject">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+             <expectedCodes>201</expectedCodes>
+         </test>
+         <test ID="createObject">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+             <expectedCodes>201</expectedCodes>
+         </test>
+         <test ID="createRelation">
+             <method>POST</method>
+             <uri>/cspace-services/relations</uri>
+             <filename>relation/r-1.xml</filename>
+             <vars>
+                <var ID="subjectCsid">${createSubject.CSID}</var>
+                <var ID="objectCsid">${createObject.CSID}</var>
+                <var ID="subjectDocumentType">objectexit</var>
+                <var ID="objectDocumentType">objectexit</var>
+                <var ID="relationshipType">affects</var>
+             </vars>
+             <expectedCodes>201</expectedCodes>
+         </test>
+         <test ID="getRelationWorkflowStateBeforeDelete">
+             <method>GET</method>
+             <uri>/cspace-services/relations/${createRelation.CSID}/workflow</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/workflowState.res.xml</filename>
+                <vars>
+                    <var ID="workflowState">project</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="getRelationListBeforeDelete">
+             <method>GET</method>
+             <uri>/cspace-services/relations?sbj=${createSubject.CSID}&amp;wf_deleted=false</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/relationsList.res.xml</filename>
+                <vars>
+                    <var ID="totalItemsValue">1</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="softDeleteSubject">
+             <method>PUT</method>
+             <uri>/cspace-services/objectexit/${createSubject.CSID}/workflow/delete</uri>
+             <expectedCodes>200</expectedCodes>
+             <!-- XmlReplay appears to require a filename on PUT. -->
+             <!-- If not present, throws "java.io.FileNotFoundException: File '' does not exist" -->
+             <!-- The contents of that file, sent in the PUT payload, will be ignored by the services. -->
+             <filename>relation/res/workflowState.res.xml</filename>
+             <vars>
+                 <var ID="workflowState">deleted</var>
+             </vars>
+         </test>
+         <test ID="verifySubjectIsSoftDeleted">
+             <method>GET</method>
+             <uri>/cspace-services/objectexit/${createSubject.CSID}/workflow</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/workflowState.res.xml</filename>
+                <vars>
+                    <var ID="workflowState">deleted</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="verifyRelationIsSoftDeleted">
+             <method>GET</method>
+             <uri>/cspace-services/relations/${createRelation.CSID}/workflow</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/workflowState.res.xml</filename>
+                <vars>
+                    <var ID="workflowState">deleted</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="getRelationListAfterDelete">
+             <method>GET</method>
+             <uri>/cspace-services/relations?sbj=${createSubject.CSID}&amp;wf_deleted=false</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/relationsList.res.xml</filename>
+                <vars>
+                    <var ID="totalItemsValue">0</var>
+                </vars>
+             </response>
+         </test>
+    </testGroup>
+    
+    <!-- Test whether multiple relations are automatically soft deleted -->
+    <!-- when an object of the relation is soft deleted. -->
+    <testGroup ID="cascadeDeleteMultipleRelationsOnObjectDelete" autoDeletePOSTS="true">
+         <test ID="createSubject1">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+             <expectedCodes>201</expectedCodes>
+         </test>
+         <test ID="createSubject2">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+             <expectedCodes>201</expectedCodes>
+         </test>
+         <test ID="createObject">
+             <method>POST</method>
+             <uri>/cspace-services/objectexit/</uri>
+             <filename>relation/oe1.xml</filename>
+             <expectedCodes>201</expectedCodes>
+         </test>
+         <test ID="createRelation1">
+             <method>POST</method>
+             <uri>/cspace-services/relations</uri>
+             <filename>relation/r-1.xml</filename>
+             <vars>
+                <var ID="subjectCsid">${createSubject1.CSID}</var>
+                <var ID="objectCsid">${createObject.CSID}</var>
+                <var ID="subjectDocumentType">objectexit</var>
+                <var ID="objectDocumentType">objectexit</var>
+                <var ID="relationshipType">affects</var>
+             </vars>
+             <expectedCodes>201</expectedCodes>
+         </test>
+         <test ID="createRelation2">
+             <method>POST</method>
+             <uri>/cspace-services/relations</uri>
+             <filename>relation/r-1.xml</filename>
+             <vars>
+                <var ID="subjectCsid">${createSubject2.CSID}</var>
+                <var ID="objectCsid">${createObject.CSID}</var>
+                <var ID="subjectDocumentType">objectexit</var>
+                <var ID="objectDocumentType">objectexit</var>
+                <var ID="relationshipType">affects</var>
+             </vars>
+             <expectedCodes>201</expectedCodes>
+         </test>
+         <test ID="getRelation1WorkflowStateBeforeDelete">
+             <method>GET</method>
+             <uri>/cspace-services/relations/${createRelation1.CSID}/workflow</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/workflowState.res.xml</filename>
+                <vars>
+                    <var ID="workflowState">project</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="getRelation2WorkflowStateBeforeDelete">
+             <method>GET</method>
+             <uri>/cspace-services/relations/${createRelation2.CSID}/workflow</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/workflowState.res.xml</filename>
+                <vars>
+                    <var ID="workflowState">project</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="getRelationListBeforeDelete">
+             <method>GET</method>
+             <uri>/cspace-services/relations?obj=${createObject.CSID}&amp;wf_deleted=false</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/relationsList.res.xml</filename>
+                <vars>
+                    <var ID="totalItemsValue">2</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="softDeleteObject">
+             <method>PUT</method>
+             <uri>/cspace-services/objectexit/${createObject.CSID}/workflow/delete</uri>
+             <expectedCodes>200</expectedCodes>
+             <!-- XmlReplay appears to require a filename on PUT. -->
+             <!-- If not present, throws "java.io.FileNotFoundException: File '' does not exist" -->
+             <!-- The contents of that file, sent in the PUT payload, will be ignored by the services. -->
+             <filename>relation/res/workflowState.res.xml</filename>
+             <vars>
+                 <var ID="workflowState">deleted</var>
+             </vars>
+         </test>
+         <test ID="verifyObjectIsSoftDeleted">
+             <method>GET</method>
+             <uri>/cspace-services/objectexit/${createObject.CSID}/workflow</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/workflowState.res.xml</filename>
+                <vars>
+                    <var ID="workflowState">deleted</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="verifyRelation1IsSoftDeleted">
+             <method>GET</method>
+             <uri>/cspace-services/relations/${createRelation1.CSID}/workflow</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/workflowState.res.xml</filename>
+                <vars>
+                    <var ID="workflowState">deleted</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="verifyRelation2IsSoftDeleted">
+             <method>GET</method>
+             <uri>/cspace-services/relations/${createRelation2.CSID}/workflow</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/workflowState.res.xml</filename>
+                <vars>
+                    <var ID="workflowState">deleted</var>
+                </vars>
+             </response>
+         </test>
+         <test ID="getRelationListAfterDelete">
+             <method>GET</method>
+             <uri>/cspace-services/relations?obj=${createObject.CSID}&amp;wf_deleted=false</uri>
+             <expectedCodes>200</expectedCodes>
+             <response>
+                <expected level="ADDOK" />
+                <filename>relation/res/relationsList.res.xml</filename>
+                <vars>
+                    <var ID="totalItemsValue">0</var>
+                </vars>
+             </response>
+         </test>
+    </testGroup>
+         
+</xmlReplay>
+        
+        
index 7182973b58239f7aede01efb69bf6c864fa71f3b..5b1428c7afaabf7d2b4e4fb4b28cd8917e6e55f1 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document name="workflow">\r
-    <ns2:workflow_common xmlns:ns2="http://collectionspace.org/services/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-        <lifeCyclePolicy>cs_default</lifeCyclePolicy>\r
-        <currentLifeCycleState>${workflowState}</currentLifeCycleState>\r
-    </ns2:workflow_common>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="workflow">
+    <ns2:workflow_common xmlns:ns2="http://collectionspace.org/services/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        <lifeCyclePolicy>cs_default</lifeCyclePolicy>
+        <currentLifeCycleState>${workflowState}</currentLifeCycleState>
+    </ns2:workflow_common>
 </document>
\ No newline at end of file
index 57c6960a3cf13e3f3e108d5ca8170991068d0b4a..1b0ccaf7830de408f6b127b7da25e70b05e737bd 100644 (file)
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    \r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-    </auths>\r
-    \r
-    <testGroup ID="testSingle" autoDeletePOSTS="true">\r
-        \r
-        <test ID="createReport1" auth="test">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/reports/</uri>\r
-            <filename>report/report1Record.xml</filename>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        <test ID="readReport1" auth="test">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/reports/${createReport1.CSID}</uri>\r
-        </test>\r
-        \r
-        <test ID="createAcquisition1" auth="test">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/acquisitions/</uri>\r
-            <filename>report/acquisition1.xml</filename>\r
-            <vars>\r
-                <var ID="acquisitionReferenceNumber">Ac2011.1.2-jdlmbsoq</var>\r
-            </vars>\r
-            <expectedCodes>201</expectedCodes>\r
-        </test>\r
-        \r
-        <!--\r
-            This test is still mostly a placeholder, merely verifying that,\r
-            with a generated report returned matching the 'application/xml' MIME\r
-            type, the resultant document can be successfully parsed by an\r
-            XML parser, in XmlReplay's context.\r
-\r
-            Attempts to verify additional fidelity to an expected document\r
-            at the ADDOK level or higher have so far failed, while validation at\r
-            the (more permissive) TEXT level appears to be far too lenient.\r
-            - ADR 2013-05-13\r
-        -->\r
-        <test ID="testInvokeSingle" auth="test" autoDeletePOSTS="false">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/reports/${createReport1.CSID}</uri>\r
-            <filename>report/report1InvContextStandalone.xml</filename>\r
-            <vars>\r
-                <var ID="acquisitionCSID">${createAcquisition1.CSID}</var>\r
-            </vars>\r
-            <response>\r
-                <expected level="ADDOK"/>\r
-                <filename>report/res/report1.res.xml</filename>\r
-                <vars>\r
-                    <var ID="acquisitionReferenceNumber">${createAcquisition1.acquisitionReferenceNumber}</var>\r
-                </vars>\r
-            </response>\r
-            <expectedCodes>200</expectedCodes>\r
-        </test>\r
-        \r
-        <!-- See the Batch service tests within the IntegrationTests -->\r
-        <!-- module for templates for additional report invocation tests -->\r
-        <!-- that can be added here. -->\r
-        \r
-    </testGroup>\r
-\r
-</xmlReplay>\r
-\r
+<?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@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+    </auths>
+    
+    <testGroup ID="testSingle" autoDeletePOSTS="true">
+        
+        <test ID="createReport1" auth="test">
+            <method>POST</method>
+            <uri>/cspace-services/reports/</uri>
+            <filename>report/report1Record.xml</filename>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="readReport1" auth="test">
+            <method>GET</method>
+            <uri>/cspace-services/reports/${createReport1.CSID}</uri>
+        </test>
+        
+        <test ID="createAcquisition1" auth="test">
+            <method>POST</method>
+            <uri>/cspace-services/acquisitions/</uri>
+            <filename>report/acquisition1.xml</filename>
+            <vars>
+                <var ID="acquisitionReferenceNumber">Ac2011.1.2-jdlmbsoq</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        
+        <!--
+            This test is still mostly a placeholder, merely verifying that,
+            with a generated report returned matching the 'application/xml' MIME
+            type, the resultant document can be successfully parsed by an
+            XML parser, in XmlReplay's context.
+
+            Attempts to verify additional fidelity to an expected document
+            at the ADDOK level or higher have so far failed, while validation at
+            the (more permissive) TEXT level appears to be far too lenient.
+            - ADR 2013-05-13
+        -->
+        <test ID="testInvokeSingle" auth="test" autoDeletePOSTS="false">
+            <method>POST</method>
+            <uri>/cspace-services/reports/${createReport1.CSID}</uri>
+            <filename>report/report1InvContextStandalone.xml</filename>
+            <vars>
+                <var ID="acquisitionCSID">${createAcquisition1.CSID}</var>
+            </vars>
+            <response>
+                <expected level="ADDOK"/>
+                <filename>report/res/report1.res.xml</filename>
+                <vars>
+                    <var ID="acquisitionReferenceNumber">${createAcquisition1.acquisitionReferenceNumber}</var>
+                </vars>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- See the Batch service tests within the IntegrationTests -->
+        <!-- module for templates for additional report invocation tests -->
+        <!-- that can be added here. -->
+        
+    </testGroup>
+
+</xmlReplay>
+
index ba95d818fe3ec3ba98ec92b94d968ec4e0f521f4..15bdc22a2676d8f9f5d098985c44b1379f4c79c3 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:invocationContext\r
-    xmlns:ns2="http://collectionspace.org/services/common/invocable"\r
-    xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <mode>single</mode>\r
-    <docType>Acquisition</docType>\r
-    <singleCSID>${acquisitionCSID}</singleCSID>\r
-</ns2:invocationContext>\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:invocationContext
+    xmlns:ns2="http://collectionspace.org/services/common/invocable"
+    xmlns:ns3="http://collectionspace.org/services/jaxb">
+    <mode>single</mode>
+    <docType>Acquisition</docType>
+    <singleCSID>${acquisitionCSID}</singleCSID>
+</ns2:invocationContext>
+
+
index fce3290a1a3e9c5d65ebeb4ca2a75d3e8a74d0de..013d72b5ce73aebe3ba683e8da203080790a8262 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-        <auth ID="user1@museum1">dXNlcjFAbXVzZXVtMS5vcmc6dXNlcjFAbXVzZXVtMS5vcmc=</auth>\r
-        <auth ID="bigbird2010">YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=</auth>\r
-        <auth ID="elmo2010">ZWxtbzIwMTA6ZWxtbzIwMTA=</auth>\r
-    </auths>\r
-    \r
-    \r
-    <testGroup ID="deleteBug" autoDeletePOSTS="false">\r
-        <test ID="permElmo">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions</uri>\r
-            <filename>security/2-elmo-permission.xml</filename>\r
-        </test>\r
-        <test ID="elmoPermroles">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions/${permElmo.CSID}/permroles</uri>\r
-            <filename>security/10-permissionroles-elmo.xml</filename>\r
-        </test>\r
-        <test ID="accountElmo">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/accounts</uri>\r
-            <filename>security/6-account-elmo.xml</filename>\r
-        </test>\r
-\r
-               <test ID="dimension1"  auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <filename>dimension/1.xml</filename>\r
-        </test>\r
-               <test ID="dimensionElmoDELETE" auth="elmo2010">\r
-            <expectedCodes>403</expectedCodes>\r
-            <method>DELETE</method>\r
-            <fromTestID>dimension1</fromTestID>\r
-        </test>\r
-        <test ID="dimensionAdminDELETE" auth="admin@core.collectionspace.org">\r
-            <method>DELETE</method>\r
-            <fromTestID>dimension1</fromTestID>\r
-        </test>\r
-        <test ID="deleteElmoPermroles">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/authorization/permissions/${permElmo.CSID}/permroles</uri>\r
-        </test>\r
-        <test ID="deleteAccountElmo">\r
-            <method>DELETE</method>\r
-            <fromTestID>accountElmo</fromTestID>\r
-        </test>\r
-    </testGroup>\r
-    \r
-    \r
-    <testGroup ID="security" autoDeletePOSTS="false">\r
-\r
-        <!--First test that bigbird2010 does NOT have write access: -->\r
-        <test ID="dimension0"  auth="bigbird2010">\r
-            <expectedCodes>401,500,501</expectedCodes>\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <filename>dimension/1.xml</filename>\r
-        </test>\r
-\r
-        <!--Next, set up permissions and roles, and test bigbird2010 and elmo2010. -->\r
-        <test ID="permBigbird" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions</uri>\r
-            <filename>security/1-bigbird-permission.xml</filename>\r
-        </test>\r
-        <test ID="permElmo">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions</uri>\r
-            <filename>security/2-elmo-permission.xml</filename>\r
-        </test>\r
-        <test ID="roleTestCM">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/roles</uri>\r
-            <filename>security/3-role-test-cm.xml</filename>\r
-        </test>\r
-        <test ID="roleIntern">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/roles</uri>\r
-            <filename>security/4-role-intern.xml</filename>\r
-        </test>\r
-        <test ID="accountBigbird">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/accounts</uri>\r
-            <filename>security/5-account-bigbird.xml</filename>\r
-        </test>\r
-        <test ID="accountElmo">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/accounts</uri>\r
-            <filename>security/6-account-elmo.xml</filename>\r
-        </test>\r
-        <test ID="accountrolesBigbird">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/accounts/${accountBigbird.CSID}/accountroles</uri>\r
-            <filename>security/7-accountroles-bigbird.xml</filename>\r
-        </test>\r
-        <test ID="accountrolesElmo">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/accounts/${accountElmo.CSID}/accountroles</uri>\r
-            <filename>security/8-account-roles-elmo.xml</filename>\r
-        </test>\r
-        <test ID="bigbirdPermroles">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>\r
-            <filename>security/9-permissionroles-bigbird.xml</filename>\r
-        </test>\r
-        <test ID="elmoPermroles">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions/${permElmo.CSID}/permroles</uri>\r
-            <filename>security/10-permissionroles-elmo.xml</filename>\r
-        </test>\r
-\r
-        <test ID="dimension1"  auth="bigbird2010">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <filename>dimension/1.xml</filename>\r
-        </test>\r
-        <test ID="dimension2">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/dimensions/${dimension1.CSID}</uri>\r
-            <filename>dimension/2-put.xml</filename>\r
-        </test>\r
-        <test>\r
-            <method>GET</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <fromTestID>dimension1</fromTestID>\r
-        </test>\r
-        <test ID="dimensionElmoPOST"  auth="elmo2010">\r
-            <expectedCodes>403</expectedCodes>\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <filename>dimension/1.xml</filename>\r
-        </test>\r
-        <test ID="dimensionElmoPUT">\r
-            <expectedCodes>403</expectedCodes>\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/dimensions/${dimension1.CSID}</uri>\r
-            <filename>dimension/2-put.xml</filename>\r
-        </test>\r
-        <test ID="dimensionElmoGET">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <fromTestID>dimension1</fromTestID>\r
-        </test>\r
-        <test ID="dimensionElmoDELETE" auth="elmo2010">\r
-            <expectedCodes>403</expectedCodes>\r
-            <method>DELETE</method>\r
-            <fromTestID>dimension1</fromTestID>\r
-        </test>\r
-        <test ID="dimensionBigbirdDELETE" auth="bigbird2010">\r
-            <method>DELETE</method>\r
-            <fromTestID>dimension1</fromTestID>\r
-        </test>\r
-\r
-        <!--   The element:  <action>SEARCH </action>  implies LIST\r
-               in C:\bin\xmlreplay\test-data\xmlReplay\security\1-bigbird-permission.xml\r
-               Add DELETE, do CRUD for both, then switch roles and redo CRUD\r
-        -->\r
-\r
-\r
-        <test ID="dimensionBigBirdDELETEpermroles" auth="admin@core.collectionspace.org">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>\r
-            <!-- don't do <fromTestID>, no CSID of permrole on end of url, but deleteURL will put one there for you, so don't use it.\r
-                wrong: <fromTestID>bigbirdPermroles</fromTestID>\r
-                wrong: http://localhost:8280/cspace-services/authorization/permissions/28943d0f-efac-48d3-8c01-e4ef7e75e296/permroles/0891ca9a-ba34-4701-9662-4ab73757890e\r
-                Create a <uri> element instead:\r
-                right: http://localhost:8280/cspace-services/authorization/permissions/28943d0f-efac-48d3-8c01-e4ef7e75e296/permroles\r
-            -->\r
-        </test>\r
-        <test>\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/authorization/permissions/${permElmo.CSID}/permroles</uri>\r
-        </test>\r
-        \r
-        <test ID="dimensionBigbirdPOSTAfterPermrolesDeleted"  auth="bigbird2010">\r
-        <msg>Removing all permissions from Bigbird's role</msg>\r
-            <expectedCodes>403,404</expectedCodes>\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <filename>dimension/1.xml</filename>\r
-        </test>\r
-        <test ID="dimensionBigbirdPUTAfterPermrolesDeleted">\r
-            <expectedCodes>404</expectedCodes>\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/dimensions/${dimension1.CSID}</uri>\r
-            <filename>dimension/2-put.xml</filename>\r
-        </test>\r
-\r
-        \r
-        <test ID="accountroles2" auth="admin@core.collectionspace.org">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/accounts/${accountBigbird.CSID}/accountroles</uri>\r
-        </test>\r
-        <test>\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/accounts/${accountElmo.CSID}/accountroles</uri>\r
-        </test>\r
-        <test>\r
-            <method>DELETE</method>\r
-            <!-- These both work, and fromTestID takes precedence. -->\r
-            <uri>${roleTestCM.deleteURL}</uri>\r
-            <fromTestID>roleTestCM</fromTestID>\r
-        </test>\r
-        <test>\r
-            <method>DELETE</method>\r
-            <fromTestID>roleIntern</fromTestID>\r
-        </test>\r
-        <test>\r
-            <method>DELETE</method>\r
-            <fromTestID>accountBigbird</fromTestID>\r
-        </test>\r
-        <test>\r
-            <method>DELETE</method>\r
-            <fromTestID>accountElmo</fromTestID>\r
-        </test>\r
-        <!-- delete permissions.  Don't delete permissions, or Admin will get hosed. -->\r
-    </testGroup>\r
-    \r
-    \r
-    \r
-    \r
-    \r
-   <!-- ================================================================================ -->\r
-    \r
-   <testGroup ID="securityRemovingRoleperms" autoDeletePOSTS="false">\r
-\r
-        <!--First test that bigbird2010 does NOT have write access: -->\r
-        <test ID="dimensionBeforePerms"  auth="bigbird2010">\r
-            <expectedCodes>401,403,500,501</expectedCodes>\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <filename>dimension/1.xml</filename>\r
-        </test>\r
-\r
-        <!--Next, set up permissions and roles, and test bigbird2010.-->\r
-        <test ID="permBigbird" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions</uri>\r
-            <filename>security/1-bigbird-permission.xml</filename>\r
-        </test>\r
-        <test ID="roleTestCM"  auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/roles</uri>\r
-            <filename>security/3-role-test-cm.xml</filename>\r
-        </test>\r
-        <test ID="accountBigbird">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/accounts</uri>\r
-            <filename>security/5-account-bigbird.xml</filename>\r
-        </test>\r
-        <test ID="accountrolesBigbird">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/accounts/${accountBigbird.CSID}/accountroles</uri>\r
-            <filename>security/7-accountroles-bigbird.xml</filename>\r
-        </test>\r
-        <test ID="bigbirdPermroles">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>\r
-            <filename>security/9-permissionroles-bigbird.xml</filename>\r
-        </test>\r
-\r
-        <!--  bigbird2010 now has CRUD permissions, -->\r
-        <!--  so now try CRUDL by bigbird2010 -->\r
-        \r
-        <test ID="dimensionBigbird_POST"  auth="bigbird2010">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-                       <filename>dimension/1.xml</filename>\r
-        </test>\r
-        <!-- TODO: FAILING, BUT SHOULD SUCCEED.  REMOVING TEST FOR NOW. -->\r
-        <test ID="dimensionBigbird_PUT">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/dimensions/${dimensionBigbird_POST.CSID}</uri>\r
-                       <filename>dimension/2-put.xml</filename>\r
-        </test>\r
-\r
-\r
-\r
-       <test ID="dimensionBigbird_GET">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <fromTestID>dimensionBigbird_POST</fromTestID>\r
-        </test>\r
-        <test ID="dimensionBigbird_DELETE" auth="bigbird2010">\r
-            <method>DELETE</method>\r
-            <fromTestID>dimensionBigbird_POST</fromTestID>\r
-        </test>\r
-        \r
-        <!--  NOW **REMOVE** PERMROLES FROM BIGBIRD -->\r
-        \r
-        <test ID="deletePermrolesBigbird" auth="admin@core.collectionspace.org">\r
-            <msg>Deleting permroles from bigbird2010</msg>\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>\r
-        </test>\r
-        \r
-        <!--  NOW TRY CRUDL BY BIGBIRD WITH NO PERMROLES -->\r
-        \r
-        <test ID="dimensionBigbird_POST_AfterPermrolesDeleted"  auth="bigbird2010">\r
-            <msg>Trying to POST after permroles removed from Bigbird</msg>\r
-            <expectedCodes>403,404</expectedCodes>\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-                       <filename>dimension/1.xml</filename>\r
-        </test>\r
-        <test ID="dimensionBigbird_PUT_AfterPermrolesDeleted">\r
-            <expectedCodes>403,404,405</expectedCodes><!-- Expected failure because dimensionBigbird_POST_AfterPermrolesDeleted failed.-->\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/dimensions/${dimensionBigbird_POST_AfterPermrolesDeleted.CSID}</uri>\r
-                       <filename>dimension/2-put.xml</filename>\r
-        </test>\r
-        <test ID="dimensionBigbird_GET_AfterPermrolesDeleted">\r
-            <expectedCodes>403,404</expectedCodes>\r
-            <method>GET</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <fromTestID>dimensionBigbird_POST_AfterPermrolesDeleted</fromTestID>\r
-        </test>\r
-        <test ID="dimensionBigbird_DELETE_AfterPermrolesDeleted" auth="bigbird2010">\r
-            <expectedCodes>0,403,404</expectedCodes>\r
-            <method>DELETE</method>\r
-            <fromTestID>dimensionBigbird_POST_AfterPermrolesDeleted</fromTestID>\r
-        </test>\r
-\r
-        <!--  NOW **ADD** PERMS CRU TO BIGBIRD -->\r
-\r
-        <test ID="permBigbird_CRU" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions</uri>\r
-            <filename>security/11-bigbird-permission-CRU.xml</filename>\r
-        </test>\r
-        <test ID="bigbirdPermrolesCRU" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions/${permBigbird_CRU.CSID}/permroles</uri>\r
-            <filename>security/11-permissionroles-bigbird-CRU.xml</filename>\r
-        </test>\r
-        \r
-        <!--  NOW TRY CRUDL BY BIGBIRD BUT WITH CRU ADDED -->\r
-\r
-        <test ID="dimensionBigbird_POST_CRU"  auth="bigbird2010">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-                       <filename>dimension/1.xml</filename>\r
-        </test>\r
-        <test ID="dimensionBigbird_PUT_CRU">\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/dimensions/${dimensionBigbird_POST_CRU.CSID}</uri>\r
-                       <filename>dimension/2-put.xml</filename>\r
-        </test>\r
-        <test ID="dimensionBigbird_GET_CRU">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <fromTestID>dimensionBigbird_POST_CRU</fromTestID>\r
-        </test>\r
-        <test ID="dimensionBigbird_DELETE_CRU">\r
-            <expectedCodes>403,404</expectedCodes>\r
-            <method>DELETE</method>\r
-            <fromTestID>dimensionBigbird_POST_CRU</fromTestID>\r
-        </test>\r
-\r
-        <!--  NOW **REMOVE** PERMROLES FROM BIGBIRD -->\r
-        \r
-        <test ID="deletePermrolesBigbird" auth="admin@core.collectionspace.org">\r
-            <msg>Deleting permroles from bigbird2010</msg>\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/authorization/permissions/${permBigbird_CRU.CSID}/permroles</uri>\r
-        </test>\r
-        \r
-        <!--  NOW **ADD** PERMS R TO BIGBIRD -->\r
-\r
-        <test ID="permBigbird_R" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions</uri>\r
-            <filename>security/12-bigbird-permission-R.xml</filename>\r
-        </test>\r
-        <test ID="bigbirdPermroles_R" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/authorization/permissions/${permBigbird_R.CSID}/permroles</uri>\r
-            <filename>security/12-permissionroles-bigbird-R.xml</filename>\r
-        </test>\r
-\r
-        <!--  NOW TRY CRUDL BY BIGBIRD with R only -->\r
-        \r
-        <test ID="dimensionBigbird_POST_R"  auth="bigbird2010">\r
-            <expectedCodes>403,404</expectedCodes>\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-                       <filename>dimension/1.xml</filename>\r
-        </test>\r
-        <test ID="dimensionBigbird_PUT_R">\r
-            <expectedCodes>403,404,405</expectedCodes>\r
-            <method>PUT</method>\r
-            <uri>/cspace-services/dimensions/${dimensionBigbird_POST_R.CSID}</uri>\r
-                       <filename>dimension/2-put.xml</filename>\r
-        </test>\r
-        <test ID="dimensionBigbird_GET_R">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <fromTestID>dimensionBigbird_POST_R</fromTestID>\r
-        </test>\r
-        <test ID="dimensionBigbird_DELETE_R">\r
-        <!-- RESPONSE CODE 0 MEANS XmlReplay could not find a deleteURL or CSID, which is right, because the POST failed. -->\r
-            <expectedCodes>0,403,404</expectedCodes>\r
-            <method>DELETE</method>\r
-            <fromTestID>dimensionBigbird_POST_R</fromTestID>\r
-        </test>\r
-        \r
-        <!-- CLEANUP -->\r
-        \r
-        <test ID="deletePermrolesBigbird" auth="admin@core.collectionspace.org">\r
-            <msg>Deleting permroles from bigbird2010</msg>\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>\r
-        </test>\r
-        <test  auth="admin@core.collectionspace.org">\r
-            <method>DELETE</method>\r
-            <uri>/cspace-services/accounts/${accountBigbird.CSID}/accountroles</uri>\r
-        </test>\r
-         <test ID="securityCleanupRoleTestCM">\r
-            <method>DELETE</method>\r
-            <fromTestID>roleTestCM</fromTestID>\r
-        </test>\r
-        <test ID="securityCleanupAccountBigbird">\r
-            <method>DELETE</method>\r
-            <fromTestID>accountBigbird</fromTestID>\r
-        </test>\r
-        \r
-    </testGroup>\r
-\r
-        <!-- proposed simplification for re-runs:\r
-        <test rerunID="dimensionBigbird" testGroupID="dimensionCRUDL">\r
-            <expectedCodes>404</expectedCodes>\r
-        </test>\r
-        -->\r
-\r
-</xmlReplay>\r
-        \r
-        \r
+<?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@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+        <auth ID="user1@museum1">dXNlcjFAbXVzZXVtMS5vcmc6dXNlcjFAbXVzZXVtMS5vcmc=</auth>
+        <auth ID="bigbird2010">YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=</auth>
+        <auth ID="elmo2010">ZWxtbzIwMTA6ZWxtbzIwMTA=</auth>
+    </auths>
+    
+    
+    <testGroup ID="deleteBug" autoDeletePOSTS="false">
+        <test ID="permElmo">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions</uri>
+            <filename>security/2-elmo-permission.xml</filename>
+        </test>
+        <test ID="elmoPermroles">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions/${permElmo.CSID}/permroles</uri>
+            <filename>security/10-permissionroles-elmo.xml</filename>
+        </test>
+        <test ID="accountElmo">
+            <method>POST</method>
+            <uri>/cspace-services/accounts</uri>
+            <filename>security/6-account-elmo.xml</filename>
+        </test>
+
+               <test ID="dimension1"  auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <filename>dimension/1.xml</filename>
+        </test>
+               <test ID="dimensionElmoDELETE" auth="elmo2010">
+            <expectedCodes>403</expectedCodes>
+            <method>DELETE</method>
+            <fromTestID>dimension1</fromTestID>
+        </test>
+        <test ID="dimensionAdminDELETE" auth="admin@core.collectionspace.org">
+            <method>DELETE</method>
+            <fromTestID>dimension1</fromTestID>
+        </test>
+        <test ID="deleteElmoPermroles">
+            <method>DELETE</method>
+            <uri>/cspace-services/authorization/permissions/${permElmo.CSID}/permroles</uri>
+        </test>
+        <test ID="deleteAccountElmo">
+            <method>DELETE</method>
+            <fromTestID>accountElmo</fromTestID>
+        </test>
+    </testGroup>
+    
+    
+    <testGroup ID="security" autoDeletePOSTS="false">
+
+        <!--First test that bigbird2010 does NOT have write access: -->
+        <test ID="dimension0"  auth="bigbird2010">
+            <expectedCodes>401,500,501</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <filename>dimension/1.xml</filename>
+        </test>
+
+        <!--Next, set up permissions and roles, and test bigbird2010 and elmo2010. -->
+        <test ID="permBigbird" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions</uri>
+            <filename>security/1-bigbird-permission.xml</filename>
+        </test>
+        <test ID="permElmo">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions</uri>
+            <filename>security/2-elmo-permission.xml</filename>
+        </test>
+        <test ID="roleTestCM">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/roles</uri>
+            <filename>security/3-role-test-cm.xml</filename>
+        </test>
+        <test ID="roleIntern">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/roles</uri>
+            <filename>security/4-role-intern.xml</filename>
+        </test>
+        <test ID="accountBigbird">
+            <method>POST</method>
+            <uri>/cspace-services/accounts</uri>
+            <filename>security/5-account-bigbird.xml</filename>
+        </test>
+        <test ID="accountElmo">
+            <method>POST</method>
+            <uri>/cspace-services/accounts</uri>
+            <filename>security/6-account-elmo.xml</filename>
+        </test>
+        <test ID="accountrolesBigbird">
+            <method>POST</method>
+            <uri>/cspace-services/accounts/${accountBigbird.CSID}/accountroles</uri>
+            <filename>security/7-accountroles-bigbird.xml</filename>
+        </test>
+        <test ID="accountrolesElmo">
+            <method>POST</method>
+            <uri>/cspace-services/accounts/${accountElmo.CSID}/accountroles</uri>
+            <filename>security/8-account-roles-elmo.xml</filename>
+        </test>
+        <test ID="bigbirdPermroles">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>
+            <filename>security/9-permissionroles-bigbird.xml</filename>
+        </test>
+        <test ID="elmoPermroles">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions/${permElmo.CSID}/permroles</uri>
+            <filename>security/10-permissionroles-elmo.xml</filename>
+        </test>
+
+        <test ID="dimension1"  auth="bigbird2010">
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <filename>dimension/1.xml</filename>
+        </test>
+        <test ID="dimension2">
+            <method>PUT</method>
+            <uri>/cspace-services/dimensions/${dimension1.CSID}</uri>
+            <filename>dimension/2-put.xml</filename>
+        </test>
+        <test>
+            <method>GET</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <fromTestID>dimension1</fromTestID>
+        </test>
+        <test ID="dimensionElmoPOST"  auth="elmo2010">
+            <expectedCodes>403</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <filename>dimension/1.xml</filename>
+        </test>
+        <test ID="dimensionElmoPUT">
+            <expectedCodes>403</expectedCodes>
+            <method>PUT</method>
+            <uri>/cspace-services/dimensions/${dimension1.CSID}</uri>
+            <filename>dimension/2-put.xml</filename>
+        </test>
+        <test ID="dimensionElmoGET">
+            <method>GET</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <fromTestID>dimension1</fromTestID>
+        </test>
+        <test ID="dimensionElmoDELETE" auth="elmo2010">
+            <expectedCodes>403</expectedCodes>
+            <method>DELETE</method>
+            <fromTestID>dimension1</fromTestID>
+        </test>
+        <test ID="dimensionBigbirdDELETE" auth="bigbird2010">
+            <method>DELETE</method>
+            <fromTestID>dimension1</fromTestID>
+        </test>
+
+        <!--   The element:  <action>SEARCH </action>  implies LIST
+               in C:\bin\xmlreplay\test-data\xmlReplay\security\1-bigbird-permission.xml
+               Add DELETE, do CRUD for both, then switch roles and redo CRUD
+        -->
+
+
+        <test ID="dimensionBigBirdDELETEpermroles" auth="admin@core.collectionspace.org">
+            <method>DELETE</method>
+            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>
+            <!-- don't do <fromTestID>, no CSID of permrole on end of url, but deleteURL will put one there for you, so don't use it.
+                wrong: <fromTestID>bigbirdPermroles</fromTestID>
+                wrong: http://localhost:8280/cspace-services/authorization/permissions/28943d0f-efac-48d3-8c01-e4ef7e75e296/permroles/0891ca9a-ba34-4701-9662-4ab73757890e
+                Create a <uri> element instead:
+                right: http://localhost:8280/cspace-services/authorization/permissions/28943d0f-efac-48d3-8c01-e4ef7e75e296/permroles
+            -->
+        </test>
+        <test>
+            <method>DELETE</method>
+            <uri>/cspace-services/authorization/permissions/${permElmo.CSID}/permroles</uri>
+        </test>
+        
+        <test ID="dimensionBigbirdPOSTAfterPermrolesDeleted"  auth="bigbird2010">
+        <msg>Removing all permissions from Bigbird's role</msg>
+            <expectedCodes>403,404</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <filename>dimension/1.xml</filename>
+        </test>
+        <test ID="dimensionBigbirdPUTAfterPermrolesDeleted">
+            <expectedCodes>404</expectedCodes>
+            <method>PUT</method>
+            <uri>/cspace-services/dimensions/${dimension1.CSID}</uri>
+            <filename>dimension/2-put.xml</filename>
+        </test>
+
+        
+        <test ID="accountroles2" auth="admin@core.collectionspace.org">
+            <method>DELETE</method>
+            <uri>/cspace-services/accounts/${accountBigbird.CSID}/accountroles</uri>
+        </test>
+        <test>
+            <method>DELETE</method>
+            <uri>/cspace-services/accounts/${accountElmo.CSID}/accountroles</uri>
+        </test>
+        <test>
+            <method>DELETE</method>
+            <!-- These both work, and fromTestID takes precedence. -->
+            <uri>${roleTestCM.deleteURL}</uri>
+            <fromTestID>roleTestCM</fromTestID>
+        </test>
+        <test>
+            <method>DELETE</method>
+            <fromTestID>roleIntern</fromTestID>
+        </test>
+        <test>
+            <method>DELETE</method>
+            <fromTestID>accountBigbird</fromTestID>
+        </test>
+        <test>
+            <method>DELETE</method>
+            <fromTestID>accountElmo</fromTestID>
+        </test>
+        <!-- delete permissions.  Don't delete permissions, or Admin will get hosed. -->
+    </testGroup>
+    
+    
+    
+    
+    
+   <!-- ================================================================================ -->
+    
+   <testGroup ID="securityRemovingRoleperms" autoDeletePOSTS="false">
+
+        <!--First test that bigbird2010 does NOT have write access: -->
+        <test ID="dimensionBeforePerms"  auth="bigbird2010">
+            <expectedCodes>401,403,500,501</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <filename>dimension/1.xml</filename>
+        </test>
+
+        <!--Next, set up permissions and roles, and test bigbird2010.-->
+        <test ID="permBigbird" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions</uri>
+            <filename>security/1-bigbird-permission.xml</filename>
+        </test>
+        <test ID="roleTestCM"  auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/roles</uri>
+            <filename>security/3-role-test-cm.xml</filename>
+        </test>
+        <test ID="accountBigbird">
+            <method>POST</method>
+            <uri>/cspace-services/accounts</uri>
+            <filename>security/5-account-bigbird.xml</filename>
+        </test>
+        <test ID="accountrolesBigbird">
+            <method>POST</method>
+            <uri>/cspace-services/accounts/${accountBigbird.CSID}/accountroles</uri>
+            <filename>security/7-accountroles-bigbird.xml</filename>
+        </test>
+        <test ID="bigbirdPermroles">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>
+            <filename>security/9-permissionroles-bigbird.xml</filename>
+        </test>
+
+        <!--  bigbird2010 now has CRUD permissions, -->
+        <!--  so now try CRUDL by bigbird2010 -->
+        
+        <test ID="dimensionBigbird_POST"  auth="bigbird2010">
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+                       <filename>dimension/1.xml</filename>
+        </test>
+        <!-- TODO: FAILING, BUT SHOULD SUCCEED.  REMOVING TEST FOR NOW. -->
+        <test ID="dimensionBigbird_PUT">
+            <method>PUT</method>
+            <uri>/cspace-services/dimensions/${dimensionBigbird_POST.CSID}</uri>
+                       <filename>dimension/2-put.xml</filename>
+        </test>
+
+
+
+       <test ID="dimensionBigbird_GET">
+            <method>GET</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <fromTestID>dimensionBigbird_POST</fromTestID>
+        </test>
+        <test ID="dimensionBigbird_DELETE" auth="bigbird2010">
+            <method>DELETE</method>
+            <fromTestID>dimensionBigbird_POST</fromTestID>
+        </test>
+        
+        <!--  NOW **REMOVE** PERMROLES FROM BIGBIRD -->
+        
+        <test ID="deletePermrolesBigbird" auth="admin@core.collectionspace.org">
+            <msg>Deleting permroles from bigbird2010</msg>
+            <method>DELETE</method>
+            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>
+        </test>
+        
+        <!--  NOW TRY CRUDL BY BIGBIRD WITH NO PERMROLES -->
+        
+        <test ID="dimensionBigbird_POST_AfterPermrolesDeleted"  auth="bigbird2010">
+            <msg>Trying to POST after permroles removed from Bigbird</msg>
+            <expectedCodes>403,404</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+                       <filename>dimension/1.xml</filename>
+        </test>
+        <test ID="dimensionBigbird_PUT_AfterPermrolesDeleted">
+            <expectedCodes>403,404,405</expectedCodes><!-- Expected failure because dimensionBigbird_POST_AfterPermrolesDeleted failed.-->
+            <method>PUT</method>
+            <uri>/cspace-services/dimensions/${dimensionBigbird_POST_AfterPermrolesDeleted.CSID}</uri>
+                       <filename>dimension/2-put.xml</filename>
+        </test>
+        <test ID="dimensionBigbird_GET_AfterPermrolesDeleted">
+            <expectedCodes>403,404</expectedCodes>
+            <method>GET</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <fromTestID>dimensionBigbird_POST_AfterPermrolesDeleted</fromTestID>
+        </test>
+        <test ID="dimensionBigbird_DELETE_AfterPermrolesDeleted" auth="bigbird2010">
+            <expectedCodes>0,403,404</expectedCodes>
+            <method>DELETE</method>
+            <fromTestID>dimensionBigbird_POST_AfterPermrolesDeleted</fromTestID>
+        </test>
+
+        <!--  NOW **ADD** PERMS CRU TO BIGBIRD -->
+
+        <test ID="permBigbird_CRU" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions</uri>
+            <filename>security/11-bigbird-permission-CRU.xml</filename>
+        </test>
+        <test ID="bigbirdPermrolesCRU" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions/${permBigbird_CRU.CSID}/permroles</uri>
+            <filename>security/11-permissionroles-bigbird-CRU.xml</filename>
+        </test>
+        
+        <!--  NOW TRY CRUDL BY BIGBIRD BUT WITH CRU ADDED -->
+
+        <test ID="dimensionBigbird_POST_CRU"  auth="bigbird2010">
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+                       <filename>dimension/1.xml</filename>
+        </test>
+        <test ID="dimensionBigbird_PUT_CRU">
+            <method>PUT</method>
+            <uri>/cspace-services/dimensions/${dimensionBigbird_POST_CRU.CSID}</uri>
+                       <filename>dimension/2-put.xml</filename>
+        </test>
+        <test ID="dimensionBigbird_GET_CRU">
+            <method>GET</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <fromTestID>dimensionBigbird_POST_CRU</fromTestID>
+        </test>
+        <test ID="dimensionBigbird_DELETE_CRU">
+            <expectedCodes>403,404</expectedCodes>
+            <method>DELETE</method>
+            <fromTestID>dimensionBigbird_POST_CRU</fromTestID>
+        </test>
+
+        <!--  NOW **REMOVE** PERMROLES FROM BIGBIRD -->
+        
+        <test ID="deletePermrolesBigbird" auth="admin@core.collectionspace.org">
+            <msg>Deleting permroles from bigbird2010</msg>
+            <method>DELETE</method>
+            <uri>/cspace-services/authorization/permissions/${permBigbird_CRU.CSID}/permroles</uri>
+        </test>
+        
+        <!--  NOW **ADD** PERMS R TO BIGBIRD -->
+
+        <test ID="permBigbird_R" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions</uri>
+            <filename>security/12-bigbird-permission-R.xml</filename>
+        </test>
+        <test ID="bigbirdPermroles_R" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/authorization/permissions/${permBigbird_R.CSID}/permroles</uri>
+            <filename>security/12-permissionroles-bigbird-R.xml</filename>
+        </test>
+
+        <!--  NOW TRY CRUDL BY BIGBIRD with R only -->
+        
+        <test ID="dimensionBigbird_POST_R"  auth="bigbird2010">
+            <expectedCodes>403,404</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+                       <filename>dimension/1.xml</filename>
+        </test>
+        <test ID="dimensionBigbird_PUT_R">
+            <expectedCodes>403,404,405</expectedCodes>
+            <method>PUT</method>
+            <uri>/cspace-services/dimensions/${dimensionBigbird_POST_R.CSID}</uri>
+                       <filename>dimension/2-put.xml</filename>
+        </test>
+        <test ID="dimensionBigbird_GET_R">
+            <method>GET</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <fromTestID>dimensionBigbird_POST_R</fromTestID>
+        </test>
+        <test ID="dimensionBigbird_DELETE_R">
+        <!-- RESPONSE CODE 0 MEANS XmlReplay could not find a deleteURL or CSID, which is right, because the POST failed. -->
+            <expectedCodes>0,403,404</expectedCodes>
+            <method>DELETE</method>
+            <fromTestID>dimensionBigbird_POST_R</fromTestID>
+        </test>
+        
+        <!-- CLEANUP -->
+        
+        <test ID="deletePermrolesBigbird" auth="admin@core.collectionspace.org">
+            <msg>Deleting permroles from bigbird2010</msg>
+            <method>DELETE</method>
+            <uri>/cspace-services/authorization/permissions/${permBigbird.CSID}/permroles</uri>
+        </test>
+        <test  auth="admin@core.collectionspace.org">
+            <method>DELETE</method>
+            <uri>/cspace-services/accounts/${accountBigbird.CSID}/accountroles</uri>
+        </test>
+         <test ID="securityCleanupRoleTestCM">
+            <method>DELETE</method>
+            <fromTestID>roleTestCM</fromTestID>
+        </test>
+        <test ID="securityCleanupAccountBigbird">
+            <method>DELETE</method>
+            <fromTestID>accountBigbird</fromTestID>
+        </test>
+        
+    </testGroup>
+
+        <!-- proposed simplification for re-runs:
+        <test rerunID="dimensionBigbird" testGroupID="dimensionCRUDL">
+            <expectedCodes>404</expectedCodes>
+        </test>
+        -->
+
+</xmlReplay>
+        
+        
index b806b583f0758fc00ba00ed7eef6d1a7b273c4a1..3f7afdb7cfa886ca0de3a0492a81248fc4f2652e 100644 (file)
@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:permission xmlns:ns2="http://collectionspace.org/services/authorization/perms">\r
-  <resourceName>dimensions</resourceName>\r
-  <action>\r
-    <name>CREATE</name>\r
-  </action>\r
-  <action>\r
-    <name>READ</name>\r
-  </action>\r
-  <action>\r
-    <name>UPDATE</name>\r
-  </action>\r
-  <action>\r
-    <name>DELETE</name>\r
-  </action>\r
-  <effect>PERMIT</effect>\r
-</ns2:permission>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:permission xmlns:ns2="http://collectionspace.org/services/authorization/perms">
+  <resourceName>dimensions</resourceName>
+  <action>
+    <name>CREATE</name>
+  </action>
+  <action>
+    <name>READ</name>
+  </action>
+  <action>
+    <name>UPDATE</name>
+  </action>
+  <action>
+    <name>DELETE</name>
+  </action>
+  <effect>PERMIT</effect>
+</ns2:permission>
+
index 0806b941454476a236f899de2b0ea7c216682207..af52b93e4b73077762530cd9241b2a98ca335e6b 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:permission_role\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <permission>\r
-    <permissionId>${permElmo.CSID}</permissionId>\r
-    <resourceName>dimensions</resourceName>\r
-  </permission>\r
-  <role>\r
-    <roleId>${roleIntern.CSID}</roleId>\r
-    <roleName>ROLE_TEST_INTERN</roleName>\r
-  </role>\r
-</ns2:permission_role>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:permission_role
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <permission>
+    <permissionId>${permElmo.CSID}</permissionId>
+    <resourceName>dimensions</resourceName>
+  </permission>
+  <role>
+    <roleId>${roleIntern.CSID}</roleId>
+    <roleName>ROLE_TEST_INTERN</roleName>
+  </role>
+</ns2:permission_role>
+
index f542aa5e605b7b3bcfb3ea14d9436926b9df4fdd..bb7ae56072b24d85e1b992f6e866b171b9687f28 100644 (file)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:permission\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <resourceName>dimensions</resourceName>\r
-  <action>\r
-    <name>CREATE</name>\r
-  </action>\r
-  <action>\r
-    <name>READ</name>\r
-  </action>\r
-  <action>\r
-    <name>UPDATE</name>\r
-  </action>\r
-  <effect>PERMIT</effect>\r
-</ns2:permission>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:permission
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <resourceName>dimensions</resourceName>
+  <action>
+    <name>CREATE</name>
+  </action>
+  <action>
+    <name>READ</name>
+  </action>
+  <action>
+    <name>UPDATE</name>
+  </action>
+  <effect>PERMIT</effect>
+</ns2:permission>
+
index 90287511fef6e4105ea0557f549695f3daf339a4..df8889fb6f84ec871e07dabd85c4565f961dbda0 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:permission_role\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <permission>\r
-    <permissionId>${permBigbird_CRU.CSID}</permissionId>\r
-    <resourceName>dimensions</resourceName>\r
-  </permission>\r
-  <role>\r
-    <roleId>${roleTestCM.CSID}</roleId>\r
-    <roleName>ROLE_TEST_CM</roleName>\r
-  </role>\r
-</ns2:permission_role>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:permission_role
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <permission>
+    <permissionId>${permBigbird_CRU.CSID}</permissionId>
+    <resourceName>dimensions</resourceName>
+  </permission>
+  <role>
+    <roleId>${roleTestCM.CSID}</roleId>
+    <roleName>ROLE_TEST_CM</roleName>
+  </role>
+</ns2:permission_role>
+
index 4786d012f64db70026fdf75c1506ecc905d3e7e8..6d4da79f574e4c2a8b8012b15bb2e493e76c9424 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:permission\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <resourceName>dimensions</resourceName>\r
-  <action>\r
-    <name>READ</name>\r
-  </action>\r
-  <effect>PERMIT</effect>\r
-</ns2:permission>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:permission
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <resourceName>dimensions</resourceName>
+  <action>
+    <name>READ</name>
+  </action>
+  <effect>PERMIT</effect>
+</ns2:permission>
+
index dde7075cc35b6f3e8660064ef418c7e130bee9b9..f4517f2d9cd11eef2533daf706d122fcc40a1857 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:permission_role\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <permission>\r
-    <permissionId>${permBigbird_R.CSID}</permissionId>\r
-    <resourceName>dimensions</resourceName>\r
-  </permission>\r
-  <role>\r
-    <roleId>${roleTestCM.CSID}</roleId>\r
-    <roleName>ROLE_TEST_CM</roleName>\r
-  </role>\r
-</ns2:permission_role>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:permission_role
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <permission>
+    <permissionId>${permBigbird_R.CSID}</permissionId>
+    <resourceName>dimensions</resourceName>
+  </permission>
+  <role>
+    <roleId>${roleTestCM.CSID}</roleId>
+    <roleName>ROLE_TEST_CM</roleName>
+  </role>
+</ns2:permission_role>
+
index dde7075cc35b6f3e8660064ef418c7e130bee9b9..f4517f2d9cd11eef2533daf706d122fcc40a1857 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:permission_role\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <permission>\r
-    <permissionId>${permBigbird_R.CSID}</permissionId>\r
-    <resourceName>dimensions</resourceName>\r
-  </permission>\r
-  <role>\r
-    <roleId>${roleTestCM.CSID}</roleId>\r
-    <roleName>ROLE_TEST_CM</roleName>\r
-  </role>\r
-</ns2:permission_role>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:permission_role
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <permission>
+    <permissionId>${permBigbird_R.CSID}</permissionId>
+    <resourceName>dimensions</resourceName>
+  </permission>
+  <role>
+    <roleId>${roleTestCM.CSID}</roleId>
+    <roleName>ROLE_TEST_CM</roleName>
+  </role>
+</ns2:permission_role>
+
index 6849999620350334ba311c827fc1a7c367b619b6..d4eec7790c46f1fdee3564769df65f2aee971109 100644 (file)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns3:permission xmlns:ns3="http://collectionspace.org/services/authorization/perms">\r
-  <resourceName>dimensions</resourceName>\r
-  <action>\r
-    <name>READ</name>\r
-  </action>\r
-  <effect>PERMIT</effect>\r
-</ns3:permission>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns3:permission xmlns:ns3="http://collectionspace.org/services/authorization/perms">
+  <resourceName>dimensions</resourceName>
+  <action>
+    <name>READ</name>
+  </action>
+  <effect>PERMIT</effect>
+</ns3:permission>
index d81506a7fe50fc7642652236fe8c968c9447b187..8575b3a78da43cdadb1984e3e5b4eb00f0a0ca41 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:role\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <roleName>ROLE_TEST_CM</roleName>\r
-  <description>role for ROLE_TEST_CM</description>\r
-</ns2:role>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:role
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <roleName>ROLE_TEST_CM</roleName>
+  <description>role for ROLE_TEST_CM</description>
+</ns2:role>
index b0fdce4b8c1babb6dff9d3739b51b75cfe9fd5eb..d74115ed29a66e7b322fd43e84940c80db184b44 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:role xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <roleName>ROLE_TEST_INTERN</roleName>\r
-  <description>role for ROLE_TEST_INTERN</description>\r
-</ns2:role>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:role xmlns:ns2="http://collectionspace.org/services/authorization">
+  <roleName>ROLE_TEST_INTERN</roleName>
+  <description>role for ROLE_TEST_INTERN</description>
+</ns2:role>
index ed27953781181e1c9283fac432924fe967f6c415..023dd1dbec920824db4147bd6fdfd6f221f9442f 100644 (file)
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:accounts_common\r
-xmlns:ns2="http://collectionspace.org/services/account"\r
-xmlns:ns3="http://collectionspace.org/services/hyperjaxb">\r
-  <screenName>bigbird2010</screenName>\r
-  <personRefName>bigbird2010</personRefName>\r
-  <email>bigbird@cspace.org</email>\r
-  <phone>1234567890</phone>\r
-  <userId>bigbird2010</userId>\r
-       <!-- Password is bigbird2010 base 64 encoded -->\r
-  <password>YmlnYmlyZDIwMTA=</password>\r
-  <tenants>\r
-    <tenant_id>1</tenant_id>\r
-  </tenants>\r
-</ns2:accounts_common>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:accounts_common
+xmlns:ns2="http://collectionspace.org/services/account"
+xmlns:ns3="http://collectionspace.org/services/hyperjaxb">
+  <screenName>bigbird2010</screenName>
+  <personRefName>bigbird2010</personRefName>
+  <email>bigbird@cspace.org</email>
+  <phone>1234567890</phone>
+  <userId>bigbird2010</userId>
+       <!-- Password is bigbird2010 base 64 encoded -->
+  <password>YmlnYmlyZDIwMTA=</password>
+  <tenants>
+    <tenant_id>1</tenant_id>
+  </tenants>
+</ns2:accounts_common>
index dc3bf0301885ef5f8e4547cf8f9eddf8dffd4cd0..af1447aeeff0a634b957a768a557d947a486a558 100644 (file)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:accounts_common\r
-xmlns:ns2="http://collectionspace.org/services/account"\r
-xmlns:ns3="http://collectionspace.org/services/hyperjaxb">\r
-  <screenName>elmo2010</screenName>\r
-  <personRefName>elmo2010</personRefName>\r
-  <email>elmo@cspace.org</email>\r
-  <phone>1234567890</phone>\r
-  <userId>elmo2010</userId>\r
-       <!-- Pass word is elmo2010, base64 encoded -->\r
-  <password>ZWxtbzIwMTA=</password>\r
-  <tenants>\r
-    <tenant_id>1</tenant_id>\r
-  </tenants>\r
-</ns2:accounts_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:accounts_common
+xmlns:ns2="http://collectionspace.org/services/account"
+xmlns:ns3="http://collectionspace.org/services/hyperjaxb">
+  <screenName>elmo2010</screenName>
+  <personRefName>elmo2010</personRefName>
+  <email>elmo@cspace.org</email>
+  <phone>1234567890</phone>
+  <userId>elmo2010</userId>
+       <!-- Pass word is elmo2010, base64 encoded -->
+  <password>ZWxtbzIwMTA=</password>
+  <tenants>
+    <tenant_id>1</tenant_id>
+  </tenants>
+</ns2:accounts_common>
+
index 585db05b501822b1a798cf9cb228c91832ee5c76..a1d518c049750b7adf32361e2713acee9d73372e 100644 (file)
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:account_role\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <subject>ROLE</subject>\r
-  <account>\r
-    <accountId>${accountBigbird.CSID}</accountId>\r
-    <screenName>bigbird2010</screenName>\r
-    <userId>bigbird2010</userId>\r
-  </account>\r
-  <role>\r
-    <roleId>${roleTestCM.CSID}</roleId>\r
-    <roleName>ROLE_TEST_CM</roleName>\r
-  </role>\r
-</ns2:account_role>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:account_role
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <subject>ROLE</subject>
+  <account>
+    <accountId>${accountBigbird.CSID}</accountId>
+    <screenName>bigbird2010</screenName>
+    <userId>bigbird2010</userId>
+  </account>
+  <role>
+    <roleId>${roleTestCM.CSID}</roleId>
+    <roleName>ROLE_TEST_CM</roleName>
+  </role>
+</ns2:account_role>
+
index 1e34d9f5d9c198f4ce5a7fb58bee27bcb11d936c..5c321065e91de7b25cc44301a1183263a9b0fc9a 100644 (file)
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:account_role\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <subject>ROLE</subject>\r
-  <account>\r
-    <accountId>${permElmo.CSID}</accountId>\r
-    <screenName>elmo2010</screenName>\r
-    <userId>elmo2010</userId>\r
-  </account>\r
-  <role>\r
-    <roleId>${roleIntern.CSID}</roleId>\r
-    <roleName>ROLE_TEST_INTERN</roleName>\r
-  </role>\r
-</ns2:account_role>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:account_role
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <subject>ROLE</subject>
+  <account>
+    <accountId>${permElmo.CSID}</accountId>
+    <screenName>elmo2010</screenName>
+    <userId>elmo2010</userId>
+  </account>
+  <role>
+    <roleId>${roleIntern.CSID}</roleId>
+    <roleName>ROLE_TEST_INTERN</roleName>
+  </role>
+</ns2:account_role>
+
index 9e05c2fdd74f6d20b30b5f5926b75ee47ed9fa0a..08df47170befb02498eafc6c3a8d15401f578ed4 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:permission_role\r
-xmlns:ns2="http://collectionspace.org/services/authorization">\r
-  <permission>\r
-    <permissionId>${permBigbird.CSID}</permissionId>\r
-    <resourceName>dimensions</resourceName>\r
-  </permission>\r
-  <role>\r
-    <roleId>${roleTestCM.CSID}</roleId>\r
-    <roleName>ROLE_TEST_CM</roleName>\r
-  </role>\r
-</ns2:permission_role>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:permission_role
+xmlns:ns2="http://collectionspace.org/services/authorization">
+  <permission>
+    <permissionId>${permBigbird.CSID}</permissionId>
+    <resourceName>dimensions</resourceName>
+  </permission>
+  <role>
+    <roleId>${roleTestCM.CSID}</roleId>
+    <roleName>ROLE_TEST_CM</roleName>
+  </role>
+</ns2:permission_role>
+
index 8a31d0df04d1c8764ba0811526e6ac9731d0c410..8b73a3caab53c7cc6a54b3bc683b1c05d426bf58 100644 (file)
@@ -1,44 +1,44 @@
-        bigbird2010\r
-        bsh % unp = "bigbird2010:bigbird2010";\r
-        <bigbird2010bigbird2010>\r
-        bsh % String encoding = new sun.misc.BASE64Encoder().encode (unp.getBytes());\r
-        bsh % encoding = new sun.misc.BASE64Encoder().encode (unp.getBytes());\r
-        <YmlnYmlyZDIwMTBiaWdiaXJkMjAxMA==>\r
-        \r
-        bsh % unp = "bigbird2010:bigbird2010";\r
-        <bigbird2010:bigbird2010>\r
-        bsh %  encoding = new sun.misc.BASE64Encoder().encode (unp.getBytes());\r
-        <YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=>\r
-        \r
-        bsh % String  decode(String s){return new String(Base64.decode(s.getBytes()));}\r
-        \r
-        bsh % decode("dGVzdC1wYWhtYTp0ZXN0");\r
-        test-pahma:test\r
-        //used for DELETE /cspace-services/accounts/9230dc97-0888-4252-8c89-795c92305ca0 HTTP/1.1\r
-        \r
-        //used for creating accounts, roles, etc:\r
-        bsh % decode("dGVzdDp0ZXN0");\r
-        test:test\r
-        \r
-        //used for dimension service tests:\r
-        bsh % decode("dXNlcjFAbXVzZXVtMS5vcmc6dXNlcjFAbXVzZXVtMS5vcmc=");\r
-        user1@museum1.org:user1@museum1.org\r
-        \r
-        dGVzdDpudWxs\r
-        bsh % decode("dGVzdDpudWxs");\r
-        test:null  (no password)\r
-        ==> HTTP/1.1 401 Password Incorrect/Password Required\r
-        \r
-        bsh % decode("dXNlcjJAbXVzZXVtMi5vcmc6dXNlcjJAbXVzZXVtMi5vcmc=");\r
-        user2@museum2.org:user2@museum2.org\r
-        DELETE OK on DELETE /cspace-services/dimensions/7922ea12-401d-4a7b-9f1a HTTP/1.1\r
-\r
-        dGVzdDpiYXI=\r
-        test:bar\r
-        //used for incorrect password.\r
-        Some more forbidden auths:\r
-        bsh % decode("YmFieWJvcDpiYWJ5Ym9wMDk=");\r
-        babybop:babybop09\r
-        bsh % decode("YmFybmV5OmJhcm5leTA4");\r
-        barney:barney08\r
-\r
+        bigbird2010
+        bsh % unp = "bigbird2010:bigbird2010";
+        <bigbird2010bigbird2010>
+        bsh % String encoding = new sun.misc.BASE64Encoder().encode (unp.getBytes());
+        bsh % encoding = new sun.misc.BASE64Encoder().encode (unp.getBytes());
+        <YmlnYmlyZDIwMTBiaWdiaXJkMjAxMA==>
+        
+        bsh % unp = "bigbird2010:bigbird2010";
+        <bigbird2010:bigbird2010>
+        bsh %  encoding = new sun.misc.BASE64Encoder().encode (unp.getBytes());
+        <YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=>
+        
+        bsh % String  decode(String s){return new String(Base64.decode(s.getBytes()));}
+        
+        bsh % decode("dGVzdC1wYWhtYTp0ZXN0");
+        test-pahma:test
+        //used for DELETE /cspace-services/accounts/9230dc97-0888-4252-8c89-795c92305ca0 HTTP/1.1
+        
+        //used for creating accounts, roles, etc:
+        bsh % decode("dGVzdDp0ZXN0");
+        test:test
+        
+        //used for dimension service tests:
+        bsh % decode("dXNlcjFAbXVzZXVtMS5vcmc6dXNlcjFAbXVzZXVtMS5vcmc=");
+        user1@museum1.org:user1@museum1.org
+        
+        dGVzdDpudWxs
+        bsh % decode("dGVzdDpudWxs");
+        test:null  (no password)
+        ==> HTTP/1.1 401 Password Incorrect/Password Required
+        
+        bsh % decode("dXNlcjJAbXVzZXVtMi5vcmc6dXNlcjJAbXVzZXVtMi5vcmc=");
+        user2@museum2.org:user2@museum2.org
+        DELETE OK on DELETE /cspace-services/dimensions/7922ea12-401d-4a7b-9f1a HTTP/1.1
+
+        dGVzdDpiYXI=
+        test:bar
+        //used for incorrect password.
+        Some more forbidden auths:
+        bsh % decode("YmFieWJvcDpiYWJ5Ym9wMDk=");
+        babybop:babybop09
+        bsh % decode("YmFybmV5OmJhcm5leTA4");
+        barney:barney08
+
index 44e4012f97eade8790994364e6e194b7fd47884c..fe8f1134ff99c8f26c75b41f9b7a93d73927743b 100644 (file)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplayMaster>\r
-    <protoHostPort>http://localhost:8180</protoHostPort>\r
-    \r
-    <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->\r
-    <dump payloads="false" dumpServiceResult="auto" />\r
-    \r
-    <auths default="admin@core.collectionspace.org">\r
-       <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-    </auths>\r
-\r
-    <!-- commenting out... I think this runs from test code anyway...  \r
-         <run controlFile="./xml-replay-self-test.xml" testGroup="selftestGroup" />\r
-    -->\r
-</xmlReplayMaster>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplayMaster>
+    <protoHostPort>http://localhost:8180</protoHostPort>
+    
+    <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->
+    <dump payloads="false" dumpServiceResult="auto" />
+    
+    <auths default="admin@core.collectionspace.org">
+       <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+    </auths>
+
+    <!-- commenting out... I think this runs from test code anyway...  
+         <run controlFile="./xml-replay-self-test.xml" testGroup="selftestGroup" />
+    -->
+</xmlReplayMaster>
+
index 52a57212c3ac9ffd5633f036ada3983c538b37d4..26f4e37068b33c35cffcf1e86749ba856ee75dc2 100644 (file)
@@ -1,94 +1,94 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplayMaster>\r
-    <protoHostPort>http://localhost:8180</protoHostPort>\r
-    \r
-    <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->\r
-    <dump payloads="false" dumpServiceResult="auto" />\r
-    \r
-    <auths default="admin@core.collectionspace.org">\r
-        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
-    </auths>\r
-    \r
-    \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
\r
-    <run controlFile="collectionobject/collectionobject-adv-search.xml" testGroup="advSearchCommonSchema" />\r
-    <run controlFile="collectionobject/collectionobject-adv-search.xml" testGroup="advSearchExtensionSchema" />\r
-    <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />\r
-    <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />\r
-    <run controlFile="relation/relation.xml" testGroup="makeRelations" />\r
-\r
-    <run controlFile="person/person.xml" testGroup="postPerson" />\r
-    <run controlFile="person/person.xml" testGroup="updatePerson" />\r
-    <run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />\r
-\r
-    <run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />\r
-    <run controlFile="organization/organization-hierarchy.xml" testGroup="HierarchicOrganization" />\r
\r
-    <run controlFile="report/report.xml" />\r
-    <run controlFile="authrefs/authrefs.xml" testGroup="AuthRefs" />\r
-    <run controlFile="vocabulary/vocabulary.xml" testGroup="TestOrder" />\r
-    <run controlFile="authrefs/authrefsSimple.xml" testGroup="AuthRefsSimple" />\r
-    <run controlFile="authrefs/authrefsComplex.xml" testGroup="AuthRefsComplex" />\r
-    <run controlFile="authority/authority.xml" testGroup="TestAuthoritiesMultiVocabSearch" />\r
-    \r
-    <run controlFile="imports/imports.xml" testGroup="importsTestGroup" />\r
-    <run controlFile="imports/imports.xml" testGroup="importsSeparateRepoTestGroup" />\r
-\r
-    <run controlFile="collectionobject/collectionobject-hierarchy-csid.xml" testGroup="CreateUpdateReadStructuredObjects" />\r
-    <run controlFile="collectionobject/collectionobject-hierarchy-refname.xml" testGroup="CreateUpdateReadStructuredObjects" />\r
-    <run controlFile="collectionobject/collectionobject-displayname-update.xml" testGroup="DisplayNameChangesReflectedInRefNames" />\r
-    \r
-    <run controlFile="versioning/versioning.xml" testGroup="VersionedRecordFiltering" />\r
-    \r
-    <run controlFile="batch/batch.xml" />\r
-    \r
-    <!-- Uncomment the following when needed to test the UpdateObjectLocationBatchJob -->\r
-    <!-- which updates the computed current location values in CollectionObject records. -->\r
-    <!-- For these tests to be meaningful, you will also first need to disable the event listener -->\r
-    <!-- that auto-updates these values, by removing the JAR file whose name begins with -->\r
-    <!-- 'org.collectionspace.services.listener.updateobjectlocationonmove' -->\r
-    <!-- from $CSPACE_JSEESERVER_HOME/nuxeo-server/plugins, and then restarting Tomcat. -->\r
-    <!--\r
-    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeSingle" />\r
-    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeSingleWithTiebreaker" />\r
-    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeList" />\r
-    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeGroup" />\r
-    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeSingleInVersioningEnabledTenant" />\r
-    -->\r
-    \r
-    <run controlFile="listener/listener-update-object-loc.xml" testGroup="updateObjectLocationOnMoveEventListener" />\r
-    <run controlFile="listener/listener-update-object-loc.xml" testGroup="updateObjectLocationOnMoveInVersioningEnabledTenant"/>    \r
-\r
-    <!-- Broken tests -->\r
-    \r
-    <!-- FIXME: the following tests were commented out without any annotation as to why this was done. -->\r
-    <!-- We might check whether any of these tests should be re-enabled - ADR 2012-09-07 -->\r
-    \r
-    <!-- run controlFile="objectexit/object-exit.xml" testGroup="CRUDL" / -->\r
-    <!-- run controlFile="objectexit/object-exit.xml" testGroup="domwalk" / -->\r
-    <!-- run controlFile="media/media.xml" testGroup="authrefs" / -->\r
-    <!-- run controlFile="./organization.xml" testGroup="organization" / -->\r
-\r
-    <!-- Comments on broken tests, below, are historic, were written by various authors, and lack JIRA issue context. - ADR 2012-09-07 -->\r
-    \r
-    <!-- No - this test is broken -->\r
-    <!-- run controlFile="relation/relation.xml" testGroup="r2only" / -->\r
-    \r
-    <!-- This used to work, but for check-in, I'm commenting it out as it currently breaks if things are left around in DB. -->\r
-    <!-- run controlFile="./security.xml" testGroup="security" / -->\r
-\r
-    <!--\r
-    This was working but is not now because security db hangs onto results from failed tests.\r
-    However, it is more complete than testGroup="security", so is the correct testGroup to run.\r
-    When the DB is cleaned with [ant create_db import] it runs OK.\r
-    -->\r
-    <!-- run controlFile="./security.xml" testGroup="securityRemovingRoleperms" / -->\r
-    \r
-</xmlReplayMaster>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplayMaster>
+    <protoHostPort>http://localhost:8180</protoHostPort>
+    
+    <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->
+    <dump payloads="false" dumpServiceResult="auto" />
+    
+    <auths default="admin@core.collectionspace.org">
+        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+    </auths>
+    
+    
+    
+    
+    <run controlFile="./security.xml" testGroup="deleteBug" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="makeone" />
+    <run controlFile="objectexit/object-exit.xml" testGroup="checkList" />
+    <run controlFile="objectexit/object-exit-display.xml" testGroup="refNameDisplayNameOnly" />
+    <run controlFile="collectionobject/collectionobject-adv-search.xml" testGroup="advSearchCommonSchema" />
+    <run controlFile="collectionobject/collectionobject-adv-search.xml" testGroup="advSearchExtensionSchema" />
+    <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />
+    <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />
+    <run controlFile="relation/relation.xml" testGroup="makeRelations" />
+
+    <run controlFile="person/person.xml" testGroup="postPerson" />
+    <run controlFile="person/person.xml" testGroup="updatePerson" />
+    <run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />
+
+    <run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />
+    <run controlFile="organization/organization-hierarchy.xml" testGroup="HierarchicOrganization" />
+    <run controlFile="report/report.xml" />
+    <run controlFile="authrefs/authrefs.xml" testGroup="AuthRefs" />
+    <run controlFile="vocabulary/vocabulary.xml" testGroup="TestOrder" />
+    <run controlFile="authrefs/authrefsSimple.xml" testGroup="AuthRefsSimple" />
+    <run controlFile="authrefs/authrefsComplex.xml" testGroup="AuthRefsComplex" />
+    <run controlFile="authority/authority.xml" testGroup="TestAuthoritiesMultiVocabSearch" />
+    
+    <run controlFile="imports/imports.xml" testGroup="importsTestGroup" />
+    <run controlFile="imports/imports.xml" testGroup="importsSeparateRepoTestGroup" />
+
+    <run controlFile="collectionobject/collectionobject-hierarchy-csid.xml" testGroup="CreateUpdateReadStructuredObjects" />
+    <run controlFile="collectionobject/collectionobject-hierarchy-refname.xml" testGroup="CreateUpdateReadStructuredObjects" />
+    <run controlFile="collectionobject/collectionobject-displayname-update.xml" testGroup="DisplayNameChangesReflectedInRefNames" />
+    
+    <run controlFile="versioning/versioning.xml" testGroup="VersionedRecordFiltering" />
+    
+    <run controlFile="batch/batch.xml" />
+    
+    <!-- Uncomment the following when needed to test the UpdateObjectLocationBatchJob -->
+    <!-- which updates the computed current location values in CollectionObject records. -->
+    <!-- For these tests to be meaningful, you will also first need to disable the event listener -->
+    <!-- that auto-updates these values, by removing the JAR file whose name begins with -->
+    <!-- 'org.collectionspace.services.listener.updateobjectlocationonmove' -->
+    <!-- from $CSPACE_JSEESERVER_HOME/nuxeo-server/plugins, and then restarting Tomcat. -->
+    <!--
+    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeSingle" />
+    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeSingleWithTiebreaker" />
+    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeList" />
+    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeGroup" />
+    <run controlFile="batch/batch-update-object-loc.xml" testGroup="invocationModeSingleInVersioningEnabledTenant" />
+    -->
+    
+    <run controlFile="listener/listener-update-object-loc.xml" testGroup="updateObjectLocationOnMoveEventListener" />
+    <run controlFile="listener/listener-update-object-loc.xml" testGroup="updateObjectLocationOnMoveInVersioningEnabledTenant"/>    
+
+    <!-- Broken tests -->
+    
+    <!-- FIXME: the following tests were commented out without any annotation as to why this was done. -->
+    <!-- We might check whether any of these tests should be re-enabled - ADR 2012-09-07 -->
+    
+    <!-- run controlFile="objectexit/object-exit.xml" testGroup="CRUDL" / -->
+    <!-- run controlFile="objectexit/object-exit.xml" testGroup="domwalk" / -->
+    <!-- run controlFile="media/media.xml" testGroup="authrefs" / -->
+    <!-- run controlFile="./organization.xml" testGroup="organization" / -->
+
+    <!-- Comments on broken tests, below, are historic, were written by various authors, and lack JIRA issue context. - ADR 2012-09-07 -->
+    
+    <!-- No - this test is broken -->
+    <!-- run controlFile="relation/relation.xml" testGroup="r2only" / -->
+    
+    <!-- This used to work, but for check-in, I'm commenting it out as it currently breaks if things are left around in DB. -->
+    <!-- run controlFile="./security.xml" testGroup="security" / -->
+
+    <!--
+    This was working but is not now because security db hangs onto results from failed tests.
+    However, it is more complete than testGroup="security", so is the correct testGroup to run.
+    When the DB is cleaned with [ant create_db import] it runs OK.
+    -->
+    <!-- run controlFile="./security.xml" testGroup="securityRemovingRoleperms" / -->
+    
+</xmlReplayMaster>
+
index 12a695c0ccab1da9b9d23c20402b16919f370a40..0c056cc36a5a9c13d954fc49e9f7800e0318d259 100644 (file)
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-<!--\r
-    <testGroup ID="selftestGroup" autoDeletePOSTS="true">\r
-        <test ID="OrgAuth1" auth="admin@core.collectionspace.org">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/orgauthorities/</uri>\r
-            <part>\r
-                <label>orgauthorities_common</label>\r
-                <filename>organization/orgauthorities_common.xml</filename>\r
-            </part>\r
-        </test>\r
-        <test ID="Org1">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/</uri>\r
-            <part>\r
-                <label>organizations_common</label>\r
-                <filename>organization/organizations_common.xml</filename>\r
-            </part>\r
-        </test>\r
-        <test ID="getOrg1">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/${Org1.CSID}</uri>\r
-        </test>\r
-        <test ID="getItems">\r
-            <method>GET</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}</uri>\r
-        </test>\r
-        <test ID="oneOrgLIST">\r
-            <method>LIST</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}</uri>\r
-        </test>\r
-        <test ID="organizationLIST2">\r
-            <method>LIST</method>\r
-            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/</uri>\r
-        </test>\r
-    </testGroup>\r
--->\r
-</xmlReplay>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplay>
+<!--
+    <testGroup ID="selftestGroup" autoDeletePOSTS="true">
+        <test ID="OrgAuth1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/orgauthorities/</uri>
+            <part>
+                <label>orgauthorities_common</label>
+                <filename>organization/orgauthorities_common.xml</filename>
+            </part>
+        </test>
+        <test ID="Org1">
+            <method>POST</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/</uri>
+            <part>
+                <label>organizations_common</label>
+                <filename>organization/organizations_common.xml</filename>
+            </part>
+        </test>
+        <test ID="getOrg1">
+            <method>GET</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/${Org1.CSID}</uri>
+        </test>
+        <test ID="getItems">
+            <method>GET</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}</uri>
+        </test>
+        <test ID="oneOrgLIST">
+            <method>LIST</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}</uri>
+        </test>
+        <test ID="organizationLIST2">
+            <method>LIST</method>
+            <uri>/cspace-services/orgauthorities/${OrgAuth1.CSID}/items/</uri>
+        </test>
+    </testGroup>
+-->
+</xmlReplay>
index 8ce2006044edc4ca7839c68f34fc081207a35310..ed9ae51de8ebfde712a333317d2853111a4607c6 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.jaxrs.provider</artifactId>\r
-    <name>services.jaxrs.provider</name>\r
-    <packaging>war</packaging>\r
-\r
-    <properties>\r
-        <cs.release>0.5</cs.release>\r
-        <spring.version>3.0.0.RELEASE</spring.version>\r
-        <spring.security.version>3.0.2.RELEASE</spring.security.version>\r
-    </properties>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>log4j</groupId>\r
-            <artifactId>log4j</artifactId>\r
-            <version>1.2.14</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!-- somewhere dependency is added 1.6.1 unnecessarily -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-simple</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>jcl-over-slf4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <exclusions>\r
-               <exclusion>\r
-                       <artifactId>nuxeo-core-facade</artifactId>\r
-                       <groupId>org.nuxeo.ecm.core</groupId>\r
-               </exclusion>\r
-               <exclusion>\r
-                       <artifactId>servlet-api-2.5</artifactId>\r
-                       <groupId>org.mortbay.jetty</groupId>\r
-               </exclusion>\r
-            </exclusions>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <exclusions>\r
-               <exclusion>\r
-                       <artifactId>jboss-logging-log4j</artifactId>\r
-                       <groupId>org.jboss.logging</groupId>\r
-               </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-            <exclusions>\r
-               <exclusion>\r
-                       <artifactId>servlet-api-2.5</artifactId>\r
-                       <groupId>org.mortbay.jetty</groupId>\r
-               </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.account.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization-mgt.service</artifactId>\r
-            <version>${project.version}</version>\r
-                       <exclusions>\r
-               <exclusion>\r
-                       <artifactId>jboss-logging-log4j</artifactId>\r
-                       <groupId>org.jboss.logging</groupId>\r
-               </exclusion>\r
-                <exclusion>\r
-                    <groupId>org.collectionspace.services</groupId>\r
-                    <artifactId>org.collectionspace.services.authorization-mgt.import</artifactId>\r
-                </exclusion>\r
-            </exclusions> \r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.blob.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.id.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.group.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.loanin.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.loanout.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.conditioncheck.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.objectexit.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.batch.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.imports.service</artifactId>\r
-             <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.media.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.valuationcontrol.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.location.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.place.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.work.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.concept.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.taxonomy.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.movement.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.report.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.dimension.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.publicitem.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.servicegroup.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.contact.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.acquisition.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.vocabulary.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.citation.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.workflow.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!--dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.query.service</artifactId>\r
-            <version>1.0</version>\r
-        </dependency-->\r
-        <dependency>\r
-            <groupId>commons-io</groupId>\r
-            <artifactId>commons-io</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>jaxrs-api</artifactId>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-\r
-\r
-        <!-- dependencies on spring security & framework are runtime deps only -->\r
-        <!-- the following list is kept to make sure domain has these packages -->\r
-        <!-- in the cspace/lib directory -->\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-core</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-config</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-web</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-context</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-context-support</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-web</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!--dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-acl</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-aop</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>aopalliance</groupId>\r
-            <artifactId>aopalliance</artifactId>\r
-            <version>1.0</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-tx</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>net.sf.ehcache</groupId>\r
-            <artifactId>ehcache</artifactId>\r
-            <version>1.6.2</version>\r
-            <optional>true</optional>\r
-        </dependency-->\r
-\r
-        <!-- javax -->\r
-        <dependency>\r
-                       <artifactId>servlet-api</artifactId>\r
-                       <groupId>javax.servlet</groupId>\r
-                       <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <!-- jboss -->\r
-        <dependency>\r
-            <groupId>jboss</groupId>\r
-            <artifactId>jboss-remoting</artifactId>\r
-            <version>2.2.2.SP8</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->        \r
-        <dependency>\r
-            <groupId>org.nuxeo.common</groupId>\r
-            <artifactId>nuxeo-common</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime</artifactId>\r
-                       <version>${nuxeo.core.version}</version>            \r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core</artifactId>\r
-                       <version>${nuxeo.core.version}</version>\r
-                       <exclusions>\r
-                <exclusion>\r
-                    <groupId>xerces</groupId>\r
-                    <artifactId>xercesImpl</artifactId>\r
-                </exclusion>\r
-            </exclusions> \r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-convert</artifactId>\r
-                       <version>${nuxeo.core.version}</version>            \r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-storage-sql-extensions</artifactId>\r
-                       <version>${nuxeo.core.version}</version>            \r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-storage-sql-ra</artifactId>\r
-                       <version>${nuxeo.core.version}</version>            \r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-client</artifactId>\r
-                       <version>${nuxeo.core.version}</version>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>org.jboss.jbossas</groupId>\r
-                    <artifactId>jboss-as-jbossas-remoting</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-query</artifactId>\r
-                                               <version>${nuxeo.core.version}</version>            \r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-schema</artifactId>\r
-                                               <version>${nuxeo.core.version}</version>            \r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-io</artifactId>\r
-                       <version>${nuxeo.core.version}</version>            \r
-        </dependency>\r
-<!--         \r
-        <dependency>\r
-                 <groupId>org.nuxeo.runtime</groupId>\r
-                 <artifactId>nuxeo-runtime-scripting</artifactId>\r
-                 <version>${nuxeo.core.version}</version>                \r
-        </dependency>\r
- -->        \r
-        <dependency>\r
-                       <groupId>org.nuxeo.runtime</groupId>\r
-                       <artifactId>nuxeo-runtime-jtajca</artifactId>\r
-                       <version>${nuxeo.core.version}</version>  \r
-                       <!-- Until issue http://issues.collectionspace.org/browse/CSPACE-4639 is resolved, we\r
-                               <version>5.5-NXP-8140</version>\r
-                               need to use this patched Nuxeo artifact that is only available on our public Maven\r
-                               repository -see http://nightly.collectionspace.org:8081/artifactory\r
-                               \r
-                               Once the issue is resolved and a public version of the artifact becomes available, we\r
-                               should revert this dependency's version to be the following:\r
-                       <version>${nuxeo.core.version}</version>\r
-                       -->\r
-                       <exclusions>\r
-                               <exclusion>\r
-                                       <artifactId>geronimo-transaction</artifactId>\r
-                                       <groupId>org.apache.geronimo.components</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>geronimo-connector</artifactId>\r
-                                       <groupId>org.apache.geronimo.components</groupId>\r
-                               </exclusion>\r
-                       </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.nuxeo.runtime</groupId>\r
-                       <artifactId>nuxeo-runtime-datasource</artifactId>\r
-                       <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.nuxeo.ecm.platform</groupId>\r
-                       <artifactId>nuxeo-platform-usermanager-api</artifactId>\r
-                       <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-               <groupId>org.nuxeo.ecm.platform</groupId>\r
-               <artifactId>nuxeo-platform-commandline-executor</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.nuxeo.ecm.platform</groupId>\r
-                       <artifactId>nuxeo-platform-api</artifactId>\r
-                       <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.nuxeo.ecm.platform</groupId>\r
-                       <artifactId>nuxeo-platform-login</artifactId>\r
-                       <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.nuxeo.ecm.platform</groupId>\r
-                       <artifactId>nuxeo-platform-imaging-core</artifactId>\r
-                       <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.nuxeo.ecm.platform</groupId>\r
-                       <artifactId>nuxeo-platform-imaging-preview</artifactId>\r
-                       <version>${nuxeo.core.version}</version>\r
-                       <exclusions>\r
-                               <exclusion>\r
-                                       <artifactId>jboss-seam-pdf</artifactId>\r
-                                       <groupId>org.jboss.seam</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>jboss-seam-rss</artifactId>\r
-                                       <groupId>org.jboss.seam</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>jboss-seam-excel</artifactId>\r
-                                       <groupId>org.jboss.seam</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>nuxeo-platform-ui-web</artifactId>\r
-                                       <groupId>org.nuxeo.ecm.platform</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>xercesImpl</artifactId>\r
-                                       <groupId>xerces</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>servlet-api</artifactId>\r
-                                       <groupId>javax.servlet</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>oauth-httpclient3</artifactId>\r
-                                       <groupId>net.oauth.core</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>oauth-consumer</artifactId>\r
-                                       <groupId>net.oauth.core</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>oauth-provider</artifactId>\r
-                                       <groupId>net.oauth.core</groupId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <artifactId>oauth</artifactId>\r
-                                       <groupId>net.oauth.core</groupId>\r
-                               </exclusion>\r
-                       </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.nuxeo.ecm.platform</groupId>\r
-                       <artifactId>nuxeo-platform-audit-api</artifactId>\r
-                       <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime-osgi</artifactId>\r
-                       <version>${nuxeo.core.version}</version>            \r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.osgi</groupId>\r
-            <artifactId>org.osgi.core</artifactId>\r
-            <version>4.1.0</version>\r
-        </dependency>\r
-\r
-         <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <!-- Possibly not needed.  Please experiment and remove unnecessary artifacts -->\r
-        <dependency>\r
-                       <groupId>javax.security</groupId>\r
-                       <artifactId>jaas</artifactId>\r
-                       <version>1.0.01</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>wutka-dtdparser</groupId>\r
-                       <artifactId>dtdparser121</artifactId>\r
-                       <version>1.2.1</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>oswego-concurrent</groupId>\r
-                       <artifactId>concurrent</artifactId>\r
-                       <version>1.3.4-jboss-update1</version>\r
-        </dependency>\r
-        <dependency>\r
-                 <groupId>trove</groupId>\r
-                 <artifactId>trove</artifactId>\r
-                 <version>2.1.1</version>\r
-        </dependency>\r
-        <dependency>\r
-                 <groupId>qdox</groupId>\r
-                 <artifactId>qdox</artifactId>\r
-                 <version>1.6.1</version>\r
-               </dependency>\r
-        <dependency>\r
-                 <groupId>apache-xerces</groupId>\r
-                 <artifactId>xml-apis</artifactId>\r
-                 <version>2.9.1</version>\r
-        </dependency>\r
-        <dependency>\r
-                 <groupId>org.apache</groupId>\r
-                 <artifactId>xmlsec</artifactId>\r
-                 <version>1.4.2</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.apache.bcel</groupId>\r
-                       <artifactId>bcel</artifactId>\r
-                       <version>5.1</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.apache.ant</groupId>\r
-                       <artifactId>ant</artifactId>\r
-                       <version>1.7.0</version>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>cspace-services</finalName>\r
-        <defaultGoal>package</defaultGoal>\r
-        <filters>\r
-            <filter>../../build.properties</filter>\r
-        </filters>\r
-        <resources>\r
-            <resource>\r
-                <directory>src/main/resources</directory>\r
-                <filtering>true</filtering>\r
-            </resource>\r
-            <resource>\r
-                <directory>src/main/webapp/META-INF</directory>\r
-                <filtering>true</filtering>\r
-            </resource>\r
-        </resources>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.codehaus.mojo</groupId>\r
-                <artifactId>properties-maven-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <phase>initialize</phase>\r
-                        <goals>\r
-                            <goal>read-project-properties</goal>\r
-                        </goals>\r
-                    </execution>\r
-                </executions>\r
-                <configuration>\r
-                    <files>\r
-                        <file>../../build.properties</file>\r
-                    </files>\r
-                </configuration>\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-resources-plugin</artifactId>\r
-                <version>2.5</version>\r
-                <executions>\r
-                    <execution>\r
-                        <phase>process-resources</phase>\r
-                        <goals>\r
-                            <goal>resources</goal>\r
-                        </goals>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>org.codehaus.cargo</groupId>\r
-                <artifactId>cargo-maven2-plugin</artifactId>\r
-                <version>0.3</version>\r
-                <!-- Container configuration -->\r
-                <configuration>\r
-                    <container>\r
-                        <containerId>jboss4x</containerId>\r
-                        <home>${jboss.dir}</home>\r
-                        <type>remote</type>\r
-                    </container>\r
-                    <configuration>\r
-                        <type>runtime</type>\r
-                        <properties>\r
-                            <cargo.servlet.port>${jboss.domain.cspace.port}</cargo.servlet.port>\r
-                            <cargo.jboss.configuration>cspace</cargo.jboss.configuration>\r
-                        </properties>\r
-                    </configuration>\r
-                    <deployer>\r
-                        <type>remote</type>\r
-                        <deployables>\r
-                            <deployable>\r
-                                <groupId>org.collectionspace.services</groupId>\r
-                                <artifactId>org.collectionspace.services.jaxrs.provider</artifactId>\r
-                                <type>war</type>\r
-                                <pingURL>http://${host}:${jboss.domain.cspace.port}</pingURL>\r
-                            </deployable>\r
-                        </deployables>\r
-                    </deployer>\r
-                </configuration>\r
-\r
-            </plugin>\r
-\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-war-plugin</artifactId>\r
-                <configuration>\r
-                    <webResources>\r
-                        <resource>\r
-                          <directory>src/main/webapp</directory>\r
-                          <filtering>true</filtering>\r
-                        </resource>\r
-                    </webResources>\r
-                    <archive>\r
-                        <manifest>\r
-                            <packageName>${project.groupId}</packageName>\r
-                            <!--addDefaultImplementationEntries/-->\r
-                        </manifest>\r
-                        <manifestEntries>\r
-                            <Vendor>CollectionSpace Services</Vendor>\r
-                            <Package>${project.groupId}</Package>\r
-                            <Release>${cs.release}</Release>\r
-                        </manifestEntries>\r
-                    </archive>\r
-                </configuration>\r
-            </plugin>\r
-\r
-        </plugins>\r
-        <pluginManagement>\r
-               <plugins>\r
-                       <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->\r
-                       <plugin>\r
-                               <groupId>org.eclipse.m2e</groupId>\r
-                               <artifactId>lifecycle-mapping</artifactId>\r
-                               <version>1.0.0</version>\r
-                               <configuration>\r
-                                       <lifecycleMappingMetadata>\r
-                                               <pluginExecutions>\r
-                                                       <pluginExecution>\r
-                                                               <pluginExecutionFilter>\r
-                                                                       <groupId>\r
-                                                                               org.codehaus.mojo\r
-                                                                       </groupId>\r
-                                                                       <artifactId>\r
-                                                                               properties-maven-plugin\r
-                                                                       </artifactId>\r
-                                                                       <versionRange>\r
-                                                                               [1.0-alpha-2,)\r
-                                                                       </versionRange>\r
-                                                                       <goals>\r
-                                                                               <goal>\r
-                                                                                       read-project-properties\r
-                                                                               </goal>\r
-                                                                       </goals>\r
-                                                               </pluginExecutionFilter>\r
-                                                               <action>\r
-                                                                       <ignore></ignore>\r
-                                                               </action>\r
-                                                       </pluginExecution>\r
-                                               </pluginExecutions>\r
-                                       </lifecycleMappingMetadata>\r
-                               </configuration>\r
-                       </plugin>\r
-               </plugins>\r
-        </pluginManagement>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.jaxrs.provider</artifactId>
+    <name>services.jaxrs.provider</name>
+    <packaging>war</packaging>
+
+    <properties>
+        <cs.release>0.5</cs.release>
+        <spring.version>3.0.0.RELEASE</spring.version>
+        <spring.security.version>3.0.2.RELEASE</spring.security.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.14</version>
+            <scope>provided</scope>
+        </dependency>
+        <!-- somewhere dependency is added 1.6.1 unnecessarily -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <version>1.6.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <version>1.6.1</version>
+            <scope>test</scope>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+               <exclusion>
+                       <artifactId>nuxeo-core-facade</artifactId>
+                       <groupId>org.nuxeo.ecm.core</groupId>
+               </exclusion>
+               <exclusion>
+                       <artifactId>servlet-api-2.5</artifactId>
+                       <groupId>org.mortbay.jetty</groupId>
+               </exclusion>
+            </exclusions>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.service</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+               <exclusion>
+                       <artifactId>jboss-logging-log4j</artifactId>
+                       <groupId>org.jboss.logging</groupId>
+               </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+               <exclusion>
+                       <artifactId>servlet-api-2.5</artifactId>
+                       <groupId>org.mortbay.jetty</groupId>
+               </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.account.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization-mgt.service</artifactId>
+            <version>${project.version}</version>
+                       <exclusions>
+               <exclusion>
+                       <artifactId>jboss-logging-log4j</artifactId>
+                       <groupId>org.jboss.logging</groupId>
+               </exclusion>
+                <exclusion>
+                    <groupId>org.collectionspace.services</groupId>
+                    <artifactId>org.collectionspace.services.authorization-mgt.import</artifactId>
+                </exclusion>
+            </exclusions> 
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.blob.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.id.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.group.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.loanin.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.loanout.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.conditioncheck.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.objectexit.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.batch.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.imports.service</artifactId>
+             <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.media.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.valuationcontrol.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.location.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.place.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.work.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.concept.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.taxonomy.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.movement.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.report.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.dimension.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.publicitem.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.servicegroup.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.acquisition.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.vocabulary.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.citation.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.workflow.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!--dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.query.service</artifactId>
+            <version>1.0</version>
+        </dependency-->
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>jaxrs-api</artifactId>
+        </dependency>        
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+
+
+        <!-- dependencies on spring security & framework are runtime deps only -->
+        <!-- the following list is kept to make sure domain has these packages -->
+        <!-- in the cspace/lib directory -->
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-config</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-web</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context-support</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-acl</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>aopalliance</groupId>
+            <artifactId>aopalliance</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.ehcache</groupId>
+            <artifactId>ehcache</artifactId>
+            <version>1.6.2</version>
+            <optional>true</optional>
+        </dependency-->
+
+        <!-- javax -->
+        <dependency>
+                       <artifactId>servlet-api</artifactId>
+                       <groupId>javax.servlet</groupId>
+                       <scope>provided</scope>
+        </dependency>
+
+        <!-- jboss -->
+        <dependency>
+            <groupId>jboss</groupId>
+            <artifactId>jboss-remoting</artifactId>
+            <version>2.2.2.SP8</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- nuxeo -->        
+        <dependency>
+            <groupId>org.nuxeo.common</groupId>
+            <artifactId>nuxeo-common</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.runtime</groupId>
+            <artifactId>nuxeo-runtime</artifactId>
+                       <version>${nuxeo.core.version}</version>            
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core</artifactId>
+                       <version>${nuxeo.core.version}</version>
+                       <exclusions>
+                <exclusion>
+                    <groupId>xerces</groupId>
+                    <artifactId>xercesImpl</artifactId>
+                </exclusion>
+            </exclusions> 
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-convert</artifactId>
+                       <version>${nuxeo.core.version}</version>            
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-storage-sql-extensions</artifactId>
+                       <version>${nuxeo.core.version}</version>            
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-storage-sql-ra</artifactId>
+                       <version>${nuxeo.core.version}</version>            
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-client</artifactId>
+                       <version>${nuxeo.core.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.jboss.jbossas</groupId>
+                    <artifactId>jboss-as-jbossas-remoting</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-query</artifactId>
+                                               <version>${nuxeo.core.version}</version>            
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-schema</artifactId>
+                                               <version>${nuxeo.core.version}</version>            
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-io</artifactId>
+                       <version>${nuxeo.core.version}</version>            
+        </dependency>
+<!--         
+        <dependency>
+                 <groupId>org.nuxeo.runtime</groupId>
+                 <artifactId>nuxeo-runtime-scripting</artifactId>
+                 <version>${nuxeo.core.version}</version>                
+        </dependency>
+ -->        
+        <dependency>
+                       <groupId>org.nuxeo.runtime</groupId>
+                       <artifactId>nuxeo-runtime-jtajca</artifactId>
+                       <version>${nuxeo.core.version}</version>  
+                       <!-- Until issue http://issues.collectionspace.org/browse/CSPACE-4639 is resolved, we
+                               <version>5.5-NXP-8140</version>
+                               need to use this patched Nuxeo artifact that is only available on our public Maven
+                               repository -see http://nightly.collectionspace.org:8081/artifactory
+                               
+                               Once the issue is resolved and a public version of the artifact becomes available, we
+                               should revert this dependency's version to be the following:
+                       <version>${nuxeo.core.version}</version>
+                       -->
+                       <exclusions>
+                               <exclusion>
+                                       <artifactId>geronimo-transaction</artifactId>
+                                       <groupId>org.apache.geronimo.components</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>geronimo-connector</artifactId>
+                                       <groupId>org.apache.geronimo.components</groupId>
+                               </exclusion>
+                       </exclusions>
+        </dependency>
+        <dependency>
+                       <groupId>org.nuxeo.runtime</groupId>
+                       <artifactId>nuxeo-runtime-datasource</artifactId>
+                       <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+                       <groupId>org.nuxeo.ecm.platform</groupId>
+                       <artifactId>nuxeo-platform-usermanager-api</artifactId>
+                       <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+               <groupId>org.nuxeo.ecm.platform</groupId>
+               <artifactId>nuxeo-platform-commandline-executor</artifactId>
+            <version>${nuxeo.core.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+                       <groupId>org.nuxeo.ecm.platform</groupId>
+                       <artifactId>nuxeo-platform-api</artifactId>
+                       <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+                       <groupId>org.nuxeo.ecm.platform</groupId>
+                       <artifactId>nuxeo-platform-login</artifactId>
+                       <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+                       <groupId>org.nuxeo.ecm.platform</groupId>
+                       <artifactId>nuxeo-platform-imaging-core</artifactId>
+                       <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+                       <groupId>org.nuxeo.ecm.platform</groupId>
+                       <artifactId>nuxeo-platform-imaging-preview</artifactId>
+                       <version>${nuxeo.core.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <artifactId>jboss-seam-pdf</artifactId>
+                                       <groupId>org.jboss.seam</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>jboss-seam-rss</artifactId>
+                                       <groupId>org.jboss.seam</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>jboss-seam-excel</artifactId>
+                                       <groupId>org.jboss.seam</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>nuxeo-platform-ui-web</artifactId>
+                                       <groupId>org.nuxeo.ecm.platform</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>xercesImpl</artifactId>
+                                       <groupId>xerces</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>servlet-api</artifactId>
+                                       <groupId>javax.servlet</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>oauth-httpclient3</artifactId>
+                                       <groupId>net.oauth.core</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>oauth-consumer</artifactId>
+                                       <groupId>net.oauth.core</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>oauth-provider</artifactId>
+                                       <groupId>net.oauth.core</groupId>
+                               </exclusion>
+                               <exclusion>
+                                       <artifactId>oauth</artifactId>
+                                       <groupId>net.oauth.core</groupId>
+                               </exclusion>
+                       </exclusions>
+        </dependency>
+        <dependency>
+                       <groupId>org.nuxeo.ecm.platform</groupId>
+                       <artifactId>nuxeo-platform-audit-api</artifactId>
+                       <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.runtime</groupId>
+            <artifactId>nuxeo-runtime-osgi</artifactId>
+                       <version>${nuxeo.core.version}</version>            
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+
+         <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <!-- Possibly not needed.  Please experiment and remove unnecessary artifacts -->
+        <dependency>
+                       <groupId>javax.security</groupId>
+                       <artifactId>jaas</artifactId>
+                       <version>1.0.01</version>
+        </dependency>
+        <dependency>
+                       <groupId>wutka-dtdparser</groupId>
+                       <artifactId>dtdparser121</artifactId>
+                       <version>1.2.1</version>
+        </dependency>
+        <dependency>
+                       <groupId>oswego-concurrent</groupId>
+                       <artifactId>concurrent</artifactId>
+                       <version>1.3.4-jboss-update1</version>
+        </dependency>
+        <dependency>
+                 <groupId>trove</groupId>
+                 <artifactId>trove</artifactId>
+                 <version>2.1.1</version>
+        </dependency>
+        <dependency>
+                 <groupId>qdox</groupId>
+                 <artifactId>qdox</artifactId>
+                 <version>1.6.1</version>
+               </dependency>
+        <dependency>
+                 <groupId>apache-xerces</groupId>
+                 <artifactId>xml-apis</artifactId>
+                 <version>2.9.1</version>
+        </dependency>
+        <dependency>
+                 <groupId>org.apache</groupId>
+                 <artifactId>xmlsec</artifactId>
+                 <version>1.4.2</version>
+        </dependency>
+        <dependency>
+                       <groupId>org.apache.bcel</groupId>
+                       <artifactId>bcel</artifactId>
+                       <version>5.1</version>
+        </dependency>
+        <dependency>
+                       <groupId>org.apache.ant</groupId>
+                       <artifactId>ant</artifactId>
+                       <version>1.7.0</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>cspace-services</finalName>
+        <defaultGoal>package</defaultGoal>
+        <filters>
+            <filter>../../build.properties</filter>
+        </filters>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/webapp/META-INF</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>properties-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>initialize</phase>
+                        <goals>
+                            <goal>read-project-properties</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <files>
+                        <file>../../build.properties</file>
+                    </files>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.5</version>
+                <executions>
+                    <execution>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>resources</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.cargo</groupId>
+                <artifactId>cargo-maven2-plugin</artifactId>
+                <version>0.3</version>
+                <!-- Container configuration -->
+                <configuration>
+                    <container>
+                        <containerId>jboss4x</containerId>
+                        <home>${jboss.dir}</home>
+                        <type>remote</type>
+                    </container>
+                    <configuration>
+                        <type>runtime</type>
+                        <properties>
+                            <cargo.servlet.port>${jboss.domain.cspace.port}</cargo.servlet.port>
+                            <cargo.jboss.configuration>cspace</cargo.jboss.configuration>
+                        </properties>
+                    </configuration>
+                    <deployer>
+                        <type>remote</type>
+                        <deployables>
+                            <deployable>
+                                <groupId>org.collectionspace.services</groupId>
+                                <artifactId>org.collectionspace.services.jaxrs.provider</artifactId>
+                                <type>war</type>
+                                <pingURL>http://${host}:${jboss.domain.cspace.port}</pingURL>
+                            </deployable>
+                        </deployables>
+                    </deployer>
+                </configuration>
+
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <webResources>
+                        <resource>
+                          <directory>src/main/webapp</directory>
+                          <filtering>true</filtering>
+                        </resource>
+                    </webResources>
+                    <archive>
+                        <manifest>
+                            <packageName>${project.groupId}</packageName>
+                            <!--addDefaultImplementationEntries/-->
+                        </manifest>
+                        <manifestEntries>
+                            <Vendor>CollectionSpace Services</Vendor>
+                            <Package>${project.groupId}</Package>
+                            <Release>${cs.release}</Release>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+
+        </plugins>
+        <pluginManagement>
+               <plugins>
+                       <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+                       <plugin>
+                               <groupId>org.eclipse.m2e</groupId>
+                               <artifactId>lifecycle-mapping</artifactId>
+                               <version>1.0.0</version>
+                               <configuration>
+                                       <lifecycleMappingMetadata>
+                                               <pluginExecutions>
+                                                       <pluginExecution>
+                                                               <pluginExecutionFilter>
+                                                                       <groupId>
+                                                                               org.codehaus.mojo
+                                                                       </groupId>
+                                                                       <artifactId>
+                                                                               properties-maven-plugin
+                                                                       </artifactId>
+                                                                       <versionRange>
+                                                                               [1.0-alpha-2,)
+                                                                       </versionRange>
+                                                                       <goals>
+                                                                               <goal>
+                                                                                       read-project-properties
+                                                                               </goal>
+                                                                       </goals>
+                                                               </pluginExecutionFilter>
+                                                               <action>
+                                                                       <ignore></ignore>
+                                                               </action>
+                                                       </pluginExecution>
+                                               </pluginExecutions>
+                                       </lifecycleMappingMetadata>
+                               </configuration>
+                       </plugin>
+               </plugins>
+        </pluginManagement>
+    </build>
+</project>
+
index 1a84953fb0fb3cecdf0184f206c5229bc28a037e..48f79b626f5a866fa546636bd843b9c4f5fc29a1 100644 (file)
@@ -1,36 +1,36 @@
-package org.collectionspace.services.jaxrs;\r
-\r
-import javax.servlet.ServletContextEvent;\r
-\r
-import org.jboss.resteasy.core.Dispatcher;\r
-import org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap;\r
-import org.collectionspace.services.common.ResourceMap;\r
-\r
-public class CSpaceResteasyBootstrap extends ResteasyBootstrap {\r
-       \r
-       public void  contextInitialized(ServletContextEvent event) {\r
-               try {\r
-                       //\r
-               // This call to super instantiates and initializes our JAX-RS application class.\r
-               // The application class is org.collectionspace.services.jaxrs.CollectionSpaceJaxRsApplication.\r
-               //\r
-               System.out.println("[INFO] Starting up the CollectionSpace Services' JAX-RS application.");\r
-                       super.contextInitialized(event);\r
-                       CollectionSpaceJaxRsApplication app = \r
-                               (CollectionSpaceJaxRsApplication)deployment.getApplication();\r
-                       Dispatcher disp = deployment.getDispatcher();\r
-                       disp.getDefaultContextObjects().put(ResourceMap.class, app.getResourceMap());\r
-                       System.out.println("[INFO] CollectionSpace Services' JAX-RS application started.");\r
-               } catch (Throwable e) {\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-       \r
-    @Override\r
-    public void contextDestroyed(ServletContextEvent event) {\r
-       System.out.println("[INFO] Shutting down the CollectionSpace Services' JAX-RS application.");\r
-       //Do something if needed.\r
-       System.out.println("[INFO] CollectionSpace Services' JAX-RS application stopped.");\r
-    }  \r
-\r
-}\r
+package org.collectionspace.services.jaxrs;
+
+import javax.servlet.ServletContextEvent;
+
+import org.jboss.resteasy.core.Dispatcher;
+import org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap;
+import org.collectionspace.services.common.ResourceMap;
+
+public class CSpaceResteasyBootstrap extends ResteasyBootstrap {
+       
+       public void  contextInitialized(ServletContextEvent event) {
+               try {
+                       //
+               // This call to super instantiates and initializes our JAX-RS application class.
+               // The application class is org.collectionspace.services.jaxrs.CollectionSpaceJaxRsApplication.
+               //
+               System.out.println("[INFO] Starting up the CollectionSpace Services' JAX-RS application.");
+                       super.contextInitialized(event);
+                       CollectionSpaceJaxRsApplication app = 
+                               (CollectionSpaceJaxRsApplication)deployment.getApplication();
+                       Dispatcher disp = deployment.getDispatcher();
+                       disp.getDefaultContextObjects().put(ResourceMap.class, app.getResourceMap());
+                       System.out.println("[INFO] CollectionSpace Services' JAX-RS application started.");
+               } catch (Throwable e) {
+                       e.printStackTrace();
+               }
+       }
+       
+    @Override
+    public void contextDestroyed(ServletContextEvent event) {
+       System.out.println("[INFO] Shutting down the CollectionSpace Services' JAX-RS application.");
+       //Do something if needed.
+       System.out.println("[INFO] CollectionSpace Services' JAX-RS application stopped.");
+    }  
+
+}
index 430644f5b48278c25f8d955a35075464e9dbe9f2..89a20b8fd9f4b229a9b94950e2533db846ee8977 100644 (file)
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd\r
-             http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-    <persistence-unit name="org.collectionspace.services">\r
-        <provider>org.hibernate.ejb.HibernatePersistence</provider>\r
-               <!-- Until our JNDI issue with Nuxeo is resolved, we can't use this datasource element\r
-        <non-jta-data-source>CspaceDS</non-jta-data-source> -->\r
-\r
-        <class>org.collectionspace.services.account.AccountsCommon</class>\r
-        <class>org.collectionspace.services.account.Tenant</class>\r
-        <class>org.collectionspace.services.account.AccountTenant</class>\r
-        <class>org.collectionspace.services.account.Status</class>\r
-        <class>org.collectionspace.services.authentication.User</class>\r
-        <class>org.collectionspace.services.authorization.perms.Permission</class>\r
-        <class>org.collectionspace.services.authorization.perms.PermissionAction</class>\r
-        <class>org.collectionspace.services.authorization.PermissionRoleRel</class>\r
-        <class>org.collectionspace.services.authorization.Role</class>\r
-        <class>org.collectionspace.services.authorization.AccountRoleRel</class>\r
-        \r
-        <properties>\r
-                       <property name="hibernate.dialect" value="${db.dialect}"/>\r
-            <property name="hibernate.max_fetch_depth" value="3"/>\r
-                       <!-- Until our JNDI issue with Nuxeo is resolved, we have to use these JDBC properties rather than a datasource -->\r
-                       <property name="hibernate.connection.driver_class" value="${db.jdbc.driver.class}"/>\r
-                       <property name="hibernate.connection.username" value="${db.cspace.user}"/>\r
-                       <property name="hibernate.connection.password" value="${db.cspace.user.password}"/>\r
-                       <property name="hibernate.connection.url" value="${db.jdbc.cspace.url.encoded}"/>\r
-            <!--property name="hibernate.hbm2ddl.auto" value="create-drop"/-->\r
-        </properties>\r
-\r
-    </persistence-unit>\r
-</persistence>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
+             http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <persistence-unit name="org.collectionspace.services">
+        <provider>org.hibernate.ejb.HibernatePersistence</provider>
+               <!-- Until our JNDI issue with Nuxeo is resolved, we can't use this datasource element
+        <non-jta-data-source>CspaceDS</non-jta-data-source> -->
+
+        <class>org.collectionspace.services.account.AccountsCommon</class>
+        <class>org.collectionspace.services.account.Tenant</class>
+        <class>org.collectionspace.services.account.AccountTenant</class>
+        <class>org.collectionspace.services.account.Status</class>
+        <class>org.collectionspace.services.authentication.User</class>
+        <class>org.collectionspace.services.authorization.perms.Permission</class>
+        <class>org.collectionspace.services.authorization.perms.PermissionAction</class>
+        <class>org.collectionspace.services.authorization.PermissionRoleRel</class>
+        <class>org.collectionspace.services.authorization.Role</class>
+        <class>org.collectionspace.services.authorization.AccountRoleRel</class>
+        
+        <properties>
+                       <property name="hibernate.dialect" value="${db.dialect}"/>
+            <property name="hibernate.max_fetch_depth" value="3"/>
+                       <!-- Until our JNDI issue with Nuxeo is resolved, we have to use these JDBC properties rather than a datasource -->
+                       <property name="hibernate.connection.driver_class" value="${db.jdbc.driver.class}"/>
+                       <property name="hibernate.connection.username" value="${db.cspace.user}"/>
+                       <property name="hibernate.connection.password" value="${db.cspace.user.password}"/>
+                       <property name="hibernate.connection.url" value="${db.jdbc.cspace.url.encoded}"/>
+            <!--property name="hibernate.hbm2ddl.auto" value="create-drop"/-->
+        </properties>
+
+    </persistence-unit>
+</persistence>
index ba0b6ce4fb94fe308b01b33a625ef9bf82cf34bd..aa385c38a21624c6e8d0fdb8c62ab39fce210cfe 100644 (file)
@@ -1,83 +1,83 @@
-#\r
-# The default logging level\r
-#\r
-log4j.rootLogger=debug, error, cspace_appender\r
-\r
-#\r
-# The stdout appender\r
-#\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#\r
-# An appender that shows just ERROR log messsages\r
-#\r
-log4j.appender.error=org.apache.log4j.ConsoleAppender\r
-log4j.appender.error.layout=org.apache.log4j.PatternLayout\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.error.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-log4j.appender.error.Threshold=WARN\r
-\r
-#\r
-# The "cspace_appender" appender - the standout CollectionSpace services log file appender\r
-#\r
-log4j.appender.cspace_appender=org.apache.log4j.RollingFileAppender\r
-log4j.appender.cspace_appender.File=${catalina.home}/logs/cspace-services.log\r
-log4j.appender.cspace_appender.MaxFileSize=5000KB\r
-# Keep ten backup files\r
-log4j.appender.cspace_appender.MaxBackupIndex=10\r
-log4j.appender.cspace_appender.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.cspace_appender.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#\r
-# CollectionSpace Services Performance appender\r
-#\r
-log4j.appender.cspace_perf_appender=org.apache.log4j.RollingFileAppender\r
-log4j.appender.cspace_perf_appender.File=${catalina.home}/logs/cspace-services-perf.log\r
-log4j.appender.cspace_perf_appender.MaxFileSize=5000KB\r
-# Keep ten backup files\r
-log4j.appender.cspace_perf_appender.MaxBackupIndex=10\r
-log4j.appender.cspace_perf_appender.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.cspace_perf_appender.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#\r
-# This logger uses the "cspace_perf_appender" appender to log performance profiling information.\r
-#\r
-log4j.logger.perf.collectionspace=DEBUG, cspace_perf_appender, stdout\r
-# send the logs only to our appender -no inheritence.\r
-log4j.additivity.perf.collectionspace=false\r
-\r
-#\r
-# CollectionSpace loggers and default levels - all loggers using the rootLogger if not otherwise specified\r
-#\r
-log4j.logger.org.collectionspace=INFO\r
-log4j.logger.org.collectionspace.services.nuxeo.client.java=ERROR\r
-log4j.logger.org.collectionspace.services.common.storage.JDBCTools=ERROR\r
-log4j.logger.org.collectionspace.services.common.profile.CSpaceFilter=ERROR\r
-\r
-#log4j.logger.org.collectionspace.services.common.vocabulary.nuxeo=TRACE\r
-\r
-#\r
-# Nuxeo loggers, levels, and associated appenders\r
-#\r
-log4j.logger.org.nuxeo=WARN\r
-#log4j.logger.org.nuxeo.ecm.core.storage.sql=TRACE\r
-\r
-#\r
-# Misc loggers, levels\r
-#\r
-log4j.logger.org.apache=ERROR\r
-log4j.logger.httpclient=ERROR\r
-log4j.logger.org.jboss.resteasy=ERROR\r
-log4j.logger.org.apache.catalina.core=ERROR\r
-log4j.logger.org.springframework=ERROR\r
-log4j.logger.org.springframework.security=ERROR\r
-log4j.logger.org.jboss.security=ERROR\r
-log4j.logger.org.apache.catalina.realm=ERROR\r
-log4j.logger.org.hibernate=ERROR\r
-log4j.logger.ch.elca.el4j.services.xmlmerge=ERROR\r
-log4j.logger.net.sf.jmimemagic.MagicParser=ERROR\r
-\r
-\r
+#
+# The default logging level
+#
+log4j.rootLogger=debug, error, cspace_appender
+
+#
+# The stdout appender
+#
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#
+# An appender that shows just ERROR log messsages
+#
+log4j.appender.error=org.apache.log4j.ConsoleAppender
+log4j.appender.error.layout=org.apache.log4j.PatternLayout
+# Pattern to output the caller's file name and line number.
+log4j.appender.error.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+log4j.appender.error.Threshold=WARN
+
+#
+# The "cspace_appender" appender - the standout CollectionSpace services log file appender
+#
+log4j.appender.cspace_appender=org.apache.log4j.RollingFileAppender
+log4j.appender.cspace_appender.File=${catalina.home}/logs/cspace-services.log
+log4j.appender.cspace_appender.MaxFileSize=5000KB
+# Keep ten backup files
+log4j.appender.cspace_appender.MaxBackupIndex=10
+log4j.appender.cspace_appender.layout=org.apache.log4j.PatternLayout
+log4j.appender.cspace_appender.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#
+# CollectionSpace Services Performance appender
+#
+log4j.appender.cspace_perf_appender=org.apache.log4j.RollingFileAppender
+log4j.appender.cspace_perf_appender.File=${catalina.home}/logs/cspace-services-perf.log
+log4j.appender.cspace_perf_appender.MaxFileSize=5000KB
+# Keep ten backup files
+log4j.appender.cspace_perf_appender.MaxBackupIndex=10
+log4j.appender.cspace_perf_appender.layout=org.apache.log4j.PatternLayout
+log4j.appender.cspace_perf_appender.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#
+# This logger uses the "cspace_perf_appender" appender to log performance profiling information.
+#
+log4j.logger.perf.collectionspace=DEBUG, cspace_perf_appender, stdout
+# send the logs only to our appender -no inheritence.
+log4j.additivity.perf.collectionspace=false
+
+#
+# CollectionSpace loggers and default levels - all loggers using the rootLogger if not otherwise specified
+#
+log4j.logger.org.collectionspace=INFO
+log4j.logger.org.collectionspace.services.nuxeo.client.java=ERROR
+log4j.logger.org.collectionspace.services.common.storage.JDBCTools=ERROR
+log4j.logger.org.collectionspace.services.common.profile.CSpaceFilter=ERROR
+
+#log4j.logger.org.collectionspace.services.common.vocabulary.nuxeo=TRACE
+
+#
+# Nuxeo loggers, levels, and associated appenders
+#
+log4j.logger.org.nuxeo=WARN
+#log4j.logger.org.nuxeo.ecm.core.storage.sql=TRACE
+
+#
+# Misc loggers, levels
+#
+log4j.logger.org.apache=ERROR
+log4j.logger.httpclient=ERROR
+log4j.logger.org.jboss.resteasy=ERROR
+log4j.logger.org.apache.catalina.core=ERROR
+log4j.logger.org.springframework=ERROR
+log4j.logger.org.springframework.security=ERROR
+log4j.logger.org.jboss.security=ERROR
+log4j.logger.org.apache.catalina.realm=ERROR
+log4j.logger.org.hibernate=ERROR
+log4j.logger.ch.elca.el4j.services.xmlmerge=ERROR
+log4j.logger.net.sf.jmimemagic.MagicParser=ERROR
+
+
index f9d978f1b0fd2ebd959fc8ce5ce8f1d5cdd76a4b..132b8f6294ac2057a903cb7f13afe50de85e3825 100644 (file)
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<jboss-web>\r
-   <class-loading java2ClassLoadingCompliance="true"> \r
-   </class-loading>\r
-   <!-- All secure web resources will use this security domain -->\r
-    <security-domain>java:/jaas/cspace</security-domain>\r
-    <context-root>/cspace-services</context-root>\r
-    <!--resource-ref>\r
-        <description>DB Connection</description>\r
-        <res-ref-name>jdbc/cspaceds</res-ref-name>\r
-        <res-type>javax.sql.DataSource</res-type>\r
-        <jndi-name>java:/cspaceds</jndi-name>\r
-        <res-auth>Container</res-auth>\r
-    </resource-ref-->\r
-</jboss-web>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-web>
+   <class-loading java2ClassLoadingCompliance="true"> 
+   </class-loading>
+   <!-- All secure web resources will use this security domain -->
+    <security-domain>java:/jaas/cspace</security-domain>
+    <context-root>/cspace-services</context-root>
+    <!--resource-ref>
+        <description>DB Connection</description>
+        <res-ref-name>jdbc/cspaceds</res-ref-name>
+        <res-type>javax.sql.DataSource</res-type>
+        <jndi-name>java:/cspaceds</jndi-name>
+        <res-auth>Container</res-auth>
+    </resource-ref-->
+</jboss-web>
index 09da0de6487bd1cd63da8975b5b9488fba05500f..0892750f998b9d6cade713c186f82e465ca7e73c 100644 (file)
@@ -1,32 +1,32 @@
-CSpaceJBossDBLoginModule {\r
-   org.collectionspace.authentication.jaas.CSpaceJBossDBLoginModule required\r
-       dsJndiName="CspaceDS"\r
-       hashAlgorithm="SHA-256"\r
-       ignorePasswordCase="false"\r
-       principalClass="org.collectionspace.authentication.CSpacePrincipal"\r
-       principalsQuery="select passwd from users where username=?"\r
-       rolesQuery="select r.rolename, 'Role' from roles as r, accounts_roles as ar where ar.user_id=? and ar.role_id=r.csid"\r
-       tenantsQueryWithDisabled="select t.id, t.name, 'Tenants' from accounts_common as a, accounts_tenants as at, tenants as t where a.userid=? and a.csid = at.TENANTS_ACCOUNTSCOMMON_CSID and at.tenant_id = t.id"\r
-       tenantsQueryNoDisabled="select t.id, t.name, 'Tenants' from accounts_common as a, accounts_tenants as at, tenants as t where a.userid=? and a.csid = at.TENANTS_ACCOUNTSCOMMON_CSID and at.tenant_id = t.id and NOT t.disabled"\r
-    maxRetrySeconds="5000"\r
-    delayBetweenAttemptsMillis="200"\r
-       debug=true;\r
- };\r
\r
- /**\r
- * The JAAS login configuration.\r
- */\r
- cspace {\r
-   org.collectionspace.authentication.jaas.CSpaceJBossDBLoginModule required\r
-       dsJndiName="CspaceDS"\r
-       hashAlgorithm="SHA-256"\r
-       ignorePasswordCase="false"\r
-       principalClass="org.collectionspace.authentication.CSpacePrincipal"\r
-       principalsQuery="select passwd from users where username=?"\r
-       rolesQuery="select r.rolename, 'Role' from roles as r, accounts_roles as ar where ar.user_id=? and ar.role_id=r.csid"\r
-       tenantsQueryWithDisabled="select t.id, t.name, 'Tenants' from accounts_common as a, accounts_tenants as at, tenants as t where a.userid=? and a.csid = at.TENANTS_ACCOUNTSCOMMON_CSID and at.tenant_id = t.id"\r
-       tenantsQueryNoDisabled="select t.id, t.name, 'Tenants' from accounts_common as a, accounts_tenants as at, tenants as t where a.userid=? and a.csid = at.TENANTS_ACCOUNTSCOMMON_CSID and at.tenant_id = t.id and NOT t.disabled"\r
-    maxRetrySeconds="5000"\r
-    delayBetweenAttemptsMillis="200"\r
-       debug=true;\r
- };\r
+CSpaceJBossDBLoginModule {
+   org.collectionspace.authentication.jaas.CSpaceJBossDBLoginModule required
+       dsJndiName="CspaceDS"
+       hashAlgorithm="SHA-256"
+       ignorePasswordCase="false"
+       principalClass="org.collectionspace.authentication.CSpacePrincipal"
+       principalsQuery="select passwd from users where username=?"
+       rolesQuery="select r.rolename, 'Role' from roles as r, accounts_roles as ar where ar.user_id=? and ar.role_id=r.csid"
+       tenantsQueryWithDisabled="select t.id, t.name, 'Tenants' from accounts_common as a, accounts_tenants as at, tenants as t where a.userid=? and a.csid = at.TENANTS_ACCOUNTSCOMMON_CSID and at.tenant_id = t.id"
+       tenantsQueryNoDisabled="select t.id, t.name, 'Tenants' from accounts_common as a, accounts_tenants as at, tenants as t where a.userid=? and a.csid = at.TENANTS_ACCOUNTSCOMMON_CSID and at.tenant_id = t.id and NOT t.disabled"
+    maxRetrySeconds="5000"
+    delayBetweenAttemptsMillis="200"
+       debug=true;
+ };
+ /**
+ * The JAAS login configuration.
+ */
+ cspace {
+   org.collectionspace.authentication.jaas.CSpaceJBossDBLoginModule required
+       dsJndiName="CspaceDS"
+       hashAlgorithm="SHA-256"
+       ignorePasswordCase="false"
+       principalClass="org.collectionspace.authentication.CSpacePrincipal"
+       principalsQuery="select passwd from users where username=?"
+       rolesQuery="select r.rolename, 'Role' from roles as r, accounts_roles as ar where ar.user_id=? and ar.role_id=r.csid"
+       tenantsQueryWithDisabled="select t.id, t.name, 'Tenants' from accounts_common as a, accounts_tenants as at, tenants as t where a.userid=? and a.csid = at.TENANTS_ACCOUNTSCOMMON_CSID and at.tenant_id = t.id"
+       tenantsQueryNoDisabled="select t.id, t.name, 'Tenants' from accounts_common as a, accounts_tenants as at, tenants as t where a.userid=? and a.csid = at.TENANTS_ACCOUNTSCOMMON_CSID and at.tenant_id = t.id and NOT t.disabled"
+    maxRetrySeconds="5000"
+    delayBetweenAttemptsMillis="200"
+       debug=true;
+ };
index 28714fd3b18cc0979504323ccfdb11f80763767e..9de96d989139c535e9ff2be1ff772bd39ee4c435 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-    Document   : web.xml\r
-    Created on : May 19, 2009, 1:31 PM\r
-    Author     :\r
-    Copyright 2009 University of California at Berkeley\r
-    Description:\r
-        service layer web application\r
--->\r
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">    \r
-    <display-name>CollectionSpace Services</display-name>\r
-       \r
-    <!-- \r
-    <login-config>\r
-        <auth-method>BASIC</auth-method>\r
-        <realm-name>CollectionSpace realm</realm-name>\r
-    </login-config>\r
-     -->\r
-\r
-       <env-entry>\r
-        <description>Sets the logging context for the Tiger web-app</description>\r
-        <env-entry-name>cspace-logging-context</env-entry-name>\r
-        <env-entry-type>java.lang.String</env-entry-type>\r
-        <env-entry-value>CSpaceLoggingContext</env-entry-value>\r
-    </env-entry>\r
-\r
-    <context-param>\r
-        <param-name>javax.ws.rs.Application</param-name>\r
-        <param-value>org.collectionspace.services.jaxrs.CollectionSpaceJaxRsApplication</param-value>\r
-    </context-param>\r
-\r
-    <context-param>\r
-        <param-name>resteasy.servlet.mapping.prefix</param-name>\r
-        <param-value>/</param-value>\r
-    </context-param>\r
-\r
-    <!--\r
-      - Location of the XML file that defines the root application context\r
-      - Applied by Spring's ContextLoaderListener.\r
-      -->\r
-    <context-param>\r
-        <param-name>contextConfigLocation</param-name>\r
-        <param-value>\r
-            /WEB-INF/applicationContext-security.xml\r
-        </param-value>\r
-    </context-param>\r
-\r
-    <!--\r
-       Spring Security Filter\r
-    -->\r
-    <filter>\r
-        <filter-name>springSecurityFilterChain</filter-name>\r
-        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>\r
-    </filter>\r
-\r
-    <filter-mapping>\r
-        <filter-name>springSecurityFilterChain</filter-name>\r
-        <url-pattern>/*</url-pattern>\r
-    </filter-mapping>\r
-\r
-       <!--\r
-       - A filter that will attempt to retry requests that fail due to network errors.\r
-       -\r
-       -               maxRetrySeconds - How long to keep retrying a request.\r
-       -               delayBetweenAttemptsMillis - How long to wait between retries.\r
-       -\r
-       -->\r
-       <!-- \r
-       <filter>\r
-               <filter-name>networkErrorRetryFilter</filter-name>\r
-               <filter-class>org.collectionspace.services.common.NetworkErrorRetryFilter</filter-class>\r
-               <init-param>\r
-               <param-name>maxRetrySeconds</param-name>\r
-               <param-value>5000</param-value>\r
-               </init-param>\r
-               <init-param>\r
-               <param-name>delayBetweenAttemptsMillis</param-name>\r
-               <param-value>200</param-value>\r
-               </init-param>\r
-       </filter>\r
-       \r
-       <filter-mapping>\r
-               <filter-name>networkErrorRetryFilter</filter-name>\r
-               <url-pattern>/*</url-pattern>\r
-       </filter-mapping>\r
-     -->\r
-     \r
-       <!--\r
-               A filter that logs profiling information.\r
-        -->\r
-    <filter>\r
-               <filter-name>CSpaceFilter</filter-name>\r
-        <filter-class>org.collectionspace.services.common.profile.CSpaceFilter</filter-class>\r
-       </filter>\r
-       \r
-       <filter-mapping>\r
-               <filter-name>CSpaceFilter</filter-name>\r
-               <url-pattern>/*</url-pattern>\r
-       </filter-mapping>\r
-    \r
-\r
-    <!--\r
-       ***\r
-       *** Servlet Context Listeners\r
-       ***\r
-    -->\r
-\r
-    <!--\r
-      - Loads the root application context of this web app at startup.\r
-      - The application context is then available via\r
-      - WebApplicationContextUtils.getWebApplicationContext(servletContext).\r
-    -->\r
-    <listener>\r
-        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\r
-    </listener>\r
-\r
-    <!--\r
-      - Publishes events for session creation and destruction through the application\r
-      - context. Optional unless concurrent session control is being used.\r
-      -->\r
-    <listener>\r
-        <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>\r
-    </listener>\r
-\r
-    <!--listener>\r
-        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>\r
-    </listener-->\r
-\r
-       <!-- A general listener for the CollectionSpace services.  In particular, this listener starts the embedded Nuxeo EP server instance. -->\r
-    <listener>\r
-        <listener-class>\r
-            org.collectionspace.services.common.CollectionSpaceServiceContextListener\r
-        </listener-class>\r
-    </listener>\r
-    \r
-       <!-- The CollectionSpace listener that starts up the RESTEasy/JAX-RS service framework. -->\r
-    <listener>\r
-        <listener-class>\r
-            org.collectionspace.services.jaxrs.CSpaceResteasyBootstrap\r
-        </listener-class>\r
-    </listener>\r
-\r
-    <servlet>\r
-            <servlet-name>Resteasy</servlet-name>\r
-            <servlet-class>\r
-                org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher\r
-            </servlet-class>\r
-    </servlet>    \r
-    <servlet-mapping>\r
-        <servlet-name>Resteasy</servlet-name>\r
-        <url-pattern>/*</url-pattern>\r
-    </servlet-mapping>\r
-\r
-</web-app>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Document   : web.xml
+    Created on : May 19, 2009, 1:31 PM
+    Author     :
+    Copyright 2009 University of California at Berkeley
+    Description:
+        service layer web application
+-->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">    
+    <display-name>CollectionSpace Services</display-name>
+       
+    <!-- 
+    <login-config>
+        <auth-method>BASIC</auth-method>
+        <realm-name>CollectionSpace realm</realm-name>
+    </login-config>
+     -->
+
+       <env-entry>
+        <description>Sets the logging context for the Tiger web-app</description>
+        <env-entry-name>cspace-logging-context</env-entry-name>
+        <env-entry-type>java.lang.String</env-entry-type>
+        <env-entry-value>CSpaceLoggingContext</env-entry-value>
+    </env-entry>
+
+    <context-param>
+        <param-name>javax.ws.rs.Application</param-name>
+        <param-value>org.collectionspace.services.jaxrs.CollectionSpaceJaxRsApplication</param-value>
+    </context-param>
+
+    <context-param>
+        <param-name>resteasy.servlet.mapping.prefix</param-name>
+        <param-value>/</param-value>
+    </context-param>
+
+    <!--
+      - Location of the XML file that defines the root application context
+      - Applied by Spring's ContextLoaderListener.
+      -->
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>
+            /WEB-INF/applicationContext-security.xml
+        </param-value>
+    </context-param>
+
+    <!--
+       Spring Security Filter
+    -->
+    <filter>
+        <filter-name>springSecurityFilterChain</filter-name>
+        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>springSecurityFilterChain</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+       <!--
+       - A filter that will attempt to retry requests that fail due to network errors.
+       -
+       -               maxRetrySeconds - How long to keep retrying a request.
+       -               delayBetweenAttemptsMillis - How long to wait between retries.
+       -
+       -->
+       <!-- 
+       <filter>
+               <filter-name>networkErrorRetryFilter</filter-name>
+               <filter-class>org.collectionspace.services.common.NetworkErrorRetryFilter</filter-class>
+               <init-param>
+               <param-name>maxRetrySeconds</param-name>
+               <param-value>5000</param-value>
+               </init-param>
+               <init-param>
+               <param-name>delayBetweenAttemptsMillis</param-name>
+               <param-value>200</param-value>
+               </init-param>
+       </filter>
+       
+       <filter-mapping>
+               <filter-name>networkErrorRetryFilter</filter-name>
+               <url-pattern>/*</url-pattern>
+       </filter-mapping>
+     -->
+     
+       <!--
+               A filter that logs profiling information.
+        -->
+    <filter>
+               <filter-name>CSpaceFilter</filter-name>
+        <filter-class>org.collectionspace.services.common.profile.CSpaceFilter</filter-class>
+       </filter>
+       
+       <filter-mapping>
+               <filter-name>CSpaceFilter</filter-name>
+               <url-pattern>/*</url-pattern>
+       </filter-mapping>
+    
+
+    <!--
+       ***
+       *** Servlet Context Listeners
+       ***
+    -->
+
+    <!--
+      - Loads the root application context of this web app at startup.
+      - The application context is then available via
+      - WebApplicationContextUtils.getWebApplicationContext(servletContext).
+    -->
+    <listener>
+        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+
+    <!--
+      - Publishes events for session creation and destruction through the application
+      - context. Optional unless concurrent session control is being used.
+      -->
+    <listener>
+        <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
+    </listener>
+
+    <!--listener>
+        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
+    </listener-->
+
+       <!-- A general listener for the CollectionSpace services.  In particular, this listener starts the embedded Nuxeo EP server instance. -->
+    <listener>
+        <listener-class>
+            org.collectionspace.services.common.CollectionSpaceServiceContextListener
+        </listener-class>
+    </listener>
+    
+       <!-- The CollectionSpace listener that starts up the RESTEasy/JAX-RS service framework. -->
+    <listener>
+        <listener-class>
+            org.collectionspace.services.jaxrs.CSpaceResteasyBootstrap
+        </listener-class>
+    </listener>
+
+    <servlet>
+            <servlet-name>Resteasy</servlet-name>
+            <servlet-class>
+                org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
+            </servlet-class>
+    </servlet>    
+    <servlet-mapping>
+        <servlet-name>Resteasy</servlet-name>
+        <url-pattern>/*</url-pattern>
+    </servlet-mapping>
+
+</web-app>
index 818edfe14dea6d10aab48d8d1e6b0c16b90fb0c9..d3bbc7ab9de4d3ad91ce42ddd3a194bf574af206 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.PerformanceTests</artifactId>\r
-    <packaging>jar</packaging>\r
-    <name>services.PerformanceTests</name>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-    <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-PerformanceTests</finalName>\r
-        <plugins>\r
-            <!-- By default, skip running these tests.  Use the profile "perftests" below\r
-                    to run the tests -i.e., mvn test -Pperftests -->\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-surefire-plugin</artifactId>\r
-                <configuration>\r
-                    <skip>true</skip>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-\r
-       <profiles>\r
-               <profile>\r
-                       <id>perftests</id>\r
-                       <build>\r
-                               <plugins>\r
-                                       <plugin>\r
-                                               <groupId>org.apache.maven.plugins</groupId>\r
-                                               <artifactId>maven-surefire-plugin</artifactId>\r
-                                               <configuration>\r
-                                                       <skip>false</skip>\r
-                                               </configuration>\r
-                                       </plugin>\r
-                               </plugins>\r
-                       </build>\r
-               </profile>\r
-       </profiles>\r
-    \r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.PerformanceTests</artifactId>
+    <packaging>jar</packaging>
+    <name>services.PerformanceTests</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-PerformanceTests</finalName>
+        <plugins>
+            <!-- By default, skip running these tests.  Use the profile "perftests" below
+                    to run the tests -i.e., mvn test -Pperftests -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+       <profiles>
+               <profile>
+                       <id>perftests</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>org.apache.maven.plugins</groupId>
+                                               <artifactId>maven-surefire-plugin</artifactId>
+                                               <configuration>
+                                                       <skip>false</skip>
+                                               </configuration>
+                                       </plugin>
+                               </plugins>
+                       </build>
+               </profile>
+       </profiles>
+    
+</project>
+
index ae9cf211501ef6b80e9086cdb79416f473b385b6..cdefbad9e7bd756f8abaa3081cf264f78d5129a3 100644 (file)
-/**    \r
- * CollectionSpacePerformanceTest.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.PerformanceTests.test;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import java.util.Random;\r
-\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-import javax.xml.bind.JAXBContext;\r
-import javax.xml.bind.Marshaller;\r
-\r
-import org.collectionspace.services.collectionobject.CollectionobjectsCommon;\r
-import org.collectionspace.services.collectionobject.TitleGroup;\r
-import org.collectionspace.services.collectionobject.TitleGroupList;\r
-import org.collectionspace.services.intake.IntakesCommon;\r
-import org.collectionspace.services.relation.RelationsCommon;\r
-import org.collectionspace.services.relation.RelationshipType;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-\r
-/**\r
- * The Class CollectionSpacePerformanceTests.\r
- */\r
-public abstract class CollectionSpacePerformanceTest {\r
-\r
-       protected final static String OBJECT_NUMBER = "objectNumber_";\r
-       protected final static String OBJECT_TITLE = "objectTitle_";\r
-       \r
-       /*\r
-        * Package scoped methods.\r
-        */\r
-\r
-       /**\r
-        * Fill collection object.\r
-        * \r
-        * @param co the co\r
-        * @param identifier the identifier\r
-        */\r
-       void fillCollectionObject(CollectionobjectsCommon co, String identifier) {\r
-               fillCollectionObject(co, OBJECT_NUMBER + identifier, OBJECT_TITLE + identifier);\r
-       }\r
-\r
-       /**\r
-        * Fill collection object.\r
-        * \r
-        * @param co the co\r
-        * @param objectNumber the object number\r
-        * @param title the object title\r
-        */\r
-       void fillCollectionObject(CollectionobjectsCommon co, String objectNumber,\r
-                       String title) {\r
-               co.setObjectNumber(objectNumber);\r
-                TitleGroupList titleGroupList = new TitleGroupList();\r
-                List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();\r
-                TitleGroup titleGroup = new TitleGroup();\r
-                titleGroup.setTitle(title);\r
-                titleGroups.add(titleGroup);\r
-                co.setTitleGroupList(titleGroupList);\r
-       }\r
-\r
-       /**\r
-        * Fill intake.\r
-        * \r
-        * @param theIntake the the intake\r
-        * @param identifier the identifier\r
-        */\r
-       void fillIntake(IntakesCommon theIntake, String identifier) {\r
-               fillIntake(theIntake, "entryNumber-" + identifier, "entryDate-"\r
-                               + identifier);\r
-       }\r
-\r
-       /**\r
-        * Fill intake.\r
-        * \r
-        * @param theIntake the the intake\r
-        * @param entryNumber the entry number\r
-        * @param entryDate the entry date\r
-        */\r
-       void fillIntake(IntakesCommon theIntake, String entryNumber, String entryDate) {\r
-               theIntake.setEntryNumber(entryNumber);\r
-               theIntake.setEntryDate(entryDate);\r
-       }\r
-\r
-    /**\r
-     * Fill relation.\r
-     * \r
-     * @param relation the relation\r
-     * @param subjectCsid the document id1\r
-     * @param subjectDocumentType the document type1\r
-     * @param objectCsid the document id2\r
-     * @param objectDocumentType the document type2\r
-     * @param rt the rt\r
-     */\r
-    void fillRelation(RelationsCommon relation, String subjectCsid, String subjectDocumentType,\r
-               String objectCsid, String objectDocumentType, RelationshipType rt)\r
-    {\r
-        relation.setSubjectCsid(subjectCsid);\r
-        relation.setSubjectDocumentType(subjectDocumentType);\r
-        relation.setSubjectCsid(objectCsid);\r
-        relation.setObjectDocumentType(objectDocumentType);\r
-        \r
-        relation.setRelationshipType(rt.toString());\r
-    }\r
-       \r
-       /**\r
-        * Creates the identifier.\r
-        * \r
-        * @return the string\r
-        */\r
-       String createIdentifier() {\r
-               long identifier = System.currentTimeMillis();\r
-               return Long.toString(identifier);\r
-       }\r
-\r
-       /**\r
-        * Extract id.\r
-        * \r
-        * @param res the res\r
-        * \r
-        * @return the string\r
-        */\r
-       String extractId(ClientResponse<Response> res) {\r
-               String result = null;\r
-               \r
-               MultivaluedMap mvm = res.getMetadata();\r
-               String uri = (String) ((ArrayList) mvm.get("Location")).get(0);\r
-               verbose("extractId:uri=" + uri);\r
-               String[] segments = uri.split("/");\r
-               result = segments[segments.length - 1];\r
-               verbose("id=" + result);\r
-               \r
-               return result;\r
-       }\r
-\r
-       /**\r
-        * Extract part.\r
-        * \r
-        * @param input\r
-        *            the input\r
-        * @param label\r
-        *            the label\r
-        * @param clazz\r
-        *            the clazz\r
-        * \r
-        * @return the object\r
-        * \r
-        * @throws Exception\r
-        *             the exception\r
-        */\r
-       static Object extractPart(MultipartInput input, String label, Class clazz) {\r
-               Object obj = null;\r
-               \r
-               try {\r
-                       for (InputPart part : input.getParts()) {\r
-                               String partLabel = part.getHeaders().getFirst("label");\r
-                               if (label.equalsIgnoreCase(partLabel)) {\r
-                                       String partStr = part.getBodyAsString();\r
-                                       obj = part.getBody(clazz, null);\r
-                                       break;\r
-                               }\r
-                       }\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-\r
-               return obj;\r
-       }\r
-       \r
-       /**\r
-        * Verbose.\r
-        * \r
-        * @param msg the msg\r
-        */\r
-       void verbose(String msg) {\r
-//             System.out.println(msg);\r
-       }\r
-\r
-       /**\r
-        * Verbose.\r
-        * \r
-        * @param msg the msg\r
-        * @param o the o\r
-        * @param clazz the clazz\r
-        */\r
-       void verbose(String msg, Object o, Class clazz) {\r
-               try {\r
-                       verbose(msg);\r
-                       JAXBContext jc = JAXBContext.newInstance(clazz);\r
-                       Marshaller m = jc.createMarshaller();\r
-                       m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);\r
-                       m.marshal(o, System.out);\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Verbose map.\r
-        * \r
-        * @param map the map\r
-        */\r
-       void verboseMap(MultivaluedMap map) {\r
-               for (Object entry : map.entrySet()) {\r
-                       MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry;\r
-                       verbose("  name=" + mentry.getKey() + " value=" + mentry.getValue());\r
-               }\r
-       }\r
-\r
-        boolean isEnabled() {\r
-            return Boolean.getBoolean("cspace.perf");\r
-        }\r
-\r
-}\r
+/**    
+ * CollectionSpacePerformanceTest.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.PerformanceTests.test;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+
+import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
+import org.collectionspace.services.collectionobject.TitleGroup;
+import org.collectionspace.services.collectionobject.TitleGroupList;
+import org.collectionspace.services.intake.IntakesCommon;
+import org.collectionspace.services.relation.RelationsCommon;
+import org.collectionspace.services.relation.RelationshipType;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.multipart.InputPart;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
+
+/**
+ * The Class CollectionSpacePerformanceTests.
+ */
+public abstract class CollectionSpacePerformanceTest {
+
+       protected final static String OBJECT_NUMBER = "objectNumber_";
+       protected final static String OBJECT_TITLE = "objectTitle_";
+       
+       /*
+        * Package scoped methods.
+        */
+
+       /**
+        * Fill collection object.
+        * 
+        * @param co the co
+        * @param identifier the identifier
+        */
+       void fillCollectionObject(CollectionobjectsCommon co, String identifier) {
+               fillCollectionObject(co, OBJECT_NUMBER + identifier, OBJECT_TITLE + identifier);
+       }
+
+       /**
+        * Fill collection object.
+        * 
+        * @param co the co
+        * @param objectNumber the object number
+        * @param title the object title
+        */
+       void fillCollectionObject(CollectionobjectsCommon co, String objectNumber,
+                       String title) {
+               co.setObjectNumber(objectNumber);
+                TitleGroupList titleGroupList = new TitleGroupList();
+                List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();
+                TitleGroup titleGroup = new TitleGroup();
+                titleGroup.setTitle(title);
+                titleGroups.add(titleGroup);
+                co.setTitleGroupList(titleGroupList);
+       }
+
+       /**
+        * Fill intake.
+        * 
+        * @param theIntake the the intake
+        * @param identifier the identifier
+        */
+       void fillIntake(IntakesCommon theIntake, String identifier) {
+               fillIntake(theIntake, "entryNumber-" + identifier, "entryDate-"
+                               + identifier);
+       }
+
+       /**
+        * Fill intake.
+        * 
+        * @param theIntake the the intake
+        * @param entryNumber the entry number
+        * @param entryDate the entry date
+        */
+       void fillIntake(IntakesCommon theIntake, String entryNumber, String entryDate) {
+               theIntake.setEntryNumber(entryNumber);
+               theIntake.setEntryDate(entryDate);
+       }
+
+    /**
+     * Fill relation.
+     * 
+     * @param relation the relation
+     * @param subjectCsid the document id1
+     * @param subjectDocumentType the document type1
+     * @param objectCsid the document id2
+     * @param objectDocumentType the document type2
+     * @param rt the rt
+     */
+    void fillRelation(RelationsCommon relation, String subjectCsid, String subjectDocumentType,
+               String objectCsid, String objectDocumentType, RelationshipType rt)
+    {
+        relation.setSubjectCsid(subjectCsid);
+        relation.setSubjectDocumentType(subjectDocumentType);
+        relation.setSubjectCsid(objectCsid);
+        relation.setObjectDocumentType(objectDocumentType);
+        
+        relation.setRelationshipType(rt.toString());
+    }
+       
+       /**
+        * Creates the identifier.
+        * 
+        * @return the string
+        */
+       String createIdentifier() {
+               long identifier = System.currentTimeMillis();
+               return Long.toString(identifier);
+       }
+
+       /**
+        * Extract id.
+        * 
+        * @param res the res
+        * 
+        * @return the string
+        */
+       String extractId(ClientResponse<Response> res) {
+               String result = null;
+               
+               MultivaluedMap mvm = res.getMetadata();
+               String uri = (String) ((ArrayList) mvm.get("Location")).get(0);
+               verbose("extractId:uri=" + uri);
+               String[] segments = uri.split("/");
+               result = segments[segments.length - 1];
+               verbose("id=" + result);
+               
+               return result;
+       }
+
+       /**
+        * Extract part.
+        * 
+        * @param input
+        *            the input
+        * @param label
+        *            the label
+        * @param clazz
+        *            the clazz
+        * 
+        * @return the object
+        * 
+        * @throws Exception
+        *             the exception
+        */
+       static Object extractPart(MultipartInput input, String label, Class clazz) {
+               Object obj = null;
+               
+               try {
+                       for (InputPart part : input.getParts()) {
+                               String partLabel = part.getHeaders().getFirst("label");
+                               if (label.equalsIgnoreCase(partLabel)) {
+                                       String partStr = part.getBodyAsString();
+                                       obj = part.getBody(clazz, null);
+                                       break;
+                               }
+                       }
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+
+               return obj;
+       }
+       
+       /**
+        * Verbose.
+        * 
+        * @param msg the msg
+        */
+       void verbose(String msg) {
+//             System.out.println(msg);
+       }
+
+       /**
+        * Verbose.
+        * 
+        * @param msg the msg
+        * @param o the o
+        * @param clazz the clazz
+        */
+       void verbose(String msg, Object o, Class clazz) {
+               try {
+                       verbose(msg);
+                       JAXBContext jc = JAXBContext.newInstance(clazz);
+                       Marshaller m = jc.createMarshaller();
+                       m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+                       m.marshal(o, System.out);
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       /**
+        * Verbose map.
+        * 
+        * @param map the map
+        */
+       void verboseMap(MultivaluedMap map) {
+               for (Object entry : map.entrySet()) {
+                       MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry;
+                       verbose("  name=" + mentry.getKey() + " value=" + mentry.getValue());
+               }
+       }
+
+        boolean isEnabled() {
+            return Boolean.getBoolean("cspace.perf");
+        }
+
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index d7501e2c414b1a2ce2d6897a7845b083f8d5a48f..b8a2888f85c05af58ffc1b59f294ca0bacb70267 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 551ac7ac08d589753f13cacd1303c607a89c4e49..76aa9ca04e2167722d3fd1981a50d3735f137d9f 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.account</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.account</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 6e7e82320d2f8db01d44f3255d283948d1ee19c1..049c17372d13ec60c4cdc77791dea3a8b47cb82b 100644 (file)
-\r
-<project name="account" default="package" basedir=".">\r
-    <description>\r
-        collectionobject service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="gen_ddl"\r
-            description="generate service-specific tables(s), indices, etc.">\r
-        <ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>\r
-    </target>\r
-    \r
-    <target name="create_cspace_db"\r
-            description="create tables(s), indices for account service">\r
-        <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy collectionobject service">\r
-        <ant antfile="pstore/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy collectionobject service">\r
-        <ant antfile="pstore/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-            description="distribute collectionobject service}">\r
-        <ant antfile="pstore/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="account" default="package" basedir=".">
+    <description>
+        collectionobject service
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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="gen_ddl"
+            description="generate service-specific tables(s), indices, etc.">
+        <ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>
+    </target>
+    
+    <target name="create_cspace_db"
+            description="create tables(s), indices for account service">
+        <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>
+    </target>
+
+    <target name="deploy" depends="install"
+            description="deploy collectionobject service">
+        <ant antfile="pstore/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+            description="undeploy collectionobject service">
+        <ant antfile="pstore/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+            description="distribute collectionobject service}">
+        <ant antfile="pstore/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index 914ced66487abc5896edefe37c170130e64e3617..86a05a179c456dd796794b9e90f40c3d3854701d 100644 (file)
-<project name="account.client" default="package" basedir=".">\r
-    <description>\r
-        collectionspace account service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">\r
-        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>\r
-        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>\r
-        <delete file="${dest.hibernate.cfg}" verbose="true" />\r
-        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url.encoded}" />\r
-        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />\r
-        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />\r
-        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->\r
-        <filter token="DB_DIALECT" value="${db.dialect}" />\r
-        <copy todir="${basedir}/target/test-classes" filtering="true">\r
-            <fileset dir="${basedir}/src/test/resources">\r
-                <include name="hibernate.cfg.xml" />\r
-            </fileset>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy account service in ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy account service from ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="dist"\r
-            description="generate distribution for account service" depends="package">\r
-    </target>\r
-\r
-</project>\r
+<project name="account.client" default="package" basedir=".">
+    <description>
+        collectionspace account service
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init">
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </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="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">
+        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>
+        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>
+        <delete file="${dest.hibernate.cfg}" verbose="true" />
+        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url.encoded}" />
+        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />
+        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />
+        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->
+        <filter token="DB_DIALECT" value="${db.dialect}" />
+        <copy todir="${basedir}/target/test-classes" filtering="true">
+            <fileset dir="${basedir}/src/test/resources">
+                <include name="hibernate.cfg.xml" />
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="deploy" depends="install"
+            description="deploy account service in ${jee.server.cspace}">
+    </target>
+
+    <target name="undeploy"
+            description="undeploy account service from ${jee.server.cspace}">
+    </target>
+
+    <target name="dist"
+            description="generate distribution for account service" depends="package">
+    </target>
+
+</project>
index 20c3e56d70db04bd273c30534aebe03276bccd82..7787b8615b5cb15879b4538dad8f96234266f7ba 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.account</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.account.client</artifactId>\r
-    <name>services.account.client</name>\r
-\r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.account.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.collectionspace.services</groupId>\r
-                       <artifactId>org.collectionspace.services.hyperjaxb</artifactId>\r
-                       <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-\r
-        <!-- Needed if/when client test framework files are moved into -->\r
-        <!-- /services/client/src/test from /services/client/src/main -->\r
-\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-                               <dependency>\r
-                                               <groupId>postgresql</groupId>\r
-                                               <artifactId>postgresql</artifactId>\r
-            <scope>test</scope>\r
-                               </dependency>\r
-         <!-- <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>test</scope>\r
-            <type>test-jar</type>\r
-        </dependency> -->\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>cspace-services-account-client</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <artifactId>maven-antrun-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <id>subs-hibernate-config</id>\r
-                        <phase>generate-test-resources</phase>\r
-                        <goals>\r
-                            <goal>run</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <tasks>\r
-                                <property name="runtime-classpath" refid="maven.runtime.classpath"/>\r
-                                <ant target="setup_hibernate.cfg" inheritRefs="true"/>\r
-                            </tasks>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.account</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.account.client</artifactId>
+    <name>services.account.client</name>
+
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.account.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+                       <groupId>org.collectionspace.services</groupId>
+                       <artifactId>org.collectionspace.services.hyperjaxb</artifactId>
+                       <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- Needed if/when client test framework files are moved into -->
+        <!-- /services/client/src/test from /services/client/src/main -->
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>test</scope>
+        </dependency>
+                               <dependency>
+                                               <groupId>postgresql</groupId>
+                                               <artifactId>postgresql</artifactId>
+            <scope>test</scope>
+                               </dependency>
+         <!-- <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+            <type>test-jar</type>
+        </dependency> -->
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>cspace-services-account-client</finalName>
+        <plugins>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>subs-hibernate-config</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <property name="runtime-classpath" refid="maven.runtime.classpath"/>
+                                <ant target="setup_hibernate.cfg" inheritRefs="true"/>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
+
index f9c47870a50e1b0f12349ecbf8b9da7cfc8db2b1..8a63f9f1083725c7d2bc38bf08f53ffc1c22d83b 100644 (file)
@@ -1,25 +1,25 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
-log4j.logger.org.hibernate=INFO\r
-log4j.logger.org.hibernate.cfg=WARN\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
+log4j.logger.org.hibernate=INFO
+log4j.logger.org.hibernate.cfg=WARN
index 3aa34b3fc41af04adc8ea939a1627c9dc30855f8..53720a74286861e4213ec8376b127b0d4eefe18a 100644 (file)
@@ -1,25 +1,25 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
-log4j.logger.org.jvnet.hyperjaxb3=DEBUG\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
+log4j.logger.org.jvnet.hyperjaxb3=DEBUG
 log4j.logger.org.hibernate=WARN
\ No newline at end of file
index 4f16ab255f0480e371f773c487b24d6970314842..28987a60cbbbddd5d50b5d07fe687152efc378d5 100644 (file)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.account</artifactId>\r
-    <name>services.account</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>pstore</module>\r
-        <module>service</module>\r
-        <module>client</module>\r
-    </modules>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.account</artifactId>
+    <name>services.account</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>jaxb</module>
+        <module>pstore</module>
+        <module>service</module>
+        <module>client</module>
+    </modules>
+
+</project>
+
index 09106c56f915e125ff74c765455c5d1d90f04fc7..04588bc42151994c3e143ce3346e38fd36fcd64f 100644 (file)
-<project name="account.pstore" default="package" basedir=".">\r
-    <description>\r
-        collectionspace account service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- environment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">\r
-        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>\r
-        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>\r
-        <delete file="${dest.hibernate.cfg}" verbose="true" />\r
-        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url.encoded}" />\r
-        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />\r
-        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />\r
-        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->\r
-        <filter token="DB_DIALECT" value="${db.dialect}" />\r
-        <copy todir="${basedir}/target/test-classes" filtering="true">\r
-            <fileset dir="${basedir}/src/test/resources">\r
-                <include name="hibernate.cfg.xml" />\r
-            </fileset>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="gen_ddl" depends="gen_ddl-unix,gen_ddl-windows"\r
-            description="geneate ddl" />\r
-    <target name="gen_ddl-unix" if="osfamily-unix" depends="setup_hibernate.cfg">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="-Pddl" />\r
-            <arg value="process-test-resources" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="gen_ddl-windows" if="osfamily-windows" depends="setup_hibernate.cfg">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="-Pddl" />\r
-            <arg value="process-test-resources" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="create_cspace_db"\r
-            description="create tables(s), indices for account service">\r
-                               <sql driver="${db.jdbc.driver.class}"\r
-             url="${db.jdbc.cspace.url}"\r
-             userid="${db.cspace.user}"\r
-             password="${db.cspace.user.password}"\r
-             src="${db.script.dir}/account.sql"\r
-             onerror="continue" >\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-        </sql>\r
-                                               <sql driver="${db.jdbc.driver.class}"\r
-             url="${db.jdbc.cspace.url}"\r
-             userid="${db.cspace.user}"\r
-             password="${db.cspace.user.password}"\r
-             src="${db.script.dir}/account_index.sql" >\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-                                       </sql>\r
-    </target>\r
-       \r
-       <!-- We are copying only the scripts that are committed to the source tree.  We're *not* copying the ones that\r
-       get generated in the target folder -->\r
-    <target name="deploy" depends="install"\r
-            description="deploy account service in ${jee.server.cspace}">\r
-        <copy todir="${jee.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy account service from ${jee.server.cspace}"\r
-            depends="check.db.scripts.deploy.dir" if="${db.scripts.deploy.dir.exists}">\r
-        <delete>\r
-            <fileset dir="${db.scripts.deploy.dir}"\r
-                     includes="**account**.sql"/>\r
-        </delete>\r
-    </target>\r
-\r
-    <target name="dist"\r
-            description="generate distribution for account service" depends="package">\r
-        <!-- copy db scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-    </target>\r
-    \r
-    <target name="check.db.scripts.deploy.dir">\r
-        <property name="db.scripts.deploy.dir" value="${jee.server.cspace}/cspace/services/db/${db}"/>\r
-        <condition property="db.scripts.deploy.dir.exists">\r
-            <available file="${db.scripts.deploy.dir}" type="dir"/>\r
-        </condition>\r
-    </target>\r
-\r
-</project>\r
+<project name="account.pstore" default="package" basedir=".">
+    <description>
+        collectionspace account service
+    </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="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init">
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </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="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">
+        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>
+        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>
+        <delete file="${dest.hibernate.cfg}" verbose="true" />
+        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url.encoded}" />
+        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />
+        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />
+        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->
+        <filter token="DB_DIALECT" value="${db.dialect}" />
+        <copy todir="${basedir}/target/test-classes" filtering="true">
+            <fileset dir="${basedir}/src/test/resources">
+                <include name="hibernate.cfg.xml" />
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="gen_ddl" depends="gen_ddl-unix,gen_ddl-windows"
+            description="geneate ddl" />
+    <target name="gen_ddl-unix" if="osfamily-unix" depends="setup_hibernate.cfg">
+        <exec executable="mvn" failonerror="true">
+            <arg value="-Pddl" />
+            <arg value="process-test-resources" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="gen_ddl-windows" if="osfamily-windows" depends="setup_hibernate.cfg">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="-Pddl" />
+            <arg value="process-test-resources" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="create_cspace_db"
+            description="create tables(s), indices for account service">
+                               <sql driver="${db.jdbc.driver.class}"
+             url="${db.jdbc.cspace.url}"
+             userid="${db.cspace.user}"
+             password="${db.cspace.user.password}"
+             src="${db.script.dir}/account.sql"
+             onerror="continue" >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+        </sql>
+                                               <sql driver="${db.jdbc.driver.class}"
+             url="${db.jdbc.cspace.url}"
+             userid="${db.cspace.user}"
+             password="${db.cspace.user.password}"
+             src="${db.script.dir}/account_index.sql" >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+                                       </sql>
+    </target>
+       
+       <!-- We are copying only the scripts that are committed to the source tree.  We're *not* copying the ones that
+       get generated in the target folder -->
+    <target name="deploy" depends="install"
+            description="deploy account service in ${jee.server.cspace}">
+        <copy todir="${jee.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+    </target>
+
+    <target name="undeploy"
+            description="undeploy account service from ${jee.server.cspace}"
+            depends="check.db.scripts.deploy.dir" if="${db.scripts.deploy.dir.exists}">
+        <delete>
+            <fileset dir="${db.scripts.deploy.dir}"
+                     includes="**account**.sql"/>
+        </delete>
+    </target>
+
+    <target name="dist"
+            description="generate distribution for account service" depends="package">
+        <!-- copy db scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+    </target>
+    
+    <target name="check.db.scripts.deploy.dir">
+        <property name="db.scripts.deploy.dir" value="${jee.server.cspace}/cspace/services/db/${db}"/>
+        <condition property="db.scripts.deploy.dir.exists">
+            <available file="${db.scripts.deploy.dir}" type="dir"/>
+        </condition>
+    </target>
+
+</project>
index 9c2e4d03eecc3a1da216fd723908c78dd10351c5..76ff48353d2477d8aa651792a94cc14b5373b5fa 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-       <parent>\r
-               <artifactId>org.collectionspace.services.account</artifactId>\r
-               <groupId>org.collectionspace.services</groupId>\r
-               <version>4.2-SNAPSHOT</version>\r
-       </parent>\r
-\r
-       <modelVersion>4.0.0</modelVersion>\r
-       <groupId>org.collectionspace.services</groupId>\r
-       <artifactId>org.collectionspace.services.account.pstore</artifactId>\r
-       <name>services.account.pstore</name>\r
-\r
-       <properties>\r
-               <sql.file>account.sql</sql.file>\r
-               <sql.dir>${basedir}/src/main/resources/db</sql.dir>\r
-       </properties>\r
-\r
-       <dependencies>\r
-               <dependency>\r
-                       <groupId>com.sun.xml.bind</groupId>\r
-                       <artifactId>jaxb-impl</artifactId>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.jvnet.jaxb2-commons</groupId>\r
-                       <artifactId>property-listener-injector</artifactId>\r
-               </dependency>\r
-               <!-- External dependencies -->\r
-               <dependency>\r
-                       <groupId>mysql</groupId>\r
-                       <artifactId>mysql-connector-java</artifactId>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>postgresql</groupId>\r
-                       <artifactId>postgresql</artifactId>\r
-               </dependency>\r
-               <!-- CollectionSpace dependencies -->\r
-               <dependency>\r
-                       <groupId>org.collectionspace.services</groupId>\r
-                       <artifactId>org.collectionspace.services.account.jaxb</artifactId>\r
-                       <version>${project.version}</version>\r
-               </dependency>\r
-       </dependencies>\r
-\r
-       <build>\r
-               <finalName>collectionspace-services-account-pstore</finalName>\r
-               <plugins>\r
-                       <plugin>\r
-                               <artifactId>maven-antrun-plugin</artifactId>\r
-                               <executions>\r
-                                       <execution>\r
-                                               <id>subs-hibernate-config</id>\r
-                                               <phase>generate-test-resources</phase>\r
-                                               <goals>\r
-                                                       <goal>run</goal>\r
-                                               </goals>\r
-                                               <configuration>\r
-                                                       <tasks>\r
-                                                               <property name="runtime-classpath" refid="maven.runtime.classpath" />\r
-                                                               <ant target="setup_hibernate.cfg" inheritRefs="true" />\r
-                                                       </tasks>\r
-                                               </configuration>\r
-                                       </execution>\r
-                               </executions>\r
-                       </plugin>\r
-\r
-               </plugins>\r
-       </build>\r
-       <profiles>\r
-               <profile>\r
-                       <!-- use profile as this task is not needed for every build and test -->\r
-                       <id>ddl</id>\r
-                       <build>\r
-                               <plugins>\r
-                                       <plugin>\r
-                                               <groupId>org.codehaus.mojo</groupId>\r
-                                               <artifactId>properties-maven-plugin</artifactId>\r
-                                               <version>1.0-alpha-2</version>\r
-                                               <executions>\r
-                                                       <execution>\r
-                                                               <phase>initialize</phase>\r
-                                                               <goals>\r
-                                                                       <goal>read-project-properties</goal>\r
-                                                               </goals>\r
-                                                               <configuration>\r
-                                                                       <files>\r
-                                                                               <file>${basedir}/../../../build.properties</file>\r
-                                                                       </files>\r
-                                                               </configuration>\r
-                                                       </execution>\r
-                                               </executions>\r
-                                       </plugin>\r
-                                       <plugin>\r
-                                               <groupId>org.codehaus.mojo</groupId>\r
-                                               <artifactId>hibernate3-maven-plugin</artifactId>\r
-                                               <version>2.2</version>\r
-                                               <executions>\r
-                                                       <execution>\r
-                                                               <phase>process-test-resources</phase>\r
-                                                               <goals>\r
-                                                                       <goal>hbm2ddl</goal>\r
-                                                               </goals>\r
-                                                       </execution>\r
-                                               </executions>\r
-                                               <configuration>\r
-                                                       <components>\r
-                                                               <component>\r
-                                                                       <name>hbm2ddl</name>\r
-                                                               </component>\r
-                                                       </components>\r
-                                                       <componentProperties>\r
-                                                               <outputfilename>${sql.file}</outputfilename>\r
-                                                               <implementation>jpaconfiguration</implementation>\r
-                                                               <drop>true</drop>\r
-                                                               <create>true</create>\r
-                                                               <export>true</export>\r
-                                                               <jdk5>true</jdk5>\r
-                                                               <ejb3>false</ejb3>\r
-                                                               <persistenceunit>org.collectionspace.services.account</persistenceunit>\r
-                                                       </componentProperties>\r
-                                               </configuration>\r
-                                               <dependencies>\r
-                                                       <dependency>\r
-                                                               <groupId>mysql</groupId>\r
-                                                               <artifactId>mysql-connector-java</artifactId>\r
-                                                       </dependency>\r
-                                                       <dependency>\r
-                                                               <groupId>postgresql</groupId>\r
-                                                               <artifactId>postgresql</artifactId>\r
-                                                       </dependency>\r
-                                               </dependencies>\r
-                                       </plugin>\r
-                                       <plugin>\r
-                                               <artifactId>maven-antrun-plugin</artifactId>\r
-                                               <executions>\r
-                                                       <execution>\r
-                                                               <phase>process-test-resources</phase>\r
-                                                               <configuration>\r
-                                                                       <tasks>\r
-                                                                               <copy file="${basedir}/target/hibernate3/sql/${sql.file}"\r
-                                                                                       tofile="${sql.dir}/${db}/${sql.file}" />\r
-                                                                       </tasks>\r
-                                                               </configuration>\r
-                                                               <goals>\r
-                                                                       <goal>run</goal>\r
-                                                               </goals>\r
-                                                       </execution>\r
-                                               </executions>\r
-                                       </plugin>\r
-\r
-                               </plugins>\r
-                       </build>\r
-               </profile>\r
-       </profiles>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+               <artifactId>org.collectionspace.services.account</artifactId>
+               <groupId>org.collectionspace.services</groupId>
+               <version>4.2-SNAPSHOT</version>
+       </parent>
+
+       <modelVersion>4.0.0</modelVersion>
+       <groupId>org.collectionspace.services</groupId>
+       <artifactId>org.collectionspace.services.account.pstore</artifactId>
+       <name>services.account.pstore</name>
+
+       <properties>
+               <sql.file>account.sql</sql.file>
+               <sql.dir>${basedir}/src/main/resources/db</sql.dir>
+       </properties>
+
+       <dependencies>
+               <dependency>
+                       <groupId>com.sun.xml.bind</groupId>
+                       <artifactId>jaxb-impl</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.jvnet.jaxb2-commons</groupId>
+                       <artifactId>property-listener-injector</artifactId>
+               </dependency>
+               <!-- External dependencies -->
+               <dependency>
+                       <groupId>mysql</groupId>
+                       <artifactId>mysql-connector-java</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>postgresql</groupId>
+                       <artifactId>postgresql</artifactId>
+               </dependency>
+               <!-- CollectionSpace dependencies -->
+               <dependency>
+                       <groupId>org.collectionspace.services</groupId>
+                       <artifactId>org.collectionspace.services.account.jaxb</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+       </dependencies>
+
+       <build>
+               <finalName>collectionspace-services-account-pstore</finalName>
+               <plugins>
+                       <plugin>
+                               <artifactId>maven-antrun-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>subs-hibernate-config</id>
+                                               <phase>generate-test-resources</phase>
+                                               <goals>
+                                                       <goal>run</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <tasks>
+                                                               <property name="runtime-classpath" refid="maven.runtime.classpath" />
+                                                               <ant target="setup_hibernate.cfg" inheritRefs="true" />
+                                                       </tasks>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
+               </plugins>
+       </build>
+       <profiles>
+               <profile>
+                       <!-- use profile as this task is not needed for every build and test -->
+                       <id>ddl</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>org.codehaus.mojo</groupId>
+                                               <artifactId>properties-maven-plugin</artifactId>
+                                               <version>1.0-alpha-2</version>
+                                               <executions>
+                                                       <execution>
+                                                               <phase>initialize</phase>
+                                                               <goals>
+                                                                       <goal>read-project-properties</goal>
+                                                               </goals>
+                                                               <configuration>
+                                                                       <files>
+                                                                               <file>${basedir}/../../../build.properties</file>
+                                                                       </files>
+                                                               </configuration>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+                                       <plugin>
+                                               <groupId>org.codehaus.mojo</groupId>
+                                               <artifactId>hibernate3-maven-plugin</artifactId>
+                                               <version>2.2</version>
+                                               <executions>
+                                                       <execution>
+                                                               <phase>process-test-resources</phase>
+                                                               <goals>
+                                                                       <goal>hbm2ddl</goal>
+                                                               </goals>
+                                                       </execution>
+                                               </executions>
+                                               <configuration>
+                                                       <components>
+                                                               <component>
+                                                                       <name>hbm2ddl</name>
+                                                               </component>
+                                                       </components>
+                                                       <componentProperties>
+                                                               <outputfilename>${sql.file}</outputfilename>
+                                                               <implementation>jpaconfiguration</implementation>
+                                                               <drop>true</drop>
+                                                               <create>true</create>
+                                                               <export>true</export>
+                                                               <jdk5>true</jdk5>
+                                                               <ejb3>false</ejb3>
+                                                               <persistenceunit>org.collectionspace.services.account</persistenceunit>
+                                                       </componentProperties>
+                                               </configuration>
+                                               <dependencies>
+                                                       <dependency>
+                                                               <groupId>mysql</groupId>
+                                                               <artifactId>mysql-connector-java</artifactId>
+                                                       </dependency>
+                                                       <dependency>
+                                                               <groupId>postgresql</groupId>
+                                                               <artifactId>postgresql</artifactId>
+                                                       </dependency>
+                                               </dependencies>
+                                       </plugin>
+                                       <plugin>
+                                               <artifactId>maven-antrun-plugin</artifactId>
+                                               <executions>
+                                                       <execution>
+                                                               <phase>process-test-resources</phase>
+                                                               <configuration>
+                                                                       <tasks>
+                                                                               <copy file="${basedir}/target/hibernate3/sql/${sql.file}"
+                                                                                       tofile="${sql.dir}/${db}/${sql.file}" />
+                                                                       </tasks>
+                                                               </configuration>
+                                                               <goals>
+                                                                       <goal>run</goal>
+                                                               </goals>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+
+                               </plugins>
+                       </build>
+               </profile>
+       </profiles>
+</project>
+
index b591433f8f0255cb5a8dd33e46def04c973413b6..4497b3aa8ce624e871635113c14662c4ce9875a6 100644 (file)
@@ -1,32 +1,32 @@
-The file account.sql is basically generated by the gen_ddl ant target.\r
-However, you must modify the result of that to make the \r
-\r
-  DROP TABLE \r
-\r
-statements be \r
-  \r
-  DROP TABLE IF EXISTS table CASCADE \r
-\r
-This ensures that first time setup does not fail, and that later invocations\r
-can deal with dependencies.\r
-\r
-You must also make the\r
-\r
-  DROP SEQUENCE \r
-\r
-statements be \r
-\r
-  DROP SEQUENCE IF EXISTS\r
-\r
-for similar reasons.\r
-\r
-You must also remove (comment out) the statement (which is superfluous with the CASCADE above):\r
-\r
-  alter table permissions_actions drop constraint FKFDA649B05A9CEEB5;\r
-\r
-When using the account_tenants table on insert, you have to specify "nextval('hibernate_sequence')" \r
-as the value for the HJID column. \r
-\r
-Note that because of the way gen_ddl does its work per-sub-project, there is a single shared\r
-sequence for both this and the authorization.sql script. This should be okay, even if it does\r
-create gaps in what would be a nice sequence for each table.\r
+The file account.sql is basically generated by the gen_ddl ant target.
+However, you must modify the result of that to make the 
+
+  DROP TABLE 
+
+statements be 
+  
+  DROP TABLE IF EXISTS table CASCADE 
+
+This ensures that first time setup does not fail, and that later invocations
+can deal with dependencies.
+
+You must also make the
+
+  DROP SEQUENCE 
+
+statements be 
+
+  DROP SEQUENCE IF EXISTS
+
+for similar reasons.
+
+You must also remove (comment out) the statement (which is superfluous with the CASCADE above):
+
+  alter table permissions_actions drop constraint FKFDA649B05A9CEEB5;
+
+When using the account_tenants table on insert, you have to specify "nextval('hibernate_sequence')" 
+as the value for the HJID column. 
+
+Note that because of the way gen_ddl does its work per-sub-project, there is a single shared
+sequence for both this and the authorization.sql script. This should be okay, even if it does
+create gaps in what would be a nice sequence for each table.
index f9c47870a50e1b0f12349ecbf8b9da7cfc8db2b1..8a63f9f1083725c7d2bc38bf08f53ffc1c22d83b 100644 (file)
@@ -1,25 +1,25 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
-log4j.logger.org.hibernate=INFO\r
-log4j.logger.org.hibernate.cfg=WARN\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
+log4j.logger.org.hibernate=INFO
+log4j.logger.org.hibernate.cfg=WARN
index 2845a9b73e015f252529dc7c682aca503d7b5652..d04c6d364c330fdefc0fcc94c1a457448cabc1d7 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.account</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.account.service</artifactId>\r
-    <name>services.account.service</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <properties>\r
-        <spring.security.version>3.0.2.RELEASE</spring.security.version>\r
-    </properties>\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- CollectionSpace Dependencies -->\r
-        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.account.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.account.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-\r
-        <!-- External dependencies -->\r
-        \r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-\r
-        <!-- apache -->\r
-        <dependency>\r
-            <groupId>commons-beanutils</groupId>\r
-            <artifactId>commons-beanutils</artifactId>\r
-            <version>1.6.1</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-logging</groupId>\r
-            <artifactId>commons-logging</artifactId>\r
-            <version>1.1</version>\r
-        </dependency>\r
-\r
-        <!-- javax -->\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>collectionspace-services-account</finalName>\r
-        <plugins>\r
-\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.account</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.account.service</artifactId>
+    <name>services.account.service</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <spring.security.version>3.0.2.RELEASE</spring.security.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- CollectionSpace Dependencies -->
+        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.account.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.account.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- External dependencies -->
+        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+
+        <!-- apache -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+        </dependency>
+
+        <!-- javax -->
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>collectionspace-services-account</finalName>
+        <plugins>
+
+        </plugins>
+    </build>
+</project>
+
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 34718ac73fd56500026bffb94af8f61fe2cd7f3f..f509f695a122527c6a33ab0ebcbedfa28f8f543a 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.acquisition</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.acquisition</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d7501e2c414b1a2ce2d6897a7845b083f8d5a48f..b8a2888f85c05af58ffc1b59f294ca0bacb70267 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 526750ffff855d141c71427d5642ee316d017a79..122a4b80651329c1c88a144d34ee14b0ebbbcbb8 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.acquisition.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.acquisition.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 46457bb93189a6ba57a63522b186b04d1a252c26..dabea25c8a8b41a17efe55e6e277c85fa782bf3f 100644 (file)
-\r
-<project name="acquisition.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        acquisition service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy acquisition in ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <ant antfile="nuxeo-platform-cs-acquisition/build.xml" target="deploy" inheritall="false"/>\r
-        -->\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="undeploy acquisition from ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-       leaving this only for backwards compatibility reasons. -->\r
-        <ant antfile="nuxeo-platform-cs-acquisition/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-        description="generate distribution for acquisition" depends="package">\r
-        <ant antfile="nuxeo-platform-cs-acquisition/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-\r
-</project>\r
+
+<project name="acquisition.3rdparty" default="package" basedir=".">
+    <description>
+        acquisition service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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 acquisition in ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <ant antfile="nuxeo-platform-cs-acquisition/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+        description="undeploy acquisition from ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       leaving this only for backwards compatibility reasons. -->
+        <ant antfile="nuxeo-platform-cs-acquisition/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+        description="generate distribution for acquisition" depends="package">
+        <ant antfile="nuxeo-platform-cs-acquisition/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+
+</project>
index b325bd51e1f9c0575cb65024e459e34b1d0552c0..df2de39c39471a00752d5695f0bab25ba907c27d 100644 (file)
@@ -1,24 +1,24 @@
-\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.acquisition</artifactId>\r
-        <version>4.2-SNAPSHOT</version> \r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.acquisition.3rdparty</artifactId>\r
-    <packaging>pom</packaging>\r
-    <name>services.acquisition.3rdparty</name>\r
-    <description>\r
-        3rd party build for acquisition service\r
-    </description>\r
-\r
-    <modules>\r
-    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <module>nuxeo-platform-cs-acquisition</module>\r
-        -->\r
-    </modules>\r
-</project>\r
+
+<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.acquisition</artifactId>
+        <version>4.2-SNAPSHOT</version> 
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.acquisition.3rdparty</artifactId>
+    <packaging>pom</packaging>
+    <name>services.acquisition.3rdparty</name>
+    <description>
+        3rd party build for acquisition service
+    </description>
+
+    <modules>
+    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <module>nuxeo-platform-cs-acquisition</module>
+        -->
+    </modules>
+</project>
index edc7de211b2e51f9f9a20ceab6990dca28fd28ad..158ee20e28f5ee9b2cb34f0de8105c7c01c96920 100644 (file)
-\r
-<project name="acquisition" default="package" basedir=".">\r
-    <description>\r
-        acquisition service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy acquisition service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="undeploy acquisition service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-        description="distribute acquisition service">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="acquisition" default="package" basedir=".">
+    <description>
+        acquisition service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 acquisition service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy acquisition service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+        description="distribute acquisition service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index a99a63936480e9e13f975c5430b9b81bfdd6a041..2d628cfc051c2bedc32f1c03547692568ee28c4c 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.acquisition</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.acquisition.client</artifactId>\r
-    <name>services.acquisition.client</name>\r
-    <packaging>jar</packaging>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <!-- CollectionSpace Dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.acquisition.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-acquisition-client</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-surefire-plugin</artifactId>\r
-                <configuration>\r
-                    <systemProperties>\r
-                        <property>\r
-                            <name>test-data.fileName</name>\r
-                            <value>${project.build.directory}/test-classes/test-data</value>\r
-                        </property>\r
-                    </systemProperties>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.acquisition</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.acquisition.client</artifactId>
+    <name>services.acquisition.client</name>
+    <packaging>jar</packaging>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- CollectionSpace Dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.acquisition.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-acquisition-client</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemProperties>
+                        <property>
+                            <name>test-data.fileName</name>
+                            <value>${project.build.directory}/test-classes/test-data</value>
+                        </property>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index c6de59ff1470f874591edb9fc3ac7c8af7aff4ea..a328209d21fa19d85124eb263ecf2c52b66337f9 100644 (file)
@@ -1,14 +1,14 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services;\r
-\r
-/**\r
- * @author remillet\r
- *\r
- */\r
-public interface AcquisitionJAXBSchema {\r
-\r
-}\r
-\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services;
+
+/**
+ * @author remillet
+ *
+ */
+public interface AcquisitionJAXBSchema {
+
+}
+
+
index cde3b8e75d9ff965df3b8826f40a99978118a35c..ede6e53960baecac4f550a60819476d440c4764a 100644 (file)
@@ -1,14 +1,14 @@
-package org.collectionspace.services;\r
-\r
-public interface AcquisitionListItemJAXBSchema {\r
-       final static String ACQUISITION_REFERENCE_NUMBER = "acquisitionReferenceNumber";\r
-    final static String ACQUISITION_SOURCE = "acquisitionSource";\r
-    final static String ACQUISITION_SOURCES = "acquisitionSources";\r
-    //final static String ACQUISITION_SOURCE_LIST = "acquisitionSourceList";\r
-\r
-    final static String OWNER = "owner";\r
-    final static String OWNERS = "owners";\r
-    //final static String OWNER_LIST = "ownerList";\r
-    final static String CSID = "csid";\r
-       final static String URI = "url";\r
-}\r
+package org.collectionspace.services;
+
+public interface AcquisitionListItemJAXBSchema {
+       final static String ACQUISITION_REFERENCE_NUMBER = "acquisitionReferenceNumber";
+    final static String ACQUISITION_SOURCE = "acquisitionSource";
+    final static String ACQUISITION_SOURCES = "acquisitionSources";
+    //final static String ACQUISITION_SOURCE_LIST = "acquisitionSourceList";
+
+    final static String OWNER = "owner";
+    final static String OWNERS = "owners";
+    //final static String OWNER_LIST = "ownerList";
+    final static String CSID = "csid";
+       final static String URI = "url";
+}
index 30198c4201105f6b6c053f70f6fcc834b22f0a3c..39e4bdd93b4cd587883d0f246e9109069f2fdd0c 100644 (file)
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- A comment. -->\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.acquisition</artifactId>\r
-    <name>services.acquisition</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-\r
-    <build>\r
-        <plugins>            \r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A comment. -->
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.acquisition</artifactId>
+    <name>services.acquisition</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+
+    <build>
+        <plugins>            
+        </plugins>
+    </build>
+</project>
+
index 2247fb648b645859c1ec77155b3c948856344071..dbd8e25f195df29309c8ecb5acc4259a2f199826 100644 (file)
@@ -1,46 +1,46 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.acquisition</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.acquisition.service</artifactId>\r
-    <name>services.acquisition.service</name>\r
-    <packaging>jar</packaging>    \r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.acquisition.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.acquisition.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-acquisition</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.codehaus.mojo</groupId>\r
-                <artifactId>jboss-maven-plugin</artifactId>\r
-                <configuration>\r
-                    <jbossHome>${jboss.dir}</jbossHome>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.acquisition</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.acquisition.service</artifactId>
+    <name>services.acquisition.service</name>
+    <packaging>jar</packaging>    
+
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.acquisition.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.acquisition.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-acquisition</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>jboss-maven-plugin</artifactId>
+                <configuration>
+                    <jbossHome>${jboss.dir}</jbossHome>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index 3fda48096a5c10e94060dfa4ac7f7301ae1887c5..6147f2ac7949d45c5572421b800f4c8ab067bd5b 100644 (file)
@@ -1,18 +1,18 @@
-package org.collectionspace.services.acquisition.nuxeo;\r
-\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.InvalidDocumentException;\r
-import org.collectionspace.services.common.document.ValidatorHandler;\r
-import org.collectionspace.services.common.document.DocumentHandler.Action;\r
-\r
-public class AcquisitionValidatorHandler implements ValidatorHandler {\r
-\r
-       @Override\r
-       public void validate(Action action, ServiceContext ctx)\r
-                       throws InvalidDocumentException {\r
-               // TODO Auto-generated method stub\r
-               System.out.println("AcquisitionValidatorHandler executed.");\r
-\r
-       }\r
-\r
-}\r
+package org.collectionspace.services.acquisition.nuxeo;
+
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandler;
+import org.collectionspace.services.common.document.DocumentHandler.Action;
+
+public class AcquisitionValidatorHandler implements ValidatorHandler {
+
+       @Override
+       public void validate(Action action, ServiceContext ctx)
+                       throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               System.out.println("AcquisitionValidatorHandler executed.");
+
+       }
+
+}
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 80f21e119bb2efaeb208a569aa6bfaea6c900479..9d8929677669acb5112f3c4f182635e9323d3649 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.authentication</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.authentication</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 3a721a66b79a7497323d19382eeada695906f471..b0d2709f1ae4985010311fd0ea11d4d5ae40dff6 100644 (file)
-\r
-<project name="authentication" default="package" basedir=".">\r
-    <description>\r
-        authentication service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="gen_ddl"\r
-            description="generate service-specific tables(s), indices, etc.">\r
-        <ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="create_cspace_db"\r
-            description="create tables(s), indices for authentication service">\r
-        <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy authentication service">\r
-        <ant antfile="pstore/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="service/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authentication service">\r
-        <ant antfile="pstore/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="service/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-            description="distribute authentication service}">\r
-        <ant antfile="pstore/build.xml" target="dist" inheritall="false"/>\r
-        <ant antfile="service/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="authentication" default="package" basedir=".">
+    <description>
+        authentication service
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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="gen_ddl"
+            description="generate service-specific tables(s), indices, etc.">
+        <ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>
+    </target>
+
+    <target name="create_cspace_db"
+            description="create tables(s), indices for authentication service">
+        <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>
+    </target>
+
+    <target name="deploy" depends="install"
+            description="deploy authentication service">
+        <ant antfile="pstore/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="service/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authentication service">
+        <ant antfile="pstore/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="service/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+            description="distribute authentication service}">
+        <ant antfile="pstore/build.xml" target="dist" inheritall="false"/>
+        <ant antfile="service/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index 557933f52e2d9fd215615810f883a9158d8dcabc..c617b450fdcc7e18d0faeff3611bae9907027343 100644 (file)
-<project name="authentication.client" default="package" basedir=".">\r
-    <description>\r
-        collectionspace authentication service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">\r
-        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>\r
-        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>\r
-        <delete file="${dest.hibernate.cfg}" verbose="true" />\r
-        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url}" />\r
-        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />\r
-        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />\r
-        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->\r
-        <filter token="DB_DIALECT" value="${db.dialect}" />\r
-        <copy todir="${basedir}/target/test-classes" filtering="true">\r
-            <fileset dir="${basedir}/src/test/resources">\r
-                <include name="hibernate.cfg.xml" />\r
-            </fileset>\r
-        </copy>\r
-    </target>\r
-    \r
-    <target name="deploy" depends="install"\r
-    description="deploy authentication service in ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy authentication service from ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for authentication service" depends="package">\r
-    </target>\r
-\r
-</project>\r
+<project name="authentication.client" default="package" basedir=".">
+    <description>
+        collectionspace authentication service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init">
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">
+        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>
+        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>
+        <delete file="${dest.hibernate.cfg}" verbose="true" />
+        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url}" />
+        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />
+        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />
+        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->
+        <filter token="DB_DIALECT" value="${db.dialect}" />
+        <copy todir="${basedir}/target/test-classes" filtering="true">
+            <fileset dir="${basedir}/src/test/resources">
+                <include name="hibernate.cfg.xml" />
+            </fileset>
+        </copy>
+    </target>
+    
+    <target name="deploy" depends="install"
+    description="deploy authentication service in ${jee.server.cspace}">
+    </target>
+
+    <target name="undeploy"
+    description="undeploy authentication service from ${jee.server.cspace}">
+    </target>
+
+    <target name="dist"
+    description="generate distribution for authentication service" depends="package">
+    </target>
+
+</project>
index 94f4bc8605cb2d8c0f0fb84683e435c2cdec3b36..5dd48b4e35a11c774c69a44cd7fe6bc4ce556667 100644 (file)
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.authentication</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.authentication.client</artifactId>\r
-    <name>services.authentication.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>cspace-services-authentication-client</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <artifactId>maven-antrun-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <id>subs-hibernate-config</id>\r
-                        <phase>generate-test-resources</phase>\r
-                        <goals>\r
-                            <goal>run</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <tasks>\r
-                                <property name="runtime-classpath" refid="maven.runtime.classpath"/>\r
-                                <ant target="setup_hibernate.cfg" inheritRefs="true"/>\r
-                            </tasks>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.authentication</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.authentication.client</artifactId>
+    <name>services.authentication.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>cspace-services-authentication-client</finalName>
+        <plugins>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>subs-hibernate-config</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <property name="runtime-classpath" refid="maven.runtime.classpath"/>
+                                <ant target="setup_hibernate.cfg" inheritRefs="true"/>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
+
index 5d288d87d8e3024d3b87bf197cb5fab920725791..a78d354741d2a9da6cf222ac5b759803e8e7ff3c 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=WARN\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=WARN
index 6c3fe600b97f69e9addf208329318bbbdb780ea3..bcf0a33c91561798ce71cb6e92a62993bfe5878d 100644 (file)
@@ -1,20 +1,20 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project-shared-configuration>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<project-shared-configuration>
     <!--
 This file contains additional configuration written by modules in the NetBeans IDE.
 The configuration is intended to be shared among all the users of project and
 therefore it is assumed to be part of version control checkout.
 Without this configuration present, some functionality in the IDE may be limited or fail altogether.
--->\r
-    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">\r
+-->
+    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
         <!--
 Properties that influence various parts of the IDE, especially code formatting and the like. 
 You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
 That way multiple projects can share the same settings (useful for formatting rules for example).
 Any value defined here will override the pom.xml file value but is only applicable to the current project.
--->\r
-        <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>default</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>\r
-        <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>8</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>\r
-        <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>\r
-    </properties>\r
-</project-shared-configuration>\r
+-->
+        <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>default</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
+        <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>8</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>
+        <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>
+    </properties>
+</project-shared-configuration>
index 805e827d87eff28e79298ed2f56cb731b545076b..766c894c75842c491ac8ec1330426f72f01dcc2a 100644 (file)
@@ -1,26 +1,26 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.authentication</artifactId>\r
-    <name>services.authentication</name>\r
-    <packaging>pom</packaging>\r
-    <url>http://www.collectionspace.org</url>\r
-    <properties>\r
-    </properties>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>pstore</module>\r
-        <module>service</module>\r
-        <module>client</module>\r
-    </modules>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.authentication</artifactId>
+    <name>services.authentication</name>
+    <packaging>pom</packaging>
+    <url>http://www.collectionspace.org</url>
+    <properties>
+    </properties>
+
+    <modules>
+        <module>jaxb</module>
+        <module>pstore</module>
+        <module>service</module>
+        <module>client</module>
+    </modules>
+
+</project>
+
index 13a5ff5f571108b70d8bbdff3030391b621eeced..b2e346625b2c2eeddff0520fbffe9ef34bc180b1 100644 (file)
-<project name="authentication.pstore" default="package" basedir=".">\r
-    <description>\r
-        collectionspace authentication service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- environment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">\r
-        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>\r
-        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>\r
-        <delete file="${dest.hibernate.cfg}" verbose="true" />\r
-        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url}" />\r
-        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />\r
-        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />\r
-        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->\r
-        <filter token="DB_DIALECT" value="${db.dialect}" />\r
-        <copy todir="${basedir}/target/test-classes" filtering="true">\r
-            <fileset dir="${basedir}/src/test/resources">\r
-                <include name="hibernate.cfg.xml" />\r
-            </fileset>\r
-        </copy>\r
-    </target>\r
-\r
-\r
-    <target name="gen_ddl" depends="gen_ddl-unix,gen_ddl-windows"\r
-            description="geneate ddl" />\r
-    <target name="gen_ddl-unix" if="osfamily-unix" depends="setup_hibernate.cfg">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="-Pddl" />\r
-            <arg value="process-test-resources" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="gen_ddl-windows" if="osfamily-windows" depends="setup_hibernate.cfg">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="-Pddl" />\r
-            <arg value="process-test-resources" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="create_cspace_db"\r
-            description="create tables(s), indices for authentication service">\r
-                               <sql driver="${db.jdbc.driver.class}"\r
-             url="${db.jdbc.cspace.url}"\r
-             userid="${db.cspace.user}"\r
-             password="${db.cspace.user.password}"\r
-             src="${db.script.dir}/authentication.sql" >\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-        </sql>\r
-                               <!-- No longer used\r
-                               <sql driver="${db.jdbc.driver.class}"\r
-             url="${db.jdbc.cspace.url}"\r
-             userid="${db.cspace.user}"\r
-             password="${db.cspace.user.password}"\r
-             src="${db.script.dir}/authentication_index.sql" >\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-        </sql>\r
-                               <sql driver="${db.jdbc.driver.class}"\r
-             url="${db.jdbc.cspace.url}"\r
-             userid="${db.cspace.user}"\r
-             password="${db.cspace.user.password}"\r
-             src="${db.script.dir}/test_authentication.sql" >\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-                                       </sql> -->\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy authentication service in ${jee.server.cspace}">\r
-        <copy todir="${jee.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authentication service from ${jee.server.cspace}"\r
-            depends="check.db.scripts.deploy.dir" if="${db.scripts.deploy.dir.exists}">\r
-        <delete>\r
-            <fileset dir="${db.scripts.deploy.dir}"\r
-                     includes="**authentication**.sql"/>\r
-        </delete>\r
-    </target>\r
-\r
-    <target name="dist"\r
-            description="generate distribution for authentication service" depends="package">\r
-        <!-- copy db scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-    </target>\r
-    \r
-    <target name="check.db.scripts.deploy.dir">\r
-        <property name="db.scripts.deploy.dir" value="${jee.server.cspace}/cspace/services/db/${db}"/>\r
-        <condition property="db.scripts.deploy.dir.exists">\r
-            <available file="${db.scripts.deploy.dir}" type="dir"/>\r
-        </condition>\r
-    </target>\r
-\r
-</project>\r
+<project name="authentication.pstore" default="package" basedir=".">
+    <description>
+        collectionspace authentication service
+    </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="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init">
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </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="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">
+        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>
+        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>
+        <delete file="${dest.hibernate.cfg}" verbose="true" />
+        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url}" />
+        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />
+        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />
+        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->
+        <filter token="DB_DIALECT" value="${db.dialect}" />
+        <copy todir="${basedir}/target/test-classes" filtering="true">
+            <fileset dir="${basedir}/src/test/resources">
+                <include name="hibernate.cfg.xml" />
+            </fileset>
+        </copy>
+    </target>
+
+
+    <target name="gen_ddl" depends="gen_ddl-unix,gen_ddl-windows"
+            description="geneate ddl" />
+    <target name="gen_ddl-unix" if="osfamily-unix" depends="setup_hibernate.cfg">
+        <exec executable="mvn" failonerror="true">
+            <arg value="-Pddl" />
+            <arg value="process-test-resources" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="gen_ddl-windows" if="osfamily-windows" depends="setup_hibernate.cfg">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="-Pddl" />
+            <arg value="process-test-resources" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="create_cspace_db"
+            description="create tables(s), indices for authentication service">
+                               <sql driver="${db.jdbc.driver.class}"
+             url="${db.jdbc.cspace.url}"
+             userid="${db.cspace.user}"
+             password="${db.cspace.user.password}"
+             src="${db.script.dir}/authentication.sql" >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+        </sql>
+                               <!-- No longer used
+                               <sql driver="${db.jdbc.driver.class}"
+             url="${db.jdbc.cspace.url}"
+             userid="${db.cspace.user}"
+             password="${db.cspace.user.password}"
+             src="${db.script.dir}/authentication_index.sql" >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+        </sql>
+                               <sql driver="${db.jdbc.driver.class}"
+             url="${db.jdbc.cspace.url}"
+             userid="${db.cspace.user}"
+             password="${db.cspace.user.password}"
+             src="${db.script.dir}/test_authentication.sql" >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+                                       </sql> -->
+    </target>
+
+    <target name="deploy" depends="install"
+            description="deploy authentication service in ${jee.server.cspace}">
+        <copy todir="${jee.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authentication service from ${jee.server.cspace}"
+            depends="check.db.scripts.deploy.dir" if="${db.scripts.deploy.dir.exists}">
+        <delete>
+            <fileset dir="${db.scripts.deploy.dir}"
+                     includes="**authentication**.sql"/>
+        </delete>
+    </target>
+
+    <target name="dist"
+            description="generate distribution for authentication service" depends="package">
+        <!-- copy db scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+    </target>
+    
+    <target name="check.db.scripts.deploy.dir">
+        <property name="db.scripts.deploy.dir" value="${jee.server.cspace}/cspace/services/db/${db}"/>
+        <condition property="db.scripts.deploy.dir.exists">
+            <available file="${db.scripts.deploy.dir}" type="dir"/>
+        </condition>
+    </target>
+
+</project>
index ff01982a10df60937abf4bca4cac2910019c830e..899f3f447c2cc04cd0171a1f8c683cc63bd96215 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.authentication</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.authentication.pstore</artifactId>\r
-    <name>services.authentication.pstore</name>\r
-\r
-    <properties>\r
-        <sql.file>authentication.sql</sql.file>\r
-        <sql.dir>${basedir}/src/main/resources/db</sql.dir>\r
-    </properties>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-        </dependency>\r
-               <dependency>\r
-                       <groupId>postgresql</groupId>\r
-                       <artifactId>postgresql</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>cspace-services-authentication-pstore</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <artifactId>maven-antrun-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <id>subs-hibernate-config</id>\r
-                        <phase>generate-test-resources</phase>\r
-                        <goals>\r
-                            <goal>run</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <tasks>\r
-                                <property name="runtime-classpath" refid="maven.runtime.classpath"/>\r
-                                <ant target="setup_hibernate.cfg" inheritRefs="true"/>\r
-                            </tasks>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-    <profiles>\r
-        <profile>\r
-            <!-- use profile as this task is not needed for every build and test -->\r
-            <id>ddl</id>\r
-            <build>\r
-                <plugins>\r
-                                                                               <plugin>\r
-                                                                                       <groupId>org.codehaus.mojo</groupId>\r
-                                                                                       <artifactId>properties-maven-plugin</artifactId>\r
-                                                                                       <version>1.0-alpha-2</version>\r
-                                                                                       <executions>\r
-                                                                                               <execution>\r
-                                                                                                       <phase>initialize</phase>\r
-                                                                                                       <goals>\r
-                                                                                                               <goal>read-project-properties</goal>\r
-                                                                                                       </goals>\r
-                                                                                                       <configuration>\r
-                                                                                                               <files>\r
-                                                                                                                       <file>${basedir}/../../../build.properties</file>\r
-                                                                                                               </files>\r
-                                                                                                       </configuration>\r
-                                                                                               </execution>\r
-                                                                                       </executions>\r
-                                                                               </plugin>\r
-                     <plugin>\r
-                        <groupId>org.codehaus.mojo</groupId>\r
-                        <artifactId>hibernate3-maven-plugin</artifactId>\r
-                        <version>2.2</version>\r
-                        <executions>\r
-                            <execution>\r
-                                <phase>process-test-resources</phase>\r
-                                <goals>\r
-                                    <goal>hbm2ddl</goal>\r
-                                </goals>\r
-                            </execution>\r
-                        </executions>\r
-                        <configuration>\r
-                            <components>\r
-                                <component>\r
-                                    <name>hbm2ddl</name>\r
-                                </component>\r
-                            </components>\r
-                            <componentProperties>\r
-                                <outputfilename>${sql.file}</outputfilename>\r
-                                <implementation>jpaconfiguration</implementation>\r
-                                <drop>true</drop>\r
-                                <create>true</create>\r
-                                <export>true</export>\r
-                                <jdk5>true</jdk5>\r
-                                <ejb3>false</ejb3>\r
-                                <persistenceunit>org.collectionspace.services.authentication</persistenceunit>\r
-                            </componentProperties>\r
-                        </configuration>\r
-                        <dependencies>\r
-                            <dependency>\r
-                                <groupId>mysql</groupId>\r
-                                <artifactId>mysql-connector-java</artifactId>\r
-                            </dependency>\r
-                                                       <dependency>\r
-                                                               <groupId>postgresql</groupId>\r
-                                                               <artifactId>postgresql</artifactId>\r
-                                                       </dependency>\r
-                         </dependencies>\r
-                    </plugin>\r
-                    <plugin>\r
-                        <artifactId>maven-antrun-plugin</artifactId>\r
-                        <executions>\r
-                            <execution>\r
-                                <phase>process-test-resources</phase>\r
-                                <configuration>\r
-                                    <tasks>\r
-                                        <copy file="${basedir}/target/hibernate3/sql/${sql.file}" tofile="${sql.dir}/${db}/${sql.file}"/>\r
-                                    </tasks>\r
-                                </configuration>\r
-                                <goals>\r
-                                    <goal>run</goal>\r
-                                </goals>\r
-                            </execution>\r
-                        </executions>\r
-                    </plugin>\r
-\r
-                </plugins>\r
-            </build>\r
-        </profile>\r
-    </profiles>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.authentication</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.authentication.pstore</artifactId>
+    <name>services.authentication.pstore</name>
+
+    <properties>
+        <sql.file>authentication.sql</sql.file>
+        <sql.dir>${basedir}/src/main/resources/db</sql.dir>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+               <dependency>
+                       <groupId>postgresql</groupId>
+                       <artifactId>postgresql</artifactId>
+        </dependency>
+        <!-- CollectionSpace -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>cspace-services-authentication-pstore</finalName>
+        <plugins>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>subs-hibernate-config</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <property name="runtime-classpath" refid="maven.runtime.classpath"/>
+                                <ant target="setup_hibernate.cfg" inheritRefs="true"/>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <profiles>
+        <profile>
+            <!-- use profile as this task is not needed for every build and test -->
+            <id>ddl</id>
+            <build>
+                <plugins>
+                                                                               <plugin>
+                                                                                       <groupId>org.codehaus.mojo</groupId>
+                                                                                       <artifactId>properties-maven-plugin</artifactId>
+                                                                                       <version>1.0-alpha-2</version>
+                                                                                       <executions>
+                                                                                               <execution>
+                                                                                                       <phase>initialize</phase>
+                                                                                                       <goals>
+                                                                                                               <goal>read-project-properties</goal>
+                                                                                                       </goals>
+                                                                                                       <configuration>
+                                                                                                               <files>
+                                                                                                                       <file>${basedir}/../../../build.properties</file>
+                                                                                                               </files>
+                                                                                                       </configuration>
+                                                                                               </execution>
+                                                                                       </executions>
+                                                                               </plugin>
+                     <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>hibernate3-maven-plugin</artifactId>
+                        <version>2.2</version>
+                        <executions>
+                            <execution>
+                                <phase>process-test-resources</phase>
+                                <goals>
+                                    <goal>hbm2ddl</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <components>
+                                <component>
+                                    <name>hbm2ddl</name>
+                                </component>
+                            </components>
+                            <componentProperties>
+                                <outputfilename>${sql.file}</outputfilename>
+                                <implementation>jpaconfiguration</implementation>
+                                <drop>true</drop>
+                                <create>true</create>
+                                <export>true</export>
+                                <jdk5>true</jdk5>
+                                <ejb3>false</ejb3>
+                                <persistenceunit>org.collectionspace.services.authentication</persistenceunit>
+                            </componentProperties>
+                        </configuration>
+                        <dependencies>
+                            <dependency>
+                                <groupId>mysql</groupId>
+                                <artifactId>mysql-connector-java</artifactId>
+                            </dependency>
+                                                       <dependency>
+                                                               <groupId>postgresql</groupId>
+                                                               <artifactId>postgresql</artifactId>
+                                                       </dependency>
+                         </dependencies>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>process-test-resources</phase>
+                                <configuration>
+                                    <tasks>
+                                        <copy file="${basedir}/target/hibernate3/sql/${sql.file}" tofile="${sql.dir}/${db}/${sql.file}"/>
+                                    </tasks>
+                                </configuration>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
+
index 4967d1a78ebc88dce239ea614445ecf15cc344eb..a543133d9871340db29baeb65a22d58cb0b2a8c2 100644 (file)
@@ -1,11 +1,11 @@
-The file authentication.sql is basically generated by the gen_ddl ant target.\r
-\r
-However, you must modify the result of that to make the \r
-\r
-  DROP TABLE \r
-\r
-statements be \r
-  \r
-  DROP TABLE IF EXISTS table \r
-\r
-This ensures that first time setup does not fail.\r
+The file authentication.sql is basically generated by the gen_ddl ant target.
+
+However, you must modify the result of that to make the 
+
+  DROP TABLE 
+
+statements be 
+  
+  DROP TABLE IF EXISTS table 
+
+This ensures that first time setup does not fail.
index 621abf13ad62eda24c5cb51e3c2ce0a55b9c6125..eba054e645a466ab8f978a5778f7b81554cee57e 100644 (file)
-\r
-<project name="authentication.service" default="package" basedir=".">\r
-    <description>\r
-        collectionspace authentication service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="authentication.jar" value="cspace-services-authn.jar"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy authentication service in ${jee.server.cspace}">\r
-        <copy file="${basedir}/target/${authentication.jar}" todir="${jee.server.cspace}/lib"/>\r
-        <!-- This is JBoss specific and no longer needed\r
-               <copy tofile="${jee.server.cspace}/conf/login-config.xml.org"\r
-              file="${jee.server.cspace}/conf/login-config.xml"\r
-              overwrite="false"/> -->\r
-        <!-- This is JBoss specific and no longer needed\r
-        <copy tofile="${jee.server.cspace}/conf/login-config.xml"\r
-              file="${src}/main/resources/config/login-config.xml"\r
-              overwrite="true"/> -->\r
-        <copy todir="${jee.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-        <echo message="Check out Authentication Service Configuration Guide on wiki.collectionspace.org for more details" />\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authentication service from ${jee.server.cspace}">\r
-        <delete file="${jee.server.cspace}/lib/${authentication.jar}"/>\r
-               <!-- This is JBoss specific and no longer needed\r
-        <copy tofile="${jee.server.cspace}/conf/login-config.xml"\r
-              file="${jee.server.cspace}/conf/login-config.xml.org"\r
-              overwrite="true" failonerror="false" /> -->\r
-        <echo message="Check out Authentication Service Configuration Guide on wiki.collectionspace.org for more details"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-            description="generate distribution for authentication service" depends="package">\r
-        <copy todir="${services.trunk}/${dist.lib.cspace}">\r
-            <fileset file="${basedir}/target/${authentication.jar}"/>\r
-        </copy>\r
-        <!-- copy db scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="authentication.service" default="package" basedir=".">
+    <description>
+        collectionspace authentication service
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="authentication.jar" value="cspace-services-authn.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/>
+    </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 authentication service in ${jee.server.cspace}">
+        <copy file="${basedir}/target/${authentication.jar}" todir="${jee.server.cspace}/lib"/>
+        <!-- This is JBoss specific and no longer needed
+               <copy tofile="${jee.server.cspace}/conf/login-config.xml.org"
+              file="${jee.server.cspace}/conf/login-config.xml"
+              overwrite="false"/> -->
+        <!-- This is JBoss specific and no longer needed
+        <copy tofile="${jee.server.cspace}/conf/login-config.xml"
+              file="${src}/main/resources/config/login-config.xml"
+              overwrite="true"/> -->
+        <copy todir="${jee.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+        <echo message="Check out Authentication Service Configuration Guide on wiki.collectionspace.org for more details" />
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authentication service from ${jee.server.cspace}">
+        <delete file="${jee.server.cspace}/lib/${authentication.jar}"/>
+               <!-- This is JBoss specific and no longer needed
+        <copy tofile="${jee.server.cspace}/conf/login-config.xml"
+              file="${jee.server.cspace}/conf/login-config.xml.org"
+              overwrite="true" failonerror="false" /> -->
+        <echo message="Check out Authentication Service Configuration Guide on wiki.collectionspace.org for more details"/>
+    </target>
+
+    <target name="dist"
+            description="generate distribution for authentication service" depends="package">
+        <copy todir="${services.trunk}/${dist.lib.cspace}">
+            <fileset file="${basedir}/target/${authentication.jar}"/>
+        </copy>
+        <!-- copy db scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+    </target>
+
+</project>
index bc585755b1edcf185aae29d4eb461a8237e80fdf..b5b22930b00bc9ce2e2e95018144720efe2fcdf0 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.authentication.jaas;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Collection;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.security.acl.Group;\r
-\r
-import javax.security.auth.Subject;\r
-import javax.security.auth.callback.CallbackHandler;\r
-import javax.security.auth.login.LoginException;\r
-\r
-import org.collectionspace.authentication.realm.db.CSpaceDbRealm;\r
-import org.jboss.security.auth.spi.UsernamePasswordLoginModule;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * CollectionSpace default identity provider supporting multi-tenancy\r
- * @author\r
- */\r
-public class CSpaceJBossDBLoginModule extends UsernamePasswordLoginModule {\r
-\r
-    private Logger logger = LoggerFactory.getLogger(CSpaceJBossDBLoginModule.class);\r
-\r
-    private CSpaceDbRealm realm;\r
-\r
-    /**\r
-     * Initialize CSpaceDBLoginModule\r
-     *\r
-     * @param options -\r
-     * dsJndiName: The name of the DataSource of the database containing the\r
-     *    Principals, Roles tables\r
-     * principalsQuery: The prepared statement query, equivalent to:\r
-     *    "select Password from Principals where PrincipalID=?"\r
-     * rolesQuery: The prepared statement query, equivalent to:\r
-     *    "select Role, RoleGroup from Roles where PrincipalID=?"\r
-     * tenantsQuery:\r
-     * "select TenantId, TenantName, TenantGroup from Tenants where PrincipalID=?"\r
-     */\r
-    public void initialize(Subject subject, CallbackHandler callbackHandler,\r
-            Map sharedState, Map options) {\r
-        super.initialize(subject, callbackHandler, sharedState, options);\r
-        realm = new CSpaceDbRealm(options);\r
-    }\r
-\r
-    @Override\r
-    protected String createPasswordHash(String username, String password,\r
-            String digestOption)\r
-            throws LoginException {\r
-       String result = super.createPasswordHash(username, password, digestOption);\r
-       \r
-       if (result == null) {\r
-               String message = "Could not create a password hash for the supplied password.  Check your login.conf configuration's hash algorithm setting.";\r
-               log.error(message);\r
-               throw new LoginException(message);\r
-       }\r
-       \r
-       return result;\r
-    }\r
-    \r
-    protected String getUsersPassword() throws LoginException {\r
-\r
-        String username = getUsername();\r
-        String password = null;\r
-        \r
-        try {\r
-            password = realm.getUsersPassword(username);\r
-            password = convertRawPassword(password);\r
-            if (logger.isDebugEnabled()) {\r
-               logger.debug("Obtained user password for: " + username);\r
-            }\r
-        } catch (LoginException lex) {\r
-               log.error("Could not retrieve user password for: " + username, lex);\r
-            throw lex;\r
-        } catch (Exception ex) {\r
-               log.error("Could not retrieve user password for: " + username, ex);\r
-            LoginException le = new LoginException("Unknown Exception");\r
-            le.initCause(ex);\r
-            throw le;\r
-        }\r
-        \r
-        return password;\r
-    }\r
-    \r
-    @Override\r
-    public boolean commit() throws LoginException {\r
-       boolean result;\r
-       result = super.commit();\r
-       return result;\r
-    }\r
-    \r
-    @Override\r
-    public boolean abort() throws LoginException {\r
-       boolean result;\r
-       result = super.abort();\r
-       return result;\r
-    }\r
-\r
-    /** Execute the rolesQuery against the dsJndiName to obtain the roles for\r
-    the authenticated user.\r
-\r
-    @return Group[] containing the sets of roles\r
-     */\r
-    protected Group[] getRoleSets() throws LoginException {\r
-        String username = getUsername();\r
-\r
-        Collection<Group> roles = realm.getRoles(username,\r
-                "org.collectionspace.authentication.CSpacePrincipal",\r
-                "org.jboss.security.SimpleGroup");\r
-\r
-        Collection<Group> tenants = realm.getTenants(username,\r
-                "org.jboss.security.SimpleGroup");\r
-\r
-        List<Group> all = new ArrayList<Group>();\r
-        all.addAll(roles);\r
-        all.addAll(tenants);\r
-        Group[] roleSets = new Group[all.size()];\r
-        all.toArray(roleSets);\r
-        return roleSets;\r
-    }\r
-\r
-    /** A hook to allow subclasses to convert a password from the database\r
-    into a plain text string or whatever form is used for matching against\r
-    the user input. It is called from within the getUsersPassword() method.\r
-    @param rawPassword - the password as obtained from the database\r
-    @return the argument rawPassword\r
-     */\r
-    protected String convertRawPassword(String rawPassword) {\r
-        return rawPassword;\r
-    }\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.authentication.jaas;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.security.acl.Group;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginException;
+
+import org.collectionspace.authentication.realm.db.CSpaceDbRealm;
+import org.jboss.security.auth.spi.UsernamePasswordLoginModule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * CollectionSpace default identity provider supporting multi-tenancy
+ * @author
+ */
+public class CSpaceJBossDBLoginModule extends UsernamePasswordLoginModule {
+
+    private Logger logger = LoggerFactory.getLogger(CSpaceJBossDBLoginModule.class);
+
+    private CSpaceDbRealm realm;
+
+    /**
+     * Initialize CSpaceDBLoginModule
+     *
+     * @param options -
+     * dsJndiName: The name of the DataSource of the database containing the
+     *    Principals, Roles tables
+     * principalsQuery: The prepared statement query, equivalent to:
+     *    "select Password from Principals where PrincipalID=?"
+     * rolesQuery: The prepared statement query, equivalent to:
+     *    "select Role, RoleGroup from Roles where PrincipalID=?"
+     * tenantsQuery:
+     * "select TenantId, TenantName, TenantGroup from Tenants where PrincipalID=?"
+     */
+    public void initialize(Subject subject, CallbackHandler callbackHandler,
+            Map sharedState, Map options) {
+        super.initialize(subject, callbackHandler, sharedState, options);
+        realm = new CSpaceDbRealm(options);
+    }
+
+    @Override
+    protected String createPasswordHash(String username, String password,
+            String digestOption)
+            throws LoginException {
+       String result = super.createPasswordHash(username, password, digestOption);
+       
+       if (result == null) {
+               String message = "Could not create a password hash for the supplied password.  Check your login.conf configuration's hash algorithm setting.";
+               log.error(message);
+               throw new LoginException(message);
+       }
+       
+       return result;
+    }
+    
+    protected String getUsersPassword() throws LoginException {
+
+        String username = getUsername();
+        String password = null;
+        
+        try {
+            password = realm.getUsersPassword(username);
+            password = convertRawPassword(password);
+            if (logger.isDebugEnabled()) {
+               logger.debug("Obtained user password for: " + username);
+            }
+        } catch (LoginException lex) {
+               log.error("Could not retrieve user password for: " + username, lex);
+            throw lex;
+        } catch (Exception ex) {
+               log.error("Could not retrieve user password for: " + username, ex);
+            LoginException le = new LoginException("Unknown Exception");
+            le.initCause(ex);
+            throw le;
+        }
+        
+        return password;
+    }
+    
+    @Override
+    public boolean commit() throws LoginException {
+       boolean result;
+       result = super.commit();
+       return result;
+    }
+    
+    @Override
+    public boolean abort() throws LoginException {
+       boolean result;
+       result = super.abort();
+       return result;
+    }
+
+    /** Execute the rolesQuery against the dsJndiName to obtain the roles for
+    the authenticated user.
+
+    @return Group[] containing the sets of roles
+     */
+    protected Group[] getRoleSets() throws LoginException {
+        String username = getUsername();
+
+        Collection<Group> roles = realm.getRoles(username,
+                "org.collectionspace.authentication.CSpacePrincipal",
+                "org.jboss.security.SimpleGroup");
+
+        Collection<Group> tenants = realm.getTenants(username,
+                "org.jboss.security.SimpleGroup");
+
+        List<Group> all = new ArrayList<Group>();
+        all.addAll(roles);
+        all.addAll(tenants);
+        Group[] roleSets = new Group[all.size()];
+        all.toArray(roleSets);
+        return roleSets;
+    }
+
+    /** A hook to allow subclasses to convert a password from the database
+    into a plain text string or whatever form is used for matching against
+    the user input. It is called from within the getUsersPassword() method.
+    @param rawPassword - the password as obtained from the database
+    @return the argument rawPassword
+     */
+    protected String convertRawPassword(String rawPassword) {
+        return rawPassword;
+    }
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index d5290c7d5b1e04f0d57c1d861e826b72296a5d44..9dc3e098e8dea1192e5ec7286c77bd5ce2547ece 100644 (file)
-<project name="common" default="package" basedir=".">\r
-    <description>\r
-        CollectionSpace Authority services common code\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-\r
-    </condition>\r
-\r
-    <target name="init" >\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy common elements in ${jee.server.cspace}">      \r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy common elements from ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="dist"\r
-            description="generate distribution for common elements" depends="package">\r
-    </target>\r
-\r
-</project>\r
+<project name="common" default="package" basedir=".">
+    <description>
+        CollectionSpace Authority services common code
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+
+    </condition>
+
+    <target name="init" >
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </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 common elements in ${jee.server.cspace}">      
+    </target>
+
+    <target name="undeploy"
+            description="undeploy common elements from ${jee.server.cspace}">
+    </target>
+
+    <target name="dist"
+            description="generate distribution for common elements" depends="package">
+    </target>
+
+</project>
index e48c29eac0023de95a67c6e9d4002a11604eea60..2bb0252c10e3b418f7696b861c9f84af2e548e87 100644 (file)
@@ -1,48 +1,48 @@
-/**\r
- * This document is a part of the source code and related artifacts for\r
- * CollectionSpace, an open source collections management system for museums and\r
- * related institutions:\r
- *\r
- * http://www.collectionspace.org http://wiki.collectionspace.org\r
- *\r
- * Copyright 2009 University of California at Berkeley\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0. You may\r
- * not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- *\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-package org.collectionspace.services.common.vocabulary;\r
-\r
-/**\r
- * @author pschmitz\r
- *\r
- */\r
-public interface AuthorityItemJAXBSchema {\r
-\r
-    final static String IN_AUTHORITY = "inAuthority"; // REM - Is this a CSID? Or a refname? Either?\r
-    final static String REF_NAME = "refName";\r
-    final static String ORDER = "order";\r
-    final static String SHORT_IDENTIFIER = "shortIdentifier";\r
-    final static String CSID = "csid";\r
-    final static String DISPLAY_NAME = "displayName"; // This is the display name element for the Vocabulary service's item    \r
-    final static String TERM_DISPLAY_NAME = "termDisplayName"; // This is the display name element for all Authority services' items\r
-    final static String TERM_NAME = "termName";\r
-    final static String TERM_STATUS = "termStatus";\r
-    final static String TERM_INFO_GROUP_SCHEMA_NAME = ""; // FIXME: REM - Needs\r
-    // to be defined.\r
-    // CSPACE-4813 - Remove all the below values and recompile all authorityitem\r
-    // related classes\r
-    final static String DISPLAY_NAME_COMPUTED = "displayNameComputed";\r
-    final static String SHORT_DISPLAY_NAME = "shortDisplayName";\r
-    final static String SHORT_DISPLAY_NAME_COMPUTED = "shortDisplayNameComputed";\r
-    // final static String TERM_STATUS = "termStatus";\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright 2009 University of California at Berkeley
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.collectionspace.services.common.vocabulary;
+
+/**
+ * @author pschmitz
+ *
+ */
+public interface AuthorityItemJAXBSchema {
+
+    final static String IN_AUTHORITY = "inAuthority"; // REM - Is this a CSID? Or a refname? Either?
+    final static String REF_NAME = "refName";
+    final static String ORDER = "order";
+    final static String SHORT_IDENTIFIER = "shortIdentifier";
+    final static String CSID = "csid";
+    final static String DISPLAY_NAME = "displayName"; // This is the display name element for the Vocabulary service's item    
+    final static String TERM_DISPLAY_NAME = "termDisplayName"; // This is the display name element for all Authority services' items
+    final static String TERM_NAME = "termName";
+    final static String TERM_STATUS = "termStatus";
+    final static String TERM_INFO_GROUP_SCHEMA_NAME = ""; // FIXME: REM - Needs
+    // to be defined.
+    // CSPACE-4813 - Remove all the below values and recompile all authorityitem
+    // related classes
+    final static String DISPLAY_NAME_COMPUTED = "displayNameComputed";
+    final static String SHORT_DISPLAY_NAME = "shortDisplayName";
+    final static String SHORT_DISPLAY_NAME_COMPUTED = "shortDisplayNameComputed";
+    // final static String TERM_STATUS = "termStatus";
+}
index b5d2f0d81e3e27d4d5cbd5cdf396b4379d3a07c1..6814288f6f05852a744be0c2223b8a1d6e2026c5 100644 (file)
@@ -1,33 +1,33 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common.vocabulary;\r
-\r
-public interface AuthorityItemListItemJAXBSchema {\r
-       final static String DISPLAY_NAME = "displayName";\r
-       final static String SHORT_DISPLAY_NAME = "shortDisplayName";\r
-       final static String REF_NAME = "refName";\r
-       final static String SHORT_IDENTIFIER = "shortIdentifier";\r
-       final static String CSID = "csid";\r
-       final static String URI = "url";\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common.vocabulary;
+
+public interface AuthorityItemListItemJAXBSchema {
+       final static String DISPLAY_NAME = "displayName";
+       final static String SHORT_DISPLAY_NAME = "shortDisplayName";
+       final static String REF_NAME = "refName";
+       final static String SHORT_IDENTIFIER = "shortIdentifier";
+       final static String CSID = "csid";
+       final static String URI = "url";
+}
index 456ea65e03467e299fd63e97f529dafc4d71ae63..adecfe1ec1e8a8b0f52ec3fb06ac0ffdcb59e204 100644 (file)
@@ -1,38 +1,38 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common.vocabulary;\r
-\r
-/**\r
- * @author pschmitz\r
- *\r
- */\r
-public interface AuthorityJAXBSchema {\r
-       final static String DISPLAY_NAME = "displayName";\r
-       final static String SHORT_IDENTIFIER = "shortIdentifier";\r
-       final static String REF_NAME = "refName";\r
-       final static String VOCAB_TYPE = "vocabType";\r
-       final static String CSID = "csid";\r
-}\r
-\r
-\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common.vocabulary;
+
+/**
+ * @author pschmitz
+ *
+ */
+public interface AuthorityJAXBSchema {
+       final static String DISPLAY_NAME = "displayName";
+       final static String SHORT_IDENTIFIER = "shortIdentifier";
+       final static String REF_NAME = "refName";
+       final static String VOCAB_TYPE = "vocabType";
+       final static String CSID = "csid";
+}
+
+
index b02c59a34f5eb1a20d521de6996aad41f985d6a9..2cd5ae704ba51e9b90351f902cdfa1b85774e490 100644 (file)
@@ -1,33 +1,33 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common.vocabulary;\r
-\r
-public interface AuthorityListItemJAXBSchema {\r
-       final static String DISPLAY_NAME = "displayName";\r
-       final static String REF_NAME = "refName";\r
-       final static String SHORT_IDENTIFIER = "shortIdentifier";\r
-       final static String VOCAB_TYPE = "vocabType";\r
-       final static String CSID = "csid";\r
-       final static String URI = "url";\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common.vocabulary;
+
+public interface AuthorityListItemJAXBSchema {
+       final static String DISPLAY_NAME = "displayName";
+       final static String REF_NAME = "refName";
+       final static String SHORT_IDENTIFIER = "shortIdentifier";
+       final static String VOCAB_TYPE = "vocabType";
+       final static String CSID = "csid";
+       final static String URI = "url";
+}
index 06fc4fb536d4240e2710a49755b004324ae1fa46..382184e7f590a5342ec522de70e1634f4a8247b0 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0" \r
-                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \r
-                       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.authority</artifactId>\r
-    <name>services.authority</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <dependencies>\r
-        <!-- CollectionSpace dependencies\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common-api</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-                -->\r
-\r
-\r
-        <!-- Utilities -->\r
-\r
-               <!--\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-               -->\r
-        <dependency>\r
-            <groupId>log4j</groupId>\r
-            <artifactId>log4j</artifactId>\r
-            <version>1.2.14</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.apache.commons</groupId>\r
-            <artifactId>commons-jexl</artifactId>\r
-            <version>2.0.1</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>commons-codec</groupId>\r
-                       <artifactId>commons-codec</artifactId>\r
-                       <version>1.4</version>\r
-        </dependency>\r
-\r
-        <!-- javax -->\r
-        <dependency>\r
-            <groupId>javax.servlet</groupId>\r
-            <artifactId>servlet-api</artifactId>\r
-            <version>2.5</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jacc</artifactId>\r
-            <version>1.0</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!--\r
-            <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        -->\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-        </dependency>\r
-                               <dependency>\r
-                                               <groupId>postgresql</groupId>\r
-                                               <artifactId>postgresql</artifactId>\r
-                               </dependency>\r
-         <dependency>\r
-            <groupId>javax.persistence</groupId>\r
-            <artifactId>persistence-api</artifactId>\r
-        </dependency>\r
-\r
-        <!-- jboss -->\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>jaxrs-api</artifactId>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>org.hibernate</groupId>\r
-            <artifactId>hibernate-entitymanager</artifactId>\r
-        </dependency>\r
-        <!-- jboss -->\r
-        <dependency>\r
-            <groupId>jboss</groupId>\r
-            <artifactId>jbosssx</artifactId>\r
-            <version>4.2.3.GA</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>jboss</groupId>\r
-            <artifactId>jboss-remoting</artifactId>\r
-            <version>2.2.2.SP8</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!-- nuxeo -->\r
-<!-- \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-mimetype-api</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-imaging-api</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>\r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-filemanager-api</artifactId>\r
-                 <version>${nuxeo.platform.version}</version>        \r
-           </dependency>\r
--->        \r
-               <!--\r
-        <dependency>\r
-            <groupId>org.nuxeo.common</groupId>\r
-            <artifactId>nuxeo-common</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-client</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-query</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-schema</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-io</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-io</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime-osgi</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.osgi</groupId>\r
-            <artifactId>org.osgi.core</artifactId>\r
-            <version>4.1.0</version>\r
-        </dependency>\r
-               -->\r
-    </dependencies>\r
-    \r
-       <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-    </modules>\r
-       \r
-       </project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.authority</artifactId>
+    <name>services.authority</name>
+    <packaging>pom</packaging>
+
+    <dependencies>
+        <!-- CollectionSpace dependencies
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+                -->
+
+
+        <!-- Utilities -->
+
+               <!--
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+               -->
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.14</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-jexl</artifactId>
+            <version>2.0.1</version>
+        </dependency>
+        <dependency>
+                       <groupId>commons-codec</groupId>
+                       <artifactId>commons-codec</artifactId>
+                       <version>1.4</version>
+        </dependency>
+
+        <!-- javax -->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jacc</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--
+            <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+                               <dependency>
+                                               <groupId>postgresql</groupId>
+                                               <artifactId>postgresql</artifactId>
+                               </dependency>
+         <dependency>
+            <groupId>javax.persistence</groupId>
+            <artifactId>persistence-api</artifactId>
+        </dependency>
+
+        <!-- jboss -->
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>jaxrs-api</artifactId>
+        </dependency>        
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-entitymanager</artifactId>
+        </dependency>
+        <!-- jboss -->
+        <dependency>
+            <groupId>jboss</groupId>
+            <artifactId>jbosssx</artifactId>
+            <version>4.2.3.GA</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jboss</groupId>
+            <artifactId>jboss-remoting</artifactId>
+            <version>2.2.2.SP8</version>
+            <scope>provided</scope>
+        </dependency>
+        <!-- nuxeo -->
+<!-- 
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-mimetype-api</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>        
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-imaging-api</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-filemanager-api</artifactId>
+                 <version>${nuxeo.platform.version}</version>        
+           </dependency>
+-->        
+               <!--
+        <dependency>
+            <groupId>org.nuxeo.common</groupId>
+            <artifactId>nuxeo-common</artifactId>
+            <version>${nuxeo.core.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.runtime</groupId>
+            <artifactId>nuxeo-runtime</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-client</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-query</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-schema</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-io</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-io</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.runtime</groupId>
+            <artifactId>nuxeo-runtime-osgi</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+               -->
+    </dependencies>
+    
+       <modules>
+        <module>jaxb</module>
+        <module>service</module>
+    </modules>
+       
+       </project>
+
index 03deed877d206cba54aa25284d3897350c928596..7435ca575352af36f900f19c4ea765f013a96a6f 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0" \r
-                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \r
-                       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.authority</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.authority.service</artifactId>\r
-    <name>services.authority.service</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <dependencies>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.config</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common-api</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-\r
-\r
-        <!-- Utilities -->\r
-\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>log4j</groupId>\r
-            <artifactId>log4j</artifactId>\r
-            <version>1.2.14</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.apache.commons</groupId>\r
-            <artifactId>commons-jexl</artifactId>\r
-            <version>2.0.1</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>commons-codec</groupId>\r
-                       <artifactId>commons-codec</artifactId>\r
-                       <version>1.4</version>\r
-        </dependency>\r
-\r
-        <!-- javax -->\r
-        <dependency>\r
-            <groupId>javax.servlet</groupId>\r
-            <artifactId>servlet-api</artifactId>\r
-            <version>2.5</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jacc</artifactId>\r
-            <version>1.0</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!--\r
-            <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        -->\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-        </dependency>\r
-                               <dependency>\r
-                                               <groupId>postgresql</groupId>\r
-                                               <artifactId>postgresql</artifactId>\r
-                               </dependency>\r
-         <dependency>\r
-            <groupId>javax.persistence</groupId>\r
-            <artifactId>persistence-api</artifactId>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>com.sun.xml.bind</groupId>\r
-            <artifactId>jaxb-impl</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jvnet.jaxb2-commons</groupId>\r
-            <artifactId>property-listener-injector</artifactId>\r
-        </dependency>\r
-               <!--\r
-        <dependency>\r
-            <groupId>org.jvnet.jaxb2_commons</groupId>\r
-            <artifactId>runtime</artifactId>\r
-        </dependency>\r
-               -->\r
-\r
-        <!-- jboss -->\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>jaxrs-api</artifactId>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>org.hibernate</groupId>\r
-            <artifactId>hibernate-entitymanager</artifactId>\r
-        </dependency>\r
-        <!-- jboss -->\r
-        <dependency>\r
-            <groupId>jboss</groupId>\r
-            <artifactId>jbosssx</artifactId>\r
-            <version>4.2.3.GA</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>jboss</groupId>\r
-            <artifactId>jboss-remoting</artifactId>\r
-            <version>2.2.2.SP8</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!-- nuxeo -->\r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-mimetype-api</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-imaging-core</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-imaging-api</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>\r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-filemanager-api</artifactId>\r
-                 <version>${nuxeo.platform.version}</version>        \r
-           </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.common</groupId>\r
-            <artifactId>nuxeo-common</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-client</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-query</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-schema</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-storage-sql</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-io</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-               <!--\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-facade</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-               -->\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-io</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime-osgi</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.osgi</groupId>\r
-            <artifactId>org.osgi.core</artifactId>\r
-            <version>4.1.0</version>\r
-        </dependency>\r
-    </dependencies>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.authority</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.authority.service</artifactId>
+    <name>services.authority.service</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.config</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+
+        <!-- Utilities -->
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.14</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-jexl</artifactId>
+            <version>2.0.1</version>
+        </dependency>
+        <dependency>
+                       <groupId>commons-codec</groupId>
+                       <artifactId>commons-codec</artifactId>
+                       <version>1.4</version>
+        </dependency>
+
+        <!-- javax -->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jacc</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--
+            <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+                               <dependency>
+                                               <groupId>postgresql</groupId>
+                                               <artifactId>postgresql</artifactId>
+                               </dependency>
+         <dependency>
+            <groupId>javax.persistence</groupId>
+            <artifactId>persistence-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jvnet.jaxb2-commons</groupId>
+            <artifactId>property-listener-injector</artifactId>
+        </dependency>
+               <!--
+        <dependency>
+            <groupId>org.jvnet.jaxb2_commons</groupId>
+            <artifactId>runtime</artifactId>
+        </dependency>
+               -->
+
+        <!-- jboss -->
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>jaxrs-api</artifactId>
+        </dependency>        
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-entitymanager</artifactId>
+        </dependency>
+        <!-- jboss -->
+        <dependency>
+            <groupId>jboss</groupId>
+            <artifactId>jbosssx</artifactId>
+            <version>4.2.3.GA</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jboss</groupId>
+            <artifactId>jboss-remoting</artifactId>
+            <version>2.2.2.SP8</version>
+            <scope>provided</scope>
+        </dependency>
+        <!-- nuxeo -->
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-mimetype-api</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>        
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-imaging-core</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>        
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-imaging-api</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-filemanager-api</artifactId>
+                 <version>${nuxeo.platform.version}</version>        
+           </dependency>
+        <dependency>
+            <groupId>org.nuxeo.common</groupId>
+            <artifactId>nuxeo-common</artifactId>
+            <version>${nuxeo.core.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.runtime</groupId>
+            <artifactId>nuxeo-runtime</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-client</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-query</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-schema</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-storage-sql</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-io</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+               <!--
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-facade</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+               -->
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-io</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.runtime</groupId>
+            <artifactId>nuxeo-runtime-osgi</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+    </dependencies>
+</project>
+
index c39206bba34650feb24b5f42b13d18345b0b8a79..ad272c82a41424de7ab53ab438362c3827c7dabf 100644 (file)
@@ -1,7 +1,7 @@
-package org.collectionspace.services.common.vocabulary;\r
-\r
-public interface IVocabManager {\r
-       \r
-       public void exampleMethod(String someParam);\r
-\r
-}\r
+package org.collectionspace.services.common.vocabulary;
+
+public interface IVocabManager {
+       
+       public void exampleMethod(String someParam);
+
+}
index 849599071a65d8d426f203a084d8540877d141a0..27d1cfdad14335c7de6ff06d38299b4be708b7b3 100644 (file)
@@ -1,9 +1,9 @@
-package org.collectionspace.services.common.vocabulary;\r
-\r
-public class VocabManager {\r
-       static private final IVocabManager vocabManager = new VocabManagerImpl();\r
-       \r
-       static public void exampleMethod(String someParam) {\r
-               vocabManager.exampleMethod(someParam);\r
-       }\r
-}\r
+package org.collectionspace.services.common.vocabulary;
+
+public class VocabManager {
+       static private final IVocabManager vocabManager = new VocabManagerImpl();
+       
+       static public void exampleMethod(String someParam) {
+               vocabManager.exampleMethod(someParam);
+       }
+}
index 3fbac6ae1af79d1e303b10bc8ca643d039a3f13e..655eb125ebdd6f246f5f912f2b0e659676141641 100644 (file)
@@ -1,22 +1,22 @@
-package org.collectionspace.services.common.vocabulary;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import org.nuxeo.ecm.core.api.DocumentModelList;\r
-import org.nuxeo.ecm.core.api.repository.RepositoryInstance;\r
-import org.nuxeo.ecm.core.client.NuxeoClient;\r
-\r
-//import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;\r
-import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;\r
-//import org.collectionspace.services.common.query.IQueryManager;\r
-\r
-public class VocabManagerImpl implements IVocabManager {\r
-       \r
-       private final Logger logger = LoggerFactory\r
-                       .getLogger(VocabManagerImpl.class);\r
-       \r
-       public void exampleMethod(String someParam) {\r
-       }\r
-}\r
+package org.collectionspace.services.common.vocabulary;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.nuxeo.ecm.core.api.DocumentModel;
+import org.nuxeo.ecm.core.api.DocumentModelList;
+import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
+import org.nuxeo.ecm.core.client.NuxeoClient;
+
+//import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;
+import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;
+//import org.collectionspace.services.common.query.IQueryManager;
+
+public class VocabManagerImpl implements IVocabManager {
+       
+       private final Logger logger = LoggerFactory
+                       .getLogger(VocabManagerImpl.class);
+       
+       public void exampleMethod(String someParam) {
+       }
+}
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index a8ee8d8805bd0b7a1c77d3491cfaa68b19bae2f6..32a8c1d9e8cc40648a873863d827c9af10f57a19 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.authorization-mgt</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.authorization-mgt</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 507dccee2b74401b26e0b97b7ca929f14e4503e3..c26169646aaca791ea71d2cbdf3b553e6d15b847 100644 (file)
-\r
-<project name="authorization-mgt" default="package" basedir=".">\r
-    <description>\r
-        authorization service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="gen_ddl"\r
-            description="generate service-specific tables(s), indices, etc.">\r
-    </target>\r
-\r
-    <target name="create_cspace_db"\r
-            description="create tables(s), indices for authorization service">\r
-    </target>\r
-\r
-    <target name="import"\r
-            description="import default authorizations">\r
-        <ant antfile="import/build.xml" target="import" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy authorization service">\r
-        <ant antfile="service/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authorization service">\r
-        <ant antfile="service/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-            description="distribute authorization service}">\r
-        <ant antfile="service/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="authorization-mgt" default="package" basedir=".">
+    <description>
+        authorization service
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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="gen_ddl"
+            description="generate service-specific tables(s), indices, etc.">
+    </target>
+
+    <target name="create_cspace_db"
+            description="create tables(s), indices for authorization service">
+    </target>
+
+    <target name="import"
+            description="import default authorizations">
+        <ant antfile="import/build.xml" target="import" inheritAll="false"/>
+    </target>
+
+    <target name="deploy" depends="install"
+            description="deploy authorization service">
+        <ant antfile="service/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authorization service">
+        <ant antfile="service/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+            description="distribute authorization service}">
+        <ant antfile="service/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index e0d3efcf5dd8f11ebd93a1c343858484cc422657..976f4ed01a6f1ad60161d0548c4b4c80cec0eb5a 100644 (file)
-\r
-<project name="authorization-mgt.client" default="package" basedir=".">\r
-    <description>\r
-        collectionspace authorization-mgt client\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy authorization-mgt service in ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authorization-mgt service from ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="dist"\r
-            description="generate distribution for authorization-mgt service" depends="package">\r
-    </target>\r
-\r
-</project>\r
+
+<project name="authorization-mgt.client" default="package" basedir=".">
+    <description>
+        collectionspace authorization-mgt client
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init">
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </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 authorization-mgt service in ${jee.server.cspace}">
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authorization-mgt service from ${jee.server.cspace}">
+    </target>
+
+    <target name="dist"
+            description="generate distribution for authorization-mgt service" depends="package">
+    </target>
+
+</project>
index 3e9d1ff5fbaf76b1551ced950f35d1dd66d4c024..423f228766bd162b3cc4efedec8524e9d90af573 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.authorization-mgt</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>\r
-    <name>services.authorization-mgt.client</name>\r
-    <properties>\r
-        <spring.version>3.0.0.RELEASE</spring.version>\r
-        <spring.security.version>3.0.2.RELEASE</spring.security.version>\r
-    </properties>\r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-\r
-        <!-- Needed if/when client test framework files are moved into -->\r
-        <!-- /services/client/src/test from /services/client/src/main -->\r
-\r
-        <!-- <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>test</scope>\r
-            <type>test-jar</type>\r
-        </dependency> -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-core</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-config</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-acl</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-web</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-context</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-context-support</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-aop</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>aopalliance</groupId>\r
-            <artifactId>aopalliance</artifactId>\r
-            <version>1.0</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!--dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-tx</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency-->\r
-        <dependency>\r
-            <groupId>net.sf.ehcache</groupId>\r
-            <artifactId>ehcache</artifactId>\r
-            <version>1.6.2</version>\r
-            <optional>true</optional>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>postgresql</groupId>\r
-            <artifactId>postgresql</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>cspace-services-authorization-mgt-client</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-surefire-plugin</artifactId>\r
-                <configuration>\r
-                    <systemProperties>\r
-                        <property>\r
-                            <name>maven.basedir</name>\r
-                            <value>${basedir}</value>\r
-                        </property>\r
-                        <property>\r
-                            <name>log4j.configuration</name>\r
-                            <value>file:${project.build.directory}/test-classes/log4j.properties</value>\r
-                        </property>\r
-                    </systemProperties>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.authorization-mgt</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>
+    <name>services.authorization-mgt.client</name>
+    <properties>
+        <spring.version>3.0.0.RELEASE</spring.version>
+        <spring.security.version>3.0.2.RELEASE</spring.security.version>
+    </properties>
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- Needed if/when client test framework files are moved into -->
+        <!-- /services/client/src/test from /services/client/src/main -->
+
+        <!-- <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+            <type>test-jar</type>
+        </dependency> -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-config</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-acl</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-web</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context-support</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>aopalliance</groupId>
+            <artifactId>aopalliance</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency-->
+        <dependency>
+            <groupId>net.sf.ehcache</groupId>
+            <artifactId>ehcache</artifactId>
+            <version>1.6.2</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>cspace-services-authorization-mgt-client</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemProperties>
+                        <property>
+                            <name>maven.basedir</name>
+                            <value>${basedir}</value>
+                        </property>
+                        <property>
+                            <name>log4j.configuration</name>
+                            <value>file:${project.build.directory}/test-classes/log4j.properties</value>
+                        </property>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
+
index f9c47870a50e1b0f12349ecbf8b9da7cfc8db2b1..8a63f9f1083725c7d2bc38bf08f53ffc1c22d83b 100644 (file)
@@ -1,25 +1,25 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
-log4j.logger.org.hibernate=INFO\r
-log4j.logger.org.hibernate.cfg=WARN\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
+log4j.logger.org.hibernate=INFO
+log4j.logger.org.hibernate.cfg=WARN
index c3b7594bd3725ff1cd538d9360b3dcc67235d89c..0ea7137cf877b8a319917feb93bcaed9ebb9344a 100644 (file)
-<project name="authorization-mgt.import" default="package" basedir=".">\r
-    <description>\r
-        collectionspace authorization-mgt import\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="import" depends="import-unix,import-windows"\r
-            description="import authorization" />\r
-    <target name="import-unix" if="osfamily-unix" depends="setup_hibernate.cfg">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="exec:java" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="import-windows" if="osfamily-windows" depends="setup_hibernate.cfg">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" /> <!-- To debug, change command here to be 'mvnDebug.bat' -->\r
-            <arg value="exec:java" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml" depends="install">\r
-        <property name="src.hibernate.cfg" value="${basedir}/src/main/resources/hibernate.cfg.xml"/>\r
-        <property name="dest.hibernate.cfg" value="${basedir}/target/classes/hibernate.cfg.xml"/>\r
-        <property name="src.appContext.cfg" value="${basedir}/src/main/resources/applicationContext-authorization-test.xml"/>\r
-        <property name="dest.appContext.cfg" value="${basedir}/target/classes/applicationContext-authorization-test.xml"/>\r
-        <delete file="${dest.hibernate.cfg}" verbose="true" />\r
-        <delete file="${dest.appContext.cfg}" verbose="true" />\r
-        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url.encoded}" />\r
-        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />\r
-        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />\r
-        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->\r
-        <filter token="DB_DIALECT" value="${db.dialect}" />\r
-        <filter token="CLASS_ID_QUERY" value="${db.spring.acl.classIdentityQuery}" />\r
-        <filter token="SID_ID_QUERY" value="${db.spring.acl.sidIdentityQuery}" />\r
-        <copy tofile="${dest.hibernate.cfg}" file="${src.hibernate.cfg}" filtering="true"/>\r
-        <copy tofile="${dest.appContext.cfg}" file="${src.appContext.cfg}" filtering="true"/>\r
-    </target>\r
-\r
-    \r
-    <target name="deploy" depends="install"\r
-            description="deploy authorization-mgt import in ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authorization-mgt import from ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="dist"\r
-            description="generate distribution for authorization-mgt import" depends="package">\r
-    </target>\r
-\r
-</project>\r
+<project name="authorization-mgt.import" default="package" basedir=".">
+    <description>
+        collectionspace authorization-mgt import
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init">
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </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="import" depends="import-unix,import-windows"
+            description="import authorization" />
+    <target name="import-unix" if="osfamily-unix" depends="setup_hibernate.cfg">
+        <exec executable="mvn" failonerror="true">
+            <arg value="exec:java" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="import-windows" if="osfamily-windows" depends="setup_hibernate.cfg">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" /> <!-- To debug, change command here to be 'mvnDebug.bat' -->
+            <arg value="exec:java" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml" depends="install">
+        <property name="src.hibernate.cfg" value="${basedir}/src/main/resources/hibernate.cfg.xml"/>
+        <property name="dest.hibernate.cfg" value="${basedir}/target/classes/hibernate.cfg.xml"/>
+        <property name="src.appContext.cfg" value="${basedir}/src/main/resources/applicationContext-authorization-test.xml"/>
+        <property name="dest.appContext.cfg" value="${basedir}/target/classes/applicationContext-authorization-test.xml"/>
+        <delete file="${dest.hibernate.cfg}" verbose="true" />
+        <delete file="${dest.appContext.cfg}" verbose="true" />
+        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url.encoded}" />
+        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />
+        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />
+        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->
+        <filter token="DB_DIALECT" value="${db.dialect}" />
+        <filter token="CLASS_ID_QUERY" value="${db.spring.acl.classIdentityQuery}" />
+        <filter token="SID_ID_QUERY" value="${db.spring.acl.sidIdentityQuery}" />
+        <copy tofile="${dest.hibernate.cfg}" file="${src.hibernate.cfg}" filtering="true"/>
+        <copy tofile="${dest.appContext.cfg}" file="${src.appContext.cfg}" filtering="true"/>
+    </target>
+
+    
+    <target name="deploy" depends="install"
+            description="deploy authorization-mgt import in ${jee.server.cspace}">
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authorization-mgt import from ${jee.server.cspace}">
+    </target>
+
+    <target name="dist"
+            description="generate distribution for authorization-mgt import" depends="package">
+    </target>
+
+</project>
index be1d9ea9ccc57a8df25ab75a39e907851af8706b..fdaaf8a08e2a861bd759fee8bd7d04b2faedea4a 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.authorization-mgt</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.authorization-mgt.import</artifactId>\r
-    <name>services.authorization-mgt.import</name>\r
-    <properties>\r
-        <generate_only>false</generate_only>\r
-        <spring.version>3.0.0.RELEASE</spring.version>\r
-        <spring.security.version>3.0.2.RELEASE</spring.security.version>\r
-    </properties>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-                   <groupId>org.collectionspace.services</groupId>\r
-               <artifactId>org.collectionspace.services.config</artifactId>\r
-                       <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.account.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization-mgt.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- 3rd Pary dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-cli</groupId>\r
-            <artifactId>commons-cli</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-core</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-config</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-acl</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-web</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-context</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-context-support</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-aop</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>aopalliance</groupId>\r
-            <artifactId>aopalliance</artifactId>\r
-            <version>1.0</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!--dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-tx</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency-->\r
-        <dependency>\r
-            <groupId>net.sf.ehcache</groupId>\r
-            <artifactId>ehcache</artifactId>\r
-            <version>1.6.2</version>\r
-            <optional>true</optional>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-        </dependency>\r
-                               <dependency>\r
-                                               <groupId>postgresql</groupId>\r
-                                               <artifactId>postgresql</artifactId>\r
-                               </dependency>\r
-        <dependency>\r
-            <groupId>ch.elca.el4j.modules</groupId>\r
-            <artifactId>module-xml_merge-common</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>          \r
-    </dependencies>\r
-    <!-- use profile as this task is not needed for every build and test -->\r
-\r
-    <build>\r
-        <finalName>cspace-services-authorization-mgt-import</finalName>\r
-                               <filters>\r
-                                       <filter>../../../build.properties</filter>\r
-                               </filters>\r
-                               <resources>\r
-                                       <resource>\r
-                                               <directory>src/main/resources</directory>\r
-                                               <filtering>true</filtering>\r
-                                       </resource>\r
-                               </resources>\r
-        <plugins>\r
-                       <plugin>\r
-                               <groupId>org.apache.maven.plugins</groupId>\r
-                               <artifactId>maven-resources-plugin</artifactId>\r
-                               <version>2.5</version>\r
-                               <executions>\r
-                                       <execution>\r
-                                               <phase>process-resources</phase>\r
-                                               <goals>\r
-                                                       <goal>resources</goal>\r
-                                               </goals>\r
-                                       </execution>\r
-                               </executions>\r
-                       </plugin>\r
-            <plugin>\r
-                <groupId>org.codehaus.mojo</groupId>\r
-                <artifactId>exec-maven-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <goals>\r
-                            <goal>java</goal>\r
-                        </goals>\r
-                    </execution>\r
-                </executions>\r
-                <configuration>\r
-                    <mainClass>org.collectionspace.ImportAuthz</mainClass>\r
-                    <arguments>\r
-                        <argument>-g</argument>\r
-                        <argument>${generate_only}</argument>\r
-                        <argument>-u</argument>\r
-                        <argument>SPRING_ADMIN</argument>\r
-                        <argument>-p</argument>\r
-                        <argument>does_not_matter</argument>\r
-                        <argument>-b</argument>\r
-                                                                                               <!-- This should be (Needs testing):\r
-                                                                                               <argument>${jboss.server.cspace}</argument>\r
-                                                                                               -->\r
-                        <argument>${env.CSPACE_JEESERVER_HOME}</argument>\r
-                        <argument>-edir</argument>\r
-                        <argument>${basedir}/target</argument>\r
-                    </arguments>\r
-                    <systemProperties>\r
-                    </systemProperties>\r
-                </configuration>\r
-                               \r
-                <dependencies>\r
-                                                                       <!--\r
-                    <dependency>\r
-                        <groupId>mysql</groupId>\r
-                        <artifactId>mysql-connector-java</artifactId>\r
-                                               <version>${mysql.driver.version}</version>\r
-                    </dependency>\r
-                                                                               -->\r
-                                       <dependency>\r
-                                               <groupId>postgresql</groupId>\r
-                                               <artifactId>postgresql</artifactId>\r
-                                               <version>${postgres.driver.version}</version>\r
-                                       </dependency>\r
-                </dependencies>\r
-                               \r
-            </plugin>\r
-        </plugins>\r
-\r
-    </build>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.authorization-mgt</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.authorization-mgt.import</artifactId>
+    <name>services.authorization-mgt.import</name>
+    <properties>
+        <generate_only>false</generate_only>
+        <spring.version>3.0.0.RELEASE</spring.version>
+        <spring.security.version>3.0.2.RELEASE</spring.security.version>
+    </properties>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+                   <groupId>org.collectionspace.services</groupId>
+               <artifactId>org.collectionspace.services.config</artifactId>
+                       <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.account.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization-mgt.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- 3rd Pary dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-config</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-acl</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-web</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context-support</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>aopalliance</groupId>
+            <artifactId>aopalliance</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency-->
+        <dependency>
+            <groupId>net.sf.ehcache</groupId>
+            <artifactId>ehcache</artifactId>
+            <version>1.6.2</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+                               <dependency>
+                                               <groupId>postgresql</groupId>
+                                               <artifactId>postgresql</artifactId>
+                               </dependency>
+        <dependency>
+            <groupId>ch.elca.el4j.modules</groupId>
+            <artifactId>module-xml_merge-common</artifactId>
+            <version>3.1</version>
+        </dependency>          
+    </dependencies>
+    <!-- use profile as this task is not needed for every build and test -->
+
+    <build>
+        <finalName>cspace-services-authorization-mgt-import</finalName>
+                               <filters>
+                                       <filter>../../../build.properties</filter>
+                               </filters>
+                               <resources>
+                                       <resource>
+                                               <directory>src/main/resources</directory>
+                                               <filtering>true</filtering>
+                                       </resource>
+                               </resources>
+        <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.5</version>
+                               <executions>
+                                       <execution>
+                                               <phase>process-resources</phase>
+                                               <goals>
+                                                       <goal>resources</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <mainClass>org.collectionspace.ImportAuthz</mainClass>
+                    <arguments>
+                        <argument>-g</argument>
+                        <argument>${generate_only}</argument>
+                        <argument>-u</argument>
+                        <argument>SPRING_ADMIN</argument>
+                        <argument>-p</argument>
+                        <argument>does_not_matter</argument>
+                        <argument>-b</argument>
+                                                                                               <!-- This should be (Needs testing):
+                                                                                               <argument>${jboss.server.cspace}</argument>
+                                                                                               -->
+                        <argument>${env.CSPACE_JEESERVER_HOME}</argument>
+                        <argument>-edir</argument>
+                        <argument>${basedir}/target</argument>
+                    </arguments>
+                    <systemProperties>
+                    </systemProperties>
+                </configuration>
+                               
+                <dependencies>
+                                                                       <!--
+                    <dependency>
+                        <groupId>mysql</groupId>
+                        <artifactId>mysql-connector-java</artifactId>
+                                               <version>${mysql.driver.version}</version>
+                    </dependency>
+                                                                               -->
+                                       <dependency>
+                                               <groupId>postgresql</groupId>
+                                               <artifactId>postgresql</artifactId>
+                                               <version>${postgres.driver.version}</version>
+                                       </dependency>
+                </dependencies>
+                               
+            </plugin>
+        </plugins>
+
+    </build>
+
+</project>
+
index f39efb3dbd0cfbfd217f1023d897aee59d42c6e5..b5f601bdf1fd4e34623bf74cbbfb6fc7bcb9730c 100644 (file)
@@ -1,39 +1,39 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.commandline=org.apache.log4j.ConsoleAppender\r
-log4j.appender.commandline.target=System.err\r
-log4j.appender.commandline.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.commandline.layout.ConversionPattern=%d %p: %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-log4j.appender.R.MaxFileSize=100KB\r
-log4j.appender.R.MaxBackupIndex=1\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace.services.authorization.spring=INFO\r
-# log4j.logger.org.collectionspace.services.common.authorization_mgt.AuthorizationStore=TRACE\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
-log4j.logger.hibernate=WARN\r
-log4j.logger.org.hibernate=WARN\r
-log4j.logger.org.hibernate.cfg=WARN\r
-log4j.logger.org.springframework=WARN\r
-log4j.logger.ch.elca.el4j.services.xmlmerge=INFO\r
-log4j.logger.com.sun.xml.bind.v2.runtime=DEBUG\r
-log4j.logger.javax.persistence.PersistenceException=ERROR\r
-\r
-#\r
-# Logging for the command line tool that generates the Service artifacts\r
-#\r
-log4j.logger.org.collectionspace=INFO, commandline\r
-log4j.additivity.org.collectionspace=false\r
-\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.commandline=org.apache.log4j.ConsoleAppender
+log4j.appender.commandline.target=System.err
+log4j.appender.commandline.layout=org.apache.log4j.PatternLayout
+log4j.appender.commandline.layout.ConversionPattern=%d %p: %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+log4j.appender.R.MaxFileSize=100KB
+log4j.appender.R.MaxBackupIndex=1
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace.services.authorization.spring=INFO
+# log4j.logger.org.collectionspace.services.common.authorization_mgt.AuthorizationStore=TRACE
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
+log4j.logger.hibernate=WARN
+log4j.logger.org.hibernate=WARN
+log4j.logger.org.hibernate.cfg=WARN
+log4j.logger.org.springframework=WARN
+log4j.logger.ch.elca.el4j.services.xmlmerge=INFO
+log4j.logger.com.sun.xml.bind.v2.runtime=DEBUG
+log4j.logger.javax.persistence.PersistenceException=ERROR
+
+#
+# Logging for the command line tool that generates the Service artifacts
+#
+log4j.logger.org.collectionspace=INFO, commandline
+log4j.additivity.org.collectionspace=false
+
index 04f900b88a31f450ba03d0103d16b8c13ad6667e..389065094b0a699e889a986be27da4276c4201d5 100644 (file)
-\r
-<project name="authorization-mgt.service" default="package" basedir=".">\r
-    <description>\r
-        collectionspace authorization service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="authorization.jar" value="collectionspace-services-authz-mgt.jar"/>\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-<!--\r
-    <target name="deploy" depends="install"\r
-            description="deploy authorization service in ${jee.server.cspace}">\r
-        <copy file="${basedir}/target/${authorization.jar}" todir="${jee.server.cspace}/lib"/>\r
-        <echo message="Check out authorization Service Configuration Guide on wiki.collectionspace.org for more details" />\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authorization service from ${jee.server.cspace}">\r
-        <delete file="${jee.server.cspace}/lib/${authorization.jar}"/>\r
-        <echo message="Check out authorization Service Configuration Guide on wiki.collectionspace.org for more details"/>\r
-    </target>\r
--->    \r
-\r
-    <target name="dist"\r
-            description="generate distribution for authorization service" depends="package">\r
-        <!-- copy db scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="authorization-mgt.service" default="package" basedir=".">
+    <description>
+        collectionspace authorization service
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="authorization.jar" value="collectionspace-services-authz-mgt.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/>
+    </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 authorization service in ${jee.server.cspace}">
+        <copy file="${basedir}/target/${authorization.jar}" todir="${jee.server.cspace}/lib"/>
+        <echo message="Check out authorization Service Configuration Guide on wiki.collectionspace.org for more details" />
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authorization service from ${jee.server.cspace}">
+        <delete file="${jee.server.cspace}/lib/${authorization.jar}"/>
+        <echo message="Check out authorization Service Configuration Guide on wiki.collectionspace.org for more details"/>
+    </target>
+-->    
+
+    <target name="dist"
+            description="generate distribution for authorization service" depends="package">
+        <!-- copy db scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+    </target>
+
+</project>
index 9ed3fc315a9fbbe7c91926166d437cf3f95d6088..cf9bcdc0c206db72e688f2c306e6f5884e4fed84 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.authorization-mgt</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <artifactId>org.collectionspace.services.authorization-mgt.service</artifactId>\r
-    <packaging>jar</packaging>\r
-    <name>services.authorization-mgt.service</name>\r
-    <url>http://www.collectionspace.org</url>\r
-\r
-    <properties>\r
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r
-        <spring.version>3.0.0.RELEASE</spring.version>\r
-        <spring.security.version>3.0.2.RELEASE</spring.security.version>\r
-    </properties>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <!-- utilities -->\r
-\r
-        <!-- slf4j not available due to classloading issues running in system classpath \r
-        <dependency>\r
-            <groupId>commons-logging</groupId>\r
-            <artifactId>commons-logging</artifactId>\r
-            <version>1.1.1</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>log4j</groupId>\r
-            <artifactId>log4j</artifactId>\r
-            <version>1.2.14</version>\r
-            <scope>provided</scope>\r
-        </dependency> -->\r
-\r
-        <!-- slf4j used for testing only -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <!-- javax -->\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <!-- jboss -->\r
-        <dependency>\r
-            <groupId>org.jboss.logging</groupId>\r
-            <artifactId>jboss-logging-log4j</artifactId>\r
-            <version>2.1.0.GA</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>jboss</groupId>\r
-            <artifactId>jbosssx</artifactId>\r
-            <version>4.2.3.GA</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-\r
-        <!-- spring -->\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-core</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-config</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-acl</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-web</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-context</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-context-support</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-aop</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>aopalliance</groupId>\r
-            <artifactId>aopalliance</artifactId>\r
-            <version>1.0</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!--dependency>\r
-            <groupId>org.springframework</groupId>\r
-            <artifactId>spring-tx</artifactId>\r
-            <version>${spring.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency-->\r
-        <dependency>\r
-            <groupId>net.sf.ehcache</groupId>\r
-            <artifactId>ehcache</artifactId>\r
-            <version>1.6.2</version>\r
-            <optional>true</optional>\r
-        </dependency>\r
-\r
-        <!-- collectionspace -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.account.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>collectionspace-services-authz-mgt</finalName>\r
-    </build>\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>org.collectionspace.services.authorization-mgt</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>org.collectionspace.services.authorization-mgt.service</artifactId>
+    <packaging>jar</packaging>
+    <name>services.authorization-mgt.service</name>
+    <url>http://www.collectionspace.org</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <spring.version>3.0.0.RELEASE</spring.version>
+        <spring.security.version>3.0.2.RELEASE</spring.security.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <!-- utilities -->
+
+        <!-- slf4j not available due to classloading issues running in system classpath 
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.14</version>
+            <scope>provided</scope>
+        </dependency> -->
+
+        <!-- slf4j used for testing only -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- javax -->
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <!-- jboss -->
+        <dependency>
+            <groupId>org.jboss.logging</groupId>
+            <artifactId>jboss-logging-log4j</artifactId>
+            <version>2.1.0.GA</version>
+        </dependency>
+        <dependency>
+            <groupId>jboss</groupId>
+            <artifactId>jbosssx</artifactId>
+            <version>4.2.3.GA</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+
+        <!-- spring -->
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-config</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-acl</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-web</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context-support</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>aopalliance</groupId>
+            <artifactId>aopalliance</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+            <version>${spring.version}</version>
+            <scope>provided</scope>
+        </dependency-->
+        <dependency>
+            <groupId>net.sf.ehcache</groupId>
+            <artifactId>ehcache</artifactId>
+            <version>1.6.2</version>
+            <optional>true</optional>
+        </dependency>
+
+        <!-- collectionspace -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.account.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>collectionspace-services-authz-mgt</finalName>
+    </build>
+</project>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 53fed15553c73a257808ade5aa7f0885b7e56229..142a7d68a510f9794e8c2ec9f9a086765cb5dbdb 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.authorization</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.authorization</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 3ee6d6dc2c9dc5cc5ccdcefafc0dde21790f909c..97ea8d2f8b49f1680f89eb5c5529e50e9d5349ae 100644 (file)
-\r
-<project name="authorization" default="package" basedir=".">\r
-    <description>\r
-        authorization service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="gen_ddl"\r
-            description="generate service-specific tables(s), indices, etc.">\r
-        <ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="create_cspace_db"\r
-            description="create tables(s), indices for authorization service">\r
-        <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy authorization service">\r
-        <ant antfile="pstore/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="service/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authorization service">\r
-        <ant antfile="pstore/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="service/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-            description="distribute authorization service}">\r
-        <!--ant antfile="pstore/build.xml" target="dist" inheritall="false"/-->\r
-        <ant antfile="service/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="authorization" default="package" basedir=".">
+    <description>
+        authorization service
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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="gen_ddl"
+            description="generate service-specific tables(s), indices, etc.">
+        <ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>
+    </target>
+
+    <target name="create_cspace_db"
+            description="create tables(s), indices for authorization service">
+        <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>
+    </target>
+
+    <target name="deploy" depends="install"
+            description="deploy authorization service">
+        <ant antfile="pstore/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="service/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authorization service">
+        <ant antfile="pstore/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="service/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+            description="distribute authorization service}">
+        <!--ant antfile="pstore/build.xml" target="dist" inheritall="false"/-->
+        <ant antfile="service/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index 049837bbc121215e49c4b1c8d782ecb47c9a5a28..845dec84a13662c8dffb5cbd9bd97fd0dd4e2c7e 100644 (file)
@@ -1,80 +1,80 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.authorization</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-    <name>services.authorization.jaxb</name>\r
-    <properties>\r
-    </properties>\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>com.sun.xml.bind</groupId>\r
-            <artifactId>jaxb-impl</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jvnet.jaxb2-commons</groupId>\r
-            <artifactId>property-listener-injector</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>javax.persistence</groupId>\r
-            <artifactId>persistence-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.hibernate</groupId>\r
-            <artifactId>hibernate-entitymanager</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jvnet.hyperjaxb3</groupId>\r
-            <artifactId>hyperjaxb3-ejb-runtime</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.collectionspace.services</groupId>\r
-                       <artifactId>org.collectionspace.services.hyperjaxb</artifactId>\r
-                       <version>${project.version}</version>\r
-        </dependency>        \r
-<!--     \r
-        <dependency>\r
-            <groupId>javax.persistence</groupId>\r
-            <artifactId>persistence-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jvnet.hyperjaxb3</groupId>\r
-            <artifactId>hyperjaxb3-ejb-runtime</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.hibernate</groupId>\r
-            <artifactId>hibernate-entitymanager</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>org.collectionspace.services</groupId>\r
-                       <artifactId>org.collectionspace.services.hyperjaxb</artifactId>\r
-                       <version>${project.version}</version>\r
-                       <exclusions>\r
-                               <exclusion>\r
-                                       <artifactId>jaxb-impl</artifactId>\r
-                                       <groupId>com.sun.xml.bind</groupId>\r
-                               </exclusion>\r
-                       </exclusions>\r
-        </dependency>\r
--->\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>collectionspace-services-authorization-jaxb</finalName>\r
-        <defaultGoal>install</defaultGoal>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.jvnet.hyperjaxb3</groupId>\r
-                <artifactId>maven-hyperjaxb3-plugin</artifactId>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.authorization</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+    <name>services.authorization.jaxb</name>
+    <properties>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jvnet.jaxb2-commons</groupId>
+            <artifactId>property-listener-injector</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.persistence</groupId>
+            <artifactId>persistence-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-entitymanager</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jvnet.hyperjaxb3</groupId>
+            <artifactId>hyperjaxb3-ejb-runtime</artifactId>
+        </dependency>
+        <dependency>
+                       <groupId>org.collectionspace.services</groupId>
+                       <artifactId>org.collectionspace.services.hyperjaxb</artifactId>
+                       <version>${project.version}</version>
+        </dependency>        
+<!--     
+        <dependency>
+            <groupId>javax.persistence</groupId>
+            <artifactId>persistence-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jvnet.hyperjaxb3</groupId>
+            <artifactId>hyperjaxb3-ejb-runtime</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-entitymanager</artifactId>
+        </dependency>
+        <dependency>
+                       <groupId>org.collectionspace.services</groupId>
+                       <artifactId>org.collectionspace.services.hyperjaxb</artifactId>
+                       <version>${project.version}</version>
+                       <exclusions>
+                               <exclusion>
+                                       <artifactId>jaxb-impl</artifactId>
+                                       <groupId>com.sun.xml.bind</groupId>
+                               </exclusion>
+                       </exclusions>
+        </dependency>
+-->
+    </dependencies>
+
+    <build>
+        <finalName>collectionspace-services-authorization-jaxb</finalName>
+        <defaultGoal>install</defaultGoal>
+        <plugins>
+            <plugin>
+                <groupId>org.jvnet.hyperjaxb3</groupId>
+                <artifactId>maven-hyperjaxb3-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
index 9417bd38c82974651959a421aa9b9c5b49265ba3..9617f0827820f8cf19c0a897a673614b572678df 100644 (file)
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
-    CollectionSpace default (security) authorization provider schema (XSD)\r
-\r
-    $LastChangedRevision: 916 $\r
-    $LastChangedDate: 2009-11-05 16:59:20 -0800 (Thu, 05 Nov 2009) $\r
--->\r
-\r
-<xs:schema\r
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"\r
-    jaxb:version="1.0" elementFormDefault="unqualified"\r
-    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"\r
-    xmlns:hj="http://hyperjaxb3.jvnet.org/ejb/schemas/customizations"\r
-    xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"\r
-    xmlns:ns="http://collectionspace.org/services/authorization"\r
-    xmlns="http://collectionspace.org/services/authorization"\r
-    targetNamespace="http://collectionspace.org/services/authorization"\r
-    version="0.1"\r
-    jaxb:extensionBindingPrefixes="hj orm xjc"\r
-    >\r
-\r
-    <xs:include schemaLocation="authorization_common.xsd"/>\r
-\r
-    <xs:element name="account_permission" type="account_permission"/>\r
-    <xs:complexType name="account_permission">\r
-        <xs:annotation>\r
-            <xs:documentation>\r
-                AccountPermission defines 1-n association between\r
-                an account and its corresponding permissions.\r
-            </xs:documentation>\r
-            <xs:appinfo>\r
-                <hj:ignored/>\r
-            </xs:appinfo>\r
-        </xs:annotation>\r
-        <xs:sequence>\r
-            <!-- subject is not required to be given by the service consumer -->\r
-            <!-- subject is for service use only -->\r
-            <xs:element name="account" type="ns:account_value" minOccurs="1" maxOccurs="unbounded"/>\r
-            <xs:element name="permission" type="ns:permission_value" minOccurs="1" maxOccurs="unbounded"/>\r
-        </xs:sequence>\r
-    </xs:complexType>\r
-</xs:schema>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    CollectionSpace default (security) authorization provider schema (XSD)
+
+    $LastChangedRevision: 916 $
+    $LastChangedDate: 2009-11-05 16:59:20 -0800 (Thu, 05 Nov 2009) $
+-->
+
+<xs:schema
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+    jaxb:version="1.0" elementFormDefault="unqualified"
+    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
+    xmlns:hj="http://hyperjaxb3.jvnet.org/ejb/schemas/customizations"
+    xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
+    xmlns:ns="http://collectionspace.org/services/authorization"
+    xmlns="http://collectionspace.org/services/authorization"
+    targetNamespace="http://collectionspace.org/services/authorization"
+    version="0.1"
+    jaxb:extensionBindingPrefixes="hj orm xjc"
+    >
+
+    <xs:include schemaLocation="authorization_common.xsd"/>
+
+    <xs:element name="account_permission" type="account_permission"/>
+    <xs:complexType name="account_permission">
+        <xs:annotation>
+            <xs:documentation>
+                AccountPermission defines 1-n association between
+                an account and its corresponding permissions.
+            </xs:documentation>
+            <xs:appinfo>
+                <hj:ignored/>
+            </xs:appinfo>
+        </xs:annotation>
+        <xs:sequence>
+            <!-- subject is not required to be given by the service consumer -->
+            <!-- subject is for service use only -->
+            <xs:element name="account" type="ns:account_value" minOccurs="1" maxOccurs="unbounded"/>
+            <xs:element name="permission" type="ns:permission_value" minOccurs="1" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+</xs:schema>
+
index 3aa34b3fc41af04adc8ea939a1627c9dc30855f8..53720a74286861e4213ec8376b127b0d4eefe18a 100644 (file)
@@ -1,25 +1,25 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
-log4j.logger.org.jvnet.hyperjaxb3=DEBUG\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
+log4j.logger.org.jvnet.hyperjaxb3=DEBUG
 log4j.logger.org.hibernate=WARN
\ No newline at end of file
index 7be651fc91b8d95ad0b347baee7800865cb0e9af..807f256865491958f0294699e2f37a6805b2299e 100644 (file)
-<project name="authorization.pstore" default="package" basedir=".">\r
-    <description>\r
-        collectionspace authorization service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- environment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">\r
-        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>\r
-        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>\r
-        <delete file="${dest.hibernate.cfg}" verbose="true" />\r
-        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url}" />\r
-        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />\r
-        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />\r
-        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->\r
-        <filter token="DB_DIALECT" value="${db.dialect}" />\r
-        <copy todir="${basedir}/target/test-classes" filtering="true">\r
-            <fileset dir="${basedir}/src/test/resources">\r
-                <include name="hibernate.cfg.xml" />\r
-            </fileset>\r
-        </copy>\r
-    </target>\r
-\r
-\r
-    <target name="gen_ddl" depends="gen_ddl-unix,gen_ddl-windows"\r
-            description="geneate ddl" />\r
-    <target name="gen_ddl-unix" if="osfamily-unix" depends="setup_hibernate.cfg">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="-Pddl" />\r
-            <arg value="process-test-resources" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="gen_ddl-windows" if="osfamily-windows" depends="setup_hibernate.cfg">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="-Pddl" />\r
-            <arg value="process-test-resources" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="create_cspace_db"\r
-            description="create tables(s), indices for authorization service">\r
-                               <sql driver="${db.jdbc.driver.class}"\r
-             url="${db.jdbc.cspace.url}"\r
-             userid="${db.cspace.user}"\r
-             password="${db.cspace.user.password}"\r
-             src="${db.script.dir}/authorization.sql"\r
-             onerror="continue" >\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-        </sql>\r
-                               <sql driver="${db.jdbc.driver.class}"\r
-                                                url="${db.jdbc.cspace.url}"\r
-             userid="${db.cspace.user}"\r
-             password="${db.cspace.user.password}"\r
-             src="${db.script.dir}/authorization_index.sql" >\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-        </sql>\r
-                               <sql driver="${db.jdbc.driver.class}"\r
-             url="${db.jdbc.cspace.url}"\r
-             userid="${db.cspace.user}"\r
-             password="${db.cspace.user.password}"\r
-             src="${db.script.dir}/acl.sql" >\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-        </sql>\r
-                               <!-- No longer used\r
-        <sql driver="com.mysql.jdbc.Driver"\r
-             url="jdbc:mysql://${db.host}:${db.port}/cspace"\r
-             userid="${db.cspace.user}"\r
-             password="${db.cspace.user.password}"\r
-             src="${db.script.dir}/test_authorization.sql"\r
-             >\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-                                       </sql> -->\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy authorization service in ${jee.server.cspace}">\r
-        <copy todir="${jee.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authorization service from ${jee.server.cspace}"\r
-            depends="check.db.scripts.deploy.dir" if="${db.scripts.deploy.dir.exists}">\r
-        <delete>\r
-            <fileset dir="${db.scripts.deploy.dir}"\r
-                     includes="**authorization**.sql"/>\r
-        </delete>\r
-    </target>\r
-\r
-    <target name="dist"\r
-            description="generate distribution for authorization service" depends="package">\r
-        <!-- copy db scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-    </target>\r
-    \r
-    <target name="check.db.scripts.deploy.dir">\r
-        <property name="db.scripts.deploy.dir" value="${jee.server.cspace}/cspace/services/db/${db}"/>\r
-        <condition property="db.scripts.deploy.dir.exists">\r
-            <available file="${db.scripts.deploy.dir}" type="dir"/>\r
-        </condition>\r
-    </target>\r
-\r
-</project>\r
+<project name="authorization.pstore" default="package" basedir=".">
+    <description>
+        collectionspace authorization service
+    </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="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init">
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </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="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">
+        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>
+        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>
+        <delete file="${dest.hibernate.cfg}" verbose="true" />
+        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url}" />
+        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />
+        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />
+        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->
+        <filter token="DB_DIALECT" value="${db.dialect}" />
+        <copy todir="${basedir}/target/test-classes" filtering="true">
+            <fileset dir="${basedir}/src/test/resources">
+                <include name="hibernate.cfg.xml" />
+            </fileset>
+        </copy>
+    </target>
+
+
+    <target name="gen_ddl" depends="gen_ddl-unix,gen_ddl-windows"
+            description="geneate ddl" />
+    <target name="gen_ddl-unix" if="osfamily-unix" depends="setup_hibernate.cfg">
+        <exec executable="mvn" failonerror="true">
+            <arg value="-Pddl" />
+            <arg value="process-test-resources" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="gen_ddl-windows" if="osfamily-windows" depends="setup_hibernate.cfg">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="-Pddl" />
+            <arg value="process-test-resources" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="create_cspace_db"
+            description="create tables(s), indices for authorization service">
+                               <sql driver="${db.jdbc.driver.class}"
+             url="${db.jdbc.cspace.url}"
+             userid="${db.cspace.user}"
+             password="${db.cspace.user.password}"
+             src="${db.script.dir}/authorization.sql"
+             onerror="continue" >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+        </sql>
+                               <sql driver="${db.jdbc.driver.class}"
+                                                url="${db.jdbc.cspace.url}"
+             userid="${db.cspace.user}"
+             password="${db.cspace.user.password}"
+             src="${db.script.dir}/authorization_index.sql" >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+        </sql>
+                               <sql driver="${db.jdbc.driver.class}"
+             url="${db.jdbc.cspace.url}"
+             userid="${db.cspace.user}"
+             password="${db.cspace.user.password}"
+             src="${db.script.dir}/acl.sql" >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+        </sql>
+                               <!-- No longer used
+        <sql driver="com.mysql.jdbc.Driver"
+             url="jdbc:mysql://${db.host}:${db.port}/cspace"
+             userid="${db.cspace.user}"
+             password="${db.cspace.user.password}"
+             src="${db.script.dir}/test_authorization.sql"
+             >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+                                       </sql> -->
+    </target>
+
+    <target name="deploy" depends="install"
+            description="deploy authorization service in ${jee.server.cspace}">
+        <copy todir="${jee.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authorization service from ${jee.server.cspace}"
+            depends="check.db.scripts.deploy.dir" if="${db.scripts.deploy.dir.exists}">
+        <delete>
+            <fileset dir="${db.scripts.deploy.dir}"
+                     includes="**authorization**.sql"/>
+        </delete>
+    </target>
+
+    <target name="dist"
+            description="generate distribution for authorization service" depends="package">
+        <!-- copy db scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+    </target>
+    
+    <target name="check.db.scripts.deploy.dir">
+        <property name="db.scripts.deploy.dir" value="${jee.server.cspace}/cspace/services/db/${db}"/>
+        <condition property="db.scripts.deploy.dir.exists">
+            <available file="${db.scripts.deploy.dir}" type="dir"/>
+        </condition>
+    </target>
+
+</project>
index 3d1fd7764a74e355c16bc82c24f069a1e92344e5..88d0cdd9145460bf5b8ac1aac6cd8536de886ceb 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.authorization</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.authorization.pstore</artifactId>\r
-    <name>services.authorization.pstore</name>\r
-    <properties>\r
-        <sql.file>authorization.sql</sql.file>\r
-        <sql.dir>${basedir}/src/main/resources/db</sql.dir>\r
-    </properties>\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-        </dependency>\r
-                       <dependency>\r
-                       <groupId>postgresql</groupId>\r
-                       <artifactId>postgresql</artifactId>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>cspace-services-authorization-pstore</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <artifactId>maven-antrun-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <id>subs-hibernate-config</id>\r
-                        <phase>generate-test-resources</phase>\r
-                        <goals>\r
-                            <goal>run</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <tasks>\r
-                                <property name="runtime-classpath" refid="maven.runtime.classpath" />\r
-                                <ant target="setup_hibernate.cfg" inheritRefs="true" />\r
-                            </tasks>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-    <profiles>\r
-        <profile>\r
-            <!-- use profile as this task is not needed for every build and test -->\r
-            <id>ddl</id>\r
-            <build>\r
-                <plugins>\r
-                                       <plugin>\r
-                                               <groupId>org.codehaus.mojo</groupId>\r
-                                               <artifactId>properties-maven-plugin</artifactId>\r
-                                               <version>1.0-alpha-2</version>\r
-                                               <executions>\r
-                                                       <execution>\r
-                                                               <phase>initialize</phase>\r
-                                                               <goals>\r
-                                                                       <goal>read-project-properties</goal>\r
-                                                               </goals>\r
-                                                               <configuration>\r
-                                                                       <files>\r
-                                                                               <file>${basedir}/../../../build.properties</file>\r
-                                                                       </files>\r
-                                                               </configuration>\r
-                                                       </execution>\r
-                                               </executions>\r
-                                       </plugin>\r
-                     <plugin>\r
-                        <groupId>org.codehaus.mojo</groupId>\r
-                        <artifactId>hibernate3-maven-plugin</artifactId>\r
-                        <version>2.2</version>\r
-                        <executions>\r
-                            <execution>\r
-                                <phase>process-test-resources</phase>\r
-                                <goals>\r
-                                    <goal>hbm2ddl</goal>\r
-                                </goals>\r
-                            </execution>\r
-                        </executions>\r
-                        <configuration>\r
-                            <components>\r
-                                <component>\r
-                                    <name>hbm2ddl</name>\r
-                                </component>\r
-                            </components>\r
-                            <componentProperties>\r
-                                <outputfilename>${sql.file}</outputfilename>\r
-                                <implementation>jpaconfiguration</implementation>\r
-                                <drop>true</drop>\r
-                                <create>true</create>\r
-                                <export>true</export>\r
-                                <jdk5>true</jdk5>\r
-                                <ejb3>false</ejb3>\r
-                                <persistenceunit>org.collectionspace.services.authorization</persistenceunit>\r
-                            </componentProperties>\r
-                        </configuration>\r
-                        <dependencies>\r
-                            <dependency>\r
-                                <groupId>mysql</groupId>\r
-                                <artifactId>mysql-connector-java</artifactId>\r
-                            </dependency>\r
-                                                       <dependency>\r
-                                                               <groupId>postgresql</groupId>\r
-                                                               <artifactId>postgresql</artifactId>\r
-                                                       </dependency>\r
-                         </dependencies>\r
-                    </plugin>\r
-                    <plugin>\r
-                        <artifactId>maven-antrun-plugin</artifactId>\r
-                        <executions>\r
-                            <execution>\r
-                                <phase>process-test-resources</phase>\r
-                                <configuration>\r
-                                    <tasks>\r
-                                                                               <copy file="${basedir}/target/hibernate3/sql/${sql.file}" tofile="${sql.dir}/${db}/${sql.file}"/>\r
-                                    </tasks>\r
-                                </configuration>\r
-                                <goals>\r
-                                    <goal>run</goal>\r
-                                </goals>\r
-                            </execution>\r
-                        </executions>\r
-                    </plugin>\r
-\r
-                </plugins>\r
-            </build>\r
-        </profile>\r
-    </profiles>\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.authorization</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.authorization.pstore</artifactId>
+    <name>services.authorization.pstore</name>
+    <properties>
+        <sql.file>authorization.sql</sql.file>
+        <sql.dir>${basedir}/src/main/resources/db</sql.dir>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+                       <dependency>
+                       <groupId>postgresql</groupId>
+                       <artifactId>postgresql</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>cspace-services-authorization-pstore</finalName>
+        <plugins>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>subs-hibernate-config</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <property name="runtime-classpath" refid="maven.runtime.classpath" />
+                                <ant target="setup_hibernate.cfg" inheritRefs="true" />
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <profiles>
+        <profile>
+            <!-- use profile as this task is not needed for every build and test -->
+            <id>ddl</id>
+            <build>
+                <plugins>
+                                       <plugin>
+                                               <groupId>org.codehaus.mojo</groupId>
+                                               <artifactId>properties-maven-plugin</artifactId>
+                                               <version>1.0-alpha-2</version>
+                                               <executions>
+                                                       <execution>
+                                                               <phase>initialize</phase>
+                                                               <goals>
+                                                                       <goal>read-project-properties</goal>
+                                                               </goals>
+                                                               <configuration>
+                                                                       <files>
+                                                                               <file>${basedir}/../../../build.properties</file>
+                                                                       </files>
+                                                               </configuration>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+                     <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>hibernate3-maven-plugin</artifactId>
+                        <version>2.2</version>
+                        <executions>
+                            <execution>
+                                <phase>process-test-resources</phase>
+                                <goals>
+                                    <goal>hbm2ddl</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <components>
+                                <component>
+                                    <name>hbm2ddl</name>
+                                </component>
+                            </components>
+                            <componentProperties>
+                                <outputfilename>${sql.file}</outputfilename>
+                                <implementation>jpaconfiguration</implementation>
+                                <drop>true</drop>
+                                <create>true</create>
+                                <export>true</export>
+                                <jdk5>true</jdk5>
+                                <ejb3>false</ejb3>
+                                <persistenceunit>org.collectionspace.services.authorization</persistenceunit>
+                            </componentProperties>
+                        </configuration>
+                        <dependencies>
+                            <dependency>
+                                <groupId>mysql</groupId>
+                                <artifactId>mysql-connector-java</artifactId>
+                            </dependency>
+                                                       <dependency>
+                                                               <groupId>postgresql</groupId>
+                                                               <artifactId>postgresql</artifactId>
+                                                       </dependency>
+                         </dependencies>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>process-test-resources</phase>
+                                <configuration>
+                                    <tasks>
+                                                                               <copy file="${basedir}/target/hibernate3/sql/${sql.file}" tofile="${sql.dir}/${db}/${sql.file}"/>
+                                    </tasks>
+                                </configuration>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
index b9cf6f804ba00bad5339412138b98fe8eede733f..fbc2b89190e0a325b9663a8d63f1259ee1d3df67 100644 (file)
@@ -1,32 +1,32 @@
-The file authorization.sql is basically generated by the gen_ddl ant target.\r
-However, you must modify the result of that to make the \r
-\r
-  DROP TABLE \r
-\r
-statements be \r
-  \r
-  DROP TABLE IF EXISTS table CASCADE \r
-\r
-This ensures that first time setup does not fail, and that later invocations\r
-can deal with dependencies.\r
-\r
-You must also make the\r
-\r
-  DROP SEQUENCE \r
-\r
-statements be \r
-\r
-  DROP SEQUENCE IF EXISTS\r
-\r
-for similar reasons.\r
-\r
-You must also remove (comment out) the statement (which is superfluous with the CASCADE above):\r
-\r
-  alter table permissions_actions drop constraint FK85F82042E2DC84FD;\r
-\r
-When using the account_tenants table on insert, you have to specify "nextval('hibernate_sequence')" \r
-as the value for the HJID column. \r
-\r
-Note that because of the way gen_ddl does its work per-sub-project, there is a single shared\r
-sequence for both this and the authorization.sql script. This should be okay, even if it does\r
-create gaps in what would be a nice sequence for each table.\r
+The file authorization.sql is basically generated by the gen_ddl ant target.
+However, you must modify the result of that to make the 
+
+  DROP TABLE 
+
+statements be 
+  
+  DROP TABLE IF EXISTS table CASCADE 
+
+This ensures that first time setup does not fail, and that later invocations
+can deal with dependencies.
+
+You must also make the
+
+  DROP SEQUENCE 
+
+statements be 
+
+  DROP SEQUENCE IF EXISTS
+
+for similar reasons.
+
+You must also remove (comment out) the statement (which is superfluous with the CASCADE above):
+
+  alter table permissions_actions drop constraint FK85F82042E2DC84FD;
+
+When using the account_tenants table on insert, you have to specify "nextval('hibernate_sequence')" 
+as the value for the HJID column. 
+
+Note that because of the way gen_ddl does its work per-sub-project, there is a single shared
+sequence for both this and the authorization.sql script. This should be okay, even if it does
+create gaps in what would be a nice sequence for each table.
index d5718661210033f0ca1c86580ceb3ce6459f885e..86b7206ce713f99709f30b7739076f1f7ed1e103 100644 (file)
-\r
-<project name="authorization.service" default="package" basedir=".">\r
-    <description>\r
-        collectionspace authorization service\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="authorization.jar" value="cspace-services-authz.jar"/>\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-            description="deploy authorization service in ${jee.server.cspace}">\r
-        <copy file="${basedir}/target/${authorization.jar}" todir="${jee.server.cspace}/lib"/>\r
-        <echo message="Check out authorization Service Configuration Guide on wiki.collectionspace.org for more details" />\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-            description="undeploy authorization service from ${jee.server.cspace}">\r
-        <delete file="${jee.server.cspace}/lib/${authorization.jar}"/>\r
-        <echo message="Check out authorization Service Configuration Guide on wiki.collectionspace.org for more details"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-            description="generate distribution for authorization service" depends="package">\r
-        <!-- copy db scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/"/>\r
-        </copy>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="authorization.service" default="package" basedir=".">
+    <description>
+        collectionspace authorization service
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="authorization.jar" value="cspace-services-authz.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/>
+    </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 authorization service in ${jee.server.cspace}">
+        <copy file="${basedir}/target/${authorization.jar}" todir="${jee.server.cspace}/lib"/>
+        <echo message="Check out authorization Service Configuration Guide on wiki.collectionspace.org for more details" />
+    </target>
+
+    <target name="undeploy"
+            description="undeploy authorization service from ${jee.server.cspace}">
+        <delete file="${jee.server.cspace}/lib/${authorization.jar}"/>
+        <echo message="Check out authorization Service Configuration Guide on wiki.collectionspace.org for more details"/>
+    </target>
+
+    <target name="dist"
+            description="generate distribution for authorization service" depends="package">
+        <!-- copy db scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
+    </target>
+
+</project>
index 306e0e10b9d2e276c637a388cd4de5e438947430..bc75b164d73f2822c29af9ecc716c6f552aeae79 100644 (file)
@@ -1,5 +1,5 @@
-package org.collectionspace.services.authorization;\r
-\r
-public class PermissionActionUtil {\r
-\r
-}\r
+package org.collectionspace.services.authorization;
+
+public class PermissionActionUtil {
+
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index e857f894eae94a7832461236f331d49a785f1709..a8deb97b63ac45e17cb13f369289c6a518b9caf3 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.batch</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.batch</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 9f043a30b935911d25cfcc0482266dbff34518e2..361dafef620832ff814d043c855e1cba9affb13f 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.batch.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.batch.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d05375dbda8fb3aae1947446aa34f6a92c6e3c88..ef5f42081705307f21aca18d23b4d05f16e39ac6 100644 (file)
@@ -1,23 +1,23 @@
-Manifest-Version: 1.0 \r
-Bundle-ManifestVersion: 1 \r
-Bundle-Name: NuxeoCS\r
-Bundle-SymbolicName: org.collectionspace.batch;singleton:=true \r
-Bundle-Version: 1.0.0\r
-Bundle-Localization: plugin\r
-Bundle-Vendor: Nuxeo \r
-Require-Bundle: org.nuxeo.runtime, \r
- org.nuxeo.ecm.core.api, \r
- org.nuxeo.ecm.core,\r
- org.nuxeo.ecm.core.api,\r
- org.nuxeo.ecm.platform.types.api,\r
- org.nuxeo.ecm.platform.versioning.api,\r
- org.nuxeo.ecm.platform.ui,\r
- org.nuxeo.ecm.platform.forms.layout.client,\r
- org.nuxeo.ecm.platform.ws,\r
- org.collectionspace.collectionspace_core\r
-Provide-Package: org.collectionspace.batch\r
-Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
- OSGI-INF/life-cycle-contrib.xml,\r
- OSGI-INF/ecm-types-contrib.xml,\r
- OSGI-INF/layouts-contrib.xml\r
-\r
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: NuxeoCS
+Bundle-SymbolicName: org.collectionspace.batch;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.batch
+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
+
index 2b0b5e44de215fa75a84d9aa72212b36de5e8952..0b670e4e29374e2f0e64b6dd93dc4403bbc7e1f8 100644 (file)
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
-    Loan Out schema (XSD)\r
-    \r
-    Entity  : Batch\r
-    Part    : Common\r
-    Used for: Nuxeo EP core document type\r
-\r
-    $LastChangedRevision: 2316 $\r
-    $LastChangedDate: 2010-06-02 16:03:51 -0700 (Wed, 02 Jun 2010) $\r
--->\r
-\r
-<xs:schema \r
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-    xmlns:ns="http://collectionspace.org/batch/"\r
-    xmlns="http://collectionspace.org/batch/"\r
-    targetNamespace="http://collectionspace.org/batch/"\r
-    version="0.1">\r
-    \r
-    <!-- See http://wiki.collectionspace.org/display/collectionspace/Loans+Out+Schema -->\r
-\r
-    <!--  Batch Information Group -->\r
-    \r
-    <xs:element name="name" type="xs:string"/>\r
-    <xs:element name="notes" type="xs:string"/>\r
-    <xs:element name="forDocTypes">\r
-        <xs:complexType>\r
-            <xs:sequence>\r
-                <xs:element name="forDocType" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>\r
-            </xs:sequence>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="supportsNoContext" type="xs:boolean"/>\r
-    <xs:element name="supportsSingleDoc" type="xs:boolean"/>\r
-    <xs:element name="supportsDocList" type="xs:boolean"/>\r
-    <xs:element name="supportsGroup" type="xs:boolean"/>\r
-    <!-- NYI <xs:element name="supportsQuery" type="xs:boolean"/>  -->\r
-    <xs:element name="createsNewFocus" type="xs:boolean"/>\r
-    <xs:element name="className" type="xs:string"/>\r
-</xs:schema>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Loan Out schema (XSD)
+    
+    Entity  : Batch
+    Part    : Common
+    Used for: Nuxeo EP core document type
+
+    $LastChangedRevision: 2316 $
+    $LastChangedDate: 2010-06-02 16:03:51 -0700 (Wed, 02 Jun 2010) $
+-->
+
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/batch/"
+    xmlns="http://collectionspace.org/batch/"
+    targetNamespace="http://collectionspace.org/batch/"
+    version="0.1">
+    
+    <!-- See http://wiki.collectionspace.org/display/collectionspace/Loans+Out+Schema -->
+
+    <!--  Batch Information Group -->
+    
+    <xs:element name="name" type="xs:string"/>
+    <xs:element name="notes" type="xs:string"/>
+    <xs:element name="forDocTypes">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="forDocType" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="supportsNoContext" type="xs:boolean"/>
+    <xs:element name="supportsSingleDoc" type="xs:boolean"/>
+    <xs:element name="supportsDocList" type="xs:boolean"/>
+    <xs:element name="supportsGroup" type="xs:boolean"/>
+    <!-- NYI <xs:element name="supportsQuery" type="xs:boolean"/>  -->
+    <xs:element name="createsNewFocus" type="xs:boolean"/>
+    <xs:element name="className" type="xs:string"/>
+</xs:schema>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 01274ea20a2233d360e7a75788f0082ebf064959..5275e58e35b2206bcc8232b5b342aeaa4a9709f0 100644 (file)
@@ -1,18 +1,18 @@
-package org.collectionspace.services.batch;\r
-\r
-import java.util.HashMap;\r
-import java.util.Set;\r
-\r
-import org.collectionspace.services.common.ResourceBase;\r
-import org.collectionspace.services.common.ResourceMap;\r
-import org.collectionspace.services.common.invocable.Invocable;\r
-\r
-public interface BatchInvocable extends Invocable {\r
-\r
-       /**\r
-        * Sets the invocation context for the batch job. Called before run().\r
-        * @param context an instance of InvocationContext.\r
-        */\r
-       public void setResourceMap(ResourceMap resourceMap);\r
-\r
-}\r
+package org.collectionspace.services.batch;
+
+import java.util.HashMap;
+import java.util.Set;
+
+import org.collectionspace.services.common.ResourceBase;
+import org.collectionspace.services.common.ResourceMap;
+import org.collectionspace.services.common.invocable.Invocable;
+
+public interface BatchInvocable extends Invocable {
+
+       /**
+        * Sets the invocation context for the batch job. Called before run().
+        * @param context an instance of InvocationContext.
+        */
+       public void setResourceMap(ResourceMap resourceMap);
+
+}
index 2cb6d0902cb248f0cf3a07856cb7d49d4b7e5904..316c54e4815a94572eed78de4728d5dfc84f97a7 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.blob</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.blob</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 5ca2f2bb0ed9a3b1f3d6d15ea330f53798756687..32f0563ade637060c2035ccef59ec3726e928b78 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.blob.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.blob.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 557b59c698c5a02ed32b590ac8eab8b0dad65570..6a9c95d3eae57263b6c0879adce2225541447397 100644 (file)
-package org.collectionspace.services.client.test;\r
-\r
-import java.awt.Color;\r
-import java.awt.Font;\r
-import java.awt.Graphics;\r
-import java.awt.image.BufferedImage;\r
-import java.io.File;\r
-import java.io.IOException;\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
-import java.util.Random;\r
-\r
-import javax.imageio.ImageIO;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.client.BlobClient;\r
-import org.collectionspace.services.client.CollectionSpaceClient;\r
-import org.collectionspace.services.client.Profiler;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.testng.annotations.Test;\r
-\r
-public class BlobScaleTest extends BaseServiceTest<AbstractCommonList> {\r
-\r
-    private final Logger logger = LoggerFactory.getLogger(BlobScaleTest.class);\r
-       \r
-       private static final int IMAGE_SIZE = 1000;\r
-       private static final int IMAGE_EDGE = -15;\r
-       private static final int MIN_FONTSIZE = 15;\r
-       private static final int MAX_FONTSIZE = 60;\r
-       private static final String IMAGES_TO_CREATE_PROP = "imagesToCreate";\r
-       private static final int DEFAULT_IMAGES_TO_CREATE = 1;\r
-       private static final int DEFAULT_IMAGES_TO_GET = 12; //1024;\r
-    private static final String GENERATED_IMAGES = "target/generated_images";\r
-\r
-       private static Random generator = new Random(System.currentTimeMillis());\r
-       \r
-       @Override\r
-       protected CollectionSpaceClient getClientInstance() {\r
-        return new BlobClient();\r
-       }\r
-\r
-       @Override\r
-       protected String getServicePathComponent() {\r
-               return BlobClient.SERVICE_PATH_COMPONENT;\r
-       }\r
-\r
-       @Override\r
-       protected String getServiceName() {\r
-               return BlobClient.SERVICE_NAME;\r
-       }\r
-\r
-       private int getImagesToCreate() {\r
-               int result = DEFAULT_IMAGES_TO_CREATE;\r
-               \r
-        String imagesToCreate = System.getProperty(IMAGES_TO_CREATE_PROP);\r
-        try {\r
-               result = Integer.parseInt(imagesToCreate);\r
-        } catch (NumberFormatException np) {\r
-               logger.info("No value (or a bad value) for system property '"\r
-                               + IMAGES_TO_CREATE_PROP\r
-                               + "' was defined, so we'll use the default instead.");\r
-        } finally {\r
-               logger.info("Testing blob scaling by creating "\r
-                               + result\r
-                               + " images.");\r
-        }\r
-        \r
-        return result;\r
-       }\r
-       \r
-       @Test(dataProvider = "testName", dependsOnMethods = {"scaleTest"})\r
-       public void scaleGETTest(String testName) throws MalformedURLException {\r
-               this.setupRead();\r
-               String blobToGetID = getKnowResourceId();\r
-        BlobClient client = new BlobClient();\r
-        \r
-        for (int i = 0; i < DEFAULT_IMAGES_TO_GET; i++) {\r
-               ClientResponse<Response> res = client.getDerivativeContent(blobToGetID, "Thumbnail");\r
-               assertStatusCode(res, testName);\r
-        }\r
-        \r
-        logger.debug(String.format("Performed %d GET operations on blob = %s.", \r
-                       DEFAULT_IMAGES_TO_GET, blobToGetID));\r
-       }\r
-       \r
-       @Test(dataProvider = "testName")\r
-       public void scaleTest(String testName) throws MalformedURLException {\r
-               this.createDirectory(GENERATED_IMAGES);\r
-               setupCreate();\r
-               int imagesToCreate = getImagesToCreate();\r
-        BlobClient client = new BlobClient();\r
-               Profiler profiler = new Profiler(this, 1);\r
-        \r
-        for (int i = 0; i < imagesToCreate; i++, profiler.reset()) {\r
-                       File jpegFile = createJpeg(GENERATED_IMAGES);   \r
-                       URL url = jpegFile.toURI().toURL();\r
-                       \r
-               profiler.start();\r
-                       ClientResponse<Response> res = client.createBlobFromURI("http://farm6.static.flickr.com/5289/5688023100_15e00cde47_o.jpg");//url.toString());\r
-                       try {\r
-                               profiler.stop();\r
-                       assertStatusCode(res, testName);\r
-\r
-                       logger.debug(\r
-                                               i + ": Uploaded image to Nuxeo in "\r
-                                               + profiler.getCumulativeTime()\r
-                                               + " milleseconds "\r
-                                               + " - "\r
-                                               + " : "\r
-                                               + jpegFile.getAbsolutePath());\r
-                               \r
-                       String csid = extractId(res);\r
-                       this.knownResourceId = csid;\r
-                       allResourceIdsCreated.add(csid);\r
-                       } finally {\r
-                               if (res != null) {\r
-                    res.releaseConnection();\r
-                }\r
-                       }\r
-        }\r
-       }\r
-       \r
-       private void createDirectory(String dirName) {\r
-               boolean success = (\r
-                               new File(dirName)).mkdir();\r
-               if (success) {\r
-                       logger.debug("Directory: " \r
-                                       + dirName + " created");\r
-               } \r
-       }\r
-       \r
-       public File createJpeg(String destDir) {\r
-               File result = null;\r
-\r
-               BufferedImage image = new BufferedImage(IMAGE_SIZE, IMAGE_SIZE, BufferedImage.TYPE_INT_RGB);   \r
-               Graphics g = image.getGraphics();\r
-               for (int i = 0; i < IMAGE_SIZE; i = i + 10) {\r
-                       int x = random(IMAGE_EDGE, IMAGE_SIZE);\r
-                       int y = random(IMAGE_EDGE, IMAGE_SIZE);\r
-                       g.drawString(Integer.toString(random(-123456789, 123456789)), x, y);\r
-                       Color c = new Color(random(0, 255), random(0, 255), random(0, 255));\r
-                       g.setColor(c);\r
-\r
-                       Font currentFont = g.getFont();\r
-                       Font newFont = new Font(currentFont.getFontName(), currentFont.getStyle(),\r
-                                       random(MIN_FONTSIZE, MAX_FONTSIZE));\r
-                       g.setFont(newFont);\r
-               }\r
-               try {    \r
-                       ImageIO.write(image, "jpg", result = new File(destDir\r
-                                       + File.separator\r
-                                       + System.currentTimeMillis()\r
-                                       + ".jpg"));\r
-               } catch (IOException e) {    \r
-                       e.printStackTrace();   \r
-               } \r
-\r
-               return result;\r
-       }\r
-\r
-       public int random(int min, int max) {\r
-               return min + (int)(generator.nextFloat() * ((max - min) + 1));\r
-       }\r
-       \r
-\r
-}\r
+package org.collectionspace.services.client.test;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Random;
+
+import javax.imageio.ImageIO;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.client.BlobClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.Profiler;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.jboss.resteasy.client.ClientResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+public class BlobScaleTest extends BaseServiceTest<AbstractCommonList> {
+
+    private final Logger logger = LoggerFactory.getLogger(BlobScaleTest.class);
+       
+       private static final int IMAGE_SIZE = 1000;
+       private static final int IMAGE_EDGE = -15;
+       private static final int MIN_FONTSIZE = 15;
+       private static final int MAX_FONTSIZE = 60;
+       private static final String IMAGES_TO_CREATE_PROP = "imagesToCreate";
+       private static final int DEFAULT_IMAGES_TO_CREATE = 1;
+       private static final int DEFAULT_IMAGES_TO_GET = 12; //1024;
+    private static final String GENERATED_IMAGES = "target/generated_images";
+
+       private static Random generator = new Random(System.currentTimeMillis());
+       
+       @Override
+       protected CollectionSpaceClient getClientInstance() {
+        return new BlobClient();
+       }
+
+       @Override
+       protected String getServicePathComponent() {
+               return BlobClient.SERVICE_PATH_COMPONENT;
+       }
+
+       @Override
+       protected String getServiceName() {
+               return BlobClient.SERVICE_NAME;
+       }
+
+       private int getImagesToCreate() {
+               int result = DEFAULT_IMAGES_TO_CREATE;
+               
+        String imagesToCreate = System.getProperty(IMAGES_TO_CREATE_PROP);
+        try {
+               result = Integer.parseInt(imagesToCreate);
+        } catch (NumberFormatException np) {
+               logger.info("No value (or a bad value) for system property '"
+                               + IMAGES_TO_CREATE_PROP
+                               + "' was defined, so we'll use the default instead.");
+        } finally {
+               logger.info("Testing blob scaling by creating "
+                               + result
+                               + " images.");
+        }
+        
+        return result;
+       }
+       
+       @Test(dataProvider = "testName", dependsOnMethods = {"scaleTest"})
+       public void scaleGETTest(String testName) throws MalformedURLException {
+               this.setupRead();
+               String blobToGetID = getKnowResourceId();
+        BlobClient client = new BlobClient();
+        
+        for (int i = 0; i < DEFAULT_IMAGES_TO_GET; i++) {
+               ClientResponse<Response> res = client.getDerivativeContent(blobToGetID, "Thumbnail");
+               assertStatusCode(res, testName);
+        }
+        
+        logger.debug(String.format("Performed %d GET operations on blob = %s.", 
+                       DEFAULT_IMAGES_TO_GET, blobToGetID));
+       }
+       
+       @Test(dataProvider = "testName")
+       public void scaleTest(String testName) throws MalformedURLException {
+               this.createDirectory(GENERATED_IMAGES);
+               setupCreate();
+               int imagesToCreate = getImagesToCreate();
+        BlobClient client = new BlobClient();
+               Profiler profiler = new Profiler(this, 1);
+        
+        for (int i = 0; i < imagesToCreate; i++, profiler.reset()) {
+                       File jpegFile = createJpeg(GENERATED_IMAGES);   
+                       URL url = jpegFile.toURI().toURL();
+                       
+               profiler.start();
+                       ClientResponse<Response> res = client.createBlobFromURI("http://farm6.static.flickr.com/5289/5688023100_15e00cde47_o.jpg");//url.toString());
+                       try {
+                               profiler.stop();
+                       assertStatusCode(res, testName);
+
+                       logger.debug(
+                                               i + ": Uploaded image to Nuxeo in "
+                                               + profiler.getCumulativeTime()
+                                               + " milleseconds "
+                                               + " - "
+                                               + " : "
+                                               + jpegFile.getAbsolutePath());
+                               
+                       String csid = extractId(res);
+                       this.knownResourceId = csid;
+                       allResourceIdsCreated.add(csid);
+                       } finally {
+                               if (res != null) {
+                    res.releaseConnection();
+                }
+                       }
+        }
+       }
+       
+       private void createDirectory(String dirName) {
+               boolean success = (
+                               new File(dirName)).mkdir();
+               if (success) {
+                       logger.debug("Directory: " 
+                                       + dirName + " created");
+               } 
+       }
+       
+       public File createJpeg(String destDir) {
+               File result = null;
+
+               BufferedImage image = new BufferedImage(IMAGE_SIZE, IMAGE_SIZE, BufferedImage.TYPE_INT_RGB);   
+               Graphics g = image.getGraphics();
+               for (int i = 0; i < IMAGE_SIZE; i = i + 10) {
+                       int x = random(IMAGE_EDGE, IMAGE_SIZE);
+                       int y = random(IMAGE_EDGE, IMAGE_SIZE);
+                       g.drawString(Integer.toString(random(-123456789, 123456789)), x, y);
+                       Color c = new Color(random(0, 255), random(0, 255), random(0, 255));
+                       g.setColor(c);
+
+                       Font currentFont = g.getFont();
+                       Font newFont = new Font(currentFont.getFontName(), currentFont.getStyle(),
+                                       random(MIN_FONTSIZE, MAX_FONTSIZE));
+                       g.setFont(newFont);
+               }
+               try {    
+                       ImageIO.write(image, "jpg", result = new File(destDir
+                                       + File.separator
+                                       + System.currentTimeMillis()
+                                       + ".jpg"));
+               } catch (IOException e) {    
+                       e.printStackTrace();   
+               } 
+
+               return result;
+       }
+
+       public int random(int min, int max) {
+               return min + (int)(generator.nextFloat() * ((max - min) + 1));
+       }
+       
+
+}
index 5b4e490b602fe38c475c0e6fa82f7a3ca1ac88b2..be32f185c386588fab2fcf81f1e281490004e811 100644 (file)
@@ -1,25 +1,25 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.perf.collectionspace=TRACE\r
-\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.perf.collectionspace=TRACE
+
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 1674079c154904b52f1493cb22bdc26c1ced0129..ec5d6c25885ce3e7de5e61a443e4ccf99d5088e9 100644 (file)
@@ -1,31 +1,31 @@
-<classpath>\r
-  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>\r
-  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>\r
-  <classpathentry kind="src" path="target/generated-sources/xjc"/>\r
-  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>\r
-  <classpathentry kind="output" path="target/classes"/>\r
-  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>\r
-  <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar" sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1-sources.jar"/>\r
-  <classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar" sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>\r
-  <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2-sources.jar">\r
-    <attributes>\r
-      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/commons-lang/commons-lang/2.2/commons-lang-2.2-javadoc.jar!/" name="javadoc_location"/>\r
-    </attributes>\r
-  </classpathentry>\r
-  <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>\r
-  <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1/jaxb-xjc-2.1.jar" sourcepath="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1/jaxb-xjc-2.1-sources.jar"/>\r
-  <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>\r
-  <classpathentry kind="src" path="/org.collectionspace.services.jaxb"/>\r
-  <classpathentry kind="var" path="M2_REPO/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0.jar" sourcepath="M2_REPO/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0-sources.jar">\r
-    <attributes>\r
-      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0-javadoc.jar!/" name="javadoc_location"/>\r
-    </attributes>\r
-  </classpathentry>\r
-  <classpathentry kind="var" path="M2_REPO/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4.jar" sourcepath="M2_REPO/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4-sources.jar">\r
-    <attributes>\r
-      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4-javadoc.jar!/" name="javadoc_location"/>\r
-    </attributes>\r
-  </classpathentry>\r
-  <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.6/testng-5.6-jdk15.jar"/>\r
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
+<classpath>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="src" path="target/generated-sources/xjc"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar" sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar" sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/commons-lang/commons-lang/2.2/commons-lang-2.2-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1/jaxb-xjc-2.1.jar" sourcepath="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1/jaxb-xjc-2.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+  <classpathentry kind="src" path="/org.collectionspace.services.jaxb"/>
+  <classpathentry kind="var" path="M2_REPO/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0.jar" sourcepath="M2_REPO/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4.jar" sourcepath="M2_REPO/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.6/testng-5.6-jdk15.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 </classpath>
\ No newline at end of file
index e8f3befcb609983b9d2507250d17220b67ddea63..5078e9d492158be2a502e77acacd3ce7dcc34725 100644 (file)
-<project name="services-main" default="package" basedir=".">\r
-    <description>\r
-        collectionspace services main\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value=".."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="javadoc.jar" value="org.collectionspace.services-javadoc.jar"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-            description="Package CollectionSpace Services" />\r
-\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-            description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-            description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="doc" depends="install,doc-unix,doc-windows" description="Build Java API docs">\r
-        <jar destfile="${basedir}/target/${javadoc.jar}"\r
-             basedir="${basedir}/target/site"\r
-             />\r
-    </target>\r
-    <target name="doc-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="javadoc:aggregate" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="doc-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="javadoc:aggregate" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="gen_ddl"\r
-            description="generate service-specific tables(s), indices, etc.">\r
-        <ant antfile="authentication/build.xml" target="gen_ddl" inheritAll="false"/>\r
-        <ant antfile="authorization/build.xml" target="gen_ddl" inheritAll="false"/>\r
-        <ant antfile="account/build.xml" target="gen_ddl" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="create_cspace_db"\r
-            description="create service-specific tables(s), indices, etc.">\r
-        <ant antfile="authentication/build.xml" target="create_cspace_db" inheritAll="false"/>\r
-        <ant antfile="authorization/build.xml" target="create_cspace_db" inheritAll="false"/>\r
-        <ant antfile="account/build.xml" target="create_cspace_db" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="create_nuxeo_db"\r
-            description="create service-specific tables(s), indices, etc.">\r
-        <ant antfile="id/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="import"\r
-            description="import default configuration">\r
-        <ant antfile="authorization-mgt/build.xml" target="import" inheritAll="false"/>\r
-    </target>\r
-\r
-    <!-- this target is called in order based on the dependencies between the services -->\r
-    <target name="deploy" depends="install"\r
-            description="deploy services in ${jee.server.cspace}">\r
-        <ant antfile="authentication/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="authorization/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="authority/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="blob/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="workflow/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="common/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="account/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="relation/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="id/build.xml" target="deploy" inheritAll="false"/>\r
-       <!--\r
-        <ant antfile="note/build.xml" target="deploy" inheritAll="false"/>\r
-        -->\r
-        <ant antfile="collectionobject/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="servicegroup/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="group/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="intake/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="imports/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="loanin/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="loanout/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="conditioncheck/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="valuationcontrol/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="objectexit/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="batch/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="location/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="place/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="work/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="concept/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="taxonomy/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="media/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="movement/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="report/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="vocabulary/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="organization/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="person/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="citation/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="acquisition/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="dimension/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="contact/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="publicitem/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="JaxRsServiceProvider/build.xml" target="deploy" inheritAll="false"/>\r
-    </target>\r
-\r
-    <!-- this target is called in reverse order of deploy targets -->\r
-    <target name="undeploy"\r
-            description="undeploy services from ${jee.server.cspace}">\r
-        <ant antfile="JaxRsServiceProvider/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="vocabulary/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="citation/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="organization/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="person/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="publicitem/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="contact/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="dimension/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="acquisition/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="taxonomy/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="concept/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="work/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="place/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="location/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="objectexit/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="valuationcontrol/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="conditioncheck/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="batch/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="report/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="movement/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="loanout/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="loanin/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="media/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="intake/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="imports/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="group/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="servicegroup/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="collectionobject/build.xml" target="undeploy" inheritAll="false"/>\r
-       <!--\r
-        <ant antfile="note/build.xml" target="undeploy" inheritAll="false"/>\r
-        -->\r
-        <ant antfile="id/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="relation/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="account/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="common/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="media/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="blob/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="workflow/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="authority/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="authorization/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="authentication/build.xml" target="undeploy" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="hotdeploy" depends="install"\r
-            description="deploy services in running ${jee.server.cspace}">\r
-        <ant antfile="JaxRsServiceProvider/build.xml" target="hotdeploy" inheritAll="false"/>\r
-    </target>\r
-\r
-    <!-- this target is called in order based on the dependencies between the services -->\r
-    <target name="dist" depends="doc"\r
-            description="create distribution for services">\r
-        <ant antfile="authentication/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="authorization/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="authority/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="account/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="blob/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="workflow/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="common/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="relation/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="id/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="collectionobject/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="servicegroup/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="group/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="intake/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="loanin/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="loanout/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="location/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="place/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="work/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="concept/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="taxonomy/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="conditioncheck/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="valuationcontrol/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="objectexit/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="batch/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="media/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="movement/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="report/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="vocabulary/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="organization/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="person/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="citation/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="acquisition/build.xml" target="dist" inheritAll="false"/>\r
-        <ant antfile="JaxRsServiceProvider/build.xml" target="dist" inheritAll="false"/>\r
-        <copy file="${basedir}/target/${javadoc.jar}"\r
-              todir="${services.trunk}/${dist.server.cspace}/cspace/services/docs"/>\r
-    </target>\r
-\r
-    <!-- this target is called in order based on the dependencies between the services -->\r
-    <target name="dist_installer"\r
-            description="create distribution for CollectionSpace installer">\r
-\r
-        <!-- copy install scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.installer.services}">\r
-            <fileset dir="./installer"/>\r
-        </copy>\r
-        <ant antfile="id/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="collectionobject/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="vocabulary/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="organization/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="person/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <!--\r
-        <ant antfile="account/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="common/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="authorization/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="authentication/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="relation/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="intake/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="loanin/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="acquisition/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="JaxRsServiceProvider/build.xml" target="dist_installer" inheritAll="false"/>\r
--->        \r
-    </target>\r
-    \r
-   <target name="generate-dependencies-reports"\r
-            description="Generate a report of dependencies, including their licensing information.">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="project-info-reports:dependencies"/>\r
-            <arg value="-Ddependency.locations.enabled=false" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="copy-dependencies-reports" \r
-            description="Copy dependencies reports to a single directory.">\r
-        <property name="dependencies-reports-dir" value="${basedir}/target/dependencies"/>\r
-        <mkdir dir="${dependencies-reports-dir}"/>\r
-        <!-- Copy the top-level services dependencies report -->\r
-        <copy todir="${dependencies-reports-dir}"\r
-             file="${basedir}/target/site/dependencies.html"/>\r
-        <!-- Copy the dependencies reports from each module, flattening -->\r
-        <!-- report names by substituting dot notation for full module paths -->\r
-        <copy todir="${dependencies-reports-dir}">\r
-            <fileset\r
-                id="dependency-report-files"\r
-                dir="${basedir}">\r
-                <include name="**/dependencies.html"/>\r
-            </fileset>\r
-            <chainedmapper>\r
-                <regexpmapper\r
-                     handledirsep="true"\r
-                     from="(.*?)/target/site/(.*)"\r
-                     to="\1${file.separator}\2"/>\r
-                <filtermapper>\r
-                    <replacestring from="${file.separator}" to="."/>\r
-                </filtermapper>\r
-            </chainedmapper>\r
-        </copy>\r
-    </target>\r
-\r
-</project>\r
+<project name="services-main" default="package" basedir=".">
+    <description>
+        collectionspace services main
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value=".."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="javadoc.jar" value="org.collectionspace.services-javadoc.jar"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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="doc" depends="install,doc-unix,doc-windows" description="Build Java API docs">
+        <jar destfile="${basedir}/target/${javadoc.jar}"
+             basedir="${basedir}/target/site"
+             />
+    </target>
+    <target name="doc-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="javadoc:aggregate" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="doc-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="javadoc:aggregate" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="gen_ddl"
+            description="generate service-specific tables(s), indices, etc.">
+        <ant antfile="authentication/build.xml" target="gen_ddl" inheritAll="false"/>
+        <ant antfile="authorization/build.xml" target="gen_ddl" inheritAll="false"/>
+        <ant antfile="account/build.xml" target="gen_ddl" inheritAll="false"/>
+    </target>
+
+    <target name="create_cspace_db"
+            description="create service-specific tables(s), indices, etc.">
+        <ant antfile="authentication/build.xml" target="create_cspace_db" inheritAll="false"/>
+        <ant antfile="authorization/build.xml" target="create_cspace_db" inheritAll="false"/>
+        <ant antfile="account/build.xml" target="create_cspace_db" inheritAll="false"/>
+    </target>
+
+    <target name="create_nuxeo_db"
+            description="create service-specific tables(s), indices, etc.">
+        <ant antfile="id/build.xml" target="create_nuxeo_db" inheritAll="false"/>
+    </target>
+
+    <target name="import"
+            description="import default configuration">
+        <ant antfile="authorization-mgt/build.xml" target="import" inheritAll="false"/>
+    </target>
+
+    <!-- this target is called in order based on the dependencies between the services -->
+    <target name="deploy" depends="install"
+            description="deploy services in ${jee.server.cspace}">
+        <ant antfile="authentication/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="authorization/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="authority/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="blob/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="workflow/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="common/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="account/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="relation/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="id/build.xml" target="deploy" inheritAll="false"/>
+       <!--
+        <ant antfile="note/build.xml" target="deploy" inheritAll="false"/>
+        -->
+        <ant antfile="collectionobject/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="servicegroup/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="group/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="intake/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="imports/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="loanin/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="loanout/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="conditioncheck/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="valuationcontrol/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="objectexit/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="batch/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="location/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="place/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="work/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="concept/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="taxonomy/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="media/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="movement/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="report/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="vocabulary/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="organization/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="person/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="citation/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="acquisition/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="dimension/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="contact/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="publicitem/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="JaxRsServiceProvider/build.xml" target="deploy" inheritAll="false"/>
+    </target>
+
+    <!-- this target is called in reverse order of deploy targets -->
+    <target name="undeploy"
+            description="undeploy services from ${jee.server.cspace}">
+        <ant antfile="JaxRsServiceProvider/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="vocabulary/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="citation/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="organization/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="person/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="publicitem/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="contact/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="dimension/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="acquisition/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="taxonomy/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="concept/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="work/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="place/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="location/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="objectexit/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="valuationcontrol/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="conditioncheck/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="batch/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="report/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="movement/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="loanout/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="loanin/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="media/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="intake/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="imports/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="group/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="servicegroup/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="collectionobject/build.xml" target="undeploy" inheritAll="false"/>
+       <!--
+        <ant antfile="note/build.xml" target="undeploy" inheritAll="false"/>
+        -->
+        <ant antfile="id/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="relation/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="account/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="common/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="media/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="blob/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="workflow/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="authority/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="authorization/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="authentication/build.xml" target="undeploy" inheritAll="false"/>
+    </target>
+
+    <target name="hotdeploy" depends="install"
+            description="deploy services in running ${jee.server.cspace}">
+        <ant antfile="JaxRsServiceProvider/build.xml" target="hotdeploy" inheritAll="false"/>
+    </target>
+
+    <!-- this target is called in order based on the dependencies between the services -->
+    <target name="dist" depends="doc"
+            description="create distribution for services">
+        <ant antfile="authentication/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="authorization/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="authority/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="account/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="blob/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="workflow/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="common/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="relation/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="id/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="collectionobject/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="servicegroup/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="group/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="intake/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="loanin/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="loanout/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="location/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="place/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="work/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="concept/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="taxonomy/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="conditioncheck/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="valuationcontrol/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="objectexit/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="batch/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="media/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="movement/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="report/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="vocabulary/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="organization/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="person/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="citation/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="acquisition/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="JaxRsServiceProvider/build.xml" target="dist" inheritAll="false"/>
+        <copy file="${basedir}/target/${javadoc.jar}"
+              todir="${services.trunk}/${dist.server.cspace}/cspace/services/docs"/>
+    </target>
+
+    <!-- this target is called in order based on the dependencies between the services -->
+    <target name="dist_installer"
+            description="create distribution for CollectionSpace installer">
+
+        <!-- copy install scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.installer.services}">
+            <fileset dir="./installer"/>
+        </copy>
+        <ant antfile="id/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="collectionobject/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="vocabulary/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="organization/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="person/build.xml" target="dist_installer" inheritAll="false"/>
+        <!--
+        <ant antfile="account/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="common/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="authorization/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="authentication/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="relation/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="intake/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="loanin/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="acquisition/build.xml" target="dist_installer" inheritAll="false"/>
+        <ant antfile="JaxRsServiceProvider/build.xml" target="dist_installer" inheritAll="false"/>
+-->        
+    </target>
+    
+   <target name="generate-dependencies-reports"
+            description="Generate a report of dependencies, including their licensing information.">
+        <exec executable="mvn" failonerror="true">
+            <arg value="project-info-reports:dependencies"/>
+            <arg value="-Ddependency.locations.enabled=false" />
+        </exec>
+    </target>
+
+    <target name="copy-dependencies-reports" 
+            description="Copy dependencies reports to a single directory.">
+        <property name="dependencies-reports-dir" value="${basedir}/target/dependencies"/>
+        <mkdir dir="${dependencies-reports-dir}"/>
+        <!-- Copy the top-level services dependencies report -->
+        <copy todir="${dependencies-reports-dir}"
+             file="${basedir}/target/site/dependencies.html"/>
+        <!-- Copy the dependencies reports from each module, flattening -->
+        <!-- report names by substituting dot notation for full module paths -->
+        <copy todir="${dependencies-reports-dir}">
+            <fileset
+                id="dependency-report-files"
+                dir="${basedir}">
+                <include name="**/dependencies.html"/>
+            </fileset>
+            <chainedmapper>
+                <regexpmapper
+                     handledirsep="true"
+                     from="(.*?)/target/site/(.*)"
+                     to="\1${file.separator}\2"/>
+                <filtermapper>
+                    <replacestring from="${file.separator}" to="."/>
+                </filtermapper>
+            </chainedmapper>
+        </copy>
+    </target>
+
+</project>
index d18316afc439864cbba0150febce32e2e724ffba..2068e34f3ee13d634f8514b5c61eb9ef3f88dd6b 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index 0d6e32b7d5f434e7ee59efcac8fc3d97b5461296..788c80f37889e7a0fe1d1e93f1e89d6555d46dd3 100644 (file)
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.citation</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.jdt.core.javabuilder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-               <nature>org.eclipse.jdt.core.javanature</nature>\r
-               <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.citation</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.maven.ide.eclipse.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.maven.ide.eclipse.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d18316afc439864cbba0150febce32e2e724ffba..2068e34f3ee13d634f8514b5c61eb9ef3f88dd6b 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index 6f2a74af454fbfe105c614e10f296899cff212be..32ddd40d4837d407ba91f3042b3421c7f090849e 100644 (file)
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.citation.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.jdt.core.javabuilder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-               <nature>org.eclipse.jdt.core.javanature</nature>\r
-               <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.citation.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.maven.ide.eclipse.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.maven.ide.eclipse.maven2Nature</nature>
+       </natures>
+</projectDescription>
index fb5453bc23577fd6d06a1e29813c221147eff0bb..223a9a2f50f81b6bc39b81a81929553e75f8a607 100644 (file)
@@ -1,14 +1,14 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services;\r
-import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;\r
-\r
-/**\r
- * @author pschmitz\r
- *\r
- */\r
-public interface CitationJAXBSchema extends AuthorityItemJAXBSchema {\r
-       final static String CITATIONS_COMMON = "citations_common";      \r
-}\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services;
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
+
+/**
+ * @author pschmitz
+ *
+ */
+public interface CitationJAXBSchema extends AuthorityItemJAXBSchema {
+       final static String CITATIONS_COMMON = "citations_common";      
+}
+
index d59201497dd75dbc364971903f8db66b4e1626b3..edfdc6365957c7c10d39e955ae0f0a2f419653c7 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.client</artifactId>\r
-    <name>services.client</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-<!-- CollectionSpace dependencies -->\r
-\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-                   <artifactId>org.collectionspace.services.common-api</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        \r
-<!-- External dependencies -->\r
-\r
-        <dependency>\r
-            <groupId>org.apache.maven.plugins</groupId>\r
-            <artifactId>maven-surefire-plugin</artifactId>\r
-            <version>2.4.3</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-io</groupId>\r
-            <artifactId>commons-io</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>jaxrs-api</artifactId>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <!-- Set TestNG scope to default (compile), rather than test -->\r
-        <!-- to allow import(s) in AbstractServiceTest class -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-            <scope>compile</scope>\r
-        </dependency>\r
-\r
-        <!-- javax -->\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-                   <groupId>com.sun.xml.bind</groupId>\r
-                   <artifactId>jaxb-impl</artifactId>\r
-                   <version>2.2.2</version>\r
-                   <type>jar</type>\r
-                   <scope>compile</scope>\r
-               </dependency>        \r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>        \r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>collectionspace-services-client</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-jar-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <goals>\r
-                            <goal>test-jar</goal>\r
-                        </goals>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.client</artifactId>
+    <name>services.client</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        
+<!-- CollectionSpace dependencies -->
+
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+                   <artifactId>org.collectionspace.services.common-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        
+<!-- External dependencies -->
+
+        <dependency>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <version>2.4.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>jaxrs-api</artifactId>
+        </dependency>        
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <!-- Set TestNG scope to default (compile), rather than test -->
+        <!-- to allow import(s) in AbstractServiceTest class -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <!-- javax -->
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+                   <groupId>com.sun.xml.bind</groupId>
+                   <artifactId>jaxb-impl</artifactId>
+                   <version>2.2.2</version>
+                   <type>jar</type>
+                   <scope>compile</scope>
+               </dependency>        
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>        
+    </dependencies>
+
+    <build>
+        <finalName>collectionspace-services-client</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index 22cae7501f250a61707cd3da423e7bd071162b10..e62fe58ea9b32f30e898902df2ec6e371673e7f4 100644 (file)
@@ -1,18 +1,18 @@
-package org.collectionspace.services.client;\r
-\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-/**\r
- * \r
- * @author remillet\r
- *\r
- * All clients returning AbstractCommonList types should extend this class.\r
- * \r
- * @param <P>\r
- */\r
-public abstract class AbstractCommonListPoxServiceClientImpl<P extends CollectionSpaceCommonListPoxProxy>\r
-       extends AbstractPoxServiceClientImpl<AbstractCommonList, P> {\r
-       //\r
-       // All clients returning AbstractCommonList types should extend this class.\r
-       //\r
-}\r
+package org.collectionspace.services.client;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+/**
+ * 
+ * @author remillet
+ *
+ * All clients returning AbstractCommonList types should extend this class.
+ * 
+ * @param <P>
+ */
+public abstract class AbstractCommonListPoxServiceClientImpl<P extends CollectionSpaceCommonListPoxProxy>
+       extends AbstractPoxServiceClientImpl<AbstractCommonList, P> {
+       //
+       // All clients returning AbstractCommonList types should extend this class.
+       //
+}
index 22866cccc03325e75646d85e590b78d7777b1a46..1741033bd6325680bd78add67e5571fa090cb3a4 100644 (file)
@@ -1,46 +1,46 @@
-package org.collectionspace.services.client;\r
-\r
-import java.util.List;\r
-\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.slf4j.Logger;\r
-import org.w3c.dom.Element;\r
-import org.w3c.dom.Node;\r
-\r
-public class AbstractCommonListUtils {\r
-    public static void ListItemsInAbstractCommonList(\r
-               AbstractCommonList list, Logger logger, String testName) {\r
-       List<AbstractCommonList.ListItem> items =\r
-               list.getListItem();\r
-       int i = 0;\r
-       for(AbstractCommonList.ListItem item : items){\r
-               List<Element> elList = item.getAny();\r
-               StringBuilder elementStrings = new StringBuilder();\r
-               for(Element el : elList) {\r
-                       Node textEl = el.getFirstChild();\r
-                               elementStrings.append("["+el.getNodeName()+":"+((textEl!=null)?textEl.getNodeValue():"NULL")+"] ");\r
-               }\r
-               logger.debug(testName + ": list-item[" + i + "]: "+elementStrings.toString());\r
-               i++;\r
-       }\r
-    }\r
-\r
-    public static String ListItemGetCSID(AbstractCommonList.ListItem item) {\r
-               return ListItemGetElementValue(item, "csid");\r
-       }\r
-\r
-    public static String ListItemGetElementValue(AbstractCommonList.ListItem item,\r
-               String elName) {\r
-               List<Element> elList = item.getAny();\r
-               for(Element el : elList) {\r
-                       if(elName.equalsIgnoreCase(el.getNodeName())) {\r
-                       Node textEl = el.getFirstChild();\r
-                       return textEl.getNodeValue();\r
-                       }\r
-               }\r
-               return null;\r
-       }\r
-\r
-\r
-\r
-}\r
+package org.collectionspace.services.client;
+
+import java.util.List;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.slf4j.Logger;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class AbstractCommonListUtils {
+    public static void ListItemsInAbstractCommonList(
+               AbstractCommonList list, Logger logger, String testName) {
+       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();
+                               elementStrings.append("["+el.getNodeName()+":"+((textEl!=null)?textEl.getNodeValue():"NULL")+"] ");
+               }
+               logger.debug(testName + ": list-item[" + i + "]: "+elementStrings.toString());
+               i++;
+       }
+    }
+
+    public static String ListItemGetCSID(AbstractCommonList.ListItem item) {
+               return ListItemGetElementValue(item, "csid");
+       }
+
+    public static String ListItemGetElementValue(AbstractCommonList.ListItem item,
+               String elName) {
+               List<Element> elList = item.getAny();
+               for(Element el : elList) {
+                       if(elName.equalsIgnoreCase(el.getNodeName())) {
+                       Node textEl = el.getFirstChild();
+                       return textEl.getNodeValue();
+                       }
+               }
+               return null;
+       }
+
+
+
+}
index 56ad16593fc69e6254a9247be2e7c316d737e9b7..b326a2cfbfa333d131fafbb00fce74e199845647 100644 (file)
@@ -1,60 +1,60 @@
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.core.Response;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-/*\r
- * CLT = List type\r
- * P = Proxy type\r
- */\r
-public abstract class AbstractPoxServiceClientImpl<CLT extends AbstractCommonList, P extends CollectionSpacePoxProxy<CLT>>\r
-       extends AbstractServiceClientImpl<CLT, PoxPayloadOut, String, P> \r
-       implements CollectionSpacePoxClient<CLT, P> {\r
-       \r
-    @Override\r
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {\r
-        return getProxy().create(xmlPayload.getBytes());\r
-    }\r
-               \r
-    @Override\r
-       public ClientResponse<String> read(String csid) {\r
-        return getProxy().read(csid);\r
-    }\r
-    \r
-    public ClientResponse<CLT> readList() {\r
-       CollectionSpaceProxy<CLT> proxy = (CollectionSpaceProxy<CLT>)getProxy();\r
-       return proxy.readList();\r
-    }    \r
-    \r
-    @Override\r
-    public ClientResponse<CLT> readIncludeDeleted(Boolean includeDeleted) {\r
-       CollectionSpacePoxProxy<CLT> proxy = getProxy();\r
-       return proxy.readIncludeDeleted(includeDeleted.toString());\r
-    }\r
-    \r
-    @Override\r
-       public ClientResponse<String> readIncludeDeleted(String csid, Boolean includeDeleted) {\r
-        return getProxy().readIncludeDeleted(csid, includeDeleted.toString());\r
-    }\r
-\r
-    @Override\r
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {\r
-        return getProxy().update(csid, xmlPayload.getBytes());\r
-    }\r
-    \r
-\r
-    @Override\r
-    public ClientResponse<CLT> keywordSearchIncludeDeleted(String keywords, Boolean includeDeleted) {\r
-        CollectionSpacePoxProxy<CLT> proxy = getProxy();\r
-        return proxy.keywordSearchIncludeDeleted(keywords, includeDeleted.toString());\r
-    }\r
-\r
-    @Override\r
-    public ClientResponse<CLT> advancedSearchIncludeDeleted(String whereClause, Boolean includeDeleted) {\r
-        CollectionSpacePoxProxy<CLT> proxy = getProxy();\r
-        return proxy.advancedSearchIncludeDeleted(whereClause, includeDeleted.toString());\r
-    }\r
-\r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+/*
+ * CLT = List type
+ * P = Proxy type
+ */
+public abstract class AbstractPoxServiceClientImpl<CLT extends AbstractCommonList, P extends CollectionSpacePoxProxy<CLT>>
+       extends AbstractServiceClientImpl<CLT, PoxPayloadOut, String, P> 
+       implements CollectionSpacePoxClient<CLT, P> {
+       
+    @Override
+    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
+        return getProxy().create(xmlPayload.getBytes());
+    }
+               
+    @Override
+       public ClientResponse<String> read(String csid) {
+        return getProxy().read(csid);
+    }
+    
+    public ClientResponse<CLT> readList() {
+       CollectionSpaceProxy<CLT> proxy = (CollectionSpaceProxy<CLT>)getProxy();
+       return proxy.readList();
+    }    
+    
+    @Override
+    public ClientResponse<CLT> readIncludeDeleted(Boolean includeDeleted) {
+       CollectionSpacePoxProxy<CLT> proxy = getProxy();
+       return proxy.readIncludeDeleted(includeDeleted.toString());
+    }
+    
+    @Override
+       public ClientResponse<String> readIncludeDeleted(String csid, Boolean includeDeleted) {
+        return getProxy().readIncludeDeleted(csid, includeDeleted.toString());
+    }
+
+    @Override
+    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
+        return getProxy().update(csid, xmlPayload.getBytes());
+    }
+    
+
+    @Override
+    public ClientResponse<CLT> keywordSearchIncludeDeleted(String keywords, Boolean includeDeleted) {
+        CollectionSpacePoxProxy<CLT> proxy = getProxy();
+        return proxy.keywordSearchIncludeDeleted(keywords, includeDeleted.toString());
+    }
+
+    @Override
+    public ClientResponse<CLT> advancedSearchIncludeDeleted(String whereClause, Boolean includeDeleted) {
+        CollectionSpacePoxProxy<CLT> proxy = getProxy();
+        return proxy.advancedSearchIncludeDeleted(whereClause, includeDeleted.toString());
+    }
+
+}
index 377fb551a6f089a57cb0874ce2daaeae409d47c9..b9102852f6f04bd65372e09085ff7e8a858c9580 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.client;\r
-\r
-import java.io.InputStream;\r
-import java.io.UnsupportedEncodingException;\r
-import java.net.URL;\r
-import java.util.Properties;\r
-\r
-import javax.ws.rs.PathParam;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.apache.commons.httpclient.HttpClient;\r
-import org.apache.commons.httpclient.UsernamePasswordCredentials;\r
-import org.apache.commons.httpclient.auth.AuthScope; //import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;\r
-\r
-import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-import org.jboss.resteasy.client.ClientResponse; //import org.collectionspace.services.common.context.ServiceContext;\r
-import org.jboss.resteasy.client.ProxyFactory;\r
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;\r
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;\r
-import org.jboss.resteasy.spi.ResteasyProviderFactory;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * BaseServiceClient is an abstract base client of all service clients FIXME:\r
- * http://issues.collectionspace.org/browse/CSPACE-1684\r
- * @param <CommonListType> \r
- * @param <ListType> \r
- * \r
- * CLT - List type\r
- * REQUEST_PT - Request payload type\r
- * RESPONSE_PT - Response payload type\r
- * P - Proxy type\r
- */\r
-public abstract class AbstractServiceClientImpl<CLT, REQUEST_PT, RESPONSE_PT, P extends CollectionSpaceProxy<CLT>>\r
-       implements CollectionSpaceClient<CLT, REQUEST_PT, RESPONSE_PT, P> {\r
-\r
-    /** The logger. */\r
-    protected final Logger logger = LoggerFactory.getLogger(AbstractServiceClientImpl.class);\r
-    /**\r
-     * The character used to separate the words in a part label\r
-     */\r
-    public static final String PART_LABEL_SEPARATOR = "_";\r
-    /** The Constant PART_COMMON_LABEL. */\r
-    public static final String PART_COMMON_LABEL = "common";\r
-    /** The properties. */\r
-    private Properties properties = new Properties();\r
-    /** The url. */\r
-    private URL url;\r
-    /** The http client. */\r
-    private HttpClient httpClient;\r
-    /** The RESTEasy proxy */\r
-    private P proxy;\r
-\r
-    /**\r
-     * Gets the logger.\r
-     *\r
-     * @return the logger\r
-     */\r
-    public Logger getLogger() {\r
-       return logger;\r
-    }\r
-    \r
-    abstract public String getServicePathComponent();\r
-    \r
-    /**\r
-     * Returns a UTF-8 encode byte array from 'string'\r
-     *\r
-     * @return UTF-8 encoded byte array\r
-     */\r
-    protected byte[] getBytes(String string) {\r
-       byte[] result = null;\r
-       try {\r
-                       result = string.getBytes("UTF8");\r
-               } catch (UnsupportedEncodingException e) {\r
-                       if (logger.isWarnEnabled() == true) {\r
-                               logger.warn(e.getMessage(), e);\r
-                       }\r
-               }\r
-               return result;\r
-    }\r
-    \r
-    /*\r
-     * Subclasses can override this method to return their AbstractCommonList subclass\r
-     */\r
-    protected Class<CLT> getCommonListType() {\r
-       return (Class<CLT>) AbstractCommonList.class;\r
-    }\r
-    \r
-    /**\r
-     * Gets the common part name.\r
-     *\r
-     * @return the common part name\r
-     */\r
-    @Override\r
-    public String getCommonPartName() {\r
-        return getCommonPartName(getServiceName());\r
-    }\r
-\r
-    /**\r
-     * Gets the common part name.\r
-     *\r
-     * @param servicePathComponent\r
-     *            the service path component\r
-     * @return the common part name\r
-     */\r
-    protected String getCommonPartName(String commonPrefix) {\r
-        return commonPrefix + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;\r
-    }\r
-\r
-//    /**\r
-//     * Gets the service path component.\r
-//     *\r
-//     * @return the service path component\r
-//     */\r
-//    abstract public String getServicePathComponent();\r
-\r
-    /**\r
-     * Instantiates a new abstract service client impl.\r
-     */\r
-    protected AbstractServiceClientImpl() {\r
-        readProperties();\r
-        setupHttpClient();\r
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();\r
-        RegisterBuiltin.register(factory);\r
-        setProxy();        \r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#getProperty\r
-     * (java.lang.String)\r
-     */\r
-    @Override\r
-    public String getProperty(String propName) {\r
-        return properties.getProperty(propName);\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#setProperty\r
-     * (java.lang.String, java.lang.String)\r
-     */\r
-    @Override\r
-    public void setProperty(String propName, String value) {\r
-        properties.setProperty(propName, value);\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#removeProperty\r
-     * (java.lang.String)\r
-     */\r
-    @Override\r
-    public Object removeProperty(String propName) {\r
-        return properties.remove(propName);\r
-    }\r
-\r
-    /**\r
-     * Prints the properties.\r
-     */\r
-    public void printProperties() {\r
-        for (Object kobj : properties.keySet()) {\r
-            String key = (String) kobj;\r
-            logger.trace("begin property name=" + key + " value="\r
-                    + properties.get(key));\r
-        }\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#getBaseURL()\r
-     */\r
-    @Override\r
-    public String getBaseURL() {\r
-        return properties.getProperty(URL_PROPERTY);\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#getHttpClient()\r
-     */\r
-    @Override\r
-    public HttpClient getHttpClient() {\r
-        return httpClient;\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see org.collectionspace.services.client.CollectionSpaceClient#useAuth()\r
-     */\r
-    @Override\r
-    public boolean useAuth() {\r
-        String auth = properties.getProperty(AUTH_PROPERTY);\r
-        return Boolean.valueOf(auth);\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see org.collectionspace.services.client.CollectionSpaceClient#useSSL()\r
-     */\r
-    @Override\r
-    public boolean useSSL() {\r
-        String ssl = properties.getProperty(SSL_PROPERTY);\r
-        return Boolean.valueOf(ssl);\r
-    }\r
-\r
-    /**\r
-     * readProperties reads properties from system class path as well as it\r
-     * overrides properties made available using command line\r
-     *\r
-     * @exception RuntimeException\r
-     */\r
-    private void readProperties() {\r
-\r
-        ClassLoader cl = Thread.currentThread().getContextClassLoader();\r
-        InputStream is = null;\r
-        try {\r
-            is = cl.getResourceAsStream("collectionspace-client.properties");\r
-            properties.load(is);\r
-            if (logger.isDebugEnabled()) {\r
-                printProperties();\r
-            }\r
-            String spec = System.getProperty(URL_PROPERTY);\r
-            if (spec != null && !"".equals(spec)) {\r
-                properties.setProperty(URL_PROPERTY, spec);\r
-            }\r
-\r
-            spec = properties.getProperty(URL_PROPERTY);\r
-            url = new URL(spec);\r
-            logger.debug("readProperties() using url=" + url);\r
-\r
-            String auth = System.getProperty(AUTH_PROPERTY);\r
-            if (auth != null && !"".equals(auth)) {\r
-                properties.setProperty(AUTH_PROPERTY, auth);\r
-            }\r
-            String ssl = System.getProperty(SSL_PROPERTY);\r
-            if (ssl != null && !"".equals(ssl)) {\r
-                properties.setProperty(AUTH_PROPERTY, ssl);\r
-            }\r
-            String user = System.getProperty(USER_PROPERTY);\r
-            if (user != null && !"".equals(user)) {\r
-                properties.setProperty(USER_PROPERTY, user);\r
-            }\r
-            String password = System.getProperty(PASSWORD_PROPERTY);\r
-            if (password != null && !"".equals(password)) {\r
-                properties.setProperty(PASSWORD_PROPERTY, password);\r
-            }\r
-            String tenant = System.getProperty(TENANT_PROPERTY);\r
-            if (tenant != null && !"".equals(tenant)) {\r
-                properties.setProperty(TENANT_PROPERTY, tenant);\r
-            }\r
-            if (logger.isDebugEnabled()) {\r
-                printProperties();\r
-            }\r
-        } catch (Exception e) {\r
-            logger.debug("Caught exception while reading properties", e);\r
-            throw new RuntimeException(e);\r
-        } finally {\r
-            if (is != null) {\r
-                try {\r
-                    is.close();\r
-                } catch (Exception e) {\r
-                    if (logger.isDebugEnabled() == true) {\r
-                        e.printStackTrace();\r
-                    }\r
-                }\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     * setupHttpClient sets up HTTP client for the service client the setup\r
-     * process relies on the following properties URL_PROPERTY USER_PROPERTY\r
-     * PASSWORD_PROPERTY AUTH_PROPERTY SSL_PROPERTY\r
-     */\r
-    @Override\r
-    public void setupHttpClient() {\r
-       try {\r
-               this.httpClient = new HttpClient();\r
-               if (useAuth()) {\r
-                   String user = properties.getProperty(USER_PROPERTY);\r
-                   String password = properties.getProperty(PASSWORD_PROPERTY);\r
-                   if (logger.isDebugEnabled()) {\r
-                       logger.debug("setupHttpClient() using url=" + url + " user="\r
-                               + user + " password=" + password);\r
-                   }\r
-       \r
-                   httpClient.getState().setCredentials(\r
-                           new AuthScope(url.getHost(), url.getPort(),\r
-                           AuthScope.ANY_REALM),\r
-                           new UsernamePasswordCredentials(user, password));\r
-                   // JAXRS client library requires HTTP preemptive authentication\r
-                   httpClient.getParams().setAuthenticationPreemptive(true);\r
-                   if (logger.isDebugEnabled()) {\r
-                       logger.debug("setupHttpClient: set preemptive authentication");\r
-                   }\r
-               } else {\r
-                   if (logger.isDebugEnabled()) {\r
-                       logger.debug("setupHttpClient() : no auth mode!");\r
-                   }\r
-               }\r
-       } catch (Throwable e) {\r
-               e.printStackTrace();\r
-       }\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#isServerSecure\r
-     * ()\r
-     */\r
-    @Override\r
-    public boolean isServerSecure() {\r
-        return Boolean.getBoolean("cspace.server.secure");\r
-    }\r
-\r
-    @Override\r
-    public P getProxy() {\r
-       return proxy;\r
-    }\r
-    \r
-    /**\r
-     * allow to reset proxy as per security needs\r
-     */\r
-    @Override\r
-       public void setProxy() {\r
-       Class<P> proxyClass = this.getProxyClass();\r
-        if (useAuth()) {\r
-            proxy = ProxyFactory.create(proxyClass,\r
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));\r
-        } else {\r
-               proxy = ProxyFactory.create(proxyClass,\r
-                    getBaseURL());\r
-        }\r
-    }\r
-\r
-    @Override\r
-       public void setAuth(boolean useAuth,\r
-            String user, boolean useUser,\r
-            String password, boolean usePassword) {\r
-        if (useAuth == true) {\r
-            setProperty(CollectionSpaceClient.AUTH_PROPERTY, "true");\r
-            if (useUser) {\r
-                setProperty(CollectionSpaceClient.USER_PROPERTY,\r
-                        user);\r
-            } else {\r
-                removeProperty(CollectionSpaceClient.USER_PROPERTY);\r
-            }\r
-            if (usePassword) {\r
-                setProperty(CollectionSpaceClient.PASSWORD_PROPERTY,\r
-                        password);\r
-            } else {\r
-                removeProperty(CollectionSpaceClient.PASSWORD_PROPERTY);\r
-            }\r
-        } else {\r
-            removeProperty(CollectionSpaceClient.AUTH_PROPERTY);\r
-        }\r
-        setupHttpClient();\r
-        setProxy();\r
-    }\r
-    \r
-       /*\r
-        * \r
-        * Common Proxied service calls\r
-        * \r
-        */\r
-    \r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.client.AbstractServiceClientImpl#delete(java.lang.String)\r
-     */\r
-    @Override\r
-       public ClientResponse<Response> delete(String csid) {\r
-        return getProxy().delete(csid);\r
-    }\r
-\r
-    /**\r
-     * @param csid\r
-     * @return\r
-     * @see org.collectionspace.services.client.BlobProxy#getAuthorityRefs(java.lang.String)\r
-     */\r
-    @Override\r
-       public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {\r
-        return getProxy().getAuthorityRefs(csid);\r
-    }\r
-    \r
-    @Override\r
-       public ClientResponse<String> getWorkflow(String csid) {\r
-       return getProxy().getWorkflow(csid);\r
-    }\r
-    \r
-    @Override\r
-       public ClientResponse<String> updateWorkflowWithTransition(String csid, String workflowTransition) {\r
-       return getProxy().updateWorkflowWithTransition(csid, workflowTransition);\r
-    }        \r
-    \r
-    /*\r
-     * Because of how RESTEasy creates proxy classes, sub-interfaces will need to override\r
-     * these methods with their specific "common" list return types.  Otherwise, only the info\r
-     * in the AbstractCommonList type will be returned to the callers\r
-     */\r
-\r
-    \r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
-     * .lang.String, java.lang.String)\r
-     */\r
-    @Override\r
-    public ClientResponse<CLT> readList(Long pageSize,\r
-               Long pageNumber) {\r
-        return getProxy().readList(pageSize, pageNumber);\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
-     * .lang.String, java.lang.String)\r
-     */\r
-    @Override\r
-    public ClientResponse<CLT> readList(String sortBy, Long pageSize,\r
-            Long pageNumber) {\r
-        return getProxy().readList(sortBy, pageSize, pageNumber);\r
-    }\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.client;
+
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.util.Properties;
+
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Response;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.auth.AuthScope; //import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
+
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+import org.jboss.resteasy.client.ClientResponse; //import org.collectionspace.services.common.context.ServiceContext;
+import org.jboss.resteasy.client.ProxyFactory;
+import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
+import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * BaseServiceClient is an abstract base client of all service clients FIXME:
+ * http://issues.collectionspace.org/browse/CSPACE-1684
+ * @param <CommonListType> 
+ * @param <ListType> 
+ * 
+ * CLT - List type
+ * REQUEST_PT - Request payload type
+ * RESPONSE_PT - Response payload type
+ * P - Proxy type
+ */
+public abstract class AbstractServiceClientImpl<CLT, REQUEST_PT, RESPONSE_PT, P extends CollectionSpaceProxy<CLT>>
+       implements CollectionSpaceClient<CLT, REQUEST_PT, RESPONSE_PT, P> {
+
+    /** The logger. */
+    protected final Logger logger = LoggerFactory.getLogger(AbstractServiceClientImpl.class);
+    /**
+     * The character used to separate the words in a part label
+     */
+    public static final String PART_LABEL_SEPARATOR = "_";
+    /** The Constant PART_COMMON_LABEL. */
+    public static final String PART_COMMON_LABEL = "common";
+    /** The properties. */
+    private Properties properties = new Properties();
+    /** The url. */
+    private URL url;
+    /** The http client. */
+    private HttpClient httpClient;
+    /** The RESTEasy proxy */
+    private P proxy;
+
+    /**
+     * Gets the logger.
+     *
+     * @return the logger
+     */
+    public Logger getLogger() {
+       return logger;
+    }
+    
+    abstract public String getServicePathComponent();
+    
+    /**
+     * Returns a UTF-8 encode byte array from 'string'
+     *
+     * @return UTF-8 encoded byte array
+     */
+    protected byte[] getBytes(String string) {
+       byte[] result = null;
+       try {
+                       result = string.getBytes("UTF8");
+               } catch (UnsupportedEncodingException e) {
+                       if (logger.isWarnEnabled() == true) {
+                               logger.warn(e.getMessage(), e);
+                       }
+               }
+               return result;
+    }
+    
+    /*
+     * Subclasses can override this method to return their AbstractCommonList subclass
+     */
+    protected Class<CLT> getCommonListType() {
+       return (Class<CLT>) AbstractCommonList.class;
+    }
+    
+    /**
+     * Gets the common part name.
+     *
+     * @return the common part name
+     */
+    @Override
+    public String getCommonPartName() {
+        return getCommonPartName(getServiceName());
+    }
+
+    /**
+     * Gets the common part name.
+     *
+     * @param servicePathComponent
+     *            the service path component
+     * @return the common part name
+     */
+    protected String getCommonPartName(String commonPrefix) {
+        return commonPrefix + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+    }
+
+//    /**
+//     * Gets the service path component.
+//     *
+//     * @return the service path component
+//     */
+//    abstract public String getServicePathComponent();
+
+    /**
+     * Instantiates a new abstract service client impl.
+     */
+    protected AbstractServiceClientImpl() {
+        readProperties();
+        setupHttpClient();
+        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
+        RegisterBuiltin.register(factory);
+        setProxy();        
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.collectionspace.services.client.CollectionSpaceClient#getProperty
+     * (java.lang.String)
+     */
+    @Override
+    public String getProperty(String propName) {
+        return properties.getProperty(propName);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.collectionspace.services.client.CollectionSpaceClient#setProperty
+     * (java.lang.String, java.lang.String)
+     */
+    @Override
+    public void setProperty(String propName, String value) {
+        properties.setProperty(propName, value);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.collectionspace.services.client.CollectionSpaceClient#removeProperty
+     * (java.lang.String)
+     */
+    @Override
+    public Object removeProperty(String propName) {
+        return properties.remove(propName);
+    }
+
+    /**
+     * Prints the properties.
+     */
+    public void printProperties() {
+        for (Object kobj : properties.keySet()) {
+            String key = (String) kobj;
+            logger.trace("begin property name=" + key + " value="
+                    + properties.get(key));
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.collectionspace.services.client.CollectionSpaceClient#getBaseURL()
+     */
+    @Override
+    public String getBaseURL() {
+        return properties.getProperty(URL_PROPERTY);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.collectionspace.services.client.CollectionSpaceClient#getHttpClient()
+     */
+    @Override
+    public HttpClient getHttpClient() {
+        return httpClient;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.collectionspace.services.client.CollectionSpaceClient#useAuth()
+     */
+    @Override
+    public boolean useAuth() {
+        String auth = properties.getProperty(AUTH_PROPERTY);
+        return Boolean.valueOf(auth);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.collectionspace.services.client.CollectionSpaceClient#useSSL()
+     */
+    @Override
+    public boolean useSSL() {
+        String ssl = properties.getProperty(SSL_PROPERTY);
+        return Boolean.valueOf(ssl);
+    }
+
+    /**
+     * readProperties reads properties from system class path as well as it
+     * overrides properties made available using command line
+     *
+     * @exception RuntimeException
+     */
+    private void readProperties() {
+
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
+        InputStream is = null;
+        try {
+            is = cl.getResourceAsStream("collectionspace-client.properties");
+            properties.load(is);
+            if (logger.isDebugEnabled()) {
+                printProperties();
+            }
+            String spec = System.getProperty(URL_PROPERTY);
+            if (spec != null && !"".equals(spec)) {
+                properties.setProperty(URL_PROPERTY, spec);
+            }
+
+            spec = properties.getProperty(URL_PROPERTY);
+            url = new URL(spec);
+            logger.debug("readProperties() using url=" + url);
+
+            String auth = System.getProperty(AUTH_PROPERTY);
+            if (auth != null && !"".equals(auth)) {
+                properties.setProperty(AUTH_PROPERTY, auth);
+            }
+            String ssl = System.getProperty(SSL_PROPERTY);
+            if (ssl != null && !"".equals(ssl)) {
+                properties.setProperty(AUTH_PROPERTY, ssl);
+            }
+            String user = System.getProperty(USER_PROPERTY);
+            if (user != null && !"".equals(user)) {
+                properties.setProperty(USER_PROPERTY, user);
+            }
+            String password = System.getProperty(PASSWORD_PROPERTY);
+            if (password != null && !"".equals(password)) {
+                properties.setProperty(PASSWORD_PROPERTY, password);
+            }
+            String tenant = System.getProperty(TENANT_PROPERTY);
+            if (tenant != null && !"".equals(tenant)) {
+                properties.setProperty(TENANT_PROPERTY, tenant);
+            }
+            if (logger.isDebugEnabled()) {
+                printProperties();
+            }
+        } catch (Exception e) {
+            logger.debug("Caught exception while reading properties", e);
+            throw new RuntimeException(e);
+        } finally {
+            if (is != null) {
+                try {
+                    is.close();
+                } catch (Exception e) {
+                    if (logger.isDebugEnabled() == true) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * setupHttpClient sets up HTTP client for the service client the setup
+     * process relies on the following properties URL_PROPERTY USER_PROPERTY
+     * PASSWORD_PROPERTY AUTH_PROPERTY SSL_PROPERTY
+     */
+    @Override
+    public void setupHttpClient() {
+       try {
+               this.httpClient = new HttpClient();
+               if (useAuth()) {
+                   String user = properties.getProperty(USER_PROPERTY);
+                   String password = properties.getProperty(PASSWORD_PROPERTY);
+                   if (logger.isDebugEnabled()) {
+                       logger.debug("setupHttpClient() using url=" + url + " user="
+                               + user + " password=" + password);
+                   }
+       
+                   httpClient.getState().setCredentials(
+                           new AuthScope(url.getHost(), url.getPort(),
+                           AuthScope.ANY_REALM),
+                           new UsernamePasswordCredentials(user, password));
+                   // JAXRS client library requires HTTP preemptive authentication
+                   httpClient.getParams().setAuthenticationPreemptive(true);
+                   if (logger.isDebugEnabled()) {
+                       logger.debug("setupHttpClient: set preemptive authentication");
+                   }
+               } else {
+                   if (logger.isDebugEnabled()) {
+                       logger.debug("setupHttpClient() : no auth mode!");
+                   }
+               }
+       } catch (Throwable e) {
+               e.printStackTrace();
+       }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.collectionspace.services.client.CollectionSpaceClient#isServerSecure
+     * ()
+     */
+    @Override
+    public boolean isServerSecure() {
+        return Boolean.getBoolean("cspace.server.secure");
+    }
+
+    @Override
+    public P getProxy() {
+       return proxy;
+    }
+    
+    /**
+     * allow to reset proxy as per security needs
+     */
+    @Override
+       public void setProxy() {
+       Class<P> proxyClass = this.getProxyClass();
+        if (useAuth()) {
+            proxy = ProxyFactory.create(proxyClass,
+                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
+        } else {
+               proxy = ProxyFactory.create(proxyClass,
+                    getBaseURL());
+        }
+    }
+
+    @Override
+       public void setAuth(boolean useAuth,
+            String user, boolean useUser,
+            String password, boolean usePassword) {
+        if (useAuth == true) {
+            setProperty(CollectionSpaceClient.AUTH_PROPERTY, "true");
+            if (useUser) {
+                setProperty(CollectionSpaceClient.USER_PROPERTY,
+                        user);
+            } else {
+                removeProperty(CollectionSpaceClient.USER_PROPERTY);
+            }
+            if (usePassword) {
+                setProperty(CollectionSpaceClient.PASSWORD_PROPERTY,
+                        password);
+            } else {
+                removeProperty(CollectionSpaceClient.PASSWORD_PROPERTY);
+            }
+        } else {
+            removeProperty(CollectionSpaceClient.AUTH_PROPERTY);
+        }
+        setupHttpClient();
+        setProxy();
+    }
+    
+       /*
+        * 
+        * Common Proxied service calls
+        * 
+        */
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.AbstractServiceClientImpl#delete(java.lang.String)
+     */
+    @Override
+       public ClientResponse<Response> delete(String csid) {
+        return getProxy().delete(csid);
+    }
+
+    /**
+     * @param csid
+     * @return
+     * @see org.collectionspace.services.client.BlobProxy#getAuthorityRefs(java.lang.String)
+     */
+    @Override
+       public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
+        return getProxy().getAuthorityRefs(csid);
+    }
+    
+    @Override
+       public ClientResponse<String> getWorkflow(String csid) {
+       return getProxy().getWorkflow(csid);
+    }
+    
+    @Override
+       public ClientResponse<String> updateWorkflowWithTransition(String csid, String workflowTransition) {
+       return getProxy().updateWorkflowWithTransition(csid, workflowTransition);
+    }        
+    
+    /*
+     * Because of how RESTEasy creates proxy classes, sub-interfaces will need to override
+     * these methods with their specific "common" list return types.  Otherwise, only the info
+     * in the AbstractCommonList type will be returned to the callers
+     */
+
+    
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.collectionspace.services.client.CollectionSpaceClient#readList(java
+     * .lang.String, java.lang.String)
+     */
+    @Override
+    public ClientResponse<CLT> readList(Long pageSize,
+               Long pageNumber) {
+        return getProxy().readList(pageSize, pageNumber);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.collectionspace.services.client.CollectionSpaceClient#readList(java
+     * .lang.String, java.lang.String)
+     */
+    @Override
+    public ClientResponse<CLT> readList(String sortBy, Long pageSize,
+            Long pageNumber) {
+        return getProxy().readList(sortBy, pageSize, pageNumber);
+    }
+}
index 1dea28bba309d1c49dbfce8664e2720d46f5e431..affb581bd554510ceeaa4e4b6de780dd3bea2ddd 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.core.Response;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
-import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-/*\r
- * LT - List type\r
- * ILT - Authority item list type\r
- * P - Proxy type\r
- */\r
-public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy> \r
-       extends CollectionSpacePoxClient<AbstractCommonList, P> {\r
-\r
-    /** The uri path element for items in an authority */\r
-    public static String ITEMS = "items";    //used to construct uri's in service paths for authorities.\r
-\r
-       /*\r
-        * Basic CRUD operations\r
-        */\r
-       \r
-    String getItemCommonPartName();\r
-    \r
-    // Get the inAuthorityCsid (the item's parent)\r
-    String getInAuthority(AUTHORITY_ITEM_TYPE item);\r
-       \r
-    // Get the inAuthorityCsid (the item's parent)\r
-    void setInAuthority(AUTHORITY_ITEM_TYPE item, String inAuthorityCsid);\r
-       \r
-    //(C)reate Item\r
-    ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut);\r
-\r
-    //(R)ead Item\r
-    ClientResponse<String> readItem(String vcsid, String csid);\r
-    \r
-    //(R)ead Item\r
-    ClientResponse<String> readItem(String vcsid, String csid, Boolean includeDeleted);    \r
-\r
-    //(U)pdate Item\r
-    ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut);\r
-\r
-    //(D)elete Item\r
-    ClientResponse<Response> deleteItem(String vcsid, String csid);\r
-    \r
-    // Get a list of objects that\r
-    ClientResponse<AuthorityRefDocList> getReferencingObjects(\r
-            String parentcsid,\r
-            String itemcsid);\r
-    /**\r
-     * Get a list of objects that reference a given authority term.\r
-     * \r
-     * @param parentcsid \r
-     * @param itemcsid \r
-     * @param csid\r
-     * @return\r
-     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)\r
-     */\r
-    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String itemcsid);    \r
-    \r
-    /*\r
-     * \r
-     */\r
-    \r
-    ClientResponse<String> readByName(String name);\r
-    \r
-    ClientResponse<String> readByName(String name, Boolean includeDeleted);\r
-    \r
-    /*\r
-     * Item subresource methods\r
-     */\r
-    \r
-    /**\r
-     * Read named item.\r
-     *\r
-     * @param vcsid the vcsid\r
-     * @param shortId the shortIdentifier\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> readNamedItem(String vcsid, String shortId);\r
-\r
-    public ClientResponse<String> readNamedItem(String vcsid, String shortId, Boolean includeDeleted);\r
-\r
-    /**\r
-     * Read item in Named Authority.\r
-     *\r
-     * @param authShortId the shortIdentifier for the Authority\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid);\r
-\r
-    public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted);\r
-\r
-    /**\r
-     * Read named item in Named Authority.\r
-     *\r
-     * @param authShortId the shortIdentifier for the Authority\r
-     * @param itemShortId the shortIdentifier for the item\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId);\r
-    \r
-    public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted);\r
-    \r
-    /**\r
-     * Read item list, filtering by partial term match, or keywords. Only one of\r
-     * partialTerm or keywords should be specified. If both are specified, keywords\r
-     * will be ignored.\r
-     *\r
-     * @param inAuthority the parent authority\r
-     * @param partialTerm A partial term on which to match,\r
-     *     which will filter list results to return only matched resources.\r
-     * @param keywords A set of keywords on which to match,\r
-     *     which will filter list results to return only matched resources.\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<AbstractCommonList> readItemList(String inAuthority, String partialTerm, String keywords);\r
-    \r
-    public ClientResponse<AbstractCommonList> readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted);\r
-    \r
-    /**\r
-     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of\r
-     * partialTerm or keywords should be specified. If both are specified, keywords\r
-     * will be ignored.\r
-     *\r
-     * @param specifier the specifier\r
-     * @param partialTerm A partial term on which to match,\r
-     *     which will filter list results to return only matched resources.\r
-     * @param keywords A set of keywords on which to match,\r
-     *     which will filter list results to return only matched resources.\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(String specifier, \r
-               String partialTerm, String keywords);\r
-    \r
-    public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(String specifier, \r
-               String partialTerm, \r
-               String keywords,\r
-               Boolean includeDeleted);\r
-    \r
-    /*\r
-     * Workflow related methods\r
-     */\r
-    \r
-    public ClientResponse<String> readItemWorkflow(String vcsid, String csid);\r
-    \r
-    public ClientResponse<String> updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition);\r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+/*
+ * LT - List type
+ * ILT - Authority item list type
+ * P - Proxy type
+ */
+public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy> 
+       extends CollectionSpacePoxClient<AbstractCommonList, P> {
+
+    /** The uri path element for items in an authority */
+    public static String ITEMS = "items";    //used to construct uri's in service paths for authorities.
+
+       /*
+        * Basic CRUD operations
+        */
+       
+    String getItemCommonPartName();
+    
+    // Get the inAuthorityCsid (the item's parent)
+    String getInAuthority(AUTHORITY_ITEM_TYPE item);
+       
+    // Get the inAuthorityCsid (the item's parent)
+    void setInAuthority(AUTHORITY_ITEM_TYPE item, String inAuthorityCsid);
+       
+    //(C)reate Item
+    ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut);
+
+    //(R)ead Item
+    ClientResponse<String> readItem(String vcsid, String csid);
+    
+    //(R)ead Item
+    ClientResponse<String> readItem(String vcsid, String csid, Boolean includeDeleted);    
+
+    //(U)pdate Item
+    ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut);
+
+    //(D)elete Item
+    ClientResponse<Response> deleteItem(String vcsid, String csid);
+    
+    // Get a list of objects that
+    ClientResponse<AuthorityRefDocList> getReferencingObjects(
+            String parentcsid,
+            String itemcsid);
+    /**
+     * Get a list of objects that reference a given authority term.
+     * 
+     * @param parentcsid 
+     * @param itemcsid 
+     * @param csid
+     * @return
+     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
+     */
+    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String itemcsid);    
+    
+    /*
+     * 
+     */
+    
+    ClientResponse<String> readByName(String name);
+    
+    ClientResponse<String> readByName(String name, Boolean includeDeleted);
+    
+    /*
+     * Item subresource methods
+     */
+    
+    /**
+     * Read named item.
+     *
+     * @param vcsid the vcsid
+     * @param shortId the shortIdentifier
+     * @return the client response
+     */
+    public ClientResponse<String> readNamedItem(String vcsid, String shortId);
+
+    public ClientResponse<String> readNamedItem(String vcsid, String shortId, Boolean includeDeleted);
+
+    /**
+     * Read item in Named Authority.
+     *
+     * @param authShortId the shortIdentifier for the Authority
+     * @param csid the csid
+     * @return the client response
+     */
+    public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid);
+
+    public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted);
+
+    /**
+     * Read named item in Named Authority.
+     *
+     * @param authShortId the shortIdentifier for the Authority
+     * @param itemShortId the shortIdentifier for the item
+     * @return the client response
+     */
+    public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId);
+    
+    public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted);
+    
+    /**
+     * Read item list, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
+     *
+     * @param inAuthority the parent authority
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
+     * @return the client response
+     */
+    public ClientResponse<AbstractCommonList> readItemList(String inAuthority, String partialTerm, String keywords);
+    
+    public ClientResponse<AbstractCommonList> readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted);
+    
+    /**
+     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
+     *
+     * @param specifier the specifier
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
+     * @return the client response
+     */
+    public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(String specifier, 
+               String partialTerm, String keywords);
+    
+    public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(String specifier, 
+               String partialTerm, 
+               String keywords,
+               Boolean includeDeleted);
+    
+    /*
+     * Workflow related methods
+     */
+    
+    public ClientResponse<String> readItemWorkflow(String vcsid, String csid);
+    
+    public ClientResponse<String> updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition);
+}
index a79d448448f57694a5a74be4c763633f116fe222..7d8443a21a9ff72c6760caf5ef6edacc2911384c 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.core.Response;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
-import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-/*\r
- * P - Proxy type\r
- */\r
-public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>\r
-       extends AbstractPoxServiceClientImpl<AbstractCommonList, P>\r
-       implements AuthorityClient<AUTHORITY_ITEM_TYPE, P> {\r
-\r
-       private static final String INCLUDE_DELETE_TRUE = Boolean.TRUE.toString();\r
-       /*\r
-        * Basic CRUD proxied methods\r
-        */\r
-\r
-       //(C)reate Item\r
-       @Override\r
-    public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut) {\r
-       return getProxy().createItem(vcsid, poxPayloadOut.getBytes());\r
-    }\r
-\r
-    //(R)ead Item\r
-    @Override\r
-       public ClientResponse<String> readItem(String vcsid, String csid) {\r
-       return getProxy().readItem(vcsid, csid, INCLUDE_DELETE_TRUE);\r
-    }\r
-    \r
-    @Override\r
-    public ClientResponse<String> readItem(String vcsid, String csid, Boolean includeDeleted) {\r
-       return getProxy().readItem(vcsid, csid, includeDeleted.toString());\r
-    }\r
-\r
-    //(U)pdate Item\r
-    @Override\r
-       public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {\r
-       return getProxy().updateItem(vcsid, csid, poxPayloadOut.getBytes());\r
-    }\r
-\r
-    //(D)elete Item\r
-    @Override\r
-       public ClientResponse<Response> deleteItem(String vcsid, String csid) {\r
-       return getProxy().deleteItem(vcsid, csid);\r
-    }\r
-    \r
-    @Override\r
-       public ClientResponse<AuthorityRefDocList> getReferencingObjects(\r
-            String parentcsid,\r
-            String itemcsid) {\r
-       return getProxy().getReferencingObjects(parentcsid, itemcsid, Boolean.TRUE.toString());\r
-    }\r
-    \r
-    /**\r
-     * Gets the item authority refs.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param csid the csid\r
-     * @return the item authority refs\r
-     */\r
-    @Override\r
-       public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {\r
-        return getProxy().getItemAuthorityRefs(parentcsid, csid);\r
-    }\r
-    \r
-    /*\r
-     * \r
-     */\r
-    \r
-    @Override\r
-       public ClientResponse<String> readByName(String name) {\r
-       return getProxy().readByName(name, INCLUDE_DELETE_TRUE);\r
-    }\r
-    \r
-    @Override\r
-       public ClientResponse<String> readByName(String name, Boolean includeDeleted) {\r
-       return getProxy().readByName(name, includeDeleted.toString());\r
-    }\r
-    \r
-    /*\r
-     * Item subresource methods\r
-     */\r
-    \r
-    /**\r
-     * Read named item.\r
-     *\r
-     * @param vcsid the vcsid\r
-     * @param shortId the shortIdentifier\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> readNamedItem(String vcsid, String shortId) {\r
-        return getProxy().readNamedItem(vcsid, shortId, INCLUDE_DELETE_TRUE);\r
-    }\r
-\r
-    @Override\r
-       public ClientResponse<String> readNamedItem(String vcsid, String shortId, Boolean includeDeleted) {\r
-        return getProxy().readNamedItem(vcsid, shortId, includeDeleted.toString());\r
-    }\r
-\r
-    /**\r
-     * Read item in Named Authority.\r
-     *\r
-     * @param authShortId the shortIdentifier for the Authority\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {\r
-        return getProxy().readItemInNamedAuthority(authShortId, csid, INCLUDE_DELETE_TRUE);\r
-    }\r
-\r
-    @Override\r
-       public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted) {\r
-        return getProxy().readItemInNamedAuthority(authShortId, csid, includeDeleted.toString());\r
-    }\r
-\r
-    /**\r
-     * Read named item in Named Authority.\r
-     *\r
-     * @param authShortId the shortIdentifier for the Authority\r
-     * @param itemShortId the shortIdentifier for the item\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {\r
-        return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId, INCLUDE_DELETE_TRUE);\r
-    }\r
-\r
-    @Override\r
-       public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted) {\r
-        return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId, includeDeleted.toString());\r
-    }\r
-\r
-    /**\r
-     * Read item list, filtering by partial term match, or keywords. Only one of\r
-     * partialTerm or keywords should be specified. If both are specified, keywords\r
-     * will be ignored.\r
-     *\r
-     * @param inAuthority the parent authority\r
-     * @param partialTerm A partial term on which to match,\r
-     *     which will filter list results to return only matched resources.\r
-     * @param keywords A set of keywords on which to match,\r
-     *     which will filter list results to return only matched resources.\r
-     * @return the client response\r
-     */\r
-    @Override\r
-    public ClientResponse<AbstractCommonList> \r
-               readItemList(String inAuthority, String partialTerm, String keywords) {\r
-        return getProxy().readItemList(inAuthority, partialTerm, keywords, INCLUDE_DELETE_TRUE);\r
-    }\r
-\r
-    @Override\r
-    public ClientResponse<AbstractCommonList> \r
-               readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted) {\r
-        return getProxy().readItemList(inAuthority, partialTerm, keywords, includeDeleted.toString());\r
-    }\r
-\r
-    /**\r
-     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of\r
-     * partialTerm or keywords should be specified. If both are specified, keywords\r
-     * will be ignored.\r
-     *\r
-     * @param specifier the specifier\r
-     * @param partialTerm A partial term on which to match,\r
-     *     which will filter list results to return only matched resources.\r
-     * @param keywords A set of keywords on which to match,\r
-     *     which will filter list results to return only matched resources.\r
-     * @return the client response\r
-     */\r
-\r
-       @Override\r
-       public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(\r
-                       String specifier, String partialTerm, String keywords) {\r
-        return getProxy().readItemListForNamedAuthority(specifier, partialTerm, keywords, INCLUDE_DELETE_TRUE);\r
-       }\r
-\r
-       @Override\r
-       public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(\r
-                       String specifier, \r
-                       String partialTerm, \r
-                       String keywords,\r
-                       Boolean includeDeleted) {\r
-        return getProxy().readItemListForNamedAuthority(specifier, partialTerm, keywords, includeDeleted.toString());\r
-       }\r
-       \r
-       /*\r
-        * Workflow related  methods\r
-        */\r
-       \r
-       @Override\r
-    public ClientResponse<String> readItemWorkflow(String vcsid, String csid) {\r
-       return getProxy().readItemWorkflow(vcsid, csid);\r
-    }\r
-    \r
-       @Override\r
-    public ClientResponse<String> updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition) {\r
-       return getProxy().updateItemWorkflowWithTransition(vcsid, csid, workflowTransition);\r
-    }\r
-       \r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+/*
+ * P - Proxy type
+ */
+public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
+       extends AbstractPoxServiceClientImpl<AbstractCommonList, P>
+       implements AuthorityClient<AUTHORITY_ITEM_TYPE, P> {
+
+       private static final String INCLUDE_DELETE_TRUE = Boolean.TRUE.toString();
+       /*
+        * Basic CRUD proxied methods
+        */
+
+       //(C)reate Item
+       @Override
+    public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut) {
+       return getProxy().createItem(vcsid, poxPayloadOut.getBytes());
+    }
+
+    //(R)ead Item
+    @Override
+       public ClientResponse<String> readItem(String vcsid, String csid) {
+       return getProxy().readItem(vcsid, csid, INCLUDE_DELETE_TRUE);
+    }
+    
+    @Override
+    public ClientResponse<String> readItem(String vcsid, String csid, Boolean includeDeleted) {
+       return getProxy().readItem(vcsid, csid, includeDeleted.toString());
+    }
+
+    //(U)pdate Item
+    @Override
+       public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {
+       return getProxy().updateItem(vcsid, csid, poxPayloadOut.getBytes());
+    }
+
+    //(D)elete Item
+    @Override
+       public ClientResponse<Response> deleteItem(String vcsid, String csid) {
+       return getProxy().deleteItem(vcsid, csid);
+    }
+    
+    @Override
+       public ClientResponse<AuthorityRefDocList> getReferencingObjects(
+            String parentcsid,
+            String itemcsid) {
+       return getProxy().getReferencingObjects(parentcsid, itemcsid, Boolean.TRUE.toString());
+    }
+    
+    /**
+     * Gets the item authority refs.
+     *
+     * @param parentcsid the parentcsid
+     * @param csid the csid
+     * @return the item authority refs
+     */
+    @Override
+       public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {
+        return getProxy().getItemAuthorityRefs(parentcsid, csid);
+    }
+    
+    /*
+     * 
+     */
+    
+    @Override
+       public ClientResponse<String> readByName(String name) {
+       return getProxy().readByName(name, INCLUDE_DELETE_TRUE);
+    }
+    
+    @Override
+       public ClientResponse<String> readByName(String name, Boolean includeDeleted) {
+       return getProxy().readByName(name, includeDeleted.toString());
+    }
+    
+    /*
+     * Item subresource methods
+     */
+    
+    /**
+     * Read named item.
+     *
+     * @param vcsid the vcsid
+     * @param shortId the shortIdentifier
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> readNamedItem(String vcsid, String shortId) {
+        return getProxy().readNamedItem(vcsid, shortId, INCLUDE_DELETE_TRUE);
+    }
+
+    @Override
+       public ClientResponse<String> readNamedItem(String vcsid, String shortId, Boolean includeDeleted) {
+        return getProxy().readNamedItem(vcsid, shortId, includeDeleted.toString());
+    }
+
+    /**
+     * Read item in Named Authority.
+     *
+     * @param authShortId the shortIdentifier for the Authority
+     * @param csid the csid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {
+        return getProxy().readItemInNamedAuthority(authShortId, csid, INCLUDE_DELETE_TRUE);
+    }
+
+    @Override
+       public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted) {
+        return getProxy().readItemInNamedAuthority(authShortId, csid, includeDeleted.toString());
+    }
+
+    /**
+     * Read named item in Named Authority.
+     *
+     * @param authShortId the shortIdentifier for the Authority
+     * @param itemShortId the shortIdentifier for the item
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {
+        return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId, INCLUDE_DELETE_TRUE);
+    }
+
+    @Override
+       public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted) {
+        return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId, includeDeleted.toString());
+    }
+
+    /**
+     * Read item list, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
+     *
+     * @param inAuthority the parent authority
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
+     * @return the client response
+     */
+    @Override
+    public ClientResponse<AbstractCommonList> 
+               readItemList(String inAuthority, String partialTerm, String keywords) {
+        return getProxy().readItemList(inAuthority, partialTerm, keywords, INCLUDE_DELETE_TRUE);
+    }
+
+    @Override
+    public ClientResponse<AbstractCommonList> 
+               readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted) {
+        return getProxy().readItemList(inAuthority, partialTerm, keywords, includeDeleted.toString());
+    }
+
+    /**
+     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
+     *
+     * @param specifier the specifier
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
+     * @return the client response
+     */
+
+       @Override
+       public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(
+                       String specifier, String partialTerm, String keywords) {
+        return getProxy().readItemListForNamedAuthority(specifier, partialTerm, keywords, INCLUDE_DELETE_TRUE);
+       }
+
+       @Override
+       public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(
+                       String specifier, 
+                       String partialTerm, 
+                       String keywords,
+                       Boolean includeDeleted) {
+        return getProxy().readItemListForNamedAuthority(specifier, partialTerm, keywords, includeDeleted.toString());
+       }
+       
+       /*
+        * Workflow related  methods
+        */
+       
+       @Override
+    public ClientResponse<String> readItemWorkflow(String vcsid, String csid) {
+       return getProxy().readItemWorkflow(vcsid, csid);
+    }
+    
+       @Override
+    public ClientResponse<String> updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition) {
+       return getProxy().updateItemWorkflowWithTransition(vcsid, csid, workflowTransition);
+    }
+       
+}
index d10344f4e101de15163d95a84e3343a606779ade..37f16e4587a2469842aa91b0f4c5f04248902f15 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.Consumes;\r
-import javax.ws.rs.DELETE;\r
-import javax.ws.rs.GET;\r
-import javax.ws.rs.POST;\r
-import javax.ws.rs.PUT;\r
-import javax.ws.rs.Path;\r
-import javax.ws.rs.PathParam;\r
-import javax.ws.rs.Produces;\r
-import javax.ws.rs.QueryParam;\r
-import javax.ws.rs.core.Response;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-import org.collectionspace.services.client.workflow.WorkflowClient;\r
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
-import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-/*\r
- * ILT = Item list type\r
- * LT = List type\r
- */\r
-public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {\r
-       \r
-       /*\r
-        * Basic CRUD operations\r
-        */\r
-       \r
-    //(C)reate Item\r
-    @POST\r
-    @Path("/{vcsid}/items/")\r
-    ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);\r
-\r
-    //(R)ead Item\r
-    @GET\r
-    @Path("/{vcsid}/items/{csid}")\r
-    ClientResponse<String> readItem(@PathParam("vcsid") String vcsid,\r
-               @PathParam("csid") String csid,\r
-               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-    \r
-    //(U)pdate Item\r
-    @PUT\r
-    @Path("/{vcsid}/items/{csid}")\r
-    ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);\r
-\r
-    //(D)elete Item\r
-    @DELETE\r
-    @Path("/{vcsid}/items/{csid}")\r
-    ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);\r
-    \r
-    /**\r
-     * Get a list of objects that reference a given authority term.\r
-     * \r
-     * @param parentcsid \r
-     * @param itemcsid \r
-     * @param csid\r
-     * @return\r
-     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)\r
-     */\r
-    @GET\r
-    @Path("{csid}/items/{itemcsid}/refObjs")\r
-    @Produces("application/xml")\r
-    ClientResponse<AuthorityRefDocList> getReferencingObjects(\r
-            @PathParam("csid") String parentcsid,\r
-            @PathParam("itemcsid") String itemcsid,\r
-            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-    \r
-    // List Item Authority References\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Path("/{parentcsid}/items/{itemcsid}/authorityrefs/")\r
-    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemcsid") String itemcsid);\r
-    \r
-    /*\r
-     * \r
-     */\r
-    \r
-    //(R)ead by name\r
-    @GET\r
-    @Path("/urn:cspace:name({name})")\r
-    ClientResponse<String> readByName(@PathParam("name") String name,\r
-               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-    \r
-    /*\r
-     * Item subresource methods\r
-     */\r
-    \r
-    //(R)ead Named Item\r
-    @GET\r
-    @Path("/{vcsid}/items/urn:cspace:name({specifier})")\r
-    ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid,\r
-               @PathParam("specifier") String specifier,\r
-               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-\r
-    //(R)ead Item In Named Authority\r
-    @GET\r
-    @Path("/urn:cspace:name({specifier})/items/{csid}")\r
-    ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier,\r
-               @PathParam("csid") String csid,\r
-               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-\r
-    //(R)ead Named Item In Named Authority\r
-    @GET\r
-    @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")\r
-    ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, \r
-               @PathParam("itemspecifier") String itemspecifier,\r
-               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-    \r
-    /*\r
-     * Item subresource List methods\r
-     */\r
-\r
-    // List Items matching a partial term or keywords.\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Path("/{csid}/items/")\r
-    ClientResponse<AbstractCommonList> readItemList(\r
-               @PathParam("csid") String vcsid,\r
-            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,\r
-            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,\r
-            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-    \r
-    // List Items for a named authority matching a partial term or keywords.\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Path("/urn:cspace:name({specifier})/items/")\r
-    ClientResponse<AbstractCommonList> readItemListForNamedAuthority(\r
-               @PathParam("specifier") String specifier,\r
-            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,\r
-            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,\r
-            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-\r
-    /*\r
-     * Workflow related methods\r
-     * \r
-     */\r
-    \r
-    //(R)ead Item workflow\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Consumes({"application/xml"})    \r
-    @Path("/{vcsid}/items/{csid}" + WorkflowClient.SERVICE_PATH)\r
-    ClientResponse<String> readItemWorkflow(@PathParam("vcsid") String vcsid,\r
-               @PathParam("csid") String csid);\r
-            \r
-    //(U)pdate Item workflow\r
-    @PUT\r
-    @Path("/{vcsid}/items/{csid}" + WorkflowClient.SERVICE_PATH + "/{transition}")\r
-    ClientResponse<String> updateItemWorkflowWithTransition(\r
-               @PathParam("vcsid") String vcsid,\r
-               @PathParam("csid") String csid,\r
-               @PathParam("transition") String transition);\r
-    \r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.collectionspace.services.client.workflow.WorkflowClient;
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+/*
+ * ILT = Item list type
+ * LT = List type
+ */
+public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
+       
+       /*
+        * Basic CRUD operations
+        */
+       
+    //(C)reate Item
+    @POST
+    @Path("/{vcsid}/items/")
+    ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
+
+    //(R)ead Item
+    @GET
+    @Path("/{vcsid}/items/{csid}")
+    ClientResponse<String> readItem(@PathParam("vcsid") String vcsid,
+               @PathParam("csid") String csid,
+               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+    
+    //(U)pdate Item
+    @PUT
+    @Path("/{vcsid}/items/{csid}")
+    ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
+
+    //(D)elete Item
+    @DELETE
+    @Path("/{vcsid}/items/{csid}")
+    ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
+    
+    /**
+     * Get a list of objects that reference a given authority term.
+     * 
+     * @param parentcsid 
+     * @param itemcsid 
+     * @param csid
+     * @return
+     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
+     */
+    @GET
+    @Path("{csid}/items/{itemcsid}/refObjs")
+    @Produces("application/xml")
+    ClientResponse<AuthorityRefDocList> getReferencingObjects(
+            @PathParam("csid") String parentcsid,
+            @PathParam("itemcsid") String itemcsid,
+            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+    
+    // List Item Authority References
+    @GET
+    @Produces({"application/xml"})
+    @Path("/{parentcsid}/items/{itemcsid}/authorityrefs/")
+    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemcsid") String itemcsid);
+    
+    /*
+     * 
+     */
+    
+    //(R)ead by name
+    @GET
+    @Path("/urn:cspace:name({name})")
+    ClientResponse<String> readByName(@PathParam("name") String name,
+               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+    
+    /*
+     * Item subresource methods
+     */
+    
+    //(R)ead Named Item
+    @GET
+    @Path("/{vcsid}/items/urn:cspace:name({specifier})")
+    ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid,
+               @PathParam("specifier") String specifier,
+               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+
+    //(R)ead Item In Named Authority
+    @GET
+    @Path("/urn:cspace:name({specifier})/items/{csid}")
+    ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier,
+               @PathParam("csid") String csid,
+               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+
+    //(R)ead Named Item In Named Authority
+    @GET
+    @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")
+    ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, 
+               @PathParam("itemspecifier") String itemspecifier,
+               @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+    
+    /*
+     * Item subresource List methods
+     */
+
+    // List Items matching a partial term or keywords.
+    @GET
+    @Produces({"application/xml"})
+    @Path("/{csid}/items/")
+    ClientResponse<AbstractCommonList> readItemList(
+               @PathParam("csid") String vcsid,
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
+            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+    
+    // List Items for a named authority matching a partial term or keywords.
+    @GET
+    @Produces({"application/xml"})
+    @Path("/urn:cspace:name({specifier})/items/")
+    ClientResponse<AbstractCommonList> readItemListForNamedAuthority(
+               @PathParam("specifier") String specifier,
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
+            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+
+    /*
+     * Workflow related methods
+     * 
+     */
+    
+    //(R)ead Item workflow
+    @GET
+    @Produces({"application/xml"})
+    @Consumes({"application/xml"})    
+    @Path("/{vcsid}/items/{csid}" + WorkflowClient.SERVICE_PATH)
+    ClientResponse<String> readItemWorkflow(@PathParam("vcsid") String vcsid,
+               @PathParam("csid") String csid);
+            
+    //(U)pdate Item workflow
+    @PUT
+    @Path("/{vcsid}/items/{csid}" + WorkflowClient.SERVICE_PATH + "/{transition}")
+    ClientResponse<String> updateItemWorkflowWithTransition(
+               @PathParam("vcsid") String vcsid,
+               @PathParam("csid") String csid,
+               @PathParam("transition") String transition);
+    
+}
index 8f2bf0b8fe8f15f2133f27dbcda5f5014c7f769b..138b871811e543ef49638d0fc0cd58ef30e20051 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- *\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.collectionspace.services.client;\r
-\r
-import java.io.ByteArrayInputStream;\r
-import java.io.File;\r
-import java.io.InputStream;\r
-import java.io.StringWriter;\r
-import java.util.List;\r
-\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-import javax.xml.bind.JAXBContext;\r
-import javax.xml.bind.JAXBException;\r
-import javax.xml.bind.Marshaller;\r
-import javax.xml.bind.Unmarshaller;\r
-import javax.xml.parsers.DocumentBuilderFactory;\r
-\r
-import org.apache.commons.io.FileUtils;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.w3c.dom.Document;\r
-\r
-/**\r
- * CollectionSpaceClientUtils.\r
- *\r
- * Base abstract class on which client tests of services are based.\r
- *\r
- * $LastChangedRevision: 2261 $\r
- * $LastChangedDate: 2010-05-28 16:52:22 -0700 (Fri, 28 May 2010) $\r
- */\r
-\r
-// FIXME: http://issues.collectionspace.org/browse/CSPACE-1685\r
-\r
-public class CollectionSpaceClientUtils {\r
-\r
-    //Maven's base directory -i.e., the one containing the current pom.xml\r
-    /** The Constant logger. */\r
-    private static final Logger logger = LoggerFactory.getLogger(CollectionSpaceClientUtils.class);\r
-        \r
-    protected static final int STATUS_BAD_REQUEST =\r
-        Response.Status.BAD_REQUEST.getStatusCode();\r
-    protected static final int STATUS_CREATED =\r
-        Response.Status.CREATED.getStatusCode();\r
-    protected static final int STATUS_NOT_FOUND =\r
-        Response.Status.NOT_FOUND.getStatusCode();\r
-    protected static final int STATUS_OK =\r
-        Response.Status.OK.getStatusCode();\r
-\r
-    /**\r
-     * Extract id.\r
-     *\r
-     * @param res the res\r
-     * @return the string\r
-     */\r
-    static public String extractId(ClientResponse<Response> res) {\r
-        MultivaluedMap<String, Object> mvm = res.getMetadata();\r
-        return extractIdFromResponseMetadata(mvm);\r
-    }\r
\r
-    /**\r
-     * Extract id.\r
-     *\r
-     * @param res the res\r
-     * @return the string\r
-     */\r
-    static public String extractId(Response res) {\r
-        MultivaluedMap<String, Object> mvm = res.getMetadata();\r
-        return extractIdFromResponseMetadata(mvm);\r
-    }\r
\r
-    static protected String extractIdFromResponseMetadata(MultivaluedMap<String, Object> mvm) {\r
-       // mvm may return a java.net.URI which complains about casting to String...\r
-       String uri = ((List<Object>) mvm.get("Location")).get(0).toString();\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("extractId:uri=" + uri);\r
-        }\r
-        String[] segments = uri.split("/");\r
-        String id = segments[segments.length - 1];\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("id=" + id);\r
-        }\r
-        return id;\r
-    }\r
\r
-    /**\r
-     * Extract part.\r
-     *\r
-     * @param input the input\r
-     * @param label the label\r
-     * @param clazz the clazz\r
-     * @return the object\r
-     * @throws Exception the exception\r
-     */\r
-    static protected Object extractPart(PoxPayloadIn input, String label, Class<?> clazz)\r
-            throws Exception {\r
-       Object result = null;\r
-       PayloadInputPart payloadInputPart = input.getPart(label);\r
-        if (payloadInputPart != null) {\r
-               result = payloadInputPart.getBody();\r
-        } else if (logger.isWarnEnabled() == true) {\r
-               logger.warn("Payload part: " + label +\r
-                               " is missing from payload: " + input.getName());\r
-        }\r
-        return result;\r
-    }\r
-    \r
-    /**\r
-     * Extract part.\r
-     *\r
-     * @param input the input\r
-     * @param label the label\r
-     * @param clazz the clazz\r
-     * @return the object\r
-     * @throws Exception the exception\r
-     */\r
-    @Deprecated\r
-    static public Object extractPart(MultipartInput input, String label, Class<?> clazz)\r
-            throws Exception {\r
-        Object obj = null;\r
-        String partLabel = "";\r
-        List<InputPart> parts = input.getParts();\r
-        if (parts.size() == 0) {\r
-            logger.warn("No parts found in multipart body.");\r
-        }\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("Parts:");\r
-            for (InputPart part : parts) {\r
-                partLabel = part.getHeaders().getFirst("label");\r
-                logger.debug("part = " + partLabel);\r
-            }\r
-        }\r
-        boolean partLabelMatched = false;\r
-        for (InputPart part : parts) {\r
-            partLabel = part.getHeaders().getFirst("label");\r
-            if (label.equalsIgnoreCase(partLabel)) {\r
-                partLabelMatched = true;\r
-                if (logger.isDebugEnabled()) {\r
-                    logger.debug("found part" + partLabel);\r
-                }\r
-                String partStr = part.getBodyAsString();\r
-                if (partStr == null || partStr.trim().isEmpty()) {\r
-                    logger.warn("Part '" + label + "' in multipart body is empty.");\r
-                } else {\r
-                    if (logger.isDebugEnabled()) {\r
-                        logger.debug("extracted part as str=\n" + partStr);\r
-                    }\r
-                    obj = part.getBody(clazz, null);\r
-                    if (logger.isDebugEnabled()) {\r
-                        logger.debug("extracted part as obj=\n",\r
-                                objectAsXmlString(obj, clazz));\r
-                    }\r
-                }\r
-                break;\r
-            }\r
-        }\r
-        if (!partLabelMatched) {\r
-            logger.warn("Could not find part '" + label + "' in multipart body.");\r
-            // In the event that getBodyAsString() or getBody(), above, do *not*\r
-            // throw an IOException, but getBody() nonetheless retrieves a null object.\r
-            // This *may* be unreachable.\r
-        } else if (obj == null) {\r
-            logger.warn("Could not extract part '" + label\r
-                    + "' in multipart body as an object.");\r
-        }\r
-        return obj;\r
-    }\r
-\r
-    /**\r
-     * Gets the part object.\r
-     *\r
-     * @param partStr the part str\r
-     * @param clazz the clazz\r
-     * @return the part object\r
-     * @throws JAXBException the jAXB exception\r
-     */\r
-    static public Object getPartObject(String partStr, Class<?> clazz)\r
-            throws JAXBException {\r
-        JAXBContext jc = JAXBContext.newInstance(clazz);\r
-        ByteArrayInputStream bais = null;\r
-        Object obj = null;\r
-        try {\r
-            bais = new ByteArrayInputStream(partStr.getBytes());\r
-            Unmarshaller um = jc.createUnmarshaller();\r
-            obj = um.unmarshal(bais);\r
-        } finally {\r
-            if (bais != null) {\r
-                try {\r
-                    bais.close();\r
-                } catch (Exception e) {\r
-                       if (logger.isDebugEnabled() == true) {\r
-                               e.printStackTrace();\r
-                       }\r
-                }\r
-            }\r
-        }\r
-        return obj;\r
-    }\r
-\r
-    /**\r
-     * Object as xml string.\r
-     *\r
-     * @param o the o\r
-     * @param clazz the clazz\r
-     * @return the string\r
-     */\r
-    static public String objectAsXmlString(Object o, Class<?> clazz) {\r
-        StringWriter sw = new StringWriter();\r
-        try {\r
-            JAXBContext jc = JAXBContext.newInstance(clazz);\r
-            Marshaller m = jc.createMarshaller();\r
-            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,\r
-                    Boolean.TRUE);\r
-            m.marshal(o, sw);\r
-        } catch (Exception e) {\r
-            e.printStackTrace();\r
-        }\r
-        return sw.toString();\r
-    }\r
-\r
-    /**\r
-     * getObjectFromFile get object of given class from given file (in classpath)\r
-     * @param jaxbClass\r
-     * @param fileName of the file to read to construct the object\r
-     * @return\r
-     * @throws Exception\r
-     */\r
-    static public Object getObjectFromFile(Class<?> jaxbClass, String fileName)\r
-            throws Exception {\r
-        ClassLoader tccl = Thread.currentThread().getContextClassLoader();\r
-        InputStream is = tccl.getResourceAsStream(fileName);\r
-        return getObjectFromStream(jaxbClass, is);\r
-    }\r
-\r
-    /**\r
-     * Gets the xml document.\r
-     *\r
-     * @param fileName the file name\r
-     * @return the xml document\r
-     * @throws Exception the exception\r
-     */\r
-    static public Document getXmlDocument(String fileName) throws Exception {\r
-        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r
-        File f = new File(fileName);\r
-        if (!f.exists()) {\r
-            throw new IllegalArgumentException("test data file " + fileName + " not found!");\r
-        }\r
-        // Create the builder and parse the file\r
-        return factory.newDocumentBuilder().parse(f);\r
-    }\r
-\r
-    /**\r
-     * Gets the xml document as string.\r
-     *\r
-     * @param fileName the file name\r
-     * @return the xml document as string\r
-     * @throws Exception the exception\r
-     */\r
-    static public String getXmlDocumentAsString(String fileName) throws Exception {\r
-        byte[] b = FileUtils.readFileToByteArray(new File(fileName));\r
-        return new String(b);\r
-    }\r
-\r
-    /**\r
-     * getObjectFromStream get object of given class from given inputstream\r
-     * @param jaxbClass\r
-     * @param is stream to read to construct the object\r
-     * @return\r
-     * @throws Exception\r
-     */\r
-    static public Object getObjectFromStream(Class<?> jaxbClass, InputStream is) throws Exception {\r
-        JAXBContext context = JAXBContext.newInstance(jaxbClass);\r
-        Unmarshaller unmarshaller = context.createUnmarshaller();\r
-        //note: setting schema to null will turn validator off\r
-        unmarshaller.setSchema(null);\r
-        return jaxbClass.cast(unmarshaller.unmarshal(is));\r
-    }\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.collectionspace.services.client;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.util.List;
+
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.commons.io.FileUtils;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.multipart.InputPart;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+
+/**
+ * CollectionSpaceClientUtils.
+ *
+ * Base abstract class on which client tests of services are based.
+ *
+ * $LastChangedRevision: 2261 $
+ * $LastChangedDate: 2010-05-28 16:52:22 -0700 (Fri, 28 May 2010) $
+ */
+
+// FIXME: http://issues.collectionspace.org/browse/CSPACE-1685
+
+public class CollectionSpaceClientUtils {
+
+    //Maven's base directory -i.e., the one containing the current pom.xml
+    /** The Constant logger. */
+    private static final Logger logger = LoggerFactory.getLogger(CollectionSpaceClientUtils.class);
+        
+    protected static final int STATUS_BAD_REQUEST =
+        Response.Status.BAD_REQUEST.getStatusCode();
+    protected static final int STATUS_CREATED =
+        Response.Status.CREATED.getStatusCode();
+    protected static final int STATUS_NOT_FOUND =
+        Response.Status.NOT_FOUND.getStatusCode();
+    protected static final int STATUS_OK =
+        Response.Status.OK.getStatusCode();
+
+    /**
+     * Extract id.
+     *
+     * @param res the res
+     * @return the string
+     */
+    static public String extractId(ClientResponse<Response> res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        return extractIdFromResponseMetadata(mvm);
+    }
+    /**
+     * Extract id.
+     *
+     * @param res the res
+     * @return the string
+     */
+    static public String extractId(Response res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        return extractIdFromResponseMetadata(mvm);
+    }
+    static protected String extractIdFromResponseMetadata(MultivaluedMap<String, Object> mvm) {
+       // mvm may return a java.net.URI which complains about casting to String...
+       String uri = ((List<Object>) mvm.get("Location")).get(0).toString();
+        if (logger.isDebugEnabled()) {
+            logger.debug("extractId:uri=" + uri);
+        }
+        String[] segments = uri.split("/");
+        String id = segments[segments.length - 1];
+        if (logger.isDebugEnabled()) {
+            logger.debug("id=" + id);
+        }
+        return id;
+    }
+    /**
+     * Extract part.
+     *
+     * @param input the input
+     * @param label the label
+     * @param clazz the clazz
+     * @return the object
+     * @throws Exception the exception
+     */
+    static protected Object extractPart(PoxPayloadIn input, String label, Class<?> clazz)
+            throws Exception {
+       Object result = null;
+       PayloadInputPart payloadInputPart = input.getPart(label);
+        if (payloadInputPart != null) {
+               result = payloadInputPart.getBody();
+        } else if (logger.isWarnEnabled() == true) {
+               logger.warn("Payload part: " + label +
+                               " is missing from payload: " + input.getName());
+        }
+        return result;
+    }
+    
+    /**
+     * Extract part.
+     *
+     * @param input the input
+     * @param label the label
+     * @param clazz the clazz
+     * @return the object
+     * @throws Exception the exception
+     */
+    @Deprecated
+    static public Object extractPart(MultipartInput input, String label, Class<?> clazz)
+            throws Exception {
+        Object obj = null;
+        String partLabel = "";
+        List<InputPart> parts = input.getParts();
+        if (parts.size() == 0) {
+            logger.warn("No parts found in multipart body.");
+        }
+        if (logger.isDebugEnabled()) {
+            logger.debug("Parts:");
+            for (InputPart part : parts) {
+                partLabel = part.getHeaders().getFirst("label");
+                logger.debug("part = " + partLabel);
+            }
+        }
+        boolean partLabelMatched = false;
+        for (InputPart part : parts) {
+            partLabel = part.getHeaders().getFirst("label");
+            if (label.equalsIgnoreCase(partLabel)) {
+                partLabelMatched = true;
+                if (logger.isDebugEnabled()) {
+                    logger.debug("found part" + partLabel);
+                }
+                String partStr = part.getBodyAsString();
+                if (partStr == null || partStr.trim().isEmpty()) {
+                    logger.warn("Part '" + label + "' in multipart body is empty.");
+                } else {
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("extracted part as str=\n" + partStr);
+                    }
+                    obj = part.getBody(clazz, null);
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("extracted part as obj=\n",
+                                objectAsXmlString(obj, clazz));
+                    }
+                }
+                break;
+            }
+        }
+        if (!partLabelMatched) {
+            logger.warn("Could not find part '" + label + "' in multipart body.");
+            // In the event that getBodyAsString() or getBody(), above, do *not*
+            // throw an IOException, but getBody() nonetheless retrieves a null object.
+            // This *may* be unreachable.
+        } else if (obj == null) {
+            logger.warn("Could not extract part '" + label
+                    + "' in multipart body as an object.");
+        }
+        return obj;
+    }
+
+    /**
+     * Gets the part object.
+     *
+     * @param partStr the part str
+     * @param clazz the clazz
+     * @return the part object
+     * @throws JAXBException the jAXB exception
+     */
+    static public Object getPartObject(String partStr, Class<?> clazz)
+            throws JAXBException {
+        JAXBContext jc = JAXBContext.newInstance(clazz);
+        ByteArrayInputStream bais = null;
+        Object obj = null;
+        try {
+            bais = new ByteArrayInputStream(partStr.getBytes());
+            Unmarshaller um = jc.createUnmarshaller();
+            obj = um.unmarshal(bais);
+        } finally {
+            if (bais != null) {
+                try {
+                    bais.close();
+                } catch (Exception e) {
+                       if (logger.isDebugEnabled() == true) {
+                               e.printStackTrace();
+                       }
+                }
+            }
+        }
+        return obj;
+    }
+
+    /**
+     * Object as xml string.
+     *
+     * @param o the o
+     * @param clazz the clazz
+     * @return the string
+     */
+    static public String objectAsXmlString(Object o, Class<?> clazz) {
+        StringWriter sw = new StringWriter();
+        try {
+            JAXBContext jc = JAXBContext.newInstance(clazz);
+            Marshaller m = jc.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
+                    Boolean.TRUE);
+            m.marshal(o, sw);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return sw.toString();
+    }
+
+    /**
+     * getObjectFromFile get object of given class from given file (in classpath)
+     * @param jaxbClass
+     * @param fileName of the file to read to construct the object
+     * @return
+     * @throws Exception
+     */
+    static public Object getObjectFromFile(Class<?> jaxbClass, String fileName)
+            throws Exception {
+        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+        InputStream is = tccl.getResourceAsStream(fileName);
+        return getObjectFromStream(jaxbClass, is);
+    }
+
+    /**
+     * Gets the xml document.
+     *
+     * @param fileName the file name
+     * @return the xml document
+     * @throws Exception the exception
+     */
+    static public Document getXmlDocument(String fileName) throws Exception {
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        File f = new File(fileName);
+        if (!f.exists()) {
+            throw new IllegalArgumentException("test data file " + fileName + " not found!");
+        }
+        // Create the builder and parse the file
+        return factory.newDocumentBuilder().parse(f);
+    }
+
+    /**
+     * Gets the xml document as string.
+     *
+     * @param fileName the file name
+     * @return the xml document as string
+     * @throws Exception the exception
+     */
+    static public String getXmlDocumentAsString(String fileName) throws Exception {
+        byte[] b = FileUtils.readFileToByteArray(new File(fileName));
+        return new String(b);
+    }
+
+    /**
+     * getObjectFromStream get object of given class from given inputstream
+     * @param jaxbClass
+     * @param is stream to read to construct the object
+     * @return
+     * @throws Exception
+     */
+    static public Object getObjectFromStream(Class<?> jaxbClass, InputStream is) throws Exception {
+        JAXBContext context = JAXBContext.newInstance(jaxbClass);
+        Unmarshaller unmarshaller = context.createUnmarshaller();
+        //note: setting schema to null will turn validator off
+        unmarshaller.setSchema(null);
+        return jaxbClass.cast(unmarshaller.unmarshal(is));
+    }
+}
index 6ee3dfd7f2d25f7b1f505ed7c0fdf3b04c4dba8a..a1f470806eb516a7de7f038e84d6585a2c789c35 100644 (file)
@@ -1,34 +1,34 @@
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.GET;\r
-import javax.ws.rs.Produces;\r
-import javax.ws.rs.QueryParam;\r
-\r
-import org.collectionspace.services.client.workflow.WorkflowClient;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-public interface CollectionSpaceCommonListPoxProxy extends CollectionSpacePoxProxy<AbstractCommonList> {\r
-    @GET\r
-    ClientResponse<AbstractCommonList> readList();\r
-    \r
-    @Override\r
-       @GET\r
-    @Produces({"application/xml"})\r
-    ClientResponse<AbstractCommonList> readIncludeDeleted(\r
-            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-\r
-    @Override\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    ClientResponse<AbstractCommonList> keywordSearchIncludeDeleted(\r
-           @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,\r
-            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-\r
-    @Override\r
-       @GET\r
-       @Produces({ "application/xml" })\r
-       ClientResponse<AbstractCommonList> advancedSearchIncludeDeleted(\r
-                       @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_AS) String whereClause,\r
-                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+
+import org.collectionspace.services.client.workflow.WorkflowClient;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.jboss.resteasy.client.ClientResponse;
+
+public interface CollectionSpaceCommonListPoxProxy extends CollectionSpacePoxProxy<AbstractCommonList> {
+    @GET
+    ClientResponse<AbstractCommonList> readList();
+    
+    @Override
+       @GET
+    @Produces({"application/xml"})
+    ClientResponse<AbstractCommonList> readIncludeDeleted(
+            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+
+    @Override
+    @GET
+    @Produces({"application/xml"})
+    ClientResponse<AbstractCommonList> keywordSearchIncludeDeleted(
+           @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
+            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+
+    @Override
+       @GET
+       @Produces({ "application/xml" })
+       ClientResponse<AbstractCommonList> advancedSearchIncludeDeleted(
+                       @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_AS) String whereClause,
+                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+}
index 79ac9a3fedb6be78d848c57ea9744dc13aaaa7f0..676e4ad238a91436467435e844bffcf547e722f2 100644 (file)
@@ -1,27 +1,27 @@
-package org.collectionspace.services.client;\r
-\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-/*\r
- * <LT> = List type\r
- * <PT> = Payload type\r
- * <P> = Proxy type\r
- */\r
-public interface CollectionSpacePoxClient<LT extends AbstractCommonList, P extends CollectionSpacePoxProxy<LT>>\r
-       extends CollectionSpaceClient<LT, PoxPayloadOut, String, P> {\r
-       /*\r
-        * Common service calls\r
-        */\r
-    \r
-    public ClientResponse<String> readIncludeDeleted(String csid, Boolean includeDeleted);    \r
-\r
-    /*\r
-     * GET list with workflow 'deleted' state\r
-     */\r
-    public ClientResponse<LT> readIncludeDeleted(Boolean includeDeleted);\r
-\r
-    public ClientResponse<LT> keywordSearchIncludeDeleted(String keywords, Boolean includeDeleted);\r
-    \r
-    public ClientResponse<LT> advancedSearchIncludeDeleted(String whereClause, Boolean includeDeleted);\r
-}\r
+package org.collectionspace.services.client;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.jboss.resteasy.client.ClientResponse;
+
+/*
+ * <LT> = List type
+ * <PT> = Payload type
+ * <P> = Proxy type
+ */
+public interface CollectionSpacePoxClient<LT extends AbstractCommonList, P extends CollectionSpacePoxProxy<LT>>
+       extends CollectionSpaceClient<LT, PoxPayloadOut, String, P> {
+       /*
+        * Common service calls
+        */
+    
+    public ClientResponse<String> readIncludeDeleted(String csid, Boolean includeDeleted);    
+
+    /*
+     * GET list with workflow 'deleted' state
+     */
+    public ClientResponse<LT> readIncludeDeleted(Boolean includeDeleted);
+
+    public ClientResponse<LT> keywordSearchIncludeDeleted(String keywords, Boolean includeDeleted);
+    
+    public ClientResponse<LT> advancedSearchIncludeDeleted(String whereClause, Boolean includeDeleted);
+}
index 0e760ba4e49aee10c35b31808462b4aa7c6be613..5fd88ad3383d9fd3ac8361325cff79b2fa1d4b8e 100644 (file)
@@ -1,66 +1,66 @@
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.GET;\r
-import javax.ws.rs.POST;\r
-import javax.ws.rs.PUT;\r
-import javax.ws.rs.Path;\r
-import javax.ws.rs.PathParam;\r
-import javax.ws.rs.Produces;\r
-import javax.ws.rs.QueryParam;\r
-import javax.ws.rs.core.Response;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-import org.collectionspace.services.client.workflow.WorkflowClient;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-public interface CollectionSpacePoxProxy<LT extends AbstractCommonList> extends\r
-               CollectionSpaceProxy<LT> {\r
-\r
-       // (C)reate\r
-       @POST\r
-       ClientResponse<Response> create(byte[] payload);\r
-\r
-       // (R)ead\r
-       @GET\r
-       @Path("/{csid}")\r
-       ClientResponse<String> read(@PathParam("csid") String csid);\r
-\r
-       // (R)ead\r
-       @GET\r
-       @Path("/{csid}")\r
-       ClientResponse<String> readIncludeDeleted(\r
-                       @PathParam("csid") String csid,\r
-                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-\r
-       // (U)pdate\r
-       @PUT\r
-       @Path("/{csid}")\r
-       ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);\r
-\r
-       // (L)ist non-deleted items\r
-       @GET\r
-       @Produces({ "application/xml" })\r
-       ClientResponse<LT> readIncludeDeleted(\r
-                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-\r
-       /**\r
-        * Keyword search.\r
-        * \r
-        * @param keywords\r
-        *            keywords on which to search\r
-        * @param workflowState\r
-        * @return the client response\r
-        */\r
-       @GET\r
-       @Produces({ "application/xml" })\r
-       ClientResponse<LT> keywordSearchIncludeDeleted(\r
-                       @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,\r
-                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-\r
-       @GET\r
-       @Produces({ "application/xml" })\r
-       ClientResponse<LT> advancedSearchIncludeDeleted(\r
-                       @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_AS) String whereClause,\r
-                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-\r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.collectionspace.services.client.workflow.WorkflowClient;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+public interface CollectionSpacePoxProxy<LT extends AbstractCommonList> extends
+               CollectionSpaceProxy<LT> {
+
+       // (C)reate
+       @POST
+       ClientResponse<Response> create(byte[] payload);
+
+       // (R)ead
+       @GET
+       @Path("/{csid}")
+       ClientResponse<String> read(@PathParam("csid") String csid);
+
+       // (R)ead
+       @GET
+       @Path("/{csid}")
+       ClientResponse<String> readIncludeDeleted(
+                       @PathParam("csid") String csid,
+                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+
+       // (U)pdate
+       @PUT
+       @Path("/{csid}")
+       ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
+
+       // (L)ist non-deleted items
+       @GET
+       @Produces({ "application/xml" })
+       ClientResponse<LT> readIncludeDeleted(
+                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+
+       /**
+        * Keyword search.
+        * 
+        * @param keywords
+        *            keywords on which to search
+        * @param workflowState
+        * @return the client response
+        */
+       @GET
+       @Produces({ "application/xml" })
+       ClientResponse<LT> keywordSearchIncludeDeleted(
+                       @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
+                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+
+       @GET
+       @Produces({ "application/xml" })
+       ClientResponse<LT> advancedSearchIncludeDeleted(
+                       @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_AS) String whereClause,
+                       @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+
+}
index c9dbdda6eaa3880df5834589b65101b2fc933666..2ed0b68304e3802e75518df65dd15d974985f547 100644 (file)
-/**    \r
- * CollectionSpaceProxy.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.Consumes;\r
-import javax.ws.rs.GET;\r
-import javax.ws.rs.DELETE;\r
-import javax.ws.rs.PUT;\r
-import javax.ws.rs.Path;\r
-import javax.ws.rs.PathParam;\r
-import javax.ws.rs.Produces;\r
-import javax.ws.rs.QueryParam;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.client.workflow.WorkflowClient;\r
-import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
-\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-/**\r
- * The Interface CollectionSpaceProxy.\r
- * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684\r
- */\r
-public interface CollectionSpaceProxy<CLT> {\r
-\r
-    //(D)elete\r
-    @DELETE\r
-    @Path("/{csid}")\r
-    ClientResponse<Response> delete(@PathParam("csid") String csid);\r
-       \r
-    // List Authority References\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Path("/{csid}/authorityrefs/")\r
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);\r
-    \r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Consumes({"application/xml"})    \r
-    @Path("{csid}" + WorkflowClient.SERVICE_PATH)\r
-    ClientResponse<String> getWorkflow(@PathParam("csid") String csid);\r
-    \r
-    @PUT\r
-    @Produces({"application/xml"})\r
-    @Consumes({"application/xml"})    \r
-    @Path("{csid}" + WorkflowClient.SERVICE_PATH + "/" + "{transition}")\r
-    ClientResponse<String> updateWorkflowWithTransition(@PathParam("csid") String csid, @PathParam("transition") String transition);\r
-    \r
-    /*\r
-     * (R)read List operations\r
-     */\r
-    \r
-    @GET\r
-    @Produces({"application/xml"})\r
-    ClientResponse<CLT> readList();\r
-    \r
-    /**\r
-     * Read list.\r
-     *\r
-     * @param pageSize the page size\r
-     * @param pageNumber the page number\r
-     * @return the client response\r
-     */\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    ClientResponse<CLT> readList(\r
-            @QueryParam(IClientQueryParams.PAGE_SIZE_PARAM) Long pageSize,\r
-           @QueryParam(IClientQueryParams.START_PAGE_PARAM) Long pageNumber);\r
-        \r
-    /**\r
-     * Read list.\r
-     * @param sortBy \r
-     *\r
-     * @param pageSize the page size\r
-     * @param pageNumber the page number\r
-     * @return the client response\r
-     */\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    ClientResponse<CLT> readList(\r
-            @QueryParam(IClientQueryParams.ORDER_BY_PARAM) String sortBy,\r
-            @QueryParam(IClientQueryParams.PAGE_SIZE_PARAM) Long pageSize,\r
-           @QueryParam(IClientQueryParams.START_PAGE_PARAM) Long pageNumber);    \r
-}\r
+/**    
+ * CollectionSpaceProxy.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.client.workflow.WorkflowClient;
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
+
+import org.jboss.resteasy.client.ClientResponse;
+
+/**
+ * The Interface CollectionSpaceProxy.
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
+ */
+public interface CollectionSpaceProxy<CLT> {
+
+    //(D)elete
+    @DELETE
+    @Path("/{csid}")
+    ClientResponse<Response> delete(@PathParam("csid") String csid);
+       
+    // List Authority References
+    @GET
+    @Produces({"application/xml"})
+    @Path("/{csid}/authorityrefs/")
+    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
+    
+    @GET
+    @Produces({"application/xml"})
+    @Consumes({"application/xml"})    
+    @Path("{csid}" + WorkflowClient.SERVICE_PATH)
+    ClientResponse<String> getWorkflow(@PathParam("csid") String csid);
+    
+    @PUT
+    @Produces({"application/xml"})
+    @Consumes({"application/xml"})    
+    @Path("{csid}" + WorkflowClient.SERVICE_PATH + "/" + "{transition}")
+    ClientResponse<String> updateWorkflowWithTransition(@PathParam("csid") String csid, @PathParam("transition") String transition);
+    
+    /*
+     * (R)read List operations
+     */
+    
+    @GET
+    @Produces({"application/xml"})
+    ClientResponse<CLT> readList();
+    
+    /**
+     * Read list.
+     *
+     * @param pageSize the page size
+     * @param pageNumber the page number
+     * @return the client response
+     */
+    @GET
+    @Produces({"application/xml"})
+    ClientResponse<CLT> readList(
+            @QueryParam(IClientQueryParams.PAGE_SIZE_PARAM) Long pageSize,
+           @QueryParam(IClientQueryParams.START_PAGE_PARAM) Long pageNumber);
+        
+    /**
+     * Read list.
+     * @param sortBy 
+     *
+     * @param pageSize the page size
+     * @param pageNumber the page number
+     * @return the client response
+     */
+    @GET
+    @Produces({"application/xml"})
+    ClientResponse<CLT> readList(
+            @QueryParam(IClientQueryParams.ORDER_BY_PARAM) String sortBy,
+            @QueryParam(IClientQueryParams.PAGE_SIZE_PARAM) Long pageSize,
+           @QueryParam(IClientQueryParams.START_PAGE_PARAM) Long pageNumber);    
+}
index 2401c6119e79ff5ea8d2a169743b407180339923..24865448c111b76264b6099902d5b10ff2aa3cfd 100644 (file)
@@ -1,36 +1,36 @@
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-\r
-package org.collectionspace.services.client;\r
-\r
-/**\r
- * IClientQueryParams.java\r
- *\r
- * Specifies contants used as query parameters in client requests to services.\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- */\r
-\r
-public interface IClientQueryParams {\r
-\r
-    public static final String PAGE_SIZE_PARAM = "pgSz";\r
-    public static final String START_PAGE_PARAM = "pgNum";\r
-    public static final String ORDER_BY_PARAM = "sortBy";\r
-    public static final String IMPORT_TIMEOUT_PARAM = "impTimout";\r
-    \r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+
+package org.collectionspace.services.client;
+
+/**
+ * IClientQueryParams.java
+ *
+ * Specifies contants used as query parameters in client requests to services.
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ */
+
+public interface IClientQueryParams {
+
+    public static final String PAGE_SIZE_PARAM = "pgSz";
+    public static final String START_PAGE_PARAM = "pgNum";
+    public static final String ORDER_BY_PARAM = "sortBy";
+    public static final String IMPORT_TIMEOUT_PARAM = "impTimout";
+    
+}
index 513c443ad49bf2ff055ce02571694078d7a2d88d..0536a38edb9ee2d8fa0769e05ad43e8c9d1e7047 100644 (file)
-/**    \r
- * IQueryManager.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.client;\r
-\r
-public interface IQueryManager {\r
-       \r
-       final static String SEARCH_GROUP_OPEN = "(";\r
-       final static String SEARCH_GROUP_CLOSE = ")";\r
-       final static String SEARCH_TERM_SEPARATOR = " ";\r
-       final static String SEARCH_LIKE = " LIKE ";\r
-       final static String SEARCH_ILIKE = " ILIKE ";\r
-    final static String SEARCH_TYPE_KEYWORDS = "keywords";\r
-    final static String SEARCH_TYPE_KEYWORDS_KW = "kw";\r
-    final static String SEARCH_TYPE_KEYWORDS_AS = "as";\r
-    final static String SEARCH_TYPE_PARTIALTERM = "pt";\r
-    final static String SEARCH_TYPE_DOCTYPE = "doctype";\r
-    final static String SEARCH_TYPE_INVOCATION_MODE = "mode";\r
-    final static String SEARCH_TYPE_INVOCATION = "inv";\r
-       final static String SEARCH_QUALIFIER_AND = SEARCH_TERM_SEPARATOR + "AND" + SEARCH_TERM_SEPARATOR;\r
-       final static String SEARCH_QUALIFIER_OR = SEARCH_TERM_SEPARATOR + "OR" + SEARCH_TERM_SEPARATOR;\r
-\r
-       //\r
-       // Nuxeo pseudo-values (and filters) for special document properties.\r
-       //\r
-       final static String NUXEO_UUID = "ecm:uuid";\r
-       final static String NUXEO_IS_PROXY = "ecm:isProxy";\r
-       final static String NUXEO_IS_PROXY_FILTER = NUXEO_IS_PROXY + " = 0";\r
-       final static String NUXEO_IS_VERSION = "ecm:isCheckedInVersion";\r
-       final static String NUXEO_IS_VERSION_FILTER = NUXEO_IS_VERSION + " = 0";\r
-       // In the CMIS context, the prefix is nuxeo, not ecm\r
-       final static String NUXEO_CMIS_IS_VERSION = "nuxeo:isVersion";\r
-       final static String NUXEO_CMIS_IS_VERSION_FILTER = NUXEO_CMIS_IS_VERSION + " = false";\r
-       \r
-       //\r
-       // Query params for CMIS queries on the relationship (Relation) table.\r
-       //\r
-       final static String SEARCH_RELATED_TO_CSID_AS_SUBJECT = "rtSbj";\r
-       final static String SEARCH_RELATED_TO_CSID_AS_OBJECT = "rtObj";\r
-       final static String SEARCH_RELATED_TO_CSID_AS_EITHER = "rtEither";\r
-       final static String SEARCH_RELATED_MATCH_OBJ_DOCTYPES = "rtObjDocTypes";\r
-       final static String SELECT_DOC_TYPE_FIELD = "selectDocType";\r
-       \r
-       final static String MARK_RELATED_TO_CSID_AS_SUBJECT = "mkRtSbj";\r
-       //\r
-       // Generic CMIS property mapping constants\r
-       //\r
-       final static String CMIS_OBJECT_ID = "cmis:objectId";\r
-       final static String CMIS_NUXEO_PATHSEGMENT = "nuxeo:pathSegment";\r
-       //\r
-       // Nuxeo related CMIS property mapping constants\r
-       final static String CMIS_NUXEO_ID = CMIS_OBJECT_ID;\r
-       final static String CMIS_NUXEO_NAME = CMIS_NUXEO_PATHSEGMENT;\r
-       final static String CMIS_NUXEO_TITLE = "dc:title";\r
-       final static String CMIS_CS_UPDATED_AT = CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA + ":" + CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT;\r
-       \r
-       // CollectionSpace CMIS property mapping constants\r
-       final static String CMIS_TARGET_PREFIX = "DOC";\r
-       final static String CMIS_CORESCHEMA_PREFIX = "CORE";\r
-       // Relations CMIS property mapping constants\r
-       final static String CMIS_RELATIONS_PREFIX = "REL";\r
-       \r
-       final static String CMIS_JOIN_NUXEO_IS_VERSION_FILTER = \r
-                       IQueryManager.CMIS_TARGET_PREFIX + "." + IQueryManager.NUXEO_CMIS_IS_VERSION_FILTER;\r
-\r
-       \r
-       final static String CMIS_TARGET_NUXEO_ID = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_ID;\r
-       final static String CMIS_TARGET_CSID = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_NAME;\r
-       final static String CMIS_TARGET_TITLE = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_TITLE;\r
-       final static String CMIS_TARGET_NAME = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_NAME;\r
-       final static String CMIS_TARGET_UPDATED_AT = CMIS_TARGET_PREFIX + "." + CMIS_CS_UPDATED_AT;\r
-       \r
-       final static String TENANT_USES_STARTING_WILDCARD_FOR_PARTIAL_TERM = "ptStartingWildcard";\r
-        final static String MAX_LIST_ITEMS_RETURNED_LIMIT_ON_JDBC_QUERIES = "maxListItemsReturnedLimitOnJdbcQueries";\r
-        final static String JDBC_QUERIES_ARE_TENANT_ID_RESTRICTED = "jdbcQueriesAreTenantIdRestricted";\r
-\r
-       public void execQuery(String queryString);\r
-       \r
-       public String getDatasourceName();\r
-       \r
-       /**\r
-        * Creates the where clause from keywords.\r
-        * \r
-        * @param keywords the keywords\r
-        * \r
-        * @return the string\r
-        */\r
-       public String createWhereClauseFromKeywords(String keywords);\r
-       \r
-       public String createWhereClauseFromAdvancedSearch(String advancedSearch);\r
-\r
-       final static boolean FILTER_EXCLUDE = true;\r
-       final static boolean FILTER_INCLUDE = false;\r
-       \r
-       /**\r
-        * Creates a query to filter a qualified (string) field according to a list of string values. \r
-        * @param qualifiedField The schema-qualified field to filter on\r
-        * @param filterTerms the list of one or more strings to filter on\r
-        * @param fExclude If true, will require qualifiedField NOT match the filters strings.\r
-        *                                      If false, will require qualifiedField does match one of the filters strings.\r
-        * @return queryString\r
-        */\r
-       public String createWhereClauseToFilterFromStringList(String qualifiedField, String[] filterTerms, boolean fExclude);\r
-       \r
-       /**\r
-        * Creates the where clause for partial term match.\r
-        * \r
-        * @param field the qualified field to match on\r
-        * @param partialTerm the term to match against\r
-        * \r
-        * @return the string\r
-        */\r
-       public String createWhereClauseForPartialMatch(String dataSourceName,\r
-                       String repositoryName,\r
-                       String cspaceInstanceId,\r
-                       String field,\r
-                       boolean startingWildcard,\r
-                       String partialTerm);\r
-\r
-       /**\r
-        * Creates a filtering where clause from docType, for invocables.\r
-        * \r
-        * @param schema the schema name for this invocable type\r
-        * @param docType the docType\r
-        * \r
-        * @return the string\r
-        */\r
-       public String createWhereClauseForInvocableByDocType(String schema, String docType);\r
-       \r
-       /**\r
-        * Creates a filtering where clause from invocation mode, for invocables.\r
-        * \r
-        * @param schema the schema name for this invocable type\r
-        * @param mode the mode\r
-        * \r
-        * @return the string\r
-        */\r
-       public String createWhereClauseForInvocableByMode(String schema, String mode);\r
-       \r
-}\r
+/**    
+ * IQueryManager.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.client;
+
+public interface IQueryManager {
+       
+       final static String SEARCH_GROUP_OPEN = "(";
+       final static String SEARCH_GROUP_CLOSE = ")";
+       final static String SEARCH_TERM_SEPARATOR = " ";
+       final static String SEARCH_LIKE = " LIKE ";
+       final static String SEARCH_ILIKE = " ILIKE ";
+    final static String SEARCH_TYPE_KEYWORDS = "keywords";
+    final static String SEARCH_TYPE_KEYWORDS_KW = "kw";
+    final static String SEARCH_TYPE_KEYWORDS_AS = "as";
+    final static String SEARCH_TYPE_PARTIALTERM = "pt";
+    final static String SEARCH_TYPE_DOCTYPE = "doctype";
+    final static String SEARCH_TYPE_INVOCATION_MODE = "mode";
+    final static String SEARCH_TYPE_INVOCATION = "inv";
+       final static String SEARCH_QUALIFIER_AND = SEARCH_TERM_SEPARATOR + "AND" + SEARCH_TERM_SEPARATOR;
+       final static String SEARCH_QUALIFIER_OR = SEARCH_TERM_SEPARATOR + "OR" + SEARCH_TERM_SEPARATOR;
+
+       //
+       // Nuxeo pseudo-values (and filters) for special document properties.
+       //
+       final static String NUXEO_UUID = "ecm:uuid";
+       final static String NUXEO_IS_PROXY = "ecm:isProxy";
+       final static String NUXEO_IS_PROXY_FILTER = NUXEO_IS_PROXY + " = 0";
+       final static String NUXEO_IS_VERSION = "ecm:isCheckedInVersion";
+       final static String NUXEO_IS_VERSION_FILTER = NUXEO_IS_VERSION + " = 0";
+       // In the CMIS context, the prefix is nuxeo, not ecm
+       final static String NUXEO_CMIS_IS_VERSION = "nuxeo:isVersion";
+       final static String NUXEO_CMIS_IS_VERSION_FILTER = NUXEO_CMIS_IS_VERSION + " = false";
+       
+       //
+       // Query params for CMIS queries on the relationship (Relation) table.
+       //
+       final static String SEARCH_RELATED_TO_CSID_AS_SUBJECT = "rtSbj";
+       final static String SEARCH_RELATED_TO_CSID_AS_OBJECT = "rtObj";
+       final static String SEARCH_RELATED_TO_CSID_AS_EITHER = "rtEither";
+       final static String SEARCH_RELATED_MATCH_OBJ_DOCTYPES = "rtObjDocTypes";
+       final static String SELECT_DOC_TYPE_FIELD = "selectDocType";
+       
+       final static String MARK_RELATED_TO_CSID_AS_SUBJECT = "mkRtSbj";
+       //
+       // Generic CMIS property mapping constants
+       //
+       final static String CMIS_OBJECT_ID = "cmis:objectId";
+       final static String CMIS_NUXEO_PATHSEGMENT = "nuxeo:pathSegment";
+       //
+       // Nuxeo related CMIS property mapping constants
+       final static String CMIS_NUXEO_ID = CMIS_OBJECT_ID;
+       final static String CMIS_NUXEO_NAME = CMIS_NUXEO_PATHSEGMENT;
+       final static String CMIS_NUXEO_TITLE = "dc:title";
+       final static String CMIS_CS_UPDATED_AT = CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA + ":" + CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT;
+       
+       // CollectionSpace CMIS property mapping constants
+       final static String CMIS_TARGET_PREFIX = "DOC";
+       final static String CMIS_CORESCHEMA_PREFIX = "CORE";
+       // Relations CMIS property mapping constants
+       final static String CMIS_RELATIONS_PREFIX = "REL";
+       
+       final static String CMIS_JOIN_NUXEO_IS_VERSION_FILTER = 
+                       IQueryManager.CMIS_TARGET_PREFIX + "." + IQueryManager.NUXEO_CMIS_IS_VERSION_FILTER;
+
+       
+       final static String CMIS_TARGET_NUXEO_ID = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_ID;
+       final static String CMIS_TARGET_CSID = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_NAME;
+       final static String CMIS_TARGET_TITLE = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_TITLE;
+       final static String CMIS_TARGET_NAME = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_NAME;
+       final static String CMIS_TARGET_UPDATED_AT = CMIS_TARGET_PREFIX + "." + CMIS_CS_UPDATED_AT;
+       
+       final static String TENANT_USES_STARTING_WILDCARD_FOR_PARTIAL_TERM = "ptStartingWildcard";
+        final static String MAX_LIST_ITEMS_RETURNED_LIMIT_ON_JDBC_QUERIES = "maxListItemsReturnedLimitOnJdbcQueries";
+        final static String JDBC_QUERIES_ARE_TENANT_ID_RESTRICTED = "jdbcQueriesAreTenantIdRestricted";
+
+       public void execQuery(String queryString);
+       
+       public String getDatasourceName();
+       
+       /**
+        * Creates the where clause from keywords.
+        * 
+        * @param keywords the keywords
+        * 
+        * @return the string
+        */
+       public String createWhereClauseFromKeywords(String keywords);
+       
+       public String createWhereClauseFromAdvancedSearch(String advancedSearch);
+
+       final static boolean FILTER_EXCLUDE = true;
+       final static boolean FILTER_INCLUDE = false;
+       
+       /**
+        * Creates a query to filter a qualified (string) field according to a list of string values. 
+        * @param qualifiedField The schema-qualified field to filter on
+        * @param filterTerms the list of one or more strings to filter on
+        * @param fExclude If true, will require qualifiedField NOT match the filters strings.
+        *                                      If false, will require qualifiedField does match one of the filters strings.
+        * @return queryString
+        */
+       public String createWhereClauseToFilterFromStringList(String qualifiedField, String[] filterTerms, boolean fExclude);
+       
+       /**
+        * Creates the where clause for partial term match.
+        * 
+        * @param field the qualified field to match on
+        * @param partialTerm the term to match against
+        * 
+        * @return the string
+        */
+       public String createWhereClauseForPartialMatch(String dataSourceName,
+                       String repositoryName,
+                       String cspaceInstanceId,
+                       String field,
+                       boolean startingWildcard,
+                       String partialTerm);
+
+       /**
+        * Creates a filtering where clause from docType, for invocables.
+        * 
+        * @param schema the schema name for this invocable type
+        * @param docType the docType
+        * 
+        * @return the string
+        */
+       public String createWhereClauseForInvocableByDocType(String schema, String docType);
+       
+       /**
+        * Creates a filtering where clause from invocation mode, for invocables.
+        * 
+        * @param schema the schema name for this invocable type
+        * @param mode the mode
+        * 
+        * @return the string
+        */
+       public String createWhereClauseForInvocableByMode(String schema, String mode);
+       
+}
index af3b5d7212eabe1c1ce35d78207ec12c499e2959..2892e85c1046002c03505773e33a7158ae124f52 100644 (file)
@@ -1,36 +1,36 @@
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-import org.dom4j.Element;\r
-\r
-public class PayloadInputPart extends PayloadPart {\r
-//     private Element elementBody;\r
-       \r
-       public PayloadInputPart(String label, Object body) {\r
-               super(label, body);\r
-       }\r
-       \r
-       public PayloadInputPart(String label, Object body, Element elementBody) {\r
-               super(label, body, elementBody);\r
-       }\r
-       \r
-       public PayloadInputPart(String label, Element elementBody) {\r
-               super(label, elementBody);\r
-       }\r
-       \r
-       @Override\r
-       public String asXML() {\r
-               String result = null;\r
-               Object body = getBody();\r
-               if (getElementBody() != null) {\r
-                       result = getElementBody().asXML();\r
-               } else if (body != null) {\r
-                       result = PoxPayload.toElement(getBody()).asXML();\r
-               }\r
-               return result;\r
-       }\r
-\r
-       public MediaType getMediaType() {\r
-               return MediaType.APPLICATION_XML_TYPE;  \r
-       }\r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.core.MediaType;
+import org.dom4j.Element;
+
+public class PayloadInputPart extends PayloadPart {
+//     private Element elementBody;
+       
+       public PayloadInputPart(String label, Object body) {
+               super(label, body);
+       }
+       
+       public PayloadInputPart(String label, Object body, Element elementBody) {
+               super(label, body, elementBody);
+       }
+       
+       public PayloadInputPart(String label, Element elementBody) {
+               super(label, elementBody);
+       }
+       
+       @Override
+       public String asXML() {
+               String result = null;
+               Object body = getBody();
+               if (getElementBody() != null) {
+                       result = getElementBody().asXML();
+               } else if (body != null) {
+                       result = PoxPayload.toElement(getBody()).asXML();
+               }
+               return result;
+       }
+
+       public MediaType getMediaType() {
+               return MediaType.APPLICATION_XML_TYPE;  
+       }
+}
index bd8c50caa4e7c7dcae6e72f5c1232051c9a5fac7..9a035c69e11f5974a5b1017612f88da148fa0d99 100644 (file)
@@ -1,48 +1,48 @@
-package org.collectionspace.services.client;\r
-\r
-import org.dom4j.DocumentException;\r
-import org.dom4j.Element;\r
-\r
-public class PayloadOutputPart extends PayloadPart {\r
-       \r
-       //\r
-       // Constructors\r
-       //\r
-       public PayloadOutputPart(String label, Object body) {\r
-               super(label, body);\r
-       }\r
-       \r
-       PayloadOutputPart(String label, Element elementBody) {\r
-               super(label, elementBody);\r
-       }\r
-       \r
-       PayloadOutputPart(String label, String xmlBody) throws DocumentException {\r
-               super(label, xmlBody);\r
-       }       \r
-       \r
-       PayloadOutputPart(String label, Object body, Element elementBody) {\r
-               super(label, body, elementBody);\r
-       }\r
-       \r
-       //\r
-       // Utility Methods\r
-       //\r
-       \r
-       @Override\r
-       public String asXML() {\r
-               String result = null;\r
-                               \r
-               Element elementBody = getElementBody();\r
-               if (elementBody != null) {\r
-                       result = elementBody.asXML();\r
-               } else { \r
-                       Object body = getBody();\r
-                       if (body != null) {\r
-                               result = PoxPayload.toElement(body).asXML();\r
-                       }\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-}\r
+package org.collectionspace.services.client;
+
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+
+public class PayloadOutputPart extends PayloadPart {
+       
+       //
+       // Constructors
+       //
+       public PayloadOutputPart(String label, Object body) {
+               super(label, body);
+       }
+       
+       PayloadOutputPart(String label, Element elementBody) {
+               super(label, elementBody);
+       }
+       
+       PayloadOutputPart(String label, String xmlBody) throws DocumentException {
+               super(label, xmlBody);
+       }       
+       
+       PayloadOutputPart(String label, Object body, Element elementBody) {
+               super(label, body, elementBody);
+       }
+       
+       //
+       // Utility Methods
+       //
+       
+       @Override
+       public String asXML() {
+               String result = null;
+                               
+               Element elementBody = getElementBody();
+               if (elementBody != null) {
+                       result = elementBody.asXML();
+               } else { 
+                       Object body = getBody();
+                       if (body != null) {
+                               result = PoxPayload.toElement(body).asXML();
+                       }
+               }
+               
+               return result;
+       }
+       
+}
index 810c6ba0b973b6e31732d8a3bb5bcfc16a62b27e..2ba2f68ca4c968a6d4a00b8ad12eb07bb8de766b 100644 (file)
@@ -1,82 +1,82 @@
-package org.collectionspace.services.client;\r
-\r
-import org.dom4j.DocumentException;\r
-import org.dom4j.Element;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public abstract class PayloadPart {\r
-       protected final Logger logger = LoggerFactory.getLogger(PayloadPart.class);\r
-               \r
-       private String label;\r
-       private Object body;\r
-       private Element elementBody;\r
-\r
-       public PayloadPart(String label) {\r
-               this.label = label;\r
-       }\r
-       \r
-       public PayloadPart(String label, Object body) {\r
-               this(label);\r
-               this.body = body;\r
-       }\r
-               \r
-       /**\r
-        * Instantiates a new payload part by parsing the XML string 'xmlPayload'\r
-        *\r
-        * @param label the label\r
-        * @param xmlPayload the xml payload\r
-        * @throws DocumentException the document exception\r
-        */\r
-       public PayloadPart(String label, String xmlPayload) throws DocumentException {\r
-               this(label);\r
-               Element element = PoxPayload.toElement(xmlPayload);\r
-               this.elementBody = element;\r
-               \r
-       }\r
-\r
-       public PayloadPart(String label, Object body, Element elementBody) {\r
-               this(label, body);\r
-               this.elementBody = elementBody;\r
-       }\r
-\r
-       public PayloadPart(String label, Element elementBody) {\r
-               this(label);\r
-               this.elementBody = elementBody;\r
-       }\r
-\r
-       abstract public String asXML();\r
-       \r
-       public Element asElement() {\r
-               Element result = elementBody;\r
-               // if we don't already have an Element, let's try to create one from a JAXB object\r
-               if (result == null) {\r
-                       if (body != null) {\r
-                               //toElement(body) will return null if not given an JAXB object\r
-                               result = PoxPayload.toElement(body);\r
-                       }\r
-               }\r
-               return result;\r
-       }\r
-       \r
-       public Object getBody() {\r
-               Object result = body;\r
-               if (result == null) {\r
-                       body = PoxPayload.toObject(this.getElementBody());\r
-                       result = body;\r
-               }\r
-               return result;\r
-       }\r
-       \r
-       public Element getElementBody() {\r
-               return elementBody;\r
-       }\r
-\r
-       public void setLabel(String label) {\r
-               this.label = label;\r
-       }\r
-\r
-       public String getLabel() {\r
-               return this.label;\r
-       }\r
-}\r
+package org.collectionspace.services.client;
+
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class PayloadPart {
+       protected final Logger logger = LoggerFactory.getLogger(PayloadPart.class);
+               
+       private String label;
+       private Object body;
+       private Element elementBody;
+
+       public PayloadPart(String label) {
+               this.label = label;
+       }
+       
+       public PayloadPart(String label, Object body) {
+               this(label);
+               this.body = body;
+       }
+               
+       /**
+        * Instantiates a new payload part by parsing the XML string 'xmlPayload'
+        *
+        * @param label the label
+        * @param xmlPayload the xml payload
+        * @throws DocumentException the document exception
+        */
+       public PayloadPart(String label, String xmlPayload) throws DocumentException {
+               this(label);
+               Element element = PoxPayload.toElement(xmlPayload);
+               this.elementBody = element;
+               
+       }
+
+       public PayloadPart(String label, Object body, Element elementBody) {
+               this(label, body);
+               this.elementBody = elementBody;
+       }
+
+       public PayloadPart(String label, Element elementBody) {
+               this(label);
+               this.elementBody = elementBody;
+       }
+
+       abstract public String asXML();
+       
+       public Element asElement() {
+               Element result = elementBody;
+               // if we don't already have an Element, let's try to create one from a JAXB object
+               if (result == null) {
+                       if (body != null) {
+                               //toElement(body) will return null if not given an JAXB object
+                               result = PoxPayload.toElement(body);
+                       }
+               }
+               return result;
+       }
+       
+       public Object getBody() {
+               Object result = body;
+               if (result == null) {
+                       body = PoxPayload.toObject(this.getElementBody());
+                       result = body;
+               }
+               return result;
+       }
+       
+       public Element getElementBody() {
+               return elementBody;
+       }
+
+       public void setLabel(String label) {
+               this.label = label;
+       }
+
+       public String getLabel() {
+               return this.label;
+       }
+}
index 1d41669a0fafc7258ca44840dc1159abfee116f7..e342d5ba41741f198358501a5e9c630c8aae61f9 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import java.io.ByteArrayOutputStream;\r
-import java.io.File;\r
-import java.io.IOException;\r
-import java.io.StringReader;\r
-import java.util.ArrayList;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-\r
-import javax.xml.bind.JAXBContext;\r
-import javax.xml.bind.JAXBElement;\r
-import javax.xml.bind.Marshaller;\r
-import javax.xml.bind.Unmarshaller;\r
-import javax.xml.transform.stream.StreamSource;\r
-\r
-import com.sun.xml.bind.api.impl.NameConverter;\r
-import org.apache.commons.io.FileUtils;\r
-\r
-import org.dom4j.Document;\r
-import org.dom4j.DocumentException;\r
-import org.dom4j.DocumentHelper;\r
-import org.dom4j.Element;\r
-import org.dom4j.Namespace;\r
-import org.dom4j.io.SAXReader;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-// TODO: Auto-generated Javadoc\r
-/**\r
- * The Class PoxPayload.\r
- *\r
- * @param <PT> the generic type\r
- */\r
-public abstract class PoxPayload<PT extends PayloadPart> {     \r
-       \r
-       /** The Constant logger. */\r
-       protected static final Logger logger = LoggerFactory.getLogger(PayloadPart.class);      \r
-       \r
-       /** The xml text. */\r
-       private String xmlPayload;\r
-       \r
-       private Document domDocument;\r
-       \r
-       /** The payload name. */\r
-       private String payloadName;\r
-       \r
-       // The list of POX parts contained in the xmlText payload\r
-       /** The parts. */\r
-       private List<PT> parts = new ArrayList<PT>();   \r
-       \r
-       /**\r
-        * Instantiates a new pox payload.\r
-        */\r
-       protected PoxPayload() {\r
-               //empty\r
-       }\r
-       \r
-       final protected void setPayloadName(String name) {\r
-               this.payloadName = name;\r
-       }\r
-       \r
-       private void setDomDocument(Document dom) throws DocumentException {\r
-               this.domDocument = dom;\r
-               String label = domDocument.getRootElement().getName();\r
-               if (label != null) {\r
-                       this.payloadName = label;\r
-               } else if (logger.isWarnEnabled() == true) {\r
-                       logger.warn("Incoming message payload is missing a name/label.");\r
-                       logger.warn(this.xmlPayload);\r
-               }\r
-               parseParts();\r
-       }\r
-       \r
-       /**\r
-        * Instantiates a new PoxPayload by parsing the payload into a DOM4j\r
-        * Document instance\r
-        *\r
-        * @param payloadName the payload name\r
-        */\r
-       protected PoxPayload(String xmlPayload) throws DocumentException {\r
-               this.xmlPayload = xmlPayload;\r
-               SAXReader reader = new SAXReader();\r
-               Document dom  = reader.read(new StringReader(xmlPayload));\r
-               setDomDocument(dom);\r
-       }\r
-       \r
-    /**\r
-     * Instantiates a new payload, saves the original xml, creates a DOM and parses it into parts\r
-     *\r
-     * @param file the file\r
-     * @throws DocumentException the document exception\r
-     * @throws IOException Signals that an I/O exception has occurred.\r
-     */\r
-    protected PoxPayload(File file) throws DocumentException, IOException {\r
-       this.xmlPayload = FileUtils.readFileToString(file);\r
-        SAXReader reader = new SAXReader();\r
-        Document dom = reader.read(file);\r
-               setDomDocument(dom);\r
-    }  \r
-       \r
-       /**\r
-        * Creates the part -either an PayloadOutputPart or a PayloadInputPart\r
-        *\r
-        * @param label the part label\r
-        * @param jaxbObject the JAXB object\r
-        * @param element the DOM4j element\r
-        * @return the pT\r
-        */\r
-       abstract protected PT createPart(String label, Object jaxbObject, Element element);\r
-       \r
-       /**\r
-        * Creates the part -either an PayloadOutputPart or a PayloadInputPart\r
-        *\r
-        * @param label the part label\r
-        * @param element the DOM4j element\r
-        * @return the pT\r
-        */\r
-       abstract protected PT createPart(String label, Element element);        \r
-       \r
-       /**\r
-        * Parse the DOM object into schema parts.\r
-        *\r
-        * @throws DocumentException the document exception\r
-        */\r
-       protected void parseParts() throws DocumentException {\r
-               Iterator<Element> it = getDOMDocument().getRootElement().elementIterator();\r
-               PT payloadPart = null;\r
-               while (it.hasNext() == true) {\r
-                       Element element = (Element) it.next();\r
-                       String label = element.getName();\r
-                       Object jaxbObject = PoxPayload.toObject(element);                       \r
-                       if (jaxbObject != null) {\r
-                               payloadPart = createPart(label, jaxbObject, element);\r
-                       } else {\r
-                               payloadPart = createPart(label, element);\r
-                       }\r
-                       if (payloadPart != null) {\r
-                               this.addPart(payloadPart);\r
-                       }\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * Gets the name of the payload.\r
-        *\r
-        * @return the name\r
-        */\r
-       public String getName() {\r
-               return payloadName;\r
-       }\r
-       \r
-       /**\r
-        * Gets the DOM object that we created at init time.  This should never be null;\r
-        *\r
-        * @return the dOM document\r
-        */\r
-       public Document getDOMDocument() {\r
-               return this.domDocument;\r
-       }\r
-               \r
-       /**\r
-        * Gets the xml text.\r
-        *\r
-        * @return the xml text\r
-        */\r
-       public String getXmlPayload() {\r
-               return xmlPayload;\r
-       }\r
-       \r
-       /**\r
-        * Gets the POX part with name match 'label'.\r
-        *\r
-        * @param label the label\r
-        * @return the part\r
-        */\r
-       public PT getPart(String label) {\r
-               PT result = null;\r
-               if (parts != null) {\r
-                       Iterator<PT> it = parts.iterator();\r
-                       while (it.hasNext() == true) {\r
-                               PT part = it.next();\r
-                               if (part.getLabel().equalsIgnoreCase(label) == true) {\r
-                                       result = part;\r
-                                       break;\r
-                               }\r
-                       }\r
-               }\r
-               return result;\r
-       }\r
-       \r
-       /**\r
-        * Gets a list of the POX parts.\r
-        *\r
-        * @return the parts\r
-        */\r
-       public List<PT> getParts() {\r
-               return parts;\r
-       }\r
-               \r
-       /**\r
-        * Adds a POX part to the list of existing parts with the label 'label'.\r
-        *\r
-        * @param label the label\r
-        * @param entity the entity\r
-        * @return the pT\r
-        */\r
-       public PT addPart(String label, PT entity) {\r
-               parts.add(entity);\r
-               return entity;\r
-       }\r
-       \r
-       /**\r
-        * Adds a POX part -assuming the part already has a label name.\r
-        *\r
-        * @param entity the entity\r
-        * @return the pT\r
-        */\r
-       public PT addPart(PT entity) {\r
-               parts.add(entity);\r
-               return entity;\r
-       }       \r
-               \r
-    /**\r
-     * Gets the Java package name from the specified namespace.  This method\r
-     * assumes the Namespace is a xjc (JAXB compiler) generate namespace from\r
-     * which we can extract the Java package name.\r
-     *\r
-     * @param namespace the namespace\r
-     * @return the Java package name\r
-     */\r
-    private static String getPackage(Namespace namespace) {\r
-        NameConverter nc = NameConverter.standard;\r
-               String namespaceURI = namespace.getURI();\r
-        return nc.toPackageName(namespaceURI);\r
-    }\r
-      \r
-    /**\r
-     * Attempts to marshal a DOM4j element (for a part) into an instance of a JAXB object\r
-     *\r
-     * @param elementInput the element input\r
-     * @return the object\r
-     */\r
-    public static Object toObject(Element elementInput) {\r
-       Object result = null;\r
-       try {\r
-               Namespace namespace = elementInput.getNamespace();              \r
-               String thePackage = getPackage(namespace);\r
-               JAXBContext jc = JAXBContext.newInstance(thePackage);\r
-               Unmarshaller um = jc.createUnmarshaller();\r
-               result = um.unmarshal(\r
-                               new StreamSource(new StringReader(elementInput.asXML())));                              \r
-       } catch (Exception e) {\r
-               if (logger.isTraceEnabled() == true) {\r
-                       logger.trace(e.getMessage());\r
-               }\r
-       }\r
-       \r
-       return result;\r
-    }\r
-       \r
-    /**\r
-     * Attempts to unmarshal a JAXB object (for a part) to a DOM4j element.\r
-     *\r
-     * @param jaxbObject the jaxb object\r
-     * @return the element\r
-     */\r
-    public static Element toElement(Object jaxbObject) {\r
-       Element result = null;\r
-       String text = null;\r
-       ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\r
-       try {\r
-               String thePackage = jaxbObject.getClass().getPackage().getName();\r
-               if (thePackage.equals(JAXBElement.class.getPackage().getName())) {\r
-                       JAXBElement jaxbElement = (JAXBElement)jaxbObject;\r
-                       thePackage = jaxbElement.getValue().getClass().getPackage().getName();\r
-               }\r
-               JAXBContext jc = JAXBContext.newInstance(thePackage);\r
-               //Create marshaller\r
-               Marshaller m = jc.createMarshaller();\r
-               m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false);\r
-               //Marshal object into file.\r
-               m.marshal(jaxbObject, outputStream);\r
-               text = outputStream.toString("UTF8");\r
-\r
-               Document doc = DocumentHelper.parseText(text);\r
-               result = doc.getRootElement(); //FIXME: REM - call .detach() to free the element\r
-       } catch (Exception e) {\r
-               e.printStackTrace(); //FIXME: REM - Please use proper logger.isWarning() statement\r
-       }\r
-       \r
-       return result;\r
-    }\r
-    \r
-    /**\r
-     * Attempts to unmarshal a JAXB object (for a part) to a DOM4j element.\r
-     *\r
-     * @param jaxbObject the jaxb object\r
-     * @return the element\r
-     */\r
-    public static Element toElement(String xmlPayload) throws DocumentException {\r
-       Element result = null;\r
-               Document doc = DocumentHelper.parseText(xmlPayload);\r
-               result = doc.getRootElement(); //FIXME: REM - .detach();\r
-       return result;\r
-    }  \r
-    \r
-       \r
-}\r
+package org.collectionspace.services.client;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.transform.stream.StreamSource;
+
+import com.sun.xml.bind.api.impl.NameConverter;
+import org.apache.commons.io.FileUtils;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import org.dom4j.io.SAXReader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class PoxPayload.
+ *
+ * @param <PT> the generic type
+ */
+public abstract class PoxPayload<PT extends PayloadPart> {     
+       
+       /** The Constant logger. */
+       protected static final Logger logger = LoggerFactory.getLogger(PayloadPart.class);      
+       
+       /** The xml text. */
+       private String xmlPayload;
+       
+       private Document domDocument;
+       
+       /** The payload name. */
+       private String payloadName;
+       
+       // The list of POX parts contained in the xmlText payload
+       /** The parts. */
+       private List<PT> parts = new ArrayList<PT>();   
+       
+       /**
+        * Instantiates a new pox payload.
+        */
+       protected PoxPayload() {
+               //empty
+       }
+       
+       final protected void setPayloadName(String name) {
+               this.payloadName = name;
+       }
+       
+       private void setDomDocument(Document dom) throws DocumentException {
+               this.domDocument = dom;
+               String label = domDocument.getRootElement().getName();
+               if (label != null) {
+                       this.payloadName = label;
+               } else if (logger.isWarnEnabled() == true) {
+                       logger.warn("Incoming message payload is missing a name/label.");
+                       logger.warn(this.xmlPayload);
+               }
+               parseParts();
+       }
+       
+       /**
+        * Instantiates a new PoxPayload by parsing the payload into a DOM4j
+        * Document instance
+        *
+        * @param payloadName the payload name
+        */
+       protected PoxPayload(String xmlPayload) throws DocumentException {
+               this.xmlPayload = xmlPayload;
+               SAXReader reader = new SAXReader();
+               Document dom  = reader.read(new StringReader(xmlPayload));
+               setDomDocument(dom);
+       }
+       
+    /**
+     * Instantiates a new payload, saves the original xml, creates a DOM and parses it into parts
+     *
+     * @param file the file
+     * @throws DocumentException the document exception
+     * @throws IOException Signals that an I/O exception has occurred.
+     */
+    protected PoxPayload(File file) throws DocumentException, IOException {
+       this.xmlPayload = FileUtils.readFileToString(file);
+        SAXReader reader = new SAXReader();
+        Document dom = reader.read(file);
+               setDomDocument(dom);
+    }  
+       
+       /**
+        * Creates the part -either an PayloadOutputPart or a PayloadInputPart
+        *
+        * @param label the part label
+        * @param jaxbObject the JAXB object
+        * @param element the DOM4j element
+        * @return the pT
+        */
+       abstract protected PT createPart(String label, Object jaxbObject, Element element);
+       
+       /**
+        * Creates the part -either an PayloadOutputPart or a PayloadInputPart
+        *
+        * @param label the part label
+        * @param element the DOM4j element
+        * @return the pT
+        */
+       abstract protected PT createPart(String label, Element element);        
+       
+       /**
+        * Parse the DOM object into schema parts.
+        *
+        * @throws DocumentException the document exception
+        */
+       protected void parseParts() throws DocumentException {
+               Iterator<Element> it = getDOMDocument().getRootElement().elementIterator();
+               PT payloadPart = null;
+               while (it.hasNext() == true) {
+                       Element element = (Element) it.next();
+                       String label = element.getName();
+                       Object jaxbObject = PoxPayload.toObject(element);                       
+                       if (jaxbObject != null) {
+                               payloadPart = createPart(label, jaxbObject, element);
+                       } else {
+                               payloadPart = createPart(label, element);
+                       }
+                       if (payloadPart != null) {
+                               this.addPart(payloadPart);
+                       }
+               }
+       }
+       
+       /**
+        * Gets the name of the payload.
+        *
+        * @return the name
+        */
+       public String getName() {
+               return payloadName;
+       }
+       
+       /**
+        * Gets the DOM object that we created at init time.  This should never be null;
+        *
+        * @return the dOM document
+        */
+       public Document getDOMDocument() {
+               return this.domDocument;
+       }
+               
+       /**
+        * Gets the xml text.
+        *
+        * @return the xml text
+        */
+       public String getXmlPayload() {
+               return xmlPayload;
+       }
+       
+       /**
+        * Gets the POX part with name match 'label'.
+        *
+        * @param label the label
+        * @return the part
+        */
+       public PT getPart(String label) {
+               PT result = null;
+               if (parts != null) {
+                       Iterator<PT> it = parts.iterator();
+                       while (it.hasNext() == true) {
+                               PT part = it.next();
+                               if (part.getLabel().equalsIgnoreCase(label) == true) {
+                                       result = part;
+                                       break;
+                               }
+                       }
+               }
+               return result;
+       }
+       
+       /**
+        * Gets a list of the POX parts.
+        *
+        * @return the parts
+        */
+       public List<PT> getParts() {
+               return parts;
+       }
+               
+       /**
+        * Adds a POX part to the list of existing parts with the label 'label'.
+        *
+        * @param label the label
+        * @param entity the entity
+        * @return the pT
+        */
+       public PT addPart(String label, PT entity) {
+               parts.add(entity);
+               return entity;
+       }
+       
+       /**
+        * Adds a POX part -assuming the part already has a label name.
+        *
+        * @param entity the entity
+        * @return the pT
+        */
+       public PT addPart(PT entity) {
+               parts.add(entity);
+               return entity;
+       }       
+               
+    /**
+     * Gets the Java package name from the specified namespace.  This method
+     * assumes the Namespace is a xjc (JAXB compiler) generate namespace from
+     * which we can extract the Java package name.
+     *
+     * @param namespace the namespace
+     * @return the Java package name
+     */
+    private static String getPackage(Namespace namespace) {
+        NameConverter nc = NameConverter.standard;
+               String namespaceURI = namespace.getURI();
+        return nc.toPackageName(namespaceURI);
+    }
+      
+    /**
+     * Attempts to marshal a DOM4j element (for a part) into an instance of a JAXB object
+     *
+     * @param elementInput the element input
+     * @return the object
+     */
+    public static Object toObject(Element elementInput) {
+       Object result = null;
+       try {
+               Namespace namespace = elementInput.getNamespace();              
+               String thePackage = getPackage(namespace);
+               JAXBContext jc = JAXBContext.newInstance(thePackage);
+               Unmarshaller um = jc.createUnmarshaller();
+               result = um.unmarshal(
+                               new StreamSource(new StringReader(elementInput.asXML())));                              
+       } catch (Exception e) {
+               if (logger.isTraceEnabled() == true) {
+                       logger.trace(e.getMessage());
+               }
+       }
+       
+       return result;
+    }
+       
+    /**
+     * Attempts to unmarshal a JAXB object (for a part) to a DOM4j element.
+     *
+     * @param jaxbObject the jaxb object
+     * @return the element
+     */
+    public static Element toElement(Object jaxbObject) {
+       Element result = null;
+       String text = null;
+       ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+       try {
+               String thePackage = jaxbObject.getClass().getPackage().getName();
+               if (thePackage.equals(JAXBElement.class.getPackage().getName())) {
+                       JAXBElement jaxbElement = (JAXBElement)jaxbObject;
+                       thePackage = jaxbElement.getValue().getClass().getPackage().getName();
+               }
+               JAXBContext jc = JAXBContext.newInstance(thePackage);
+               //Create marshaller
+               Marshaller m = jc.createMarshaller();
+               m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false);
+               //Marshal object into file.
+               m.marshal(jaxbObject, outputStream);
+               text = outputStream.toString("UTF8");
+
+               Document doc = DocumentHelper.parseText(text);
+               result = doc.getRootElement(); //FIXME: REM - call .detach() to free the element
+       } catch (Exception e) {
+               e.printStackTrace(); //FIXME: REM - Please use proper logger.isWarning() statement
+       }
+       
+       return result;
+    }
+    
+    /**
+     * Attempts to unmarshal a JAXB object (for a part) to a DOM4j element.
+     *
+     * @param jaxbObject the jaxb object
+     * @return the element
+     */
+    public static Element toElement(String xmlPayload) throws DocumentException {
+       Element result = null;
+               Document doc = DocumentHelper.parseText(xmlPayload);
+               result = doc.getRootElement(); //FIXME: REM - .detach();
+       return result;
+    }  
+    
+       
+}
index e887e9886e1437b983ec7be1a2c8174a62196d8a..65c3186eb5a101630f7c90d12a06dc3133864d5e 100644 (file)
@@ -1,80 +1,80 @@
-package org.collectionspace.services.client;\r
-\r
-//import java.io.ByteArrayInputStream; //FIXME: REM - Remove these unneeded import statements\r
-//import java.io.InputStream;\r
-//import java.io.Reader;\r
-//import java.io.StringReader;\r
-//import java.util.Iterator;\r
-//import java.util.List;\r
-\r
-//import javax.xml.transform.Source;\r
-//import javax.xml.transform.stream.StreamSource;\r
-\r
-//import org.dom4j.Attribute;\r
-//import org.dom4j.Document;\r
-import java.io.File;\r
-import java.io.IOException;\r
-\r
-import org.dom4j.DocumentException;\r
-import org.dom4j.Element;\r
-//import org.dom4j.Namespace;\r
-//import org.dom4j.io.SAXReader;\r
-//import org.xml.sax.InputSource;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class PoxPayloadIn extends PoxPayload<PayloadInputPart> {\r
-\r
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());\r
-\r
-    public PoxPayloadIn(String payloadName, Object jaxbObject, String partLabel) {\r
-       setPayloadName(payloadName);\r
-       PayloadInputPart inputPart = createPart(partLabel, jaxbObject, null);\r
-       this.addPart(inputPart);\r
-    }\r
-    \r
-       /*\r
-        * Parse the POX 'xmlPayload' into individual parts.  Each part is saved\r
-        * as a DOM4j Element and, if possible, a JAXB object instance as well.\r
-        */\r
-       public PoxPayloadIn(String xmlPayload) throws DocumentException {\r
-               super(xmlPayload);\r
-               if (logger.isTraceEnabled() == true) {\r
-                       logger.trace("\n\n>>>> Payload In : BEGIN >>>>\n" +\r
-                                       xmlPayload +\r
-                                       "\n>>>> Payload In : END   >>>>\n");\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * Instantiates a new PoxPayloadIn, saves the xml, creates a DOM, and parses the parts.\r
-        *\r
-        * @param file the file\r
-        * @throws DocumentException the document exception\r
-        * @throws IOException Signals that an I/O exception has occurred.\r
-        */\r
-       public PoxPayloadIn(File file) throws DocumentException, IOException {\r
-               super(file);            \r
-       }\r
-       \r
-       /* (non-Javadoc)\r
-        * @see org.collectionspace.services.client.PoxPayload#createPart(java.lang.String, java.lang.Object, org.dom4j.Element)\r
-        * \r
-        * We need this method because the generic base class has no way of calling our constructor.\r
-        */\r
-       @Override\r
-       protected PayloadInputPart createPart(String label, Object jaxbObject, Element element) {\r
-               return new PayloadInputPart(label, jaxbObject, element);\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.collectionspace.services.client.PoxPayload#createPart(java.lang.String, org.dom4j.Element)\r
-        * \r
-        * We need this method because the generic base class has no way of calling our constructor.\r
-        */\r
-       @Override\r
-       protected PayloadInputPart createPart(String label, Element element) {\r
-               return new PayloadInputPart(label, element);\r
-       }\r
-       \r
-}\r
+package org.collectionspace.services.client;
+
+//import java.io.ByteArrayInputStream; //FIXME: REM - Remove these unneeded import statements
+//import java.io.InputStream;
+//import java.io.Reader;
+//import java.io.StringReader;
+//import java.util.Iterator;
+//import java.util.List;
+
+//import javax.xml.transform.Source;
+//import javax.xml.transform.stream.StreamSource;
+
+//import org.dom4j.Attribute;
+//import org.dom4j.Document;
+import java.io.File;
+import java.io.IOException;
+
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+//import org.dom4j.Namespace;
+//import org.dom4j.io.SAXReader;
+//import org.xml.sax.InputSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class PoxPayloadIn extends PoxPayload<PayloadInputPart> {
+
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    public PoxPayloadIn(String payloadName, Object jaxbObject, String partLabel) {
+       setPayloadName(payloadName);
+       PayloadInputPart inputPart = createPart(partLabel, jaxbObject, null);
+       this.addPart(inputPart);
+    }
+    
+       /*
+        * Parse the POX 'xmlPayload' into individual parts.  Each part is saved
+        * as a DOM4j Element and, if possible, a JAXB object instance as well.
+        */
+       public PoxPayloadIn(String xmlPayload) throws DocumentException {
+               super(xmlPayload);
+               if (logger.isTraceEnabled() == true) {
+                       logger.trace("\n\n>>>> Payload In : BEGIN >>>>\n" +
+                                       xmlPayload +
+                                       "\n>>>> Payload In : END   >>>>\n");
+               }
+       }
+       
+       /**
+        * Instantiates a new PoxPayloadIn, saves the xml, creates a DOM, and parses the parts.
+        *
+        * @param file the file
+        * @throws DocumentException the document exception
+        * @throws IOException Signals that an I/O exception has occurred.
+        */
+       public PoxPayloadIn(File file) throws DocumentException, IOException {
+               super(file);            
+       }
+       
+       /* (non-Javadoc)
+        * @see org.collectionspace.services.client.PoxPayload#createPart(java.lang.String, java.lang.Object, org.dom4j.Element)
+        * 
+        * We need this method because the generic base class has no way of calling our constructor.
+        */
+       @Override
+       protected PayloadInputPart createPart(String label, Object jaxbObject, Element element) {
+               return new PayloadInputPart(label, jaxbObject, element);
+       }
+
+       /* (non-Javadoc)
+        * @see org.collectionspace.services.client.PoxPayload#createPart(java.lang.String, org.dom4j.Element)
+        * 
+        * We need this method because the generic base class has no way of calling our constructor.
+        */
+       @Override
+       protected PayloadInputPart createPart(String label, Element element) {
+               return new PayloadInputPart(label, element);
+       }
+       
+}
index eca3df2c73e3bc82a4b69e5ee6abf396052d098c..8cd0b4d325f828c3918ba25c7c8cffe1b2098dc8 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-\r
-import org.dom4j.Document;\r
-import org.dom4j.DocumentException;\r
-import org.dom4j.DocumentHelper;\r
-import org.dom4j.Element;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import java.io.File;\r
-import java.io.IOException;\r
-import java.io.UnsupportedEncodingException;\r
-import java.util.Iterator;\r
-\r
-// TODO: Auto-generated Javadoc\r
-/**\r
- * The Class PoxPayloadOut.\r
- */\r
-public class PoxPayloadOut extends PoxPayload<PayloadOutputPart> {\r
-                       \r
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());\r
-       \r
-       /**\r
-        * Instantiates a new pox payload out.\r
-        *\r
-        * @param payloadName the payload name\r
-        * @throws DocumentException the document exception\r
-        */\r
-       public PoxPayloadOut(String payloadName) {\r
-               super();\r
-               setPayloadName(payloadName);\r
-       }\r
-               \r
-       public PoxPayloadOut(byte[] xmlPayload) throws DocumentException {\r
-               super(new String(xmlPayload));\r
-       }\r
-       \r
-       /**\r
-        * Instantiates a new PoxPayloadOut, saves the xml, creates a DOM, and parses the parts.\r
-        *\r
-        * @param file the file\r
-        * @throws DocumentException the document exception\r
-        * @throws IOException Signals that an I/O exception has occurred.\r
-        */\r
-       protected PoxPayloadOut(File file) throws DocumentException, IOException {\r
-               super(file);            \r
-       }\r
-               \r
-       /* (non-Javadoc)\r
-        * @see org.collectionspace.services.client.PoxPayload#createPart(java.lang.String, java.lang.Object, org.dom4j.Element)\r
-        * \r
-        * We need this method because the generic base class has no way of calling our constructor.\r
-        */\r
-       @Override\r
-       protected PayloadOutputPart createPart(String label, Object jaxbObject, Element element) {\r
-               return new PayloadOutputPart(label, jaxbObject, element);\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.collectionspace.services.client.PoxPayload#createPart(java.lang.String, org.dom4j.Element)\r
-        * \r
-        * We need this method because the generic base class has no way of calling our constructor.\r
-        */\r
-       @Override\r
-       protected PayloadOutputPart createPart(String label, Element element) {\r
-               return new PayloadOutputPart(label, element);\r
-       }\r
-       \r
-       /**\r
-        * Creates and returns an XML string representation of ourself.\r
-        *\r
-        * @return the string\r
-        */\r
-       public String toXML() {\r
-               String result = null;\r
-        Document document = DocumentHelper.createDocument();\r
-        document.setXMLEncoding("UTF-8");\r
-        document.setName(getName());\r
-        Element root = document.addElement( "document" );\r
-        root.addAttribute("name", getName());        \r
-               \r
-               Iterator<PayloadOutputPart> it = getParts().iterator();\r
-               while (it.hasNext() == true) {\r
-                       PayloadOutputPart outPart = it.next();\r
-                       Element element = outPart.asElement();                  \r
-                       if (element != null) {\r
-                               root.add(element.detach());\r
-                       } else {\r
-                               //Add if (logger.isTraceEnabled() == true) logger.trace("Output part: " + outPart.getLabel() + " was empty.");\r
-                       }\r
-               }\r
-               result = document.asXML();\r
-               \r
-               if (logger.isTraceEnabled() == true) {\r
-                       logger.trace("\n\n<<<< Payload Out : BEGIN <<<<\n" +\r
-                                       result +\r
-                                       "\n<<<< Payload Out : END   <<<<\n");\r
-               }\r
-               \r
-               return result;\r
-       }\r
-               \r
-       /**\r
-        * Adds the part.\r
-        *\r
-        * @param entity the entity\r
-        * @param mediaType the media type\r
-        * @return the payload output part\r
-        */\r
-       @Deprecated\r
-       public PayloadOutputPart addPart(Object entity, MediaType mediaType) {\r
-               PayloadOutputPart result = addPart("unlabelled", entity);\r
-               return result;\r
-       }\r
-       \r
-       @Deprecated\r
-       public PayloadOutputPart addPart(String xmlPayload, MediaType mediaType) throws DocumentException {\r
-               PayloadOutputPart result = addPart("unlabelled", xmlPayload);\r
-               return result;\r
-       }\r
-       \r
-       \r
-       /**\r
-        * Adds a DOM4j Element part.\r
-        *\r
-        * @param label the label\r
-        * @param elementBody the element body\r
-        * @return the payload output part\r
-        */\r
-       public PayloadOutputPart addPart(String label, Element elementBody) { \r
-               PayloadOutputPart result = new PayloadOutputPart(label, elementBody);\r
-               getParts().add(result);\r
-               return result;\r
-       }\r
-       \r
-       /**\r
-        * Adds a DOM4j Element part.\r
-        *\r
-        * @param label the label\r
-        * @param elementBody the element body\r
-        * @return the payload output part\r
-        */\r
-       public PayloadOutputPart addPart(String label, String xmlBody) throws DocumentException { \r
-               PayloadOutputPart result = new PayloadOutputPart(label, xmlBody);\r
-               getParts().add(result);\r
-               return result;\r
-       }\r
-       \r
-       \r
-       /**\r
-        * Adds a JAXB object part.\r
-        *\r
-        * @param label the label\r
-        * @param entity the entity\r
-        * @return the payload output part\r
-        */\r
-       public PayloadOutputPart addPart(String label, Object entity) {\r
-               PayloadOutputPart result = new PayloadOutputPart(label, entity);\r
-               getParts().add(result);\r
-               return result;\r
-       }       \r
-       \r
-       /* (non-Javadoc)\r
-        * @see java.lang.Object#toString()\r
-        * This method calls our "toXML()" method to return an XML representation of ourself.\r
-        */\r
-       @Override\r
-       public String toString() {\r
-               return toXML();\r
-       }\r
-       \r
-       public byte[] getBytes() {\r
-               byte[] result = null;\r
-               try {\r
-                       result = toString().getBytes("UTF8");\r
-               } catch (UnsupportedEncodingException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace(); //FIXME: REM - Add proper logging statement here\r
-               }\r
-               return result;\r
-       }\r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.core.MediaType;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Iterator;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class PoxPayloadOut.
+ */
+public class PoxPayloadOut extends PoxPayload<PayloadOutputPart> {
+                       
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+       
+       /**
+        * Instantiates a new pox payload out.
+        *
+        * @param payloadName the payload name
+        * @throws DocumentException the document exception
+        */
+       public PoxPayloadOut(String payloadName) {
+               super();
+               setPayloadName(payloadName);
+       }
+               
+       public PoxPayloadOut(byte[] xmlPayload) throws DocumentException {
+               super(new String(xmlPayload));
+       }
+       
+       /**
+        * Instantiates a new PoxPayloadOut, saves the xml, creates a DOM, and parses the parts.
+        *
+        * @param file the file
+        * @throws DocumentException the document exception
+        * @throws IOException Signals that an I/O exception has occurred.
+        */
+       protected PoxPayloadOut(File file) throws DocumentException, IOException {
+               super(file);            
+       }
+               
+       /* (non-Javadoc)
+        * @see org.collectionspace.services.client.PoxPayload#createPart(java.lang.String, java.lang.Object, org.dom4j.Element)
+        * 
+        * We need this method because the generic base class has no way of calling our constructor.
+        */
+       @Override
+       protected PayloadOutputPart createPart(String label, Object jaxbObject, Element element) {
+               return new PayloadOutputPart(label, jaxbObject, element);
+       }
+
+       /* (non-Javadoc)
+        * @see org.collectionspace.services.client.PoxPayload#createPart(java.lang.String, org.dom4j.Element)
+        * 
+        * We need this method because the generic base class has no way of calling our constructor.
+        */
+       @Override
+       protected PayloadOutputPart createPart(String label, Element element) {
+               return new PayloadOutputPart(label, element);
+       }
+       
+       /**
+        * Creates and returns an XML string representation of ourself.
+        *
+        * @return the string
+        */
+       public String toXML() {
+               String result = null;
+        Document document = DocumentHelper.createDocument();
+        document.setXMLEncoding("UTF-8");
+        document.setName(getName());
+        Element root = document.addElement( "document" );
+        root.addAttribute("name", getName());        
+               
+               Iterator<PayloadOutputPart> it = getParts().iterator();
+               while (it.hasNext() == true) {
+                       PayloadOutputPart outPart = it.next();
+                       Element element = outPart.asElement();                  
+                       if (element != null) {
+                               root.add(element.detach());
+                       } else {
+                               //Add if (logger.isTraceEnabled() == true) logger.trace("Output part: " + outPart.getLabel() + " was empty.");
+                       }
+               }
+               result = document.asXML();
+               
+               if (logger.isTraceEnabled() == true) {
+                       logger.trace("\n\n<<<< Payload Out : BEGIN <<<<\n" +
+                                       result +
+                                       "\n<<<< Payload Out : END   <<<<\n");
+               }
+               
+               return result;
+       }
+               
+       /**
+        * Adds the part.
+        *
+        * @param entity the entity
+        * @param mediaType the media type
+        * @return the payload output part
+        */
+       @Deprecated
+       public PayloadOutputPart addPart(Object entity, MediaType mediaType) {
+               PayloadOutputPart result = addPart("unlabelled", entity);
+               return result;
+       }
+       
+       @Deprecated
+       public PayloadOutputPart addPart(String xmlPayload, MediaType mediaType) throws DocumentException {
+               PayloadOutputPart result = addPart("unlabelled", xmlPayload);
+               return result;
+       }
+       
+       
+       /**
+        * Adds a DOM4j Element part.
+        *
+        * @param label the label
+        * @param elementBody the element body
+        * @return the payload output part
+        */
+       public PayloadOutputPart addPart(String label, Element elementBody) { 
+               PayloadOutputPart result = new PayloadOutputPart(label, elementBody);
+               getParts().add(result);
+               return result;
+       }
+       
+       /**
+        * Adds a DOM4j Element part.
+        *
+        * @param label the label
+        * @param elementBody the element body
+        * @return the payload output part
+        */
+       public PayloadOutputPart addPart(String label, String xmlBody) throws DocumentException { 
+               PayloadOutputPart result = new PayloadOutputPart(label, xmlBody);
+               getParts().add(result);
+               return result;
+       }
+       
+       
+       /**
+        * Adds a JAXB object part.
+        *
+        * @param label the label
+        * @param entity the entity
+        * @return the payload output part
+        */
+       public PayloadOutputPart addPart(String label, Object entity) {
+               PayloadOutputPart result = new PayloadOutputPart(label, entity);
+               getParts().add(result);
+               return result;
+       }       
+       
+       /* (non-Javadoc)
+        * @see java.lang.Object#toString()
+        * This method calls our "toXML()" method to return an XML representation of ourself.
+        */
+       @Override
+       public String toString() {
+               return toXML();
+       }
+       
+       public byte[] getBytes() {
+               byte[] result = null;
+               try {
+                       result = toString().getBytes("UTF8");
+               } catch (UnsupportedEncodingException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace(); //FIXME: REM - Add proper logging statement here
+               }
+               return result;
+       }
+}
index 91554eac96e63e87b09d3c092daa0ccec5d00376..266eb8b746b8410a7c3beccb93fa13b320dea177 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.client;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * Profiler.java\r
- *\r
- * Simple utility to store and report performance metrics.\r
- *\r
- * Records start and stop times, and elapsed and cumulative timings;\r
- * writes performance-related log times.\r
- *\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- */\r
-public class Profiler {\r
-\r
-    /** The level of indentation. */\r
-    private int messageIndent = 0;\r
-    /** The indentation character(s) */\r
-    private static String INDENT = "\t";\r
-    /** The message prefix. */\r
-    private String messagePrefix = "";\r
-    /** The separator between the message prefix and the message. **/\r
-    final static String PREFIX_SEPARATOR = ":";\r
-    /** The start time. */\r
-    private long startTime = 0;\r
-    /** The stop time. */\r
-    private long stopTime = 0;\r
-    /** The segment time. */\r
-    private long elapsedTime = 0;\r
-    /** The cumulative time. */\r
-    private long cumulativeTime = 0;\r
-    /** The profiler logger. */\r
-    private static String DEFAULT_LOG4J_CATEGORY = "perf.collectionspace";\r
-    private static Logger profileLogger = LoggerFactory.getLogger(DEFAULT_LOG4J_CATEGORY);\r
-\r
-    /**\r
-     * private default constructor.\r
-     */\r
-    private Profiler() {\r
-        //empty default constructor\r
-    }\r
-\r
-    /**\r
-     * Instantiates a new profiler.\r
-     *\r
-     * @param theObject a class whose name is to be logged.\r
-     */\r
-    public Profiler(Object theObject) {\r
-        this(theObject, 0);\r
-    }\r
-\r
-    /**\r
-     * Instantiates a new profiler.\r
-     *\r
-     * @param theObject a class whose name is to be logged.\r
-     * @param messageIndent the level of indentation for log messages.\r
-     */\r
-    public Profiler(Object theObject, int messageIndent) {\r
-        init(objectName(theObject), messageIndent);\r
-    }\r
-\r
-    /**\r
-     * Instantiates a new profiler.\r
-     *\r
-     * @param messagePrefix the message prefix to appear in log messages.\r
-     * @param messageIndent the level of indentation for log messages.\r
-     */\r
-    public Profiler(String messagePrefix, int messageIndent) {\r
-        init(messagePrefix, messageIndent);\r
-    }\r
-\r
-    private void init(String messagePrefix, int messageIndent) {\r
-        this.setMessagePrefix(messagePrefix);\r
-        this.setMessageIndent(messageIndent);\r
-    }\r
-\r
-    /**\r
-     * Stores and logs the start time.\r
-     *\r
-     * Logs using a default message.\r
-     */\r
-    public void start() {\r
-        start(defaultStartMessage());\r
-    }\r
-\r
-    /**\r
-     * Stores and logs the start time.\r
-     *\r
-     * @param msg the message to log.\r
-     */\r
-    public void start(String msg) {\r
-        log(msg);\r
-        setStartTime(currentTime());\r
-    }\r
-\r
-    private void stopTimer() {\r
-        setStopTime(currentTime());\r
-        setElapsedTime(getStopTime() - getStartTime());\r
-        addToCumulativeTime(getElapsedTime());\r
-    }\r
-    \r
-    /**\r
-     * Stores and logs the stop time, and the elapsed and cumulative timings\r
-     * from one or more cycles of start and stop.\r
-     *\r
-     * Logs using a default message.\r
-     */\r
-    public void stop() {\r
-       stopTimer();\r
-        log(defaultStopMessage());\r
-    }\r
-\r
-    /**\r
-     * Stores and logs the stop time, and the elapsed and cumulative timings,\r
-     * from one or more cycles of start and stop.\r
-     *\r
-     * @param msg the message to log.\r
-     */\r
-    public void stop(String msg) {\r
-       stopTimer();\r
-        log(msg);\r
-    }\r
-\r
-    public long getStartTime() {\r
-        return this.startTime;\r
-    }\r
-\r
-    public long getStopTime() {\r
-        return this.stopTime;\r
-    }\r
-\r
-    public long getElapsedTime() {\r
-        return this.elapsedTime;\r
-    }\r
-\r
-    public long getCumulativeTime() {\r
-        return this.cumulativeTime;\r
-    }\r
-\r
-    /**\r
-     * Resets the start and stop time, and the elapsed and cumulative timings.\r
-     */\r
-    public void reset() {\r
-        setStartTime(0);\r
-        setStopTime(0);\r
-        setElapsedTime(0);\r
-        setCumulativeTime(0);\r
-    }\r
-\r
-    /**\r
-     * Writes a message to a log entry.  The message will\r
-     * be formatted, using current settings for indentation,\r
-     * prefix, etc. before being written.\r
-     *\r
-     * @param msg the message to be written to a log entry.\r
-     */\r
-    public void log(String msg) {\r
-        if (getLogger().isTraceEnabled()) {\r
-            getLogger().trace(formatLogMessage(msg));\r
-        }        \r
-    }\r
-\r
-    /**\r
-     * Writes a message to a log entry,\r
-     *\r
-     * @param msg the message to write to a log entry.\r
-     * @param formatMsg true if the message is to be formatted;\r
-     *                  false if it is not to be formatted.\r
-     */\r
-    public void log(String msg, boolean formatMsg) {\r
-        if (getLogger().isTraceEnabled()) {\r
-            if (formatMsg) {\r
-                getLogger().trace(formatLogMessage(msg));\r
-            } else {\r
-                getLogger().trace(msg);\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Gets the logger.\r
-     *\r
-     * @return the logger\r
-     */\r
-    protected Logger getLogger() {\r
-        return this.profileLogger;\r
-    }\r
-    \r
-    private void setMessagePrefix(String prefix) {\r
-        this.messagePrefix = prefix;\r
-    }\r
-\r
-    private String getMessagePrefix() {\r
-        return this.messagePrefix;\r
-    }\r
-\r
-    private int getMessageIndent() {\r
-        return this.messageIndent;\r
-    }\r
-\r
-    private void setMessageIndent(int indent) {\r
-        this.messageIndent = indent;\r
-    }\r
-\r
-    private void setStartTime(long start) {\r
-        this.startTime = start;\r
-    }\r
-\r
-    private void setStopTime(long stop) {\r
-        this.stopTime = stop;\r
-    }\r
-\r
-    private void setElapsedTime(long segment) {\r
-        this.elapsedTime = segment;\r
-    }\r
-\r
-    private void setCumulativeTime(long cumulative) {\r
-        this.cumulativeTime = cumulative;\r
-    }\r
-\r
-    private void addToCumulativeTime(long cumulative) {\r
-        this.cumulativeTime += cumulative;\r
-    }\r
-\r
-    private long currentTime() {\r
-        return System.currentTimeMillis();\r
-    }\r
-\r
-    private long elapsedTime() {\r
-        return (currentTime() - getStartTime());\r
-    }\r
-\r
-    private String objectName(Object theObject) {\r
-        if (theObject != null) {\r
-            return (theObject.getClass().getSimpleName());\r
-        } else {\r
-            return "";\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Returns a formatted log message, after adding indentation and prefix, if any.\r
-     *\r
-     * @param msg the message to log.\r
-     * @return a formatted log message, including indentation and prefix, if any.\r
-     */\r
-    private String formatLogMessage(String msg) {\r
-        StringBuffer logMsg = new StringBuffer();\r
-        for (int i = 0; i < getMessageIndent(); i++) {\r
-            logMsg.append(INDENT);\r
-        }\r
-        String prefix = getMessagePrefix();\r
-        if (prefix != null && !prefix.trim().isEmpty()) {\r
-            logMsg.append(prefix);\r
-            logMsg.append(PREFIX_SEPARATOR);\r
-        }\r
-        if (msg != null) {\r
-            logMsg.append(msg);\r
-        }\r
-        return logMsg.toString();\r
-    }\r
-\r
-    private String defaultStartMessage() {\r
-        StringBuffer defaultStartMessage = new StringBuffer();\r
-        defaultStartMessage.append(">>>> Start >>>>");\r
-        return defaultStartMessage.toString();\r
-    }\r
-\r
-    private String defaultStopMessage() {\r
-        StringBuffer defaultStopMessage = new StringBuffer();\r
-        defaultStopMessage.append("<<<< Stopped <<<<");\r
-        defaultStopMessage.append(" [" + getElapsedTime() + " ms]");\r
-        if (getCumulativeTime() > getElapsedTime()) {\r
-            defaultStopMessage.append(" (cumulative [" + getCumulativeTime() + " ms])");\r
-        }\r
-        return defaultStopMessage.toString();\r
-    }\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.client;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Profiler.java
+ *
+ * Simple utility to store and report performance metrics.
+ *
+ * Records start and stop times, and elapsed and cumulative timings;
+ * writes performance-related log times.
+ *
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ */
+public class Profiler {
+
+    /** The level of indentation. */
+    private int messageIndent = 0;
+    /** The indentation character(s) */
+    private static String INDENT = "\t";
+    /** The message prefix. */
+    private String messagePrefix = "";
+    /** The separator between the message prefix and the message. **/
+    final static String PREFIX_SEPARATOR = ":";
+    /** The start time. */
+    private long startTime = 0;
+    /** The stop time. */
+    private long stopTime = 0;
+    /** The segment time. */
+    private long elapsedTime = 0;
+    /** The cumulative time. */
+    private long cumulativeTime = 0;
+    /** The profiler logger. */
+    private static String DEFAULT_LOG4J_CATEGORY = "perf.collectionspace";
+    private static Logger profileLogger = LoggerFactory.getLogger(DEFAULT_LOG4J_CATEGORY);
+
+    /**
+     * private default constructor.
+     */
+    private Profiler() {
+        //empty default constructor
+    }
+
+    /**
+     * Instantiates a new profiler.
+     *
+     * @param theObject a class whose name is to be logged.
+     */
+    public Profiler(Object theObject) {
+        this(theObject, 0);
+    }
+
+    /**
+     * Instantiates a new profiler.
+     *
+     * @param theObject a class whose name is to be logged.
+     * @param messageIndent the level of indentation for log messages.
+     */
+    public Profiler(Object theObject, int messageIndent) {
+        init(objectName(theObject), messageIndent);
+    }
+
+    /**
+     * Instantiates a new profiler.
+     *
+     * @param messagePrefix the message prefix to appear in log messages.
+     * @param messageIndent the level of indentation for log messages.
+     */
+    public Profiler(String messagePrefix, int messageIndent) {
+        init(messagePrefix, messageIndent);
+    }
+
+    private void init(String messagePrefix, int messageIndent) {
+        this.setMessagePrefix(messagePrefix);
+        this.setMessageIndent(messageIndent);
+    }
+
+    /**
+     * Stores and logs the start time.
+     *
+     * Logs using a default message.
+     */
+    public void start() {
+        start(defaultStartMessage());
+    }
+
+    /**
+     * Stores and logs the start time.
+     *
+     * @param msg the message to log.
+     */
+    public void start(String msg) {
+        log(msg);
+        setStartTime(currentTime());
+    }
+
+    private void stopTimer() {
+        setStopTime(currentTime());
+        setElapsedTime(getStopTime() - getStartTime());
+        addToCumulativeTime(getElapsedTime());
+    }
+    
+    /**
+     * Stores and logs the stop time, and the elapsed and cumulative timings
+     * from one or more cycles of start and stop.
+     *
+     * Logs using a default message.
+     */
+    public void stop() {
+       stopTimer();
+        log(defaultStopMessage());
+    }
+
+    /**
+     * Stores and logs the stop time, and the elapsed and cumulative timings,
+     * from one or more cycles of start and stop.
+     *
+     * @param msg the message to log.
+     */
+    public void stop(String msg) {
+       stopTimer();
+        log(msg);
+    }
+
+    public long getStartTime() {
+        return this.startTime;
+    }
+
+    public long getStopTime() {
+        return this.stopTime;
+    }
+
+    public long getElapsedTime() {
+        return this.elapsedTime;
+    }
+
+    public long getCumulativeTime() {
+        return this.cumulativeTime;
+    }
+
+    /**
+     * Resets the start and stop time, and the elapsed and cumulative timings.
+     */
+    public void reset() {
+        setStartTime(0);
+        setStopTime(0);
+        setElapsedTime(0);
+        setCumulativeTime(0);
+    }
+
+    /**
+     * Writes a message to a log entry.  The message will
+     * be formatted, using current settings for indentation,
+     * prefix, etc. before being written.
+     *
+     * @param msg the message to be written to a log entry.
+     */
+    public void log(String msg) {
+        if (getLogger().isTraceEnabled()) {
+            getLogger().trace(formatLogMessage(msg));
+        }        
+    }
+
+    /**
+     * Writes a message to a log entry,
+     *
+     * @param msg the message to write to a log entry.
+     * @param formatMsg true if the message is to be formatted;
+     *                  false if it is not to be formatted.
+     */
+    public void log(String msg, boolean formatMsg) {
+        if (getLogger().isTraceEnabled()) {
+            if (formatMsg) {
+                getLogger().trace(formatLogMessage(msg));
+            } else {
+                getLogger().trace(msg);
+            }
+        }
+    }
+
+    /**
+     * Gets the logger.
+     *
+     * @return the logger
+     */
+    protected Logger getLogger() {
+        return this.profileLogger;
+    }
+    
+    private void setMessagePrefix(String prefix) {
+        this.messagePrefix = prefix;
+    }
+
+    private String getMessagePrefix() {
+        return this.messagePrefix;
+    }
+
+    private int getMessageIndent() {
+        return this.messageIndent;
+    }
+
+    private void setMessageIndent(int indent) {
+        this.messageIndent = indent;
+    }
+
+    private void setStartTime(long start) {
+        this.startTime = start;
+    }
+
+    private void setStopTime(long stop) {
+        this.stopTime = stop;
+    }
+
+    private void setElapsedTime(long segment) {
+        this.elapsedTime = segment;
+    }
+
+    private void setCumulativeTime(long cumulative) {
+        this.cumulativeTime = cumulative;
+    }
+
+    private void addToCumulativeTime(long cumulative) {
+        this.cumulativeTime += cumulative;
+    }
+
+    private long currentTime() {
+        return System.currentTimeMillis();
+    }
+
+    private long elapsedTime() {
+        return (currentTime() - getStartTime());
+    }
+
+    private String objectName(Object theObject) {
+        if (theObject != null) {
+            return (theObject.getClass().getSimpleName());
+        } else {
+            return "";
+        }
+    }
+
+    /**
+     * Returns a formatted log message, after adding indentation and prefix, if any.
+     *
+     * @param msg the message to log.
+     * @return a formatted log message, including indentation and prefix, if any.
+     */
+    private String formatLogMessage(String msg) {
+        StringBuffer logMsg = new StringBuffer();
+        for (int i = 0; i < getMessageIndent(); i++) {
+            logMsg.append(INDENT);
+        }
+        String prefix = getMessagePrefix();
+        if (prefix != null && !prefix.trim().isEmpty()) {
+            logMsg.append(prefix);
+            logMsg.append(PREFIX_SEPARATOR);
+        }
+        if (msg != null) {
+            logMsg.append(msg);
+        }
+        return logMsg.toString();
+    }
+
+    private String defaultStartMessage() {
+        StringBuffer defaultStartMessage = new StringBuffer();
+        defaultStartMessage.append(">>>> Start >>>>");
+        return defaultStartMessage.toString();
+    }
+
+    private String defaultStopMessage() {
+        StringBuffer defaultStopMessage = new StringBuffer();
+        defaultStopMessage.append("<<<< Stopped <<<<");
+        defaultStopMessage.append(" [" + getElapsedTime() + " ms]");
+        if (getCumulativeTime() > getElapsedTime()) {
+            defaultStopMessage.append(" (cumulative [" + getCumulativeTime() + " ms])");
+        }
+        return defaultStopMessage.toString();
+    }
+
+}
index 0299771cab397c54b10efa7f7844065c8b4b163b..3786f443c3b430cb00abc3eb97316ff147b5d9c2 100644 (file)
@@ -1,7 +1,7 @@
-package org.collectionspace.services.client;\r
-\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-public interface TestServiceProxy extends CollectionSpaceProxy<AbstractCommonList> {\r
-\r
-}\r
+package org.collectionspace.services.client;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+public interface TestServiceProxy extends CollectionSpaceProxy<AbstractCommonList> {
+
+}
index 3d3ff6001acfe0d065ad30b7391c9a808ace626b..f878f897e2084d21d1fa2a170fd16d0dbd2500ce 100644 (file)
-package org.collectionspace.services.client.test;\r
-\r
-import java.util.List;\r
-\r
-import javax.ws.rs.core.Response;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-import org.collectionspace.services.client.AbstractCommonListUtils;\r
-import org.collectionspace.services.client.AuthorityClient;\r
-import org.collectionspace.services.client.AuthorityClientImpl;\r
-import org.collectionspace.services.client.AuthorityProxy;\r
-import org.collectionspace.services.client.PayloadInputPart;\r
-import org.collectionspace.services.client.PayloadOutputPart;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.testng.Assert;\r
-import org.testng.annotations.Test;\r
-\r
-/**\r
- * \r
- * @author remillet\r
- *\r
- * @param <AUTHORITY_COMMON_TYPE>\r
- * @param <AUTHORITY_ITEM_TYPE>\r
- * \r
- * All CRUD related authority test classes should extend this class.\r
- * \r
- */\r
-public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE> \r
-       extends AbstractPoxServiceTestImpl<AbstractCommonList, AUTHORITY_COMMON_TYPE> {\r
-\r
-    private final Logger logger = LoggerFactory.getLogger(AbstractAuthorityServiceTest.class);\r
-       \r
-    protected String knownResourceShortIdentifer = null;\r
-       protected static final String READITEMS_SHORT_IDENTIFIER = "resourceWithItems"; \r
-       protected String knownAuthorityWithItems = null;\r
-       \r
-       protected String knownResourceRefName = null;\r
-    protected String knownItemResourceId = null;\r
-    protected String knownItemResourceShortIdentifer = null;    \r
-    protected int nItemsToCreateInList = 5;\r
-               \r
-       public abstract void authorityTests(String testName);\r
-    protected abstract String createItemInAuthority(String authorityId);\r
\r
-    protected abstract AUTHORITY_ITEM_TYPE updateItemInstance(final AUTHORITY_ITEM_TYPE authorityItem);    \r
-    protected abstract void compareUpdatedItemInstances(AUTHORITY_ITEM_TYPE original, AUTHORITY_ITEM_TYPE updated) throws Exception;\r
-    \r
-    protected void setKnownItemResource(String id, String shortIdentifer ) {\r
-       knownItemResourceId = id;\r
-       knownItemResourceShortIdentifer = shortIdentifer;\r
-    }\r
-\r
-    protected void setKnownResource(String id, String shortIdentifer,\r
-            String refName) {\r
-        knownResourceId = id;\r
-        knownResourceShortIdentifer = shortIdentifer;\r
-        knownResourceRefName = refName;\r
-    }\r
-\r
-    /**\r
-     * Returns the root URL for a service.\r
-     *\r
-     * This URL consists of a base URL for all services, followed by\r
-     * a path component for the owning vocabulary, followed by the \r
-     * path component for the items.\r
-     *\r
-     * @return The root URL for a service.\r
-     */\r
-    protected String getItemServiceRootURL(String parentResourceIdentifier) {\r
-        return getResourceURL(parentResourceIdentifier) + "/" + getServicePathItemsComponent();\r
-    }\r
-\r
-    /**\r
-     * Returns the URL of a specific resource managed by a service, and\r
-     * designated by an identifier (such as a universally unique ID, or UUID).\r
-     *\r
-     * @param  resourceIdentifier  An identifier (such as a UUID) for a resource.\r
-     *\r
-     * @return The URL of a specific resource managed by a service.\r
-     */\r
-    protected String getItemResourceURL(String parentResourceIdentifier, String resourceIdentifier) {\r
-        return getItemServiceRootURL(parentResourceIdentifier) + "/" + resourceIdentifier;\r
-    }\r
-        \r
-    /**\r
-     * For authorities we override this method so we can save the shortid.\r
-     */\r
-    @Override\r
-    protected String createWithIdentifier(String testName, String identifier) throws Exception {\r
-       String csid = createResource(testName, identifier);\r
-        // Store the ID returned from the first resource created\r
-        // for additional tests below.\r
-        if (getKnowResourceId() == null) {\r
-               setKnownResource(csid, identifier /*shortId*/, null /*refname*/ );\r
-            if (logger.isDebugEnabled()) {\r
-                logger.debug(testName + ": Setting knownResourceId=" + getKnowResourceId());\r
-            }\r
-        }\r
-       \r
-        return identifier;\r
-    }    \r
-    \r
-    @Test(dependsOnMethods = {"readItem", "CRUDTests"})\r
-    public void testItemSubmitRequest() {\r
-\r
-        // Expected status code: 200 OK\r
-        final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();\r
-\r
-        // Submit the request to the service and store the response.\r
-        String method = ServiceRequestType.READ.httpMethodName();\r
-        String url = getItemResourceURL(knownResourceId, knownItemResourceId);\r
-        int statusCode = submitRequest(method, url);\r
-\r
-        // Check the status code of the response: does it match\r
-        // the expected response(s)?\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("testItemSubmitRequest: url=" + url\r
-                    + " status=" + statusCode);\r
-        }\r
-        Assert.assertEquals(statusCode, EXPECTED_STATUS);\r
-    }    \r
-\r
-    \r
-    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,\r
-       dependsOnMethods = {"readItem"})\r
-    public void verifyIgnoredUpdateWithInAuthority(String testName) throws Exception {\r
-       // Perform setup.\r
-       setupUpdate();\r
-\r
-       // Submit the request to the service and store the response.\r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = \r
-                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-       ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);\r
-       int statusCode = res.getStatus();\r
-\r
-       // Check the status code of the response: does it match\r
-       // the expected response(s)?\r
-       if (logger.isDebugEnabled()) {\r
-               logger.debug(testName + " read authority:" + knownResourceId + "/Item:"\r
-                               + knownItemResourceId + " status = " + statusCode);\r
-       }\r
-       Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                       invalidStatusCodeMessage(testRequestType, statusCode));\r
-       Assert.assertEquals(statusCode, Response.Status.OK.getStatusCode());\r
-\r
-        AUTHORITY_ITEM_TYPE vitem = extractItemCommonPartValue(res);\r
-       Assert.assertNotNull(vitem);\r
-       // Try to Update with new parent vocab (use self, for test).\r
-       Assert.assertEquals(client.getInAuthority(vitem), knownResourceId,\r
-                       "VocabularyItem inAuthority does not match knownResourceId.");\r
-       client.setInAuthority(vitem, knownItemResourceId);\r
-\r
-       // Submit the updated resource to the service and store the response.\r
-        PoxPayloadOut output = this.createItemRequestTypeInstance(vitem);\r
-       res = client.updateItem(knownResourceId, knownItemResourceId, output);\r
-       statusCode = res.getStatus();\r
-\r
-       // Check the status code of the response: does it match the expected response(s)?\r
-       if (logger.isDebugEnabled()) {\r
-               logger.debug(testName + ": status = " + statusCode);\r
-       }\r
-       Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                       invalidStatusCodeMessage(testRequestType, statusCode));\r
-       Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-\r
-       // Retrieve the updated resource and verify that the parent did not change\r
-       res = client.readItem(knownResourceId, knownItemResourceId);\r
-        AUTHORITY_ITEM_TYPE updatedVocabularyItem = extractItemCommonPartValue(res);\r
-       Assert.assertNotNull(updatedVocabularyItem);\r
-\r
-       // Verify that the updated resource received the correct data.\r
-       Assert.assertEquals(client.getInAuthority(updatedVocabularyItem),\r
-                       knownResourceId,\r
-                       "VocabularyItem allowed update to the parent (inAuthority).");\r
-    }\r
-    \r
-    @Test(dataProvider = "testName",\r
-               dependsOnMethods = {"CRUDTests"})\r
-    public void createItem(String testName) {\r
-        // Perform setup.\r
-        setupCreate();\r
-\r
-        String newID = createItemInAuthority(knownResourceId);\r
-\r
-        // Store the ID returned from the first item resource created\r
-        // for additional tests below.\r
-        if (knownItemResourceId == null) {\r
-            knownItemResourceId = newID;\r
-            if (null != testName && logger.isDebugEnabled()) {\r
-                logger.debug(testName + ": knownItemResourceId=" + knownItemResourceId);\r
-            }\r
-        }\r
-    }\r
-    \r
-    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,\r
-               dependsOnMethods = {"createItem"})\r
-    public void createItemList(String testName) throws Exception {\r
-       knownAuthorityWithItems = createResource(testName, READITEMS_SHORT_IDENTIFIER);\r
-        for (int j = 0; j < nItemsToCreateInList; j++) {\r
-               createItemInAuthority(knownAuthorityWithItems);\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Read by name.\r
-     *\r
-     * @param testName the test name\r
-     * @throws Exception the exception\r
-     */\r
-    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,\r
-               dependsOnMethods = {"CRUDTests"})\r
-    public void readByName(String testName) throws Exception {\r
-        // Perform setup.\r
-        setupRead();\r
-\r
-        // Submit the request to the service and store the response.\r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-        ClientResponse<String> res = client.readByName(getKnowResourceIdentifier());\r
-        int statusCode = res.getStatus();\r
-\r
-        // Check the status code of the response: does it match\r
-        // the expected response(s)?\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug(testName + ": status = " + statusCode);\r
-        }\r
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                invalidStatusCodeMessage(testRequestType, statusCode));\r
-        Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-        \r
-        AUTHORITY_COMMON_TYPE commonPart = extractCommonPartValue(res);\r
-        Assert.assertNotNull(commonPart);\r
-    }\r
-    \r
-    /**\r
-     * Extracts the common part item from a service's item payload.\r
-     * \r
-     * @param res\r
-     * @return\r
-     * @throws Exception\r
-     */\r
-       public AUTHORITY_ITEM_TYPE extractItemCommonPartValue(ClientResponse<String> res) throws Exception {\r
-               AUTHORITY_ITEM_TYPE result = null;\r
-               \r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-               PayloadInputPart payloadInputPart = extractPart(res, client.getItemCommonPartName());\r
-               if (payloadInputPart != null) {\r
-                       result = (AUTHORITY_ITEM_TYPE) payloadInputPart.getBody();\r
-               }\r
-               Assert.assertNotNull(result,\r
-                               "Part or body of part " + client.getCommonPartName() + " was unexpectedly null.");\r
-               \r
-               return result;\r
-       }\r
-    \r
-    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,\r
-               dependsOnMethods = {"readItem"})\r
-    public void readItemNonExistent(String testName) {\r
-        // Perform setup.\r
-        setupReadNonExistent();\r
-\r
-        // Submit the request to the service and store the response.\r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-        ClientResponse<String> res = client.readItem(knownResourceId, NON_EXISTENT_ID);\r
-        int statusCode = res.getStatus();\r
-\r
-        // Check the status code of the response: does it match\r
-        // the expected response(s)?\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug(testName + ": status = " + statusCode);\r
-        }\r
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                invalidStatusCodeMessage(testRequestType, statusCode));\r
-        Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-    }\r
-       \r
-    @Test(dataProvider = "testName",\r
-               dependsOnMethods = {"createItem"})\r
-    public void readItem(String testName) throws Exception {\r
-        // Perform setup.\r
-        setupRead();\r
-\r
-        // Submit the request to the service and store the response.\r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-        ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);\r
-        int statusCode = res.getStatus();\r
-\r
-        // Check the status code of the response: does it match\r
-        // the expected response(s)?\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug(testName + ": status = " + statusCode);\r
-        }\r
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                invalidStatusCodeMessage(testRequestType, statusCode));\r
-        Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-\r
-        AUTHORITY_ITEM_TYPE itemCommonPart = extractItemCommonPartValue(res);\r
-        Assert.assertNotNull(itemCommonPart);\r
-        Assert.assertEquals(client.getInAuthority(itemCommonPart), knownResourceId);\r
-        verifyReadItemInstance(itemCommonPart);\r
-    }\r
-    \r
-    protected abstract void verifyReadItemInstance(AUTHORITY_ITEM_TYPE item) throws Exception;\r
-        \r
-    @Test(dataProvider = "testName",\r
-               dependsOnMethods = {"testItemSubmitRequest", "updateItem", "verifyIgnoredUpdateWithInAuthority"})    \r
-    public void deleteItem(String testName) throws Exception {\r
-        // Perform setup.\r
-        setupDelete();\r
-\r
-        // Submit the request to the service and store the response.\r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-        ClientResponse<Response> res = client.deleteItem(knownResourceId, knownItemResourceId);\r
-        int statusCode = res.getStatus();\r
-\r
-        // Check the status code of the response: does it match\r
-        // the expected response(s)?\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("delete: status = " + statusCode);\r
-        }\r
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                invalidStatusCodeMessage(testRequestType, statusCode));\r
-        Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-    }\r
-    \r
-    protected void readItemListInt(String vcsid, String shortId, String testName) {\r
-        // Perform setup.\r
-        setupReadList();\r
-\r
-        // Submit the request to the service and store the response.\r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-        ClientResponse<AbstractCommonList> res = null;\r
-        if (vcsid != null) {\r
-            res = client.readItemList(vcsid, null, null);\r
-        } else if (shortId != null) {\r
-            res = client.readItemListForNamedAuthority(shortId, null, null);\r
-        } else {\r
-            Assert.fail("Internal Error: readItemList both vcsid and shortId are null!");\r
-        }\r
-        int statusCode = res.getStatus();\r
-\r
-        // Check the status code of the response: does it match\r
-        // the expected response(s)?\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("  " + testName + ": status = " + statusCode);\r
-        }\r
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                invalidStatusCodeMessage(testRequestType, statusCode));\r
-        Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-\r
-        AbstractCommonList list = res.getEntity();\r
-        List<AbstractCommonList.ListItem> items = list.getListItem();\r
-        int nItemsReturned = items.size();\r
-        long nItemsTotal = list.getTotalItems();\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("  " + testName + ": Expected "\r
-                    + nItemsToCreateInList + " items; got: " + nItemsReturned + " of: " + nItemsTotal);\r
-        }\r
-        Assert.assertEquals(nItemsTotal, nItemsToCreateInList);\r
-\r
-        if(logger.isTraceEnabled()){\r
-               AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);\r
-        }\r
-    }\r
-    \r
-    @Test(dataProvider = "testName",\r
-               dependsOnMethods = {"createItemList"})\r
-    public void readItemList(String testName) {\r
-        readItemListInt(knownAuthorityWithItems, null, testName);\r
-    }\r
-\r
-    @Test(dataProvider = "testName",\r
-               dependsOnMethods = {"readItem"})\r
-    public void readItemListByName(String testName) {\r
-        readItemListInt(null, READITEMS_SHORT_IDENTIFIER, testName);\r
-    }\r
-\r
-    @Test(dataProvider = "testName",\r
-               dependsOnMethods = {"deleteItem"})\r
-    public void deleteNonExistentItem(String testName) {\r
-        // Perform setup.\r
-        setupDeleteNonExistent();\r
-\r
-        // Submit the request to the service and store the response.\r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-        ClientResponse<Response> res = client.deleteItem(knownResourceId, NON_EXISTENT_ID);\r
-        int statusCode = res.getStatus();\r
-\r
-        // Check the status code of the response: does it match\r
-        // the expected response(s)?\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug(testName + ": status = " + statusCode);\r
-        }\r
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                invalidStatusCodeMessage(testRequestType, statusCode));\r
-        Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-    }\r
-    \r
-    protected String getServicePathItemsComponent() {\r
-        return AuthorityClient.ITEMS;\r
-    }\r
-    \r
-       public PoxPayloadOut createItemRequestTypeInstance(AUTHORITY_ITEM_TYPE itemTypeInstance) {\r
-               PoxPayloadOut result = null;\r
-               \r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-        PoxPayloadOut payloadOut = new PoxPayloadOut(this.getServicePathItemsComponent());\r
-        PayloadOutputPart part = payloadOut.addPart(client.getItemCommonPartName(), itemTypeInstance);\r
-        result = payloadOut;\r
-               \r
-               return result;\r
-       }\r
-\r
-       /**\r
-        * Update an Authority item.\r
-        * \r
-        * @param testName\r
-        * @throws Exception\r
-        */\r
-    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,\r
-               dependsOnMethods = {"readItem", "CRUDTests", "verifyIgnoredUpdateWithInAuthority"})\r
-    public void updateItem(String testName) throws Exception {\r
-        // Perform setup.\r
-        setupUpdate();\r
-        AUTHORITY_ITEM_TYPE theUpdate = null;\r
-\r
-        // Retrieve the contents of a resource to update.\r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =\r
-                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-        ClientResponse<String> res =\r
-                client.readItem(knownResourceId, knownItemResourceId);\r
-        try {\r
-               if (logger.isDebugEnabled()) {\r
-                   logger.debug(testName + ": read status = " + res.getStatus());\r
-               }\r
-               Assert.assertEquals(res.getStatus(), testExpectedStatusCode);\r
-       \r
-               if (logger.isDebugEnabled()) {\r
-                   logger.debug("got Authority item to update with ID: "\r
-                           + knownItemResourceId\r
-                           + " in authority: " + knownResourceId);\r
-               }\r
-               AUTHORITY_ITEM_TYPE authorityItem = extractItemCommonPartValue(res);\r
-               Assert.assertNotNull(authorityItem);\r
-\r
-               // Update the contents of this resource.\r
-               theUpdate = updateItemInstance(authorityItem);\r
-               if (logger.isDebugEnabled()) {\r
-                   logger.debug("\n\nTo be updated fields: CSID = "  + knownItemResourceId + "\n"\r
-                               + objectAsXmlString(theUpdate));\r
-               }\r
-        } finally {\r
-               res.releaseConnection();\r
-        }\r
-\r
-        // Submit the updated resource to the service and store the response.\r
-        PoxPayloadOut output = this.createItemRequestTypeInstance(theUpdate);\r
-        res = client.updateItem(knownResourceId, knownItemResourceId, output);\r
-        try {\r
-               int statusCode = res.getStatus();\r
-       \r
-               // Check the status code of the response: does it match the expected response(s)?\r
-               if (logger.isDebugEnabled()) {\r
-                   logger.debug("updateItem: status = " + statusCode);\r
-               }\r
-               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                       invalidStatusCodeMessage(testRequestType, statusCode));\r
-               Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-       \r
-               // Retrieve the updated resource and verify that its contents exist.\r
-               AUTHORITY_ITEM_TYPE updatedVocabularyItem = extractItemCommonPartValue(res);\r
-               Assert.assertNotNull(updatedVocabularyItem);\r
-\r
-               compareUpdatedItemInstances(theUpdate, updatedVocabularyItem);\r
-        } finally {\r
-               res.releaseConnection();\r
-        }\r
-    }\r
-    \r
-    protected abstract PoxPayloadOut createNonExistenceItemInstance(String commonPartName, String identifier);\r
-    \r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.client.test.ServiceTest#updateNonExistent(java.lang.String)\r
-     */\r
-    @Test(dataProvider = "testName",\r
-       dependsOnMethods = {"create", "update", "updateNonExistent"})\r
-    public void updateNonExistentItem(String testName) throws Exception {\r
-       // Perform setup.\r
-       setupUpdateNonExistent();\r
-\r
-       // Submit the request to the service and store the response.\r
-       // Note: The ID used in this 'create' call may be arbitrary.\r
-       // The only relevant ID may be the one used in update(), below.\r
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =\r
-                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();\r
-       PoxPayloadOut multipart = createNonExistenceItemInstance(client.getItemCommonPartName(), NON_EXISTENT_ID);\r
-       ClientResponse<String> res =\r
-                       client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);\r
-       try {\r
-               int statusCode = res.getStatus();\r
-       \r
-               // Check the status code of the response: does it match\r
-               // the expected response(s)?\r
-               if (logger.isDebugEnabled()) {\r
-                       logger.debug(testName + ": status = " + statusCode);\r
-               }\r
-               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                               invalidStatusCodeMessage(testRequestType, statusCode));\r
-               Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-       } finally {\r
-               res.releaseConnection();\r
-       }\r
-    }\r
-        \r
-    //\r
-    // Methods to persuade TestNG to follow the correct test dependency path\r
-    //\r
-    \r
-    @Test(dataProvider = "testName",\r
-               dependsOnMethods = {"createItem"})\r
-    public void baseAuthorityTests(String testName) {\r
-       // Do nothing.  Here just to setup a test dependency chain.\r
-    }\r
-    \r
-    /*\r
-     * For convenience and terseness, this test method is the base of the test execution dependency chain.  Other test methods may\r
-     * refer to this method in their @Test annotation declarations.\r
-     */\r
-    @Override\r
-    @Test(dataProvider = "testName",\r
-               dependsOnMethods = {\r
-                       "org.collectionspace.services.client.test.AbstractServiceTestImpl.baseCRUDTests"})    \r
-       public void CRUDTests(String testName) {\r
-               // TODO Auto-generated method stub\r
-       }\r
-    \r
-}\r
+package org.collectionspace.services.client.test;
+
+import java.util.List;
+
+import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.collectionspace.services.client.AbstractCommonListUtils;
+import org.collectionspace.services.client.AuthorityClient;
+import org.collectionspace.services.client.AuthorityClientImpl;
+import org.collectionspace.services.client.AuthorityProxy;
+import org.collectionspace.services.client.PayloadInputPart;
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * @author remillet
+ *
+ * @param <AUTHORITY_COMMON_TYPE>
+ * @param <AUTHORITY_ITEM_TYPE>
+ * 
+ * All CRUD related authority test classes should extend this class.
+ * 
+ */
+public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE> 
+       extends AbstractPoxServiceTestImpl<AbstractCommonList, AUTHORITY_COMMON_TYPE> {
+
+    private final Logger logger = LoggerFactory.getLogger(AbstractAuthorityServiceTest.class);
+       
+    protected String knownResourceShortIdentifer = null;
+       protected static final String READITEMS_SHORT_IDENTIFIER = "resourceWithItems"; 
+       protected String knownAuthorityWithItems = null;
+       
+       protected String knownResourceRefName = null;
+    protected String knownItemResourceId = null;
+    protected String knownItemResourceShortIdentifer = null;    
+    protected int nItemsToCreateInList = 5;
+               
+       public abstract void authorityTests(String testName);
+    protected abstract String createItemInAuthority(String authorityId);
+    protected abstract AUTHORITY_ITEM_TYPE updateItemInstance(final AUTHORITY_ITEM_TYPE authorityItem);    
+    protected abstract void compareUpdatedItemInstances(AUTHORITY_ITEM_TYPE original, AUTHORITY_ITEM_TYPE updated) throws Exception;
+    
+    protected void setKnownItemResource(String id, String shortIdentifer ) {
+       knownItemResourceId = id;
+       knownItemResourceShortIdentifer = shortIdentifer;
+    }
+
+    protected void setKnownResource(String id, String shortIdentifer,
+            String refName) {
+        knownResourceId = id;
+        knownResourceShortIdentifer = shortIdentifer;
+        knownResourceRefName = refName;
+    }
+
+    /**
+     * Returns the root URL for a service.
+     *
+     * This URL consists of a base URL for all services, followed by
+     * a path component for the owning vocabulary, followed by the 
+     * path component for the items.
+     *
+     * @return The root URL for a service.
+     */
+    protected String getItemServiceRootURL(String parentResourceIdentifier) {
+        return getResourceURL(parentResourceIdentifier) + "/" + getServicePathItemsComponent();
+    }
+
+    /**
+     * Returns the URL of a specific resource managed by a service, and
+     * designated by an identifier (such as a universally unique ID, or UUID).
+     *
+     * @param  resourceIdentifier  An identifier (such as a UUID) for a resource.
+     *
+     * @return The URL of a specific resource managed by a service.
+     */
+    protected String getItemResourceURL(String parentResourceIdentifier, String resourceIdentifier) {
+        return getItemServiceRootURL(parentResourceIdentifier) + "/" + resourceIdentifier;
+    }
+        
+    /**
+     * For authorities we override this method so we can save the shortid.
+     */
+    @Override
+    protected String createWithIdentifier(String testName, String identifier) throws Exception {
+       String csid = createResource(testName, identifier);
+        // Store the ID returned from the first resource created
+        // for additional tests below.
+        if (getKnowResourceId() == null) {
+               setKnownResource(csid, identifier /*shortId*/, null /*refname*/ );
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": Setting knownResourceId=" + getKnowResourceId());
+            }
+        }
+       
+        return identifier;
+    }    
+    
+    @Test(dependsOnMethods = {"readItem", "CRUDTests"})
+    public void testItemSubmitRequest() {
+
+        // Expected status code: 200 OK
+        final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
+
+        // Submit the request to the service and store the response.
+        String method = ServiceRequestType.READ.httpMethodName();
+        String url = getItemResourceURL(knownResourceId, knownItemResourceId);
+        int statusCode = submitRequest(method, url);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if (logger.isDebugEnabled()) {
+            logger.debug("testItemSubmitRequest: url=" + url
+                    + " status=" + statusCode);
+        }
+        Assert.assertEquals(statusCode, EXPECTED_STATUS);
+    }    
+
+    
+    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+       dependsOnMethods = {"readItem"})
+    public void verifyIgnoredUpdateWithInAuthority(String testName) throws Exception {
+       // Perform setup.
+       setupUpdate();
+
+       // Submit the request to the service and store the response.
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = 
+                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+       ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);
+       int statusCode = res.getStatus();
+
+       // Check the status code of the response: does it match
+       // the expected response(s)?
+       if (logger.isDebugEnabled()) {
+               logger.debug(testName + " read authority:" + knownResourceId + "/Item:"
+                               + knownItemResourceId + " status = " + statusCode);
+       }
+       Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+       Assert.assertEquals(statusCode, Response.Status.OK.getStatusCode());
+
+        AUTHORITY_ITEM_TYPE vitem = extractItemCommonPartValue(res);
+       Assert.assertNotNull(vitem);
+       // Try to Update with new parent vocab (use self, for test).
+       Assert.assertEquals(client.getInAuthority(vitem), knownResourceId,
+                       "VocabularyItem inAuthority does not match knownResourceId.");
+       client.setInAuthority(vitem, knownItemResourceId);
+
+       // Submit the updated resource to the service and store the response.
+        PoxPayloadOut output = this.createItemRequestTypeInstance(vitem);
+       res = client.updateItem(knownResourceId, knownItemResourceId, output);
+       statusCode = res.getStatus();
+
+       // Check the status code of the response: does it match the expected response(s)?
+       if (logger.isDebugEnabled()) {
+               logger.debug(testName + ": status = " + statusCode);
+       }
+       Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+       Assert.assertEquals(statusCode, testExpectedStatusCode);
+
+       // Retrieve the updated resource and verify that the parent did not change
+       res = client.readItem(knownResourceId, knownItemResourceId);
+        AUTHORITY_ITEM_TYPE updatedVocabularyItem = extractItemCommonPartValue(res);
+       Assert.assertNotNull(updatedVocabularyItem);
+
+       // Verify that the updated resource received the correct data.
+       Assert.assertEquals(client.getInAuthority(updatedVocabularyItem),
+                       knownResourceId,
+                       "VocabularyItem allowed update to the parent (inAuthority).");
+    }
+    
+    @Test(dataProvider = "testName",
+               dependsOnMethods = {"CRUDTests"})
+    public void createItem(String testName) {
+        // Perform setup.
+        setupCreate();
+
+        String newID = createItemInAuthority(knownResourceId);
+
+        // Store the ID returned from the first item resource created
+        // for additional tests below.
+        if (knownItemResourceId == null) {
+            knownItemResourceId = newID;
+            if (null != testName && logger.isDebugEnabled()) {
+                logger.debug(testName + ": knownItemResourceId=" + knownItemResourceId);
+            }
+        }
+    }
+    
+    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+               dependsOnMethods = {"createItem"})
+    public void createItemList(String testName) throws Exception {
+       knownAuthorityWithItems = createResource(testName, READITEMS_SHORT_IDENTIFIER);
+        for (int j = 0; j < nItemsToCreateInList; j++) {
+               createItemInAuthority(knownAuthorityWithItems);
+        }
+    }
+
+    /**
+     * Read by name.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
+    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+               dependsOnMethods = {"CRUDTests"})
+    public void readByName(String testName) throws Exception {
+        // Perform setup.
+        setupRead();
+
+        // Submit the request to the service and store the response.
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        ClientResponse<String> res = client.readByName(getKnowResourceIdentifier());
+        int statusCode = res.getStatus();
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if (logger.isDebugEnabled()) {
+            logger.debug(testName + ": status = " + statusCode);
+        }
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, testExpectedStatusCode);
+        
+        AUTHORITY_COMMON_TYPE commonPart = extractCommonPartValue(res);
+        Assert.assertNotNull(commonPart);
+    }
+    
+    /**
+     * Extracts the common part item from a service's item payload.
+     * 
+     * @param res
+     * @return
+     * @throws Exception
+     */
+       public AUTHORITY_ITEM_TYPE extractItemCommonPartValue(ClientResponse<String> res) throws Exception {
+               AUTHORITY_ITEM_TYPE result = null;
+               
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+               PayloadInputPart payloadInputPart = extractPart(res, client.getItemCommonPartName());
+               if (payloadInputPart != null) {
+                       result = (AUTHORITY_ITEM_TYPE) payloadInputPart.getBody();
+               }
+               Assert.assertNotNull(result,
+                               "Part or body of part " + client.getCommonPartName() + " was unexpectedly null.");
+               
+               return result;
+       }
+    
+    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+               dependsOnMethods = {"readItem"})
+    public void readItemNonExistent(String testName) {
+        // Perform setup.
+        setupReadNonExistent();
+
+        // Submit the request to the service and store the response.
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        ClientResponse<String> res = client.readItem(knownResourceId, NON_EXISTENT_ID);
+        int statusCode = res.getStatus();
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if (logger.isDebugEnabled()) {
+            logger.debug(testName + ": status = " + statusCode);
+        }
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, testExpectedStatusCode);
+    }
+       
+    @Test(dataProvider = "testName",
+               dependsOnMethods = {"createItem"})
+    public void readItem(String testName) throws Exception {
+        // Perform setup.
+        setupRead();
+
+        // Submit the request to the service and store the response.
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);
+        int statusCode = res.getStatus();
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if (logger.isDebugEnabled()) {
+            logger.debug(testName + ": status = " + statusCode);
+        }
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, testExpectedStatusCode);
+
+        AUTHORITY_ITEM_TYPE itemCommonPart = extractItemCommonPartValue(res);
+        Assert.assertNotNull(itemCommonPart);
+        Assert.assertEquals(client.getInAuthority(itemCommonPart), knownResourceId);
+        verifyReadItemInstance(itemCommonPart);
+    }
+    
+    protected abstract void verifyReadItemInstance(AUTHORITY_ITEM_TYPE item) throws Exception;
+        
+    @Test(dataProvider = "testName",
+               dependsOnMethods = {"testItemSubmitRequest", "updateItem", "verifyIgnoredUpdateWithInAuthority"})    
+    public void deleteItem(String testName) throws Exception {
+        // Perform setup.
+        setupDelete();
+
+        // Submit the request to the service and store the response.
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        ClientResponse<Response> res = client.deleteItem(knownResourceId, knownItemResourceId);
+        int statusCode = res.getStatus();
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if (logger.isDebugEnabled()) {
+            logger.debug("delete: status = " + statusCode);
+        }
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, testExpectedStatusCode);
+    }
+    
+    protected void readItemListInt(String vcsid, String shortId, String testName) {
+        // Perform setup.
+        setupReadList();
+
+        // Submit the request to the service and store the response.
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        ClientResponse<AbstractCommonList> res = null;
+        if (vcsid != null) {
+            res = client.readItemList(vcsid, null, null);
+        } else if (shortId != null) {
+            res = client.readItemListForNamedAuthority(shortId, null, null);
+        } else {
+            Assert.fail("Internal Error: readItemList both vcsid and shortId are null!");
+        }
+        int statusCode = res.getStatus();
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if (logger.isDebugEnabled()) {
+            logger.debug("  " + testName + ": status = " + statusCode);
+        }
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, testExpectedStatusCode);
+
+        AbstractCommonList list = res.getEntity();
+        List<AbstractCommonList.ListItem> items = list.getListItem();
+        int nItemsReturned = items.size();
+        long nItemsTotal = list.getTotalItems();
+        if (logger.isDebugEnabled()) {
+            logger.debug("  " + testName + ": Expected "
+                    + nItemsToCreateInList + " items; got: " + nItemsReturned + " of: " + nItemsTotal);
+        }
+        Assert.assertEquals(nItemsTotal, nItemsToCreateInList);
+
+        if(logger.isTraceEnabled()){
+               AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
+        }
+    }
+    
+    @Test(dataProvider = "testName",
+               dependsOnMethods = {"createItemList"})
+    public void readItemList(String testName) {
+        readItemListInt(knownAuthorityWithItems, null, testName);
+    }
+
+    @Test(dataProvider = "testName",
+               dependsOnMethods = {"readItem"})
+    public void readItemListByName(String testName) {
+        readItemListInt(null, READITEMS_SHORT_IDENTIFIER, testName);
+    }
+
+    @Test(dataProvider = "testName",
+               dependsOnMethods = {"deleteItem"})
+    public void deleteNonExistentItem(String testName) {
+        // Perform setup.
+        setupDeleteNonExistent();
+
+        // Submit the request to the service and store the response.
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        ClientResponse<Response> res = client.deleteItem(knownResourceId, NON_EXISTENT_ID);
+        int statusCode = res.getStatus();
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if (logger.isDebugEnabled()) {
+            logger.debug(testName + ": status = " + statusCode);
+        }
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, testExpectedStatusCode);
+    }
+    
+    protected String getServicePathItemsComponent() {
+        return AuthorityClient.ITEMS;
+    }
+    
+       public PoxPayloadOut createItemRequestTypeInstance(AUTHORITY_ITEM_TYPE itemTypeInstance) {
+               PoxPayloadOut result = null;
+               
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        PoxPayloadOut payloadOut = new PoxPayloadOut(this.getServicePathItemsComponent());
+        PayloadOutputPart part = payloadOut.addPart(client.getItemCommonPartName(), itemTypeInstance);
+        result = payloadOut;
+               
+               return result;
+       }
+
+       /**
+        * Update an Authority item.
+        * 
+        * @param testName
+        * @throws Exception
+        */
+    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+               dependsOnMethods = {"readItem", "CRUDTests", "verifyIgnoredUpdateWithInAuthority"})
+    public void updateItem(String testName) throws Exception {
+        // Perform setup.
+        setupUpdate();
+        AUTHORITY_ITEM_TYPE theUpdate = null;
+
+        // Retrieve the contents of a resource to update.
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =
+                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        ClientResponse<String> res =
+                client.readItem(knownResourceId, knownItemResourceId);
+        try {
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": read status = " + res.getStatus());
+               }
+               Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
+       
+               if (logger.isDebugEnabled()) {
+                   logger.debug("got Authority item to update with ID: "
+                           + knownItemResourceId
+                           + " in authority: " + knownResourceId);
+               }
+               AUTHORITY_ITEM_TYPE authorityItem = extractItemCommonPartValue(res);
+               Assert.assertNotNull(authorityItem);
+
+               // Update the contents of this resource.
+               theUpdate = updateItemInstance(authorityItem);
+               if (logger.isDebugEnabled()) {
+                   logger.debug("\n\nTo be updated fields: CSID = "  + knownItemResourceId + "\n"
+                               + objectAsXmlString(theUpdate));
+               }
+        } finally {
+               res.releaseConnection();
+        }
+
+        // Submit the updated resource to the service and store the response.
+        PoxPayloadOut output = this.createItemRequestTypeInstance(theUpdate);
+        res = client.updateItem(knownResourceId, knownItemResourceId, output);
+        try {
+               int statusCode = res.getStatus();
+       
+               // Check the status code of the response: does it match the expected response(s)?
+               if (logger.isDebugEnabled()) {
+                   logger.debug("updateItem: status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               // Retrieve the updated resource and verify that its contents exist.
+               AUTHORITY_ITEM_TYPE updatedVocabularyItem = extractItemCommonPartValue(res);
+               Assert.assertNotNull(updatedVocabularyItem);
+
+               compareUpdatedItemInstances(theUpdate, updatedVocabularyItem);
+        } finally {
+               res.releaseConnection();
+        }
+    }
+    
+    protected abstract PoxPayloadOut createNonExistenceItemInstance(String commonPartName, String identifier);
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#updateNonExistent(java.lang.String)
+     */
+    @Test(dataProvider = "testName",
+       dependsOnMethods = {"create", "update", "updateNonExistent"})
+    public void updateNonExistentItem(String testName) throws Exception {
+       // Perform setup.
+       setupUpdateNonExistent();
+
+       // Submit the request to the service and store the response.
+       // Note: The ID used in this 'create' call may be arbitrary.
+       // The only relevant ID may be the one used in update(), below.
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =
+                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+       PoxPayloadOut multipart = createNonExistenceItemInstance(client.getItemCommonPartName(), NON_EXISTENT_ID);
+       ClientResponse<String> res =
+                       client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
+       try {
+               int statusCode = res.getStatus();
+       
+               // Check the status code of the response: does it match
+               // the expected response(s)?
+               if (logger.isDebugEnabled()) {
+                       logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                               invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       } finally {
+               res.releaseConnection();
+       }
+    }
+        
+    //
+    // Methods to persuade TestNG to follow the correct test dependency path
+    //
+    
+    @Test(dataProvider = "testName",
+               dependsOnMethods = {"createItem"})
+    public void baseAuthorityTests(String testName) {
+       // Do nothing.  Here just to setup a test dependency chain.
+    }
+    
+    /*
+     * For convenience and terseness, this test method is the base of the test execution dependency chain.  Other test methods may
+     * refer to this method in their @Test annotation declarations.
+     */
+    @Override
+    @Test(dataProvider = "testName",
+               dependsOnMethods = {
+                       "org.collectionspace.services.client.test.AbstractServiceTestImpl.baseCRUDTests"})    
+       public void CRUDTests(String testName) {
+               // TODO Auto-generated method stub
+       }
+    
+}
index 54d1e7136e18661b0641e407f09b2db348d06272..5d228ee662798e283cd18c41e434fbd972ecdbc9 100644 (file)
@@ -1,80 +1,80 @@
-package org.collectionspace.services.client.test;\r
-\r
-import org.collectionspace.services.client.CollectionSpaceClient;\r
-import org.collectionspace.services.client.PayloadInputPart;\r
-import org.collectionspace.services.client.PayloadOutputPart;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.client.AbstractCommonListUtils;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.testng.Assert;\r
-\r
-/*\r
- * <CLT> - Common list type\r
- * <CPT> - Common part type\r
- */\r
-public abstract class AbstractPoxServiceTestImpl<CLT extends AbstractCommonList, CPT>\r
-               extends AbstractServiceTestImpl<CLT, CPT, PoxPayloadOut, String> {\r
-               \r
-       @Override\r
-       public CPT extractCommonPartValue(ClientResponse<String> res) throws Exception {\r
-               CPT result = null;\r
-               \r
-               CollectionSpaceClient client = getClientInstance();\r
-               PayloadInputPart payloadInputPart = extractPart(res, client.getCommonPartName());\r
-               if (payloadInputPart != null) {\r
-                       result = (CPT) payloadInputPart.getBody();\r
-               }\r
-               Assert.assertNotNull(result,\r
-                               "Part or body of part " + client.getCommonPartName() + " was unexpectedly null.");\r
-               \r
-               return result;\r
-       }\r
-       \r
-    protected void printList(String testName, CLT list) {\r
-        if (getLogger().isTraceEnabled()){\r
-               AbstractCommonListUtils.ListItemsInAbstractCommonList(list, getLogger(), testName);\r
-        }\r
-    }\r
-       \r
-       @Override\r
-    public CPT extractCommonPartValue(PoxPayloadOut payloadOut) throws Exception {\r
-       CPT result = null;\r
-       \r
-       CollectionSpaceClient client = getClientInstance();\r
-       PayloadOutputPart payloadOutputPart = payloadOut.getPart(client.getCommonPartName());\r
-       if (payloadOutputPart != null) {\r
-               result = (CPT) payloadOutputPart.getBody();\r
-       }\r
-        Assert.assertNotNull(result,\r
-                "Part or body of part " + client.getCommonPartName() + " was unexpectedly null.");\r
-        \r
-       return result;\r
-    }  \r
-       \r
-       @Override\r
-       public PoxPayloadOut createRequestTypeInstance(CPT commonPartTypeInstance) {\r
-               PoxPayloadOut result = null;\r
-               \r
-               CollectionSpaceClient client = this.getClientInstance();\r
-        PoxPayloadOut payloadOut = new PoxPayloadOut(this.getServicePathComponent());\r
-        PayloadOutputPart part = payloadOut.addPart(client.getCommonPartName(), commonPartTypeInstance);\r
-        result = payloadOut;\r
-               \r
-               return result;\r
-       }\r
-    \r
-    protected PayloadInputPart extractPart(ClientResponse<String> res, String partLabel)\r
-            throws Exception {\r
-            if (getLogger().isDebugEnabled()) {\r
-               getLogger().debug("Reading part " + partLabel + " ...");\r
-            }\r
-            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());\r
-            PayloadInputPart payloadInputPart = input.getPart(partLabel);\r
-            Assert.assertNotNull(payloadInputPart,\r
-                    "Part " + partLabel + " was unexpectedly null.");\r
-            return payloadInputPart;\r
-    }\r
-}\r
+package org.collectionspace.services.client.test;
+
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.PayloadInputPart;
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.client.AbstractCommonListUtils;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+import org.jboss.resteasy.client.ClientResponse;
+import org.testng.Assert;
+
+/*
+ * <CLT> - Common list type
+ * <CPT> - Common part type
+ */
+public abstract class AbstractPoxServiceTestImpl<CLT extends AbstractCommonList, CPT>
+               extends AbstractServiceTestImpl<CLT, CPT, PoxPayloadOut, String> {
+               
+       @Override
+       public CPT extractCommonPartValue(ClientResponse<String> res) throws Exception {
+               CPT result = null;
+               
+               CollectionSpaceClient client = getClientInstance();
+               PayloadInputPart payloadInputPart = extractPart(res, client.getCommonPartName());
+               if (payloadInputPart != null) {
+                       result = (CPT) payloadInputPart.getBody();
+               }
+               Assert.assertNotNull(result,
+                               "Part or body of part " + client.getCommonPartName() + " was unexpectedly null.");
+               
+               return result;
+       }
+       
+    protected void printList(String testName, CLT list) {
+        if (getLogger().isTraceEnabled()){
+               AbstractCommonListUtils.ListItemsInAbstractCommonList(list, getLogger(), testName);
+        }
+    }
+       
+       @Override
+    public CPT extractCommonPartValue(PoxPayloadOut payloadOut) throws Exception {
+       CPT result = null;
+       
+       CollectionSpaceClient client = getClientInstance();
+       PayloadOutputPart payloadOutputPart = payloadOut.getPart(client.getCommonPartName());
+       if (payloadOutputPart != null) {
+               result = (CPT) payloadOutputPart.getBody();
+       }
+        Assert.assertNotNull(result,
+                "Part or body of part " + client.getCommonPartName() + " was unexpectedly null.");
+        
+       return result;
+    }  
+       
+       @Override
+       public PoxPayloadOut createRequestTypeInstance(CPT commonPartTypeInstance) {
+               PoxPayloadOut result = null;
+               
+               CollectionSpaceClient client = this.getClientInstance();
+        PoxPayloadOut payloadOut = new PoxPayloadOut(this.getServicePathComponent());
+        PayloadOutputPart part = payloadOut.addPart(client.getCommonPartName(), commonPartTypeInstance);
+        result = payloadOut;
+               
+               return result;
+       }
+    
+    protected PayloadInputPart extractPart(ClientResponse<String> res, String partLabel)
+            throws Exception {
+            if (getLogger().isDebugEnabled()) {
+               getLogger().debug("Reading part " + partLabel + " ...");
+            }
+            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+            PayloadInputPart payloadInputPart = input.getPart(partLabel);
+            Assert.assertNotNull(payloadInputPart,
+                    "Part " + partLabel + " was unexpectedly null.");
+            return payloadInputPart;
+    }
+}
index 03e4267f46f1352c23dc13dca22a648dcfc7d4dd..383bdcd4651096e8d4860d9e23aa547a2dab514b 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- *\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.collectionspace.services.client.test;\r
-\r
-import java.io.ByteArrayInputStream;\r
-import java.io.File;\r
-import java.io.StringWriter;\r
-import java.lang.reflect.Method;\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Random;\r
-\r
-import javax.activation.MimetypesFileTypeMap;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-import javax.xml.bind.JAXBContext;\r
-import javax.xml.bind.JAXBException;\r
-import javax.xml.bind.Marshaller;\r
-import javax.xml.bind.Unmarshaller;\r
-import javax.xml.parsers.DocumentBuilderFactory;\r
-\r
-import org.apache.commons.httpclient.HttpMethodBase;\r
-import org.apache.commons.httpclient.methods.EntityEnclosingMethod;\r
-import org.apache.commons.httpclient.methods.DeleteMethod;\r
-import org.apache.commons.httpclient.methods.GetMethod;\r
-import org.apache.commons.httpclient.methods.PostMethod;\r
-import org.apache.commons.httpclient.methods.PutMethod;\r
-import org.apache.commons.httpclient.methods.StringRequestEntity;\r
-import org.apache.commons.io.FileUtils;\r
-\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.testng.Assert;\r
-import org.testng.annotations.AfterClass;\r
-import org.testng.annotations.BeforeMethod;\r
-import org.testng.annotations.DataProvider;\r
-import org.w3c.dom.Document;\r
-\r
-import org.collectionspace.services.client.AuthorityClient;\r
-import org.collectionspace.services.client.CollectionSpaceClient;\r
-import org.collectionspace.services.client.PayloadInputPart;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.TestServiceClient;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.collectionspace.services.common.api.FileTools;\r
-\r
-/**\r
- * BaseServiceTest.\r
- *\r
- * Base abstract class on which client tests of services are based.\r
- *\r
- * $LastChangedRevision$\r
- * $LastChangedDate$\r
- */\r
-\r
-// FIXME: http://issues.collectionspace.org/browse/CSPACE-1685\r
-\r
-/*\r
- * <CLT> - Common list type\r
- */\r
-public abstract class BaseServiceTest<CLT> {\r
-       //A default MIME type result\r
-    static protected final String DEFAULT_MIME = "application/octet-stream; charset=ISO-8859-1";\r
-    //Maven's base directory -i.e., the one containing the current pom.xml\r
-    protected static final String MAVEN_BASEDIR_PROPERTY = "maven.basedir";\r
-    /** The Constant logger. */\r
-    private static final Logger logger = LoggerFactory.getLogger(BaseServiceTest.class);\r
-    /** The Constant serviceClient. */\r
-    protected static final TestServiceClient serviceClient = new TestServiceClient();\r
-    \r
-    protected String knownResourceIdentifier = null;\r
-    /** Use this to keep track of a single known resource */\r
-    protected String knownResourceId = null;\r
-    /* Use this to keep track of resources to delete */\r
-    protected List<String> allResourceIdsCreated = new ArrayList<String>();\r
-    /* Use this to track authority items */\r
-    protected Map<String, String> allResourceItemIdsCreated = new HashMap<String, String>(); /* itemCsid, parentCsid */\r
-    /* A runtime/command-line parameter to indicate if we should delete all the test related resource objects */\r
-    static private final String NO_TEST_CLEANUP = "noTestCleanup";\r
-    /* A random number generator */\r
-    static private final Random random = new Random(System.currentTimeMillis());\r
-    \r
-    \r
-    /** The non-existent id. */\r
-    protected final String NON_EXISTENT_ID = createNonExistentIdentifier();\r
-    /** The expected status code. */\r
-    protected int testExpectedStatusCode = 0;\r
-    /** The request type type. */\r
-    protected ServiceRequestType testRequestType = ServiceRequestType.NON_EXISTENT;\r
-    \r
-    /** The Constant XML_DECLARATION. */\r
-    protected static final String XML_DECLARATION = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";\r
-    /** The Constant MALFORMED_XML_DATA. */\r
-    protected static final String MALFORMED_XML_DATA = XML_DECLARATION\r
-            + "<malformed_xml>wrong schema contents</malformed_xml";\r
-    /** The wrong XML schema data. */\r
-    protected static final String WRONG_XML_SCHEMA_DATA = XML_DECLARATION\r
-            + "<wrong_schema>wrong schema contents</wrong_schema>";\r
-    /** The null charset. */\r
-    private static final String NULL_CHARSET = null;\r
-    \r
-    /** A visual separator for our test banners */\r
-    private static final String BANNER_SEPARATOR_LINE = "===================================================";\r
-    private static final String BANNER_PREFIX = "\n" + BANNER_SEPARATOR_LINE + "\n";\r
-    private static final String BANNER_SUFFIX = "\n" + BANNER_SEPARATOR_LINE;    \r
-\r
-    // A Unicode UTF-8 data fragment for use in test payloads: a random sequence,\r
-    // unlikely to be encountered in actual collections data, and capable of\r
-    // being rendered by the default fonts in many modern operating systems.\r
-    //\r
-    // This fragment consists of a run of USASCII characters, followed by\r
-    // four non-USASCII range Unicode UTF-8 characters:\r
-    //\r
-    // Δ : Greek capital letter Delta (U+0394)\r
-    // Ж : Cyrillic capital letter Zhe with breve (U+04C1)\r
-    // Ŵ : Latin capital letter W with circumflex (U+0174)\r
-    // Ω : Greek capital letter Omega (U+03A9)\r
-    private final static String UTF8_DATA_FRAGMENT = "utf-8-data-fragment:"\r
-            + '\u0394' + '\u04C1' + '\u0174' +'\u03A9';\r
-    //\r
-    // Status constants\r
-    //\r
-    protected static final int STATUS_BAD_REQUEST =\r
-        Response.Status.BAD_REQUEST.getStatusCode();\r
-    protected static final int STATUS_CREATED =\r
-        Response.Status.CREATED.getStatusCode();\r
-    protected static final int STATUS_INTERNAL_SERVER_ERROR =\r
-        Response.Status.INTERNAL_SERVER_ERROR.getStatusCode();\r
-    protected static final int STATUS_NOT_FOUND =\r
-        Response.Status.NOT_FOUND.getStatusCode();\r
-    protected static final int STATUS_OK =\r
-            Response.Status.OK.getStatusCode();\r
-    protected static final int STATUS_FORBIDDEN =\r
-            Response.Status.FORBIDDEN.getStatusCode();\r
-\r
-    /**\r
-     * Instantiates a new base service test.\r
-     */\r
-    public BaseServiceTest() {\r
-        super();\r
-    }\r
-\r
-    /*\r
-     * A getter for retrieving the tests logger\r
-     */\r
-    protected Logger getLogger() {\r
-        return this.logger;\r
-    }\r
-    \r
-    @BeforeMethod\r
-    protected void beforeMethod(Method m) {\r
-        logTestBanner(getLogger(), m.getName());       \r
-    }\r
-        \r
-    /**\r
-     * Gets the client.\r
-     *\r
-     * @return the client\r
-     */\r
-    abstract protected CollectionSpaceClient getClientInstance();\r
-\r
-    /*\r
-     * Subclasses can override this method to return their AbstractCommonList subclass\r
-     */\r
-    protected Class<CLT> getCommonListType() {\r
-       return (Class<CLT>)AbstractCommonList.class;\r
-    }\r
-\r
-    protected CLT getCommonList(\r
-            ClientResponse<CLT> response) {\r
-        return response.getEntity(getCommonListType());\r
-    }\r
-    \r
-    /**\r
-     * Returns the name of the currently running test.\r
-     *\r
-     * Note: although the return type is listed as Object[][],\r
-     * this method instead returns a String.\r
-     *\r
-     * @param   m  The currently running test method.\r
-     *\r
-     */\r
-    @DataProvider(name = "testName")\r
-    public static Object[][] testName(Method m) {\r
-        return new Object[][]{\r
-            new Object[]{m.getName()}\r
-        };\r
-    }\r
-\r
-    /**\r
-     * Returns the URL path component of the service.\r
-     *\r
-     * This component will follow directly after the\r
-     * base path, if any.\r
-     *\r
-     * @return The URL path component of the service.\r
-     */\r
-    protected abstract String getServicePathComponent();\r
-    \r
-    protected abstract String getServiceName();\r
-\r
-    /**\r
-     * Reinitializes setup values, to help expose any unintended reuse\r
-     * of those values between tests.\r
-     */\r
-    protected void clearSetup() {\r
-        testExpectedStatusCode = 0;\r
-        testRequestType = ServiceRequestType.NON_EXISTENT;\r
-    }\r
-\r
-    /**\r
-     * Sets up create tests.\r
-     */\r
-    protected void setupCreate() {\r
-        testExpectedStatusCode = STATUS_CREATED;\r
-        testRequestType = ServiceRequestType.CREATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-    \r
-    /**\r
-     * Initializes setup values for a given test.\r
-     *\r
-     * @param expectedStatusCode  A status code expected to be returned in the response.\r
-     *\r
-     * @param reqType  A type of service request (e.g. CREATE, DELETE).\r
-     */\r
-    protected void testSetup(\r
-            int expectedStatusCode,\r
-            ServiceRequestType reqType) {\r
-        clearSetup();\r
-        testExpectedStatusCode = expectedStatusCode;\r
-        testRequestType = reqType;\r
-    }\r
-\r
-    /**\r
-     * Returns an error message indicating that the status code returned by a\r
-     * specific call to a service does not fall within a set of valid status\r
-     * codes for that service.\r
-     *\r
-     * @param requestType  A type of service request (e.g. CREATE, DELETE).\r
-     *\r
-     * @param statusCode  The invalid status code that was returned in the response,\r
-     *                    from submitting that type of request to the service.\r
-     *\r
-     * @return An error message.\r
-     */\r
-    protected String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {\r
-        return "Status code '" + statusCode\r
-                + "' in response is NOT within the expected set: "\r
-                + requestType.validStatusCodesAsString();\r
-    }\r
-\r
-    /**\r
-     * Returns the root URL for a service.\r
-     *\r
-     * This URL consists of a base URL for all services, followed by\r
-     * a path component (or components) for a service.\r
-     *\r
-     * @return The root URL for a service.\r
-     */\r
-    protected String getServiceRootURL() {\r
-        return serviceClient.getBaseURL() + getServiceName(); //FIXME: REM - This should probably be calling getServicePathComponent() and not getServiceName();\r
-    }\r
-\r
-    public String getServiceClientTenantID() {\r
-        return serviceClient.getProperty("cspace.tenantID");\r
-    }\r
-\r
-    /**\r
-     * Returns the URL of a specific resource managed by a service, and\r
-     * designated by an identifier (such as a universally unique ID, or UUID).\r
-     *\r
-     * @param  resourceIdentifier  An identifier (such as a UUID) for a resource.\r
-     *\r
-     * @return The URL of a specific resource managed by a service.\r
-     */\r
-    protected String getResourceURL(String resourceIdentifier) {\r
-        return getServiceRootURL() + "/" + resourceIdentifier;\r
-    }\r
-\r
-    /**\r
-     * Submits an HTTP request to a specified URL, and returns the\r
-     * status code of the response.  Currently accepts GET and DELETE\r
-     * requests.\r
-     *\r
-     * @param  method  An HTTP method.\r
-     *\r
-     * @param  url     A String representation of a URL.\r
-     *\r
-     * @return The status code received in the HTTP response.\r
-     */\r
-    protected int submitRequest(String method, String url) {\r
-        int statusCode = 0;\r
-        HttpMethodBase httpMethod = null;\r
-        try {\r
-            TestServiceClient client = new TestServiceClient();\r
-            if (method.equals(javax.ws.rs.HttpMethod.DELETE)) {\r
-               httpMethod = new DeleteMethod(url);\r
-            } else if (method.equals(javax.ws.rs.HttpMethod.GET)) {\r
-               httpMethod = new GetMethod(url);\r
-            }\r
-            if (httpMethod != null) {\r
-                statusCode = client.getHttpClient().executeMethod(httpMethod);\r
-            }\r
-        } catch (Exception e) {\r
-            logger.error(\r
-                    "Exception during HTTP " + method + " request to "\r
-                    + url + ":", e);\r
-        } finally {\r
-               if (httpMethod != null) httpMethod.releaseConnection();\r
-        }\r
-        return statusCode;\r
-    }\r
-\r
-    /**\r
-     * Submits an HTTP request to a specified URL, with the submitted\r
-     * entity body, and returns the status code of the response.\r
-     * Currently accepts POST and PUT requests.\r
-     *\r
-     * @param  method  An HTTP method.\r
-     *\r
-     * @param  url     A String representation of a URL.\r
-     *\r
-     * @param  mediaType  The media type of the entity body to be submitted.\r
-     *\r
-     * @param  entityStr     The contents of the entity body to be submitted.\r
-     *\r
-     * @return The status code received in the HTTP response.\r
-     */\r
-    protected int submitRequest(String method, String url, String mediaType, String entityStr) {\r
-        int statusCode = 0;\r
-        EntityEnclosingMethod httpMethod = null;\r
-        try {\r
-            TestServiceClient client = new TestServiceClient();\r
-            if (method.equals(javax.ws.rs.HttpMethod.POST)) {\r
-                httpMethod = new PostMethod(url);\r
-            } else if (method.equals(javax.ws.rs.HttpMethod.PUT)) {\r
-                httpMethod = new PutMethod(url);\r
-            }\r
-            if (httpMethod != null) {\r
-                StringRequestEntity entityBody =\r
-                    new StringRequestEntity(mediaType, entityStr, NULL_CHARSET);\r
-               httpMethod.setRequestEntity(entityBody);\r
-               statusCode = client.getHttpClient().executeMethod(httpMethod);\r
-            }\r
-        } catch (Exception e) {\r
-            logger.error(\r
-                    "Exception during HTTP " + method + " request to "\r
-                    + url + ":", e);\r
-        } finally {\r
-               if (httpMethod != null) httpMethod.releaseConnection();\r
-        }\r
-        return statusCode;\r
-    }\r
-\r
-    // FIXME: Move some or all of the methods below to a common client and\r
-    // server utilities package, when this package becomes available.\r
-\r
-    /**\r
-     * Extract id.\r
-     *\r
-     * @param res the res\r
-     * @return the string\r
-     */\r
-    static protected String extractId(ClientResponse<Response> res) {\r
-        MultivaluedMap<String, Object> mvm = res.getMetadata();\r
-        String uri = (String) ((List<Object>) mvm.get("Location")).get(0);\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("extractId:uri=" + uri);\r
-        }\r
-        String[] segments = uri.split("/");\r
-        String id = segments[segments.length - 1];\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("id=" + id);\r
-        }\r
-        return id;\r
-    }\r
\r
-    /**\r
-     * Tests can override this method to customize their identifiers.\r
-     */\r
-    protected String createIdentifier() {\r
-        long identifier = System.currentTimeMillis() + random.nextInt();\r
-        return Long.toString(identifier);\r
-    }\r
-    \r
-    /**\r
-     * Tests can override this method to customize their identifiers.\r
-     */\r
-    protected String getKnowResourceIdentifier() {\r
-       if (knownResourceIdentifier == null) {\r
-               knownResourceIdentifier = createIdentifier();\r
-       }\r
-       return knownResourceIdentifier;\r
-    }\r
-    \r
-    /**\r
-     * Tests can override this method if they have a different knownResourceId\r
-     * @return\r
-     */\r
-    protected String getKnowResourceId() {\r
-       return this.knownResourceId;\r
-    }\r
-\r
-    /**\r
-     * Creates the non existent identifier.\r
-     *\r
-     * @return the string\r
-     */\r
-    protected String createNonExistentIdentifier() {\r
-        return Long.toString(Long.MAX_VALUE);\r
-    }\r
-\r
-    /**\r
-     * Extract part.\r
-     *\r
-     * @param input the input\r
-     * @param label the label\r
-     * @param clazz the clazz\r
-     * @return the object\r
-     * @throws Exception the exception\r
-     */\r
-    static protected Object extractPart(PoxPayloadIn input, String label, Class<?> clazz)\r
-            throws Exception {\r
-       Object result = null;\r
-       PayloadInputPart payloadInputPart = input.getPart(label);\r
-        if (payloadInputPart != null) {\r
-               result = payloadInputPart.getBody();\r
-        } else if (logger.isWarnEnabled() == true) {\r
-               logger.warn("Payload part: " + label +\r
-                               " is missing from payload: " + input.getName());\r
-        }\r
-        return result;\r
-            }\r
-\r
-    /**\r
-     * Gets the part object.\r
-     *\r
-     * @param partStr the part str\r
-     * @param clazz the clazz\r
-     * @return the part object\r
-     * @throws JAXBException the jAXB exception\r
-     */\r
-    @Deprecated\r
-    static protected Object getPartObject(String partStr, Class<?> clazz)\r
-            throws JAXBException {\r
-        JAXBContext jc = JAXBContext.newInstance(clazz);\r
-        ByteArrayInputStream bais = null;\r
-        Object obj = null;\r
-        try {\r
-            bais = new ByteArrayInputStream(partStr.getBytes());\r
-            Unmarshaller um = jc.createUnmarshaller();\r
-            obj = um.unmarshal(bais);\r
-        } finally {\r
-            if (bais != null) {\r
-                try {\r
-                    bais.close();\r
-                } catch (Exception e) {\r
-                       if (logger.isDebugEnabled()) {\r
-                               e.printStackTrace();\r
-                       }\r
-                }\r
-            }\r
-        }\r
-        return obj;\r
-    }\r
-\r
-    /**\r
-     * Object as xml string.\r
-     *\r
-     * @param o the o\r
-     * @param clazz the clazz\r
-     * @return the string\r
-     */\r
-    static protected String objectAsXmlString(Object o, Class<?> clazz) {\r
-        StringWriter sw = new StringWriter();\r
-        try {\r
-            JAXBContext jc = JAXBContext.newInstance(clazz);\r
-            Marshaller m = jc.createMarshaller();\r
-            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,\r
-                    Boolean.TRUE);\r
-            m.marshal(o, sw);\r
-        } catch (Exception e) {\r
-            e.printStackTrace();\r
-        }\r
-        return sw.toString();\r
-    }\r
-    \r
-    static protected String objectAsXmlString(Object o) {\r
-        StringWriter sw = new StringWriter();\r
-        try {\r
-            JAXBContext jc = JAXBContext.newInstance(o.getClass());\r
-            Marshaller m = jc.createMarshaller();\r
-            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,\r
-                    Boolean.TRUE);\r
-            m.marshal(o, sw);\r
-        } catch (Exception e) {\r
-            e.printStackTrace();\r
-        }\r
-        return sw.toString();\r
-    }    \r
-\r
-    /**\r
-     * getObjectFromFile get object of given class from given file (in classpath)\r
-     * @param jaxbClass\r
-     * @param fileName of the file to read to construct the object\r
-     * @return\r
-     * @throws Exception\r
-     */\r
-    static protected Object getObjectFromFile(Class<?> jaxbClass, String fileName)\r
-            throws Exception {\r
-       Object result = null;\r
-       \r
-       result = FileTools.getJaxbObjectFromFile(jaxbClass, fileName);\r
-       \r
-        return result;\r
-    }\r
-\r
-    /**\r
-     * Gets the xml document.\r
-     *\r
-     * @param fileName the file name\r
-     * @return the xml document\r
-     * @throws Exception the exception\r
-     */\r
-    static protected Document getXmlDocument(String fileName) throws Exception {\r
-        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r
-        File f = new File(fileName);\r
-        if (!f.exists()) {\r
-            throw new IllegalArgumentException("test data file " + fileName + " not found!");\r
-        }\r
-        // Create the builder and parse the file\r
-        return factory.newDocumentBuilder().parse(f);\r
-    }\r
-\r
-    /**\r
-     * Gets the xml document as string.\r
-     *\r
-     * @param fileName the file name\r
-     * @return the xml document as string\r
-     * @throws Exception the exception\r
-     */\r
-    static protected String getXmlDocumentAsString(String fileName) throws Exception {\r
-        String result = FileUtils.readFileToString(new File(fileName), "UTF8");\r
-        return result;\r
-    }\r
-\r
-    /**\r
-     * Map as string.\r
-     *\r
-     * @param map the map\r
-     * @return the string\r
-     */\r
-    protected String mapAsString(MultivaluedMap<String, Object> map) {\r
-        StringBuffer sb = new StringBuffer();\r
-        for (Object entry : map.entrySet()) {\r
-            MultivaluedMap.Entry<String, Object> mentry = (MultivaluedMap.Entry<String, Object>) entry;\r
-            sb.append("    name=" + mentry.getKey());\r
-            sb.append(" value=" + mentry.getValue() + "\n");\r
-        }\r
-        return sb.toString();\r
-    }\r
-\r
-    /**\r
-     * Returns a 'banner', consisting of a text label inside a pair of prefix\r
-     * and suffix strings.\r
-     *\r
-     * @param label The label to be output inside the banner.\r
-     *\r
-     * @return The banner.\r
-     */\r
-    protected static String getBannerStr(String label) {\r
-        StringBuffer sb = new StringBuffer();\r
-        sb.append(BANNER_PREFIX);\r
-        sb.append(label);\r
-        sb.append(BANNER_SUFFIX);\r
-        return sb.toString();\r
-    }\r
-    \r
-    /**\r
-     * Returns a test-specific banner.\r
-     *\r
-     * @param testName The name of a test method.\r
-     *\r
-     * @return A test-specific banner.\r
-     */\r
-    private static String getNameBanner(String testName) {\r
-        testName = (testName == null || testName.trim().isEmpty()) ?\r
-            " Test = no test name specified" : " Test = " + testName;\r
-        return testName;\r
-    }\r
-\r
-    /**\r
-     * Returns a test-specific banner.\r
-     *\r
-     * @param testName The name of a test method.\r
-     *\r
-     * @param testClass The name of a test class.\r
-     *\r
-     * @return A test-specific banner.\r
-     */\r
-    private static String getBanner(String testName, String testClass) {\r
-       testName = getNameBanner(testName);\r
-        testClass = (testClass == null || testClass.trim().isEmpty()) ?\r
-            "Class = no test class specified" : "Class = " + classNameFromPackageName(testClass);\r
-        String testLabel = testClass + "\n" + testName;\r
-        return getBannerStr(testLabel);\r
-    }\r
-    \r
-    protected static String getTestBanner(String testName, String testClassName) {\r
-        return getBanner(testName, testClassName);\r
-    }\r
-    \r
-    protected String getTestBanner(String testName) {\r
-       return getTestBanner(testName, this.getClass().getCanonicalName());\r
-    }\r
-        \r
-    protected void logTestBanner(Logger logger, String testName) {\r
-       if (logger.isDebugEnabled() == true) {\r
-               logger.debug(getTestBanner(testName));\r
-       }\r
-    }\r
-\r
-    protected static String classNameFromPackageName(String className) {\r
-        if (className == null || className.trim().isEmpty()) {\r
-            return className;\r
-        }\r
-        final char PKG_SEPARATOR = '.';\r
-        int pos = className.lastIndexOf(PKG_SEPARATOR) + 1;\r
-        if (pos > 0) {\r
-            className = className.substring(pos);\r
-        }\r
-        return className;\r
-    }\r
-\r
-    public int assertStatusCode(ClientResponse<?> res, String testName) {\r
-        int statusCode = res.getStatus();\r
-        \r
-        // Check the status code of the response: does it match the expected response(s)?\r
-        logger.debug(testName + ": status = " + statusCode);\r
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                       invalidStatusCodeMessage(testRequestType, statusCode));\r
-        Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-        \r
-        return statusCode;\r
-    }\r
-\r
-    public static String getUTF8DataFragment() {\r
-        return UTF8_DATA_FRAGMENT;\r
-    }\r
-\r
-    protected String getMimeType(File theFile) {\r
-        String result = null;\r
-        result = new MimetypesFileTypeMap().getContentType(theFile);\r
-        if (result == null) {\r
-            logger.debug("Could not get MIME type for file at: " + theFile.getAbsolutePath());\r
-            result = DEFAULT_MIME;\r
-        }\r
-\r
-        return result;\r
-    }\r
-\r
-    /*\r
-     * Test classes for authority services should override these method and return 'true'\r
-     */\r
-    protected boolean isAuthorityClient(CollectionSpaceClient theClient) {\r
-        return AuthorityClient.class.isInstance(theClient);\r
-    }\r
-       \r
-    /**\r
-     * Deletes all resources created by tests, after all tests have been run.\r
-     *\r
-     * This cleanup method will always be run, even if one or more tests fail.\r
-     * For this reason, it attempts to remove all resources created\r
-     * at any point during testing, even if some of those resources\r
-     * may be expected to be deleted by certain tests.\r
-     */\r
-    @AfterClass(alwaysRun = true)\r
-    public void cleanUp() {\r
-        String noTestCleanup = System.getProperty(NO_TEST_CLEANUP);\r
-        if (Boolean.TRUE.toString().equalsIgnoreCase(noTestCleanup)) {\r
-            if (logger.isDebugEnabled()) {\r
-                logger.debug("Skipping Cleanup phase ...");\r
-            }\r
-            return;\r
-        }\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("Cleaning up temporary resources created for testing ...");\r
-        }\r
-        CollectionSpaceClient client = this.getClientInstance();\r
-        //\r
-        // First, check to see if we need to cleanup any authority items\r
-        //\r
-        if (this.isAuthorityClient(client) == true) {\r
-            AuthorityClient authorityClient = (AuthorityClient) client;\r
-            for (Map.Entry<String, String> entry : allResourceItemIdsCreated.entrySet()) {\r
-                String itemResourceId = entry.getKey();\r
-                String authorityResourceId = entry.getValue();\r
-                // Note: Any non-success responses are ignored and not reported.\r
-                authorityClient.deleteItem(authorityResourceId, itemResourceId).releaseConnection();\r
-            }\r
-        }\r
-        //\r
-        // Next, delete all other entities include possible authorities.\r
-        //\r
-        for (String resourceId : allResourceIdsCreated) {\r
-            // Note: Any non-success responses are ignored and not reported.\r
-            client.delete(resourceId).releaseConnection();\r
-        }\r
-    }\r
-       \r
-       //\r
-       // Status code setup methods for tests\r
-       //\r
-       \r
-    /**\r
-     * Sets up create tests with malformed xml.\r
-     */\r
-    protected void setupCreateWithMalformedXml() {\r
-        testExpectedStatusCode = STATUS_BAD_REQUEST;\r
-        testRequestType = ServiceRequestType.CREATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-\r
-    /**\r
-     * Sets up create tests with wrong xml schema.\r
-     */\r
-    protected void setupCreateWithWrongXmlSchema() {\r
-        testExpectedStatusCode = STATUS_BAD_REQUEST;\r
-        testRequestType = ServiceRequestType.CREATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-    \r
-    /**\r
-     * Sets up read tests.\r
-     */\r
-    protected void setupRead() {\r
-        testExpectedStatusCode = STATUS_OK;\r
-        testRequestType = ServiceRequestType.READ;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-\r
-    /**\r
-     * Sets up read tests.\r
-     */\r
-    protected void setupForbidden() {\r
-        testExpectedStatusCode = STATUS_FORBIDDEN;\r
-        testRequestType = ServiceRequestType.READ;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-\r
-    /**\r
-     * Sets up read non existent tests.\r
-     */\r
-    protected void setupReadNonExistent() {\r
-        testExpectedStatusCode = STATUS_NOT_FOUND;\r
-        testRequestType = ServiceRequestType.READ;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-\r
-    /**\r
-     * Sets up read list tests.\r
-     */\r
-    protected void setupReadList() {\r
-        testExpectedStatusCode = STATUS_OK;\r
-        testRequestType = ServiceRequestType.READ_LIST;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-\r
-    /**\r
-     * Sets up update tests.\r
-     */\r
-    protected void setupUpdate() {\r
-        testExpectedStatusCode = STATUS_OK;\r
-        testRequestType = ServiceRequestType.UPDATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-       \r
-    /**\r
-     * Sets up update tests with an empty entity body.\r
-     */\r
-    protected void setupUpdateWithEmptyEntityBody() {\r
-        testExpectedStatusCode = STATUS_BAD_REQUEST;\r
-        testRequestType = ServiceRequestType.UPDATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-\r
-    /**\r
-     * Sets up update tests with malformed xml.\r
-     */\r
-    protected void setupUpdateWithMalformedXml() {\r
-        testExpectedStatusCode = STATUS_BAD_REQUEST;\r
-        testRequestType = ServiceRequestType.UPDATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-    \r
-    /**\r
-     * Sets up update tests with wrong xml schema.\r
-     */\r
-    protected void setupUpdateWithWrongXmlSchema() {\r
-        testExpectedStatusCode = STATUS_BAD_REQUEST;\r
-        testRequestType = ServiceRequestType.UPDATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-    \r
-    /**\r
-     * Sets up update non existent tests\r
-     */\r
-    protected void setupUpdateNonExistent() {\r
-        testExpectedStatusCode = STATUS_NOT_FOUND;\r
-        testRequestType = ServiceRequestType.UPDATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-\r
-    /**\r
-     * Sets up delete tests.\r
-     */\r
-    protected void setupDelete() {\r
-        testExpectedStatusCode = STATUS_OK;\r
-        testRequestType = ServiceRequestType.DELETE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-\r
-    // Failure outcomes\r
-\r
-    /**\r
-     * Sets up delete non existent tests.\r
-     */\r
-    protected void setupDeleteNonExistent() {\r
-        testExpectedStatusCode = STATUS_NOT_FOUND;\r
-        testRequestType = ServiceRequestType.DELETE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-    \r
-    /**\r
-     * Sets up create tests with empty entity body.\r
-     */\r
-    protected void setupCreateWithEmptyEntityBody() {\r
-        testExpectedStatusCode = STATUS_BAD_REQUEST;\r
-        testRequestType = ServiceRequestType.CREATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-\r
-    /**\r
-     * Sets up create tests with empty entity body.\r
-     */\r
-    protected void setupCreateWithInvalidBody() {\r
-        testExpectedStatusCode = STATUS_BAD_REQUEST;\r
-        testRequestType = ServiceRequestType.CREATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-    \r
-    /**\r
-     * Sets up create tests with empty entity body.\r
-     */\r
-    protected void setupUpdateWithInvalidBody() {\r
-        testExpectedStatusCode = STATUS_BAD_REQUEST;\r
-        testRequestType = ServiceRequestType.UPDATE;\r
-        testSetup(testExpectedStatusCode, testRequestType);\r
-    }\r
-    \r
-    public void updateWithEmptyEntityBody(String testName) throws Exception {\r
-        //FIXME: Should this test really be empty?  If so, please comment accordingly.\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)\r
-     */\r
-    public void updateWithMalformedXml(String testName) throws Exception {\r
-        //FIXME: Should this test really be empty?  If so, please comment accordingly.\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)\r
-     */\r
-    public void updateWithWrongXmlSchema(String testName) throws Exception {\r
-        //FIXME: Should this test really be empty?  If so, please comment accordingly.\r
-    }\r
-    \r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.collectionspace.services.client.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.StringWriter;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+import javax.activation.MimetypesFileTypeMap;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.methods.EntityEnclosingMethod;
+import org.apache.commons.httpclient.methods.DeleteMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.PutMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.commons.io.FileUtils;
+
+import org.jboss.resteasy.client.ClientResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.w3c.dom.Document;
+
+import org.collectionspace.services.client.AuthorityClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.PayloadInputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.TestServiceClient;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.common.api.FileTools;
+
+/**
+ * BaseServiceTest.
+ *
+ * Base abstract class on which client tests of services are based.
+ *
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ */
+
+// FIXME: http://issues.collectionspace.org/browse/CSPACE-1685
+
+/*
+ * <CLT> - Common list type
+ */
+public abstract class BaseServiceTest<CLT> {
+       //A default MIME type result
+    static protected final String DEFAULT_MIME = "application/octet-stream; charset=ISO-8859-1";
+    //Maven's base directory -i.e., the one containing the current pom.xml
+    protected static final String MAVEN_BASEDIR_PROPERTY = "maven.basedir";
+    /** The Constant logger. */
+    private static final Logger logger = LoggerFactory.getLogger(BaseServiceTest.class);
+    /** The Constant serviceClient. */
+    protected static final TestServiceClient serviceClient = new TestServiceClient();
+    
+    protected String knownResourceIdentifier = null;
+    /** Use this to keep track of a single known resource */
+    protected String knownResourceId = null;
+    /* Use this to keep track of resources to delete */
+    protected List<String> allResourceIdsCreated = new ArrayList<String>();
+    /* Use this to track authority items */
+    protected Map<String, String> allResourceItemIdsCreated = new HashMap<String, String>(); /* itemCsid, parentCsid */
+    /* A runtime/command-line parameter to indicate if we should delete all the test related resource objects */
+    static private final String NO_TEST_CLEANUP = "noTestCleanup";
+    /* A random number generator */
+    static private final Random random = new Random(System.currentTimeMillis());
+    
+    
+    /** The non-existent id. */
+    protected final String NON_EXISTENT_ID = createNonExistentIdentifier();
+    /** The expected status code. */
+    protected int testExpectedStatusCode = 0;
+    /** The request type type. */
+    protected ServiceRequestType testRequestType = ServiceRequestType.NON_EXISTENT;
+    
+    /** The Constant XML_DECLARATION. */
+    protected static final String XML_DECLARATION = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
+    /** The Constant MALFORMED_XML_DATA. */
+    protected static final String MALFORMED_XML_DATA = XML_DECLARATION
+            + "<malformed_xml>wrong schema contents</malformed_xml";
+    /** The wrong XML schema data. */
+    protected static final String WRONG_XML_SCHEMA_DATA = XML_DECLARATION
+            + "<wrong_schema>wrong schema contents</wrong_schema>";
+    /** The null charset. */
+    private static final String NULL_CHARSET = null;
+    
+    /** A visual separator for our test banners */
+    private static final String BANNER_SEPARATOR_LINE = "===================================================";
+    private static final String BANNER_PREFIX = "\n" + BANNER_SEPARATOR_LINE + "\n";
+    private static final String BANNER_SUFFIX = "\n" + BANNER_SEPARATOR_LINE;    
+
+    // A Unicode UTF-8 data fragment for use in test payloads: a random sequence,
+    // unlikely to be encountered in actual collections data, and capable of
+    // being rendered by the default fonts in many modern operating systems.
+    //
+    // This fragment consists of a run of USASCII characters, followed by
+    // four non-USASCII range Unicode UTF-8 characters:
+    //
+    // Δ : Greek capital letter Delta (U+0394)
+    // Ж : Cyrillic capital letter Zhe with breve (U+04C1)
+    // Ŵ : Latin capital letter W with circumflex (U+0174)
+    // Ω : Greek capital letter Omega (U+03A9)
+    private final static String UTF8_DATA_FRAGMENT = "utf-8-data-fragment:"
+            + '\u0394' + '\u04C1' + '\u0174' +'\u03A9';
+    //
+    // Status constants
+    //
+    protected static final int STATUS_BAD_REQUEST =
+        Response.Status.BAD_REQUEST.getStatusCode();
+    protected static final int STATUS_CREATED =
+        Response.Status.CREATED.getStatusCode();
+    protected static final int STATUS_INTERNAL_SERVER_ERROR =
+        Response.Status.INTERNAL_SERVER_ERROR.getStatusCode();
+    protected static final int STATUS_NOT_FOUND =
+        Response.Status.NOT_FOUND.getStatusCode();
+    protected static final int STATUS_OK =
+            Response.Status.OK.getStatusCode();
+    protected static final int STATUS_FORBIDDEN =
+            Response.Status.FORBIDDEN.getStatusCode();
+
+    /**
+     * Instantiates a new base service test.
+     */
+    public BaseServiceTest() {
+        super();
+    }
+
+    /*
+     * A getter for retrieving the tests logger
+     */
+    protected Logger getLogger() {
+        return this.logger;
+    }
+    
+    @BeforeMethod
+    protected void beforeMethod(Method m) {
+        logTestBanner(getLogger(), m.getName());       
+    }
+        
+    /**
+     * Gets the client.
+     *
+     * @return the client
+     */
+    abstract protected CollectionSpaceClient getClientInstance();
+
+    /*
+     * Subclasses can override this method to return their AbstractCommonList subclass
+     */
+    protected Class<CLT> getCommonListType() {
+       return (Class<CLT>)AbstractCommonList.class;
+    }
+
+    protected CLT getCommonList(
+            ClientResponse<CLT> response) {
+        return response.getEntity(getCommonListType());
+    }
+    
+    /**
+     * Returns the name of the currently running test.
+     *
+     * Note: although the return type is listed as Object[][],
+     * this method instead returns a String.
+     *
+     * @param   m  The currently running test method.
+     *
+     */
+    @DataProvider(name = "testName")
+    public static Object[][] testName(Method m) {
+        return new Object[][]{
+            new Object[]{m.getName()}
+        };
+    }
+
+    /**
+     * Returns the URL path component of the service.
+     *
+     * This component will follow directly after the
+     * base path, if any.
+     *
+     * @return The URL path component of the service.
+     */
+    protected abstract String getServicePathComponent();
+    
+    protected abstract String getServiceName();
+
+    /**
+     * Reinitializes setup values, to help expose any unintended reuse
+     * of those values between tests.
+     */
+    protected void clearSetup() {
+        testExpectedStatusCode = 0;
+        testRequestType = ServiceRequestType.NON_EXISTENT;
+    }
+
+    /**
+     * Sets up create tests.
+     */
+    protected void setupCreate() {
+        testExpectedStatusCode = STATUS_CREATED;
+        testRequestType = ServiceRequestType.CREATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+    
+    /**
+     * Initializes setup values for a given test.
+     *
+     * @param expectedStatusCode  A status code expected to be returned in the response.
+     *
+     * @param reqType  A type of service request (e.g. CREATE, DELETE).
+     */
+    protected void testSetup(
+            int expectedStatusCode,
+            ServiceRequestType reqType) {
+        clearSetup();
+        testExpectedStatusCode = expectedStatusCode;
+        testRequestType = reqType;
+    }
+
+    /**
+     * Returns an error message indicating that the status code returned by a
+     * specific call to a service does not fall within a set of valid status
+     * codes for that service.
+     *
+     * @param requestType  A type of service request (e.g. CREATE, DELETE).
+     *
+     * @param statusCode  The invalid status code that was returned in the response,
+     *                    from submitting that type of request to the service.
+     *
+     * @return An error message.
+     */
+    protected String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {
+        return "Status code '" + statusCode
+                + "' in response is NOT within the expected set: "
+                + requestType.validStatusCodesAsString();
+    }
+
+    /**
+     * Returns the root URL for a service.
+     *
+     * This URL consists of a base URL for all services, followed by
+     * a path component (or components) for a service.
+     *
+     * @return The root URL for a service.
+     */
+    protected String getServiceRootURL() {
+        return serviceClient.getBaseURL() + getServiceName(); //FIXME: REM - This should probably be calling getServicePathComponent() and not getServiceName();
+    }
+
+    public String getServiceClientTenantID() {
+        return serviceClient.getProperty("cspace.tenantID");
+    }
+
+    /**
+     * Returns the URL of a specific resource managed by a service, and
+     * designated by an identifier (such as a universally unique ID, or UUID).
+     *
+     * @param  resourceIdentifier  An identifier (such as a UUID) for a resource.
+     *
+     * @return The URL of a specific resource managed by a service.
+     */
+    protected String getResourceURL(String resourceIdentifier) {
+        return getServiceRootURL() + "/" + resourceIdentifier;
+    }
+
+    /**
+     * Submits an HTTP request to a specified URL, and returns the
+     * status code of the response.  Currently accepts GET and DELETE
+     * requests.
+     *
+     * @param  method  An HTTP method.
+     *
+     * @param  url     A String representation of a URL.
+     *
+     * @return The status code received in the HTTP response.
+     */
+    protected int submitRequest(String method, String url) {
+        int statusCode = 0;
+        HttpMethodBase httpMethod = null;
+        try {
+            TestServiceClient client = new TestServiceClient();
+            if (method.equals(javax.ws.rs.HttpMethod.DELETE)) {
+               httpMethod = new DeleteMethod(url);
+            } else if (method.equals(javax.ws.rs.HttpMethod.GET)) {
+               httpMethod = new GetMethod(url);
+            }
+            if (httpMethod != null) {
+                statusCode = client.getHttpClient().executeMethod(httpMethod);
+            }
+        } catch (Exception e) {
+            logger.error(
+                    "Exception during HTTP " + method + " request to "
+                    + url + ":", e);
+        } finally {
+               if (httpMethod != null) httpMethod.releaseConnection();
+        }
+        return statusCode;
+    }
+
+    /**
+     * Submits an HTTP request to a specified URL, with the submitted
+     * entity body, and returns the status code of the response.
+     * Currently accepts POST and PUT requests.
+     *
+     * @param  method  An HTTP method.
+     *
+     * @param  url     A String representation of a URL.
+     *
+     * @param  mediaType  The media type of the entity body to be submitted.
+     *
+     * @param  entityStr     The contents of the entity body to be submitted.
+     *
+     * @return The status code received in the HTTP response.
+     */
+    protected int submitRequest(String method, String url, String mediaType, String entityStr) {
+        int statusCode = 0;
+        EntityEnclosingMethod httpMethod = null;
+        try {
+            TestServiceClient client = new TestServiceClient();
+            if (method.equals(javax.ws.rs.HttpMethod.POST)) {
+                httpMethod = new PostMethod(url);
+            } else if (method.equals(javax.ws.rs.HttpMethod.PUT)) {
+                httpMethod = new PutMethod(url);
+            }
+            if (httpMethod != null) {
+                StringRequestEntity entityBody =
+                    new StringRequestEntity(mediaType, entityStr, NULL_CHARSET);
+               httpMethod.setRequestEntity(entityBody);
+               statusCode = client.getHttpClient().executeMethod(httpMethod);
+            }
+        } catch (Exception e) {
+            logger.error(
+                    "Exception during HTTP " + method + " request to "
+                    + url + ":", e);
+        } finally {
+               if (httpMethod != null) httpMethod.releaseConnection();
+        }
+        return statusCode;
+    }
+
+    // FIXME: Move some or all of the methods below to a common client and
+    // server utilities package, when this package becomes available.
+
+    /**
+     * Extract id.
+     *
+     * @param res the res
+     * @return the string
+     */
+    static protected String extractId(ClientResponse<Response> res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        String uri = (String) ((List<Object>) mvm.get("Location")).get(0);
+        if (logger.isDebugEnabled()) {
+            logger.debug("extractId:uri=" + uri);
+        }
+        String[] segments = uri.split("/");
+        String id = segments[segments.length - 1];
+        if (logger.isDebugEnabled()) {
+            logger.debug("id=" + id);
+        }
+        return id;
+    }
+    /**
+     * Tests can override this method to customize their identifiers.
+     */
+    protected String createIdentifier() {
+        long identifier = System.currentTimeMillis() + random.nextInt();
+        return Long.toString(identifier);
+    }
+    
+    /**
+     * Tests can override this method to customize their identifiers.
+     */
+    protected String getKnowResourceIdentifier() {
+       if (knownResourceIdentifier == null) {
+               knownResourceIdentifier = createIdentifier();
+       }
+       return knownResourceIdentifier;
+    }
+    
+    /**
+     * Tests can override this method if they have a different knownResourceId
+     * @return
+     */
+    protected String getKnowResourceId() {
+       return this.knownResourceId;
+    }
+
+    /**
+     * Creates the non existent identifier.
+     *
+     * @return the string
+     */
+    protected String createNonExistentIdentifier() {
+        return Long.toString(Long.MAX_VALUE);
+    }
+
+    /**
+     * Extract part.
+     *
+     * @param input the input
+     * @param label the label
+     * @param clazz the clazz
+     * @return the object
+     * @throws Exception the exception
+     */
+    static protected Object extractPart(PoxPayloadIn input, String label, Class<?> clazz)
+            throws Exception {
+       Object result = null;
+       PayloadInputPart payloadInputPart = input.getPart(label);
+        if (payloadInputPart != null) {
+               result = payloadInputPart.getBody();
+        } else if (logger.isWarnEnabled() == true) {
+               logger.warn("Payload part: " + label +
+                               " is missing from payload: " + input.getName());
+        }
+        return result;
+            }
+
+    /**
+     * Gets the part object.
+     *
+     * @param partStr the part str
+     * @param clazz the clazz
+     * @return the part object
+     * @throws JAXBException the jAXB exception
+     */
+    @Deprecated
+    static protected Object getPartObject(String partStr, Class<?> clazz)
+            throws JAXBException {
+        JAXBContext jc = JAXBContext.newInstance(clazz);
+        ByteArrayInputStream bais = null;
+        Object obj = null;
+        try {
+            bais = new ByteArrayInputStream(partStr.getBytes());
+            Unmarshaller um = jc.createUnmarshaller();
+            obj = um.unmarshal(bais);
+        } finally {
+            if (bais != null) {
+                try {
+                    bais.close();
+                } catch (Exception e) {
+                       if (logger.isDebugEnabled()) {
+                               e.printStackTrace();
+                       }
+                }
+            }
+        }
+        return obj;
+    }
+
+    /**
+     * Object as xml string.
+     *
+     * @param o the o
+     * @param clazz the clazz
+     * @return the string
+     */
+    static protected String objectAsXmlString(Object o, Class<?> clazz) {
+        StringWriter sw = new StringWriter();
+        try {
+            JAXBContext jc = JAXBContext.newInstance(clazz);
+            Marshaller m = jc.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
+                    Boolean.TRUE);
+            m.marshal(o, sw);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return sw.toString();
+    }
+    
+    static protected String objectAsXmlString(Object o) {
+        StringWriter sw = new StringWriter();
+        try {
+            JAXBContext jc = JAXBContext.newInstance(o.getClass());
+            Marshaller m = jc.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
+                    Boolean.TRUE);
+            m.marshal(o, sw);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return sw.toString();
+    }    
+
+    /**
+     * getObjectFromFile get object of given class from given file (in classpath)
+     * @param jaxbClass
+     * @param fileName of the file to read to construct the object
+     * @return
+     * @throws Exception
+     */
+    static protected Object getObjectFromFile(Class<?> jaxbClass, String fileName)
+            throws Exception {
+       Object result = null;
+       
+       result = FileTools.getJaxbObjectFromFile(jaxbClass, fileName);
+       
+        return result;
+    }
+
+    /**
+     * Gets the xml document.
+     *
+     * @param fileName the file name
+     * @return the xml document
+     * @throws Exception the exception
+     */
+    static protected Document getXmlDocument(String fileName) throws Exception {
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        File f = new File(fileName);
+        if (!f.exists()) {
+            throw new IllegalArgumentException("test data file " + fileName + " not found!");
+        }
+        // Create the builder and parse the file
+        return factory.newDocumentBuilder().parse(f);
+    }
+
+    /**
+     * Gets the xml document as string.
+     *
+     * @param fileName the file name
+     * @return the xml document as string
+     * @throws Exception the exception
+     */
+    static protected String getXmlDocumentAsString(String fileName) throws Exception {
+        String result = FileUtils.readFileToString(new File(fileName), "UTF8");
+        return result;
+    }
+
+    /**
+     * Map as string.
+     *
+     * @param map the map
+     * @return the string
+     */
+    protected String mapAsString(MultivaluedMap<String, Object> map) {
+        StringBuffer sb = new StringBuffer();
+        for (Object entry : map.entrySet()) {
+            MultivaluedMap.Entry<String, Object> mentry = (MultivaluedMap.Entry<String, Object>) entry;
+            sb.append("    name=" + mentry.getKey());
+            sb.append(" value=" + mentry.getValue() + "\n");
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Returns a 'banner', consisting of a text label inside a pair of prefix
+     * and suffix strings.
+     *
+     * @param label The label to be output inside the banner.
+     *
+     * @return The banner.
+     */
+    protected static String getBannerStr(String label) {
+        StringBuffer sb = new StringBuffer();
+        sb.append(BANNER_PREFIX);
+        sb.append(label);
+        sb.append(BANNER_SUFFIX);
+        return sb.toString();
+    }
+    
+    /**
+     * Returns a test-specific banner.
+     *
+     * @param testName The name of a test method.
+     *
+     * @return A test-specific banner.
+     */
+    private static String getNameBanner(String testName) {
+        testName = (testName == null || testName.trim().isEmpty()) ?
+            " Test = no test name specified" : " Test = " + testName;
+        return testName;
+    }
+
+    /**
+     * Returns a test-specific banner.
+     *
+     * @param testName The name of a test method.
+     *
+     * @param testClass The name of a test class.
+     *
+     * @return A test-specific banner.
+     */
+    private static String getBanner(String testName, String testClass) {
+       testName = getNameBanner(testName);
+        testClass = (testClass == null || testClass.trim().isEmpty()) ?
+            "Class = no test class specified" : "Class = " + classNameFromPackageName(testClass);
+        String testLabel = testClass + "\n" + testName;
+        return getBannerStr(testLabel);
+    }
+    
+    protected static String getTestBanner(String testName, String testClassName) {
+        return getBanner(testName, testClassName);
+    }
+    
+    protected String getTestBanner(String testName) {
+       return getTestBanner(testName, this.getClass().getCanonicalName());
+    }
+        
+    protected void logTestBanner(Logger logger, String testName) {
+       if (logger.isDebugEnabled() == true) {
+               logger.debug(getTestBanner(testName));
+       }
+    }
+
+    protected static String classNameFromPackageName(String className) {
+        if (className == null || className.trim().isEmpty()) {
+            return className;
+        }
+        final char PKG_SEPARATOR = '.';
+        int pos = className.lastIndexOf(PKG_SEPARATOR) + 1;
+        if (pos > 0) {
+            className = className.substring(pos);
+        }
+        return className;
+    }
+
+    public int assertStatusCode(ClientResponse<?> res, String testName) {
+        int statusCode = res.getStatus();
+        
+        // Check the status code of the response: does it match the expected response(s)?
+        logger.debug(testName + ": status = " + statusCode);
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, testExpectedStatusCode);
+        
+        return statusCode;
+    }
+
+    public static String getUTF8DataFragment() {
+        return UTF8_DATA_FRAGMENT;
+    }
+
+    protected String getMimeType(File theFile) {
+        String result = null;
+        result = new MimetypesFileTypeMap().getContentType(theFile);
+        if (result == null) {
+            logger.debug("Could not get MIME type for file at: " + theFile.getAbsolutePath());
+            result = DEFAULT_MIME;
+        }
+
+        return result;
+    }
+
+    /*
+     * Test classes for authority services should override these method and return 'true'
+     */
+    protected boolean isAuthorityClient(CollectionSpaceClient theClient) {
+        return AuthorityClient.class.isInstance(theClient);
+    }
+       
+    /**
+     * Deletes all resources created by tests, after all tests have been run.
+     *
+     * This cleanup method will always be run, even if one or more tests fail.
+     * For this reason, it attempts to remove all resources created
+     * at any point during testing, even if some of those resources
+     * may be expected to be deleted by certain tests.
+     */
+    @AfterClass(alwaysRun = true)
+    public void cleanUp() {
+        String noTestCleanup = System.getProperty(NO_TEST_CLEANUP);
+        if (Boolean.TRUE.toString().equalsIgnoreCase(noTestCleanup)) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("Skipping Cleanup phase ...");
+            }
+            return;
+        }
+        if (logger.isDebugEnabled()) {
+            logger.debug("Cleaning up temporary resources created for testing ...");
+        }
+        CollectionSpaceClient client = this.getClientInstance();
+        //
+        // First, check to see if we need to cleanup any authority items
+        //
+        if (this.isAuthorityClient(client) == true) {
+            AuthorityClient authorityClient = (AuthorityClient) client;
+            for (Map.Entry<String, String> entry : allResourceItemIdsCreated.entrySet()) {
+                String itemResourceId = entry.getKey();
+                String authorityResourceId = entry.getValue();
+                // Note: Any non-success responses are ignored and not reported.
+                authorityClient.deleteItem(authorityResourceId, itemResourceId).releaseConnection();
+            }
+        }
+        //
+        // Next, delete all other entities include possible authorities.
+        //
+        for (String resourceId : allResourceIdsCreated) {
+            // Note: Any non-success responses are ignored and not reported.
+            client.delete(resourceId).releaseConnection();
+        }
+    }
+       
+       //
+       // Status code setup methods for tests
+       //
+       
+    /**
+     * Sets up create tests with malformed xml.
+     */
+    protected void setupCreateWithMalformedXml() {
+        testExpectedStatusCode = STATUS_BAD_REQUEST;
+        testRequestType = ServiceRequestType.CREATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+
+    /**
+     * Sets up create tests with wrong xml schema.
+     */
+    protected void setupCreateWithWrongXmlSchema() {
+        testExpectedStatusCode = STATUS_BAD_REQUEST;
+        testRequestType = ServiceRequestType.CREATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+    
+    /**
+     * Sets up read tests.
+     */
+    protected void setupRead() {
+        testExpectedStatusCode = STATUS_OK;
+        testRequestType = ServiceRequestType.READ;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+
+    /**
+     * Sets up read tests.
+     */
+    protected void setupForbidden() {
+        testExpectedStatusCode = STATUS_FORBIDDEN;
+        testRequestType = ServiceRequestType.READ;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+
+    /**
+     * Sets up read non existent tests.
+     */
+    protected void setupReadNonExistent() {
+        testExpectedStatusCode = STATUS_NOT_FOUND;
+        testRequestType = ServiceRequestType.READ;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+
+    /**
+     * Sets up read list tests.
+     */
+    protected void setupReadList() {
+        testExpectedStatusCode = STATUS_OK;
+        testRequestType = ServiceRequestType.READ_LIST;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+
+    /**
+     * Sets up update tests.
+     */
+    protected void setupUpdate() {
+        testExpectedStatusCode = STATUS_OK;
+        testRequestType = ServiceRequestType.UPDATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+       
+    /**
+     * Sets up update tests with an empty entity body.
+     */
+    protected void setupUpdateWithEmptyEntityBody() {
+        testExpectedStatusCode = STATUS_BAD_REQUEST;
+        testRequestType = ServiceRequestType.UPDATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+
+    /**
+     * Sets up update tests with malformed xml.
+     */
+    protected void setupUpdateWithMalformedXml() {
+        testExpectedStatusCode = STATUS_BAD_REQUEST;
+        testRequestType = ServiceRequestType.UPDATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+    
+    /**
+     * Sets up update tests with wrong xml schema.
+     */
+    protected void setupUpdateWithWrongXmlSchema() {
+        testExpectedStatusCode = STATUS_BAD_REQUEST;
+        testRequestType = ServiceRequestType.UPDATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+    
+    /**
+     * Sets up update non existent tests
+     */
+    protected void setupUpdateNonExistent() {
+        testExpectedStatusCode = STATUS_NOT_FOUND;
+        testRequestType = ServiceRequestType.UPDATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+
+    /**
+     * Sets up delete tests.
+     */
+    protected void setupDelete() {
+        testExpectedStatusCode = STATUS_OK;
+        testRequestType = ServiceRequestType.DELETE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+
+    // Failure outcomes
+
+    /**
+     * Sets up delete non existent tests.
+     */
+    protected void setupDeleteNonExistent() {
+        testExpectedStatusCode = STATUS_NOT_FOUND;
+        testRequestType = ServiceRequestType.DELETE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+    
+    /**
+     * Sets up create tests with empty entity body.
+     */
+    protected void setupCreateWithEmptyEntityBody() {
+        testExpectedStatusCode = STATUS_BAD_REQUEST;
+        testRequestType = ServiceRequestType.CREATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+
+    /**
+     * Sets up create tests with empty entity body.
+     */
+    protected void setupCreateWithInvalidBody() {
+        testExpectedStatusCode = STATUS_BAD_REQUEST;
+        testRequestType = ServiceRequestType.CREATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+    
+    /**
+     * Sets up create tests with empty entity body.
+     */
+    protected void setupUpdateWithInvalidBody() {
+        testExpectedStatusCode = STATUS_BAD_REQUEST;
+        testRequestType = ServiceRequestType.UPDATE;
+        testSetup(testExpectedStatusCode, testRequestType);
+    }
+    
+    public void updateWithEmptyEntityBody(String testName) throws Exception {
+        //FIXME: Should this test really be empty?  If so, please comment accordingly.
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
+     */
+    public void updateWithMalformedXml(String testName) throws Exception {
+        //FIXME: Should this test really be empty?  If so, please comment accordingly.
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
+     */
+    public void updateWithWrongXmlSchema(String testName) throws Exception {
+        //FIXME: Should this test really be empty?  If so, please comment accordingly.
+    }
+    
+}
index cbf1d5ab21084982838e5e3e30f911e299ca52e8..b0ab6bf7a1ee6dd1da4214262e4f5b0eee299572 100644 (file)
@@ -1,6 +1,6 @@
-package org.collectionspace.services.client.test;\r
-\r
-public class ServiceTestUtils {\r
-\r
-       \r
-}\r
+package org.collectionspace.services.client.test;
+
+public class ServiceTestUtils {
+
+       
+}
index cdeb3d00c15868a217cd5a5f24eb68f5de6acafb..472295ea75e8e1b1f492f3d47174def0ef60a294 100644 (file)
@@ -1,18 +1,18 @@
-#url of the collectionspace server\r
-cspace.url=http://localhost:8180/cspace-services/\r
-#cspace.url=http://qa.collectionspace.org:8180/cspace-services/\r
-\r
-#cspace.url=http://localhost:8200/cspace-services/\r
-#for sockspy: \r
-#cspace.url=http://localhost:8280/cspace-services/\r
-\r
-cspace.ssl=false\r
-cspace.auth=true\r
-# default user\r
-cspace.user=admin@core.collectionspace.org\r
-#cspace.user=admin@lifesci.collectionspace.org\r
-cspace.password=Administrator\r
-# default tenant\r
-cspace.tenant=1\r
-# the tenantID of the numbered tenant:\r
+#url of the collectionspace server
+cspace.url=http://localhost:8180/cspace-services/
+#cspace.url=http://qa.collectionspace.org:8180/cspace-services/
+
+#cspace.url=http://localhost:8200/cspace-services/
+#for sockspy: 
+#cspace.url=http://localhost:8280/cspace-services/
+
+cspace.ssl=false
+cspace.auth=true
+# default user
+cspace.user=admin@core.collectionspace.org
+#cspace.user=admin@lifesci.collectionspace.org
+cspace.password=Administrator
+# default tenant
+cspace.tenant=1
+# the tenantID of the numbered tenant:
 cspace.tenantID=core.collectionspace.org
\ No newline at end of file
index 6236c6698fd88d52b42cdf7dcc7d9a33429f6cc4..f23adc6101f62fd8e1e151ecad907aa057484f5a 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=info, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=INFO\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=info, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=INFO
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 741d82ba2c067a4e89abcc5e60ada709afff60e6..fcd836ff1e46c79f76d3fc8525021e3d68a9caae 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.collectionobject</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.collectionobject</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index ce7699e9001d44f0d47594c38c613bd4bd014eba..242085f8e705c8011e8a0772f1cd2d3ac73540c1 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.collectionobject.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.collectionobject.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index fe823eec2cb155aaf1449b388509d24f15ff54e2..5e92cd25c034119a8f197764199405ba2ea67d02 100644 (file)
-\r
-<project name="collectionobject.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        collectionobject service 3rd party\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-     <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-       <property name="nuxeo-platform-collectionobject" value="nuxeo-platform-cs-collectionobject"/>\r
-       <property name="nuxeo-platform-collectionobject-lifesci" value="nuxeo-platform-collectionobject-lifesci"/>\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy collectionobject in ${jee.server.nuxeo}">\r
-       <!-- These targets are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool      \r
-        <ant antfile="${nuxeo-platform-collectionobject}/build.xml" target="deploy" inheritall="false"/>\r
-        <ant antfile="${nuxeo-platform-collectionobject-lifesci}/build.xml" target="deploy" inheritall="false"/>\r
-        -->\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy collectionobject from ${jee.server.nuxeo}">\r
-       <!-- These targets are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-       leaving this only for backwards compatibility reasons. -->      \r
-        <ant antfile="${nuxeo-platform-collectionobject}/build.xml" target="undeploy" inheritall="false"/>\r
-        <ant antfile="${nuxeo-platform-collectionobject-lifesci}/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for collectionobject" depends="package">\r
-        <ant antfile="${nuxeo-platform-collectionobject}/build.xml" target="dist" inheritall="false"/>\r
-        <ant antfile="${nuxeo-platform-collectionobject-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-collectionobject}/build.xml" target="dist_installer" inheritall="false"/>\r
-        <ant antfile="${nuxeo-platform-collectionobject-lifesci}/build.xml" target="dist_installer" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="collectionobject.3rdparty" default="package" basedir=".">
+    <description>
+        collectionobject service 3rd party
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+     <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+       <property name="nuxeo-platform-collectionobject" value="nuxeo-platform-cs-collectionobject"/>
+       <property name="nuxeo-platform-collectionobject-lifesci" value="nuxeo-platform-collectionobject-lifesci"/>
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+
+    </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 collectionobject in ${jee.server.nuxeo}">
+       <!-- These targets are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool      
+        <ant antfile="${nuxeo-platform-collectionobject}/build.xml" target="deploy" inheritall="false"/>
+        <ant antfile="${nuxeo-platform-collectionobject-lifesci}/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+    description="undeploy collectionobject from ${jee.server.nuxeo}">
+       <!-- These targets are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       leaving this only for backwards compatibility reasons. -->      
+        <ant antfile="${nuxeo-platform-collectionobject}/build.xml" target="undeploy" inheritall="false"/>
+        <ant antfile="${nuxeo-platform-collectionobject-lifesci}/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for collectionobject" depends="package">
+        <ant antfile="${nuxeo-platform-collectionobject}/build.xml" target="dist" inheritall="false"/>
+        <ant antfile="${nuxeo-platform-collectionobject-lifesci}/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+    <target name="dist_installer"
+    description="generate distribution for collectionobject" depends="package">
+        <ant antfile="${nuxeo-platform-collectionobject}/build.xml" target="dist_installer" inheritall="false"/>
+        <ant antfile="${nuxeo-platform-collectionobject-lifesci}/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index 01760d33a3da585c9768e432601f36a866bbade9..7d3705ba71211981b85e3f1ba6bab4abe9950e44 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project name="nuxeo-platform-collectionobject-lifesci" default="package" basedir=".">\r
-    <description>\r
-        Collectionobject nuxeo document type for the lifesci tenant\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../../.."/>\r
-    <!-- environment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-    <property name="dist"  location="dist"/>\r
-    <!-- JAR files used by CollectionSpace 4.0 and later -->\r
-    <!-- Both doctype and schema JAR(s) are removed via the 'undeploy' target -->\r
-    <!-- in another Ant buildfile, in a peer module to this module -->\r
-    <!-- Legacy JAR files used by CollectionSpace 3.3 and earlier --> \r
-    <!-- Additional legacy JAR(s) are removed via the 'undeploy' target in the -->\r
-    <!-- Ant buildfile for the common schema -->\r
-    <property name="nuxeo.collectionobject.lifesci.legacy.jars.all"\r
-        value="org.collectionspace.services.collectionobject.3rdparty.lifesci.nuxeo-*.jar"/>\r
-    <property name="nuxeo.collectionobject.lifesci.legacy.jar"\r
-        value="org.collectionspace.services.collectionobject.3rdparty.lifesci.nuxeo-${cspace.release}.jar"/>\r
-    \r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-        <!-- Create the build directory structure used by compile -->\r
-        <mkdir dir="${build}"/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-        description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-        description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy collectionobject doctype in ${jee.server.nuxeo}">\r
-        <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        leaving this only for backwards compatibility reasons. -->  \r
-        <copy file="${basedir}/target/${nuxeo.collectionobject.lifesci.legacy.jar}"\r
-            todir="${jee.deploy.nuxeo.plugins}"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="undeploy collectionobject doctype from ${jee.server.nuxeo}">\r
-        <delete>\r
-            <!-- Both doctype and schema JAR(s) are removed via the 'undeploy' target -->\r
-            <!-- in another Ant buildfile, in a peer module to this module -->\r
-            <!-- Undeploy legacy artifacts -->\r
-            <!-- Additional legacy JAR(s) are removed via the 'undeploy' target in the -->\r
-            <!-- Ant buildfile for the common schema -->\r
-            <fileset dir="${jee.deploy.nuxeo.plugins}">\r
-                <include name="${nuxeo.collectionobject.lifesci.legacy.jars.all}"/>\r
-            </fileset>\r
-        </delete>\r
-        <!-- Undeploy legacy artifacts from old deployment location through release 0.6 -->\r
-        <delete quiet="true">\r
-            <fileset dir="${jee.deploy.nuxeo.system}">\r
-                <include name="${nuxeo.collectionobject.lifesci.legacy.jars.all}"/>\r
-            </fileset>\r
-        </delete>\r
-    </target>\r
-\r
-    <target name="dist"\r
-       description="generate distribution for collectionobject doctype" depends="package">\r
-        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">\r
-            <fileset file="${basedir}/target/${nuxeo.collectionobject.lifesci.legacy.jar}"/>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="dist_installer"\r
-       description="Creates an installer distribution for CollectionObject doctype" depends="package">\r
-        <copy todir="${services.trunk}/${dist.installer.services}/collectionobject/nuxeo">\r
-            <fileset file="${basedir}/target/${nuxeo.collectionobject.lifesci.legacy.jar}"/>\r
-        </copy>\r
-    </target>\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="nuxeo-platform-collectionobject-lifesci" default="package" basedir=".">
+    <description>
+        Collectionobject 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="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+    <property name="dist"  location="dist"/>
+    <!-- JAR files used by CollectionSpace 4.0 and later -->
+    <!-- Both doctype and schema JAR(s) are removed via the 'undeploy' target -->
+    <!-- in another Ant buildfile, in a peer module to this module -->
+    <!-- Legacy JAR files used by CollectionSpace 3.3 and earlier --> 
+    <!-- Additional legacy JAR(s) are removed via the 'undeploy' target in the -->
+    <!-- Ant buildfile for the common schema -->
+    <property name="nuxeo.collectionobject.lifesci.legacy.jars.all"
+        value="org.collectionspace.services.collectionobject.3rdparty.lifesci.nuxeo-*.jar"/>
+    <property name="nuxeo.collectionobject.lifesci.legacy.jar"
+        value="org.collectionspace.services.collectionobject.3rdparty.lifesci.nuxeo-${cspace.release}.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 collectionobject doctype in ${jee.server.nuxeo}">
+        <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        leaving this only for backwards compatibility reasons. -->  
+        <copy file="${basedir}/target/${nuxeo.collectionobject.lifesci.legacy.jar}"
+            todir="${jee.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy collectionobject doctype from ${jee.server.nuxeo}">
+        <delete>
+            <!-- Both doctype and schema JAR(s) are removed via the 'undeploy' target -->
+            <!-- in another Ant buildfile, in a peer module to this module -->
+            <!-- Undeploy legacy artifacts -->
+            <!-- Additional legacy JAR(s) are removed via the 'undeploy' target in the -->
+            <!-- Ant buildfile for the common schema -->
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.collectionobject.lifesci.legacy.jars.all}"/>
+            </fileset>
+        </delete>
+        <!-- Undeploy legacy artifacts from old deployment location through release 0.6 -->
+        <delete quiet="true">
+            <fileset dir="${jee.deploy.nuxeo.system}">
+                <include name="${nuxeo.collectionobject.lifesci.legacy.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+    <target name="dist"
+       description="generate distribution for collectionobject doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.collectionobject.lifesci.legacy.jar}"/>
+        </copy>
+    </target>
+
+    <target name="dist_installer"
+       description="Creates an installer distribution for CollectionObject doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.installer.services}/collectionobject/nuxeo">
+            <fileset file="${basedir}/target/${nuxeo.collectionobject.lifesci.legacy.jar}"/>
+        </copy>
+    </target>
+</project>
index 53409adae80be4735bba65c09c171e66e0d71fc4..e252d382ddfb1c5233257f97c91e97403b1c5ad0 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project name="nuxeo-platform-collectionobjects_common" default="package" basedir=".">\r
-    <description>\r
-        CollectionobjectsCommon Nuxeo document type\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../../.."/>\r
-    <!-- environment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-    <property name="dist"  location="dist"/>\r
-    <!-- JAR files used by CollectionSpace 4.0 and later -->\r
-    <property name="nuxeo.collectionobject.doctype.jars.all"\r
-        value="collectionspace.collectionobject.doctype.*.jar"/>\r
-    <property name="nuxeo.collectionobject.schema.jars.all"\r
-        value="collectionspace.collectionobject.schema.*.jar"/>\r
-    <!-- Legacy JAR files used by CollectionSpace 3.3 and earlier --> \r
-    <property name="nuxeo.collectionobject.legacy.jars.all"\r
-        value="org.collectionspace.services.collectionobject.3rdparty.nuxeo-*.jar"/>\r
-    <property name="nuxeo.collectionobject.legacy.jar"\r
-        value="org.collectionspace.services.collectionobject.3rdparty.nuxeo-${cspace.release}.jar"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-        <!-- Create the build directory structure used by compile -->\r
-        <mkdir dir="${build}"/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-        description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-        description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="Deploy CollectionObjectsCommon doctype in ${jee.server.nuxeo}">\r
-        <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        leaving this only for backwards compatibility reasons. -->  \r
-        <copy file="${basedir}/target/${nuxeo.collectionobject.legacy.jar}"\r
-            todir="${jee.deploy.nuxeo.plugins}"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="Undeploy CollectionObjectsCommon doctype from ${jee.server.nuxeo}">\r
-        <delete>\r
-            <!-- Undeploy doctype and schema artifacts -->\r
-            <fileset dir="${jee.deploy.nuxeo.plugins}">\r
-                <include name="${nuxeo.collectionobject.doctype.jars.all}"/>\r
-            </fileset>\r
-            <fileset dir="${jee.deploy.nuxeo.plugins}">\r
-                <include name="${nuxeo.collectionobject.schema.jars.all}"/>\r
-            </fileset>\r
-            <!-- Undeploy legacy artifacts -->\r
-            <fileset dir="${jee.deploy.nuxeo.plugins}">\r
-                <include name="${nuxeo.collectionobject.legacy.jars.all}"/>\r
-            </fileset>\r
-        </delete>\r
-        <!-- Undeploy legacy artifacts from old deployment location through release 0.6 -->\r
-        <delete quiet="true">\r
-            <fileset dir="${jee.deploy.nuxeo.system}">\r
-                <include name="${nuxeo.collectionobject.legacy.jars.all}"/>\r
-            </fileset>\r
-        </delete>\r
-    </target>\r
-\r
-    <target name="dist"\r
-       description="generate distribution for collectionobject doctype" depends="package">\r
-        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">\r
-            <fileset file="${basedir}/target/${nuxeo.collectionobject.legacy.jar}"/>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="dist_installer"\r
-       description="Creates an installer distribution for CollectionObjectsCommon doctype" depends="package">\r
-        <copy todir="${services.trunk}/${dist.installer.services}/collectionobject/nuxeo">\r
-            <fileset file="${basedir}/target/${nuxeo.collectionobject.legacy.jar}"/>\r
-        </copy>\r
-    </target>\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="nuxeo-platform-collectionobjects_common" default="package" basedir=".">
+    <description>
+        CollectionobjectsCommon Nuxeo document type
+    </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="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+    <property name="dist"  location="dist"/>
+    <!-- JAR files used by CollectionSpace 4.0 and later -->
+    <property name="nuxeo.collectionobject.doctype.jars.all"
+        value="collectionspace.collectionobject.doctype.*.jar"/>
+    <property name="nuxeo.collectionobject.schema.jars.all"
+        value="collectionspace.collectionobject.schema.*.jar"/>
+    <!-- Legacy JAR files used by CollectionSpace 3.3 and earlier --> 
+    <property name="nuxeo.collectionobject.legacy.jars.all"
+        value="org.collectionspace.services.collectionobject.3rdparty.nuxeo-*.jar"/>
+    <property name="nuxeo.collectionobject.legacy.jar"
+        value="org.collectionspace.services.collectionobject.3rdparty.nuxeo-${cspace.release}.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 CollectionObjectsCommon doctype in ${jee.server.nuxeo}">
+        <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        leaving this only for backwards compatibility reasons. -->  
+        <copy file="${basedir}/target/${nuxeo.collectionobject.legacy.jar}"
+            todir="${jee.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="Undeploy CollectionObjectsCommon doctype from ${jee.server.nuxeo}">
+        <delete>
+            <!-- Undeploy doctype and schema artifacts -->
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.collectionobject.doctype.jars.all}"/>
+            </fileset>
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.collectionobject.schema.jars.all}"/>
+            </fileset>
+            <!-- Undeploy legacy artifacts -->
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.collectionobject.legacy.jars.all}"/>
+            </fileset>
+        </delete>
+        <!-- Undeploy legacy artifacts from old deployment location through release 0.6 -->
+        <delete quiet="true">
+            <fileset dir="${jee.deploy.nuxeo.system}">
+                <include name="${nuxeo.collectionobject.legacy.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+    <target name="dist"
+       description="generate distribution for collectionobject doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.collectionobject.legacy.jar}"/>
+        </copy>
+    </target>
+
+    <target name="dist_installer"
+       description="Creates an installer distribution for CollectionObjectsCommon doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.installer.services}/collectionobject/nuxeo">
+            <fileset file="${basedir}/target/${nuxeo.collectionobject.legacy.jar}"/>
+        </copy>
+    </target>
+</project>
index 547e0f64282e080b9f71e65d3cb1f72d52848bdc..d9ccb49e3296802e5581e067f12192f78dd321cc 100644 (file)
@@ -1,34 +1,34 @@
-\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.collectionobject</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.collectionobject.3rdparty</artifactId>\r
-    <name>services.collectionobject.3rdparty</name>\r
-    <packaging>pom</packaging>\r
-    <description>\r
-        3rd party build for collectionobject service\r
-    </description>\r
-\r
-       <properties>\r
-               <ServiceName>collectionobject</ServiceName>\r
-               <NuxeoDocTypeName>CollectionObject</NuxeoDocTypeName>   \r
-               <CommonSchemaName>collectionobjects_common</CommonSchemaName>\r
-               <TenantPrefix>Tenant</TenantPrefix>\r
-               <Lifecycle>cs_default</Lifecycle>\r
-       </properties>\r
-       \r
-    <modules>\r
-        <!-- These modules are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-       <module>nuxeo-platform-cs-collectionobject</module>\r
-        <module>nuxeo-platform-collectionobject-lifesci</module>\r
-        -->\r
-    </modules>\r
-\r
-</project>\r
+
+<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.collectionobject</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.collectionobject.3rdparty</artifactId>
+    <name>services.collectionobject.3rdparty</name>
+    <packaging>pom</packaging>
+    <description>
+        3rd party build for collectionobject service
+    </description>
+
+       <properties>
+               <ServiceName>collectionobject</ServiceName>
+               <NuxeoDocTypeName>CollectionObject</NuxeoDocTypeName>   
+               <CommonSchemaName>collectionobjects_common</CommonSchemaName>
+               <TenantPrefix>Tenant</TenantPrefix>
+               <Lifecycle>cs_default</Lifecycle>
+       </properties>
+       
+    <modules>
+        <!-- These modules are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       <module>nuxeo-platform-cs-collectionobject</module>
+        <module>nuxeo-platform-collectionobject-lifesci</module>
+        -->
+    </modules>
+
+</project>
index f77cab4999b40cd8c90371adb9066722f5426292..9011d428e2be2d8128967840054a681a5a21b00c 100644 (file)
-\r
-<project name="collectionobject" default="package" basedir=".">\r
-    <description>\r
-        collectionobject service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy collectionobject service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy collectionobject service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-       description="distribute collectionobject service}">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-        \r
-               <!-- Creates a distribution of artifacts for the installer. -->        \r
-    <target name="dist_installer" depends="package"\r
-       description="Creates a distribution of artifacts for the installer.">\r
-\r
-        <!-- copy install scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.installer.services}/collectionobject">\r
-            <fileset dir="./installer"/>\r
-        </copy>\r
-        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="collectionobject" default="package" basedir=".">
+    <description>
+        collectionobject service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 collectionobject service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy collectionobject service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+       description="distribute collectionobject service}">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+        
+               <!-- Creates a distribution of artifacts for the installer. -->        
+    <target name="dist_installer" depends="package"
+       description="Creates a distribution of artifacts for the installer.">
+
+        <!-- copy install scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.installer.services}/collectionobject">
+            <fileset dir="./installer"/>
+        </copy>
+        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index 458dbd0969b74487ee893682e8132829ae6efd7e..fffbf0fe6edb5b3214cafef82da9fe0866750667 100644 (file)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<actions>\r
-        <action>\r
-            <actionName>rebuild</actionName>\r
-            <packagings>\r
-                <packaging>*</packaging>\r
-            </packagings>\r
-            <goals>\r
-                <goal>clean</goal>\r
-                <goal>install</goal>\r
-            </goals>\r
-            <properties>\r
-                <maven.test.skip>true</maven.test.skip>\r
-            </properties>\r
-        </action>\r
-    </actions>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<actions>
+        <action>
+            <actionName>rebuild</actionName>
+            <packagings>
+                <packaging>*</packaging>
+            </packagings>
+            <goals>
+                <goal>clean</goal>
+                <goal>install</goal>
+            </goals>
+            <properties>
+                <maven.test.skip>true</maven.test.skip>
+            </properties>
+        </action>
+    </actions>
index 5573c6e26e2360bdfb2ac9d3b6c92b6f94d0be7a..ce9055c348e89781d625eaf361b3144c2265ad1e 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.collectionobject</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.collectionobject.client</artifactId>\r
-    <name>services.collectionobject.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.client</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>cspace-services-collectionobject-client</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-surefire-plugin</artifactId>\r
-                <configuration>\r
-                    <systemProperties>\r
-                        <property>\r
-                            <name>test-data.fileName</name>\r
-                            <value>${project.build.directory}/test-classes/test-data</value>\r
-                        </property>\r
-                    </systemProperties>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-        \r
-    </build>\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.collectionobject</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.collectionobject.client</artifactId>
+    <name>services.collectionobject.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.client</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>cspace-services-collectionobject-client</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemProperties>
+                        <property>
+                            <name>test-data.fileName</name>
+                            <value>${project.build.directory}/test-classes/test-data</value>
+                        </property>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+        </plugins>
+        
+    </build>
+</project>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index aa7b16f14e1662f9fc1baeae85e2faf3f2b9e689..1632ba3bde88183c34888f7b31f6879e83e3d9ed 100644 (file)
@@ -1,54 +1,54 @@
-\r
-<project name="collectionobject-install" default="install" basedir=".">\r
-    <description>\r
-        collectionobject service install\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="install" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing CollectionObject Service's &apos;install&apos; target." />\r
-                               </exec>\r
-        <copy todir="${jee.deploy.nuxeo.plugins}">\r
-            <fileset file="nuxeo/*.jar"/>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="config" description="" depends="install">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing CollectionObject Service's &apos;config&apos; target." />\r
-                               </exec>\r
-    </target>\r
-\r
-    <target name="predeploy" description="" depends="config">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing CollectionObject Service's &apos;predeploy&apos; target." />\r
-                               </exec>\r
-    </target>\r
-\r
-    <target name="deploy" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing CollectionObject Service's &apos;deploy&apos; target." />\r
-                               </exec>\r
-    </target>\r
-    \r
-    <target name="postdeploy" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing CollectionObject Service's &apos;init&apos; target." />\r
-                               </exec>         \r
-    </target>\r
-    \r
-\r
-</project>\r
+
+<project name="collectionobject-install" default="install" basedir=".">
+    <description>
+        collectionobject service install
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="install" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing CollectionObject Service's &apos;install&apos; target." />
+                               </exec>
+        <copy todir="${jee.deploy.nuxeo.plugins}">
+            <fileset file="nuxeo/*.jar"/>
+        </copy>
+    </target>
+
+    <target name="config" description="" depends="install">
+        <exec executable="echo">
+                       <arg value="Installer: Executing CollectionObject Service's &apos;config&apos; target." />
+                               </exec>
+    </target>
+
+    <target name="predeploy" description="" depends="config">
+        <exec executable="echo">
+                       <arg value="Installer: Executing CollectionObject Service's &apos;predeploy&apos; target." />
+                               </exec>
+    </target>
+
+    <target name="deploy" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing CollectionObject Service's &apos;deploy&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="postdeploy" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing CollectionObject Service's &apos;init&apos; target." />
+                               </exec>         
+    </target>
+    
+
+</project>
index 56774f27a83176dcaa0b61521265cb6a57d0ad49..e74b8634a8779da36b1a9d98b9d51bd76a177a0f 100644 (file)
@@ -1,20 +1,20 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services;\r
-\r
-/**\r
- * @author remillet\r
- *\r
- */\r
-public interface CollectionObjectJAXBSchema {\r
-       final static String OBJECT_NUMBER = "objectNumber";\r
-       final static String BRIEF_DESCRIPTION = "briefDescription";\r
-       final static String COMMENTS = "comments";\r
-       final static String DISTINGUISHING_FEATURES = "distinguishingFeatures";\r
-       final static String OBJECT_NAME = "objectName";\r
-       final static String RESPONSIBLE_DEPARTMENT = "responsibleDepartment";\r
-       final static String TITLE = "title";\r
-}\r
-\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services;
+
+/**
+ * @author remillet
+ *
+ */
+public interface CollectionObjectJAXBSchema {
+       final static String OBJECT_NUMBER = "objectNumber";
+       final static String BRIEF_DESCRIPTION = "briefDescription";
+       final static String COMMENTS = "comments";
+       final static String DISTINGUISHING_FEATURES = "distinguishingFeatures";
+       final static String OBJECT_NAME = "objectName";
+       final static String RESPONSIBLE_DEPARTMENT = "responsibleDepartment";
+       final static String TITLE = "title";
+}
+
+
index 165dcc53fd84ea11325b45f25d8f363e7d4b97f6..a392d9098359b0e39e9567f6ae2e479ec83bc61f 100644 (file)
@@ -1,12 +1,12 @@
-package org.collectionspace.services;\r
-\r
-public interface CollectionObjectListItemJAXBSchema {\r
-       final static String OBJECT_NUMBER = "objectNumber";\r
-       final static String OBJECT_NAME_LIST = "objectNameList";\r
-       final static String OBJECT_NAME = "objectName";\r
-        final static String TITLE_GROUP_LIST = "titleGroupList";\r
-       final static String TITLE = "title";\r
-       final static String RESPONSIBLE_DEPARTMENTS = "responsibleDepartments";\r
-       final static String CSID = "csid";\r
-       final static String URI = "url";\r
-}\r
+package org.collectionspace.services;
+
+public interface CollectionObjectListItemJAXBSchema {
+       final static String OBJECT_NUMBER = "objectNumber";
+       final static String OBJECT_NAME_LIST = "objectNameList";
+       final static String OBJECT_NAME = "objectName";
+        final static String TITLE_GROUP_LIST = "titleGroupList";
+       final static String TITLE = "title";
+       final static String RESPONSIBLE_DEPARTMENTS = "responsibleDepartments";
+       final static String CSID = "csid";
+       final static String URI = "url";
+}
index 458dbd0969b74487ee893682e8132829ae6efd7e..fffbf0fe6edb5b3214cafef82da9fe0866750667 100644 (file)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<actions>\r
-        <action>\r
-            <actionName>rebuild</actionName>\r
-            <packagings>\r
-                <packaging>*</packaging>\r
-            </packagings>\r
-            <goals>\r
-                <goal>clean</goal>\r
-                <goal>install</goal>\r
-            </goals>\r
-            <properties>\r
-                <maven.test.skip>true</maven.test.skip>\r
-            </properties>\r
-        </action>\r
-    </actions>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<actions>
+        <action>
+            <actionName>rebuild</actionName>
+            <packagings>
+                <packaging>*</packaging>
+            </packagings>
+            <goals>
+                <goal>clean</goal>
+                <goal>install</goal>
+            </goals>
+            <properties>
+                <maven.test.skip>true</maven.test.skip>
+            </properties>
+        </action>
+    </actions>
index b00f3e8c17cecdb522906ee21eaf72092384a7ba..b5fa272f87db4a0bed838de962c6201b7dd3f5d6 100644 (file)
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>        \r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.collectionobject</artifactId>\r
-    <name>services.collectionobject</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-    \r
-    <build>\r
-        <plugins>\r
-        </plugins>\r
-    </build>\r
-\r
-       <profiles>\r
-               <profile>\r
-                       <id>samples</id>\r
-           <modules>\r
-               <module>sample</module>\r
-           </modules>\r
-               </profile>\r
-       </profiles>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>        
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.collectionobject</artifactId>
+    <name>services.collectionobject</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+    
+    <build>
+        <plugins>
+        </plugins>
+    </build>
+
+       <profiles>
+               <profile>
+                       <id>samples</id>
+           <modules>
+               <module>sample</module>
+           </modules>
+               </profile>
+       </profiles>
+
+</project>
+
index ad5c57cd53d9532302f088bc1c1dc181d1953141..e526a471229e1318a3fc30268ce460a1dcf76690 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index 0b31a5792b96d68ece00d8d00a409fd4dce1cf47..da50f78610e314fc79fb2a1736e5cfb5f8694b97 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.collectionobject.client.samples</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.collectionobject.client.samples</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 18d3006a8a8779402200567e822eec9bcfd4f1dc..53e1798328cfdc8264c275819f134b7b12271c97 100644 (file)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.collectionobject.client.sample</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.jdt.core.javabuilder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.jdt.core.javanature</nature>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.collectionobject.client.sample</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 28b7c103e484864025c11cebd05e221a6735fde3..75c24cd418a49fcad07fd0ce7335f6055f117282 100644 (file)
@@ -1,6 +1,6 @@
-#url of the collectionspace server\r
-cspace.url=http://localhost:8180/cspace-services/\r
-cspace.ssl=false\r
-cspace.auth=true\r
-cspace.user=test\r
+#url of the collectionspace server
+cspace.url=http://localhost:8180/cspace-services/
+cspace.ssl=false
+cspace.auth=true
+cspace.user=test
 cspace.password=test
\ No newline at end of file
index 9d131b5cf8d71321eab5b1c083de0436aef7357b..ac44b0bf7cd580b6c37b9dd4055042ec04c02674 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.collectionobject</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.collectionobject.service</artifactId>\r
-    <name>services.collectionobject.service</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-<!-- CollectionSpace dependencies -->        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-<!-- External dependencies -->        \r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- apache -->\r
-        <dependency>\r
-            <groupId>commons-beanutils</groupId>\r
-            <artifactId>commons-beanutils</artifactId>\r
-            <version>1.6.1</version>\r
-        </dependency>\r
-        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->\r
-        <dependency>\r
-            <groupId>commons-logging</groupId>\r
-            <artifactId>commons-logging</artifactId>\r
-            <version>1.1</version>\r
-        </dependency>\r
-      <!-- javax -->\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-collectionobject</finalName>\r
-        <plugins>\r
-               <plugin>\r
-            <groupId>com.qmino</groupId>\r
-            <artifactId>miredot-maven-plugin</artifactId>\r
-            <version>1.3.1</version>\r
-            <executions>\r
-               <execution>\r
-                  <goals>\r
-                     <goal>restdoc</goal>\r
-                  </goals>\r
-               </execution>\r
-            </executions>\r
-            <configuration>\r
-                               <licence>\r
-                                       UHJvamVjdHxvcmcuY29sbGVjdGlvbnNwYWNlLnNlcnZpY2VzLm9yZy5jb2xsZWN0aW9uc3BhY2Uuc2VydmljZXMuY29sbGVjdGlvbm9iamVjdC5zZXJ2aWNlfDIwMTktMDItMjh8dHJ1ZSNNQ3dDRkdHK29EM2hWTVRyckIveDVaWExNcWRBNWhyL0FoUXo2bkVKV1k1NjdabnFBelh6UFdiOW1iRnVIdz09\r
-                               </licence>                <!-- insert other configuration here (optional) -->\r
-            </configuration>\r
-         </plugin>\r
-        </plugins>\r
-    </build>\r
-    \r
-    <pluginRepositories>\r
-      <pluginRepository>\r
-         <id>miredot</id>\r
-         <name>MireDot Releases</name>\r
-         <url>http://nexus.qmino.com/content/repositories/miredot</url>\r
-      </pluginRepository>\r
-   </pluginRepositories>\r
-    \r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.collectionobject</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.collectionobject.service</artifactId>
+    <name>services.collectionobject.service</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+<!-- CollectionSpace dependencies -->        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+<!-- External dependencies -->        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+        <!-- apache -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+        </dependency>
+      <!-- javax -->
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-collectionobject</finalName>
+        <plugins>
+               <plugin>
+            <groupId>com.qmino</groupId>
+            <artifactId>miredot-maven-plugin</artifactId>
+            <version>1.3.1</version>
+            <executions>
+               <execution>
+                  <goals>
+                     <goal>restdoc</goal>
+                  </goals>
+               </execution>
+            </executions>
+            <configuration>
+                               <licence>
+                                       UHJvamVjdHxvcmcuY29sbGVjdGlvbnNwYWNlLnNlcnZpY2VzLm9yZy5jb2xsZWN0aW9uc3BhY2Uuc2VydmljZXMuY29sbGVjdGlvbm9iamVjdC5zZXJ2aWNlfDIwMTktMDItMjh8dHJ1ZSNNQ3dDRkdHK29EM2hWTVRyckIveDVaWExNcWRBNWhyL0FoUXo2bkVKV1k1NjdabnFBelh6UFdiOW1iRnVIdz09
+                               </licence>                <!-- insert other configuration here (optional) -->
+            </configuration>
+         </plugin>
+        </plugins>
+    </build>
+    
+    <pluginRepositories>
+      <pluginRepository>
+         <id>miredot</id>
+         <name>MireDot Releases</name>
+         <url>http://nexus.qmino.com/content/repositories/miredot</url>
+      </pluginRepository>
+   </pluginRepositories>
+    
+</project>
+
index 289fcd5485bc60528585ba466b3df9da6e003b4d..5576004322b11f03ba0cb1a26a8267b2d9278bce 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- *//**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-/*\r
- * To change this template, choose Tools | Templates\r
- * and open the template in the editor.\r
- */\r
-package org.collectionspace.services.collectionobject.nuxeo;\r
-\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.collectionobject.CollectionobjectsCommon;\r
-//import org.collectionspace.services.common.context.MultipartServiceContext;\r
-//import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.InvalidDocumentException;\r
-import org.collectionspace.services.common.document.ValidatorHandlerImpl;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- *\r
- * @author \r
- */\r
-public class CollectionObjectValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut> {\r
-\r
-    final Logger logger = LoggerFactory.getLogger(CollectionObjectValidatorHandler.class);\r
-\r
-    //\r
-    // Error Strings\r
-    //\r
-    private static final String VALIDATION_ERROR = "The collection object record payload was invalid. See log file for more details.";\r
-    private static final String OBJECTNUMBER_NULL_ERROR = "The collection object field \"objectNumber\" cannot be empty or missing.";\r
-\r
-    @Override\r
-    protected Class<?> getCommonPartClass() {\r
-       return CollectionobjectsCommon.class;\r
-    }\r
-    \r
-       @Override\r
-       protected void handleGet(){\r
-               // TODO Auto-generated method stub\r
-               \r
-       }\r
-\r
-       @Override\r
-       protected void handleGetAll() {\r
-               // TODO Auto-generated method stub\r
-               \r
-       }\r
-\r
-       @Override\r
-       protected void handleUpdate()\r
-                       throws InvalidDocumentException {\r
-       try {\r
-            CollectionobjectsCommon co = (CollectionobjectsCommon) getCommonPart();\r
-            validateCollectionobjectsCommon(co);                        \r
-       } catch (AssertionError e) {\r
-               if (logger.isErrorEnabled() == true) {\r
-                       logger.error(e.getMessage(), e);\r
-               }\r
-               throw new InvalidDocumentException(VALIDATION_ERROR, e);\r
-       }\r
-       }\r
-\r
-       @Override\r
-       protected void handleDelete() {\r
-               // TODO Auto-generated method stub\r
-               \r
-       }\r
-    \r
-    @Override\r
-    protected void handleCreate()\r
-               throws InvalidDocumentException {\r
-       try {\r
-            CollectionobjectsCommon co = (CollectionobjectsCommon) getCommonPart();\r
-            validateCollectionobjectsCommon(co);                        \r
-       } catch (AssertionError e) {\r
-               if (logger.isErrorEnabled() == true) {\r
-                       logger.error(e.getMessage(), e);\r
-               }\r
-               throw new InvalidDocumentException(VALIDATION_ERROR, e);\r
-       }\r
-    }\r
-    \r
-    //\r
-    // Private Methods\r
-    //    \r
-    private void validateCollectionobjectsCommon(CollectionobjectsCommon co) throws AssertionError {\r
-       CS_ASSERT(co != null);\r
-        String objectNumber = co.getObjectNumber();\r
-        CS_ASSERT(objectNumber != null);\r
-        CS_ASSERT(objectNumber.isEmpty() == false, OBJECTNUMBER_NULL_ERROR);\r
-\r
-    }\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *//**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.collectionspace.services.collectionobject.nuxeo;
+
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
+//import org.collectionspace.services.common.context.MultipartServiceContext;
+//import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandlerImpl;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author 
+ */
+public class CollectionObjectValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut> {
+
+    final Logger logger = LoggerFactory.getLogger(CollectionObjectValidatorHandler.class);
+
+    //
+    // Error Strings
+    //
+    private static final String VALIDATION_ERROR = "The collection object record payload was invalid. See log file for more details.";
+    private static final String OBJECTNUMBER_NULL_ERROR = "The collection object field \"objectNumber\" cannot be empty or missing.";
+
+    @Override
+    protected Class<?> getCommonPartClass() {
+       return CollectionobjectsCommon.class;
+    }
+    
+       @Override
+       protected void handleGet(){
+               // TODO Auto-generated method stub
+               
+       }
+
+       @Override
+       protected void handleGetAll() {
+               // TODO Auto-generated method stub
+               
+       }
+
+       @Override
+       protected void handleUpdate()
+                       throws InvalidDocumentException {
+       try {
+            CollectionobjectsCommon co = (CollectionobjectsCommon) getCommonPart();
+            validateCollectionobjectsCommon(co);                        
+       } catch (AssertionError e) {
+               if (logger.isErrorEnabled() == true) {
+                       logger.error(e.getMessage(), e);
+               }
+               throw new InvalidDocumentException(VALIDATION_ERROR, e);
+       }
+       }
+
+       @Override
+       protected void handleDelete() {
+               // TODO Auto-generated method stub
+               
+       }
+    
+    @Override
+    protected void handleCreate()
+               throws InvalidDocumentException {
+       try {
+            CollectionobjectsCommon co = (CollectionobjectsCommon) getCommonPart();
+            validateCollectionobjectsCommon(co);                        
+       } catch (AssertionError e) {
+               if (logger.isErrorEnabled() == true) {
+                       logger.error(e.getMessage(), e);
+               }
+               throw new InvalidDocumentException(VALIDATION_ERROR, e);
+       }
+    }
+    
+    //
+    // Private Methods
+    //    
+    private void validateCollectionobjectsCommon(CollectionobjectsCommon co) throws AssertionError {
+       CS_ASSERT(co != null);
+        String objectNumber = co.getObjectNumber();
+        CS_ASSERT(objectNumber != null);
+        CS_ASSERT(objectNumber.isEmpty() == false, OBJECTNUMBER_NULL_ERROR);
+
+    }
+}
index 3e69acd1217cedfdc212e9b265564c67ed212829..3a550afd87a9477a0c41f700cc1076e379897419 100644 (file)
@@ -1,42 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.common-api</artifactId>\r
-    <name>services.common-api</name>\r
-    <packaging>jar</packaging>\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- Required for XPath processing using dom4j in XmlTools class -->\r
-        <dependency>\r
-            <groupId>jaxen</groupId>\r
-            <artifactId>jaxen</artifactId>\r
-            <version>1.1.1</version>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.common-api</artifactId>
+    <name>services.common-api</name>
+    <packaging>jar</packaging>
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- Required for XPath processing using dom4j in XmlTools class -->
+        <dependency>
+            <groupId>jaxen</groupId>
+            <artifactId>jaxen</artifactId>
+            <version>1.1.1</version>
+        </dependency>
+
+    </dependencies>
+
+</project>
+
index fffc22727b4ba35aecbbe0adff5dbbdf7316896e..0e8819ff5a306ec735e99481e77b213fd67fa53e 100644 (file)
@@ -1,23 +1,23 @@
-package org.collectionspace.services.common.api;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class CommonAPI {\r
-    public static final String COMMON_API = "services common api version 1";\r
-    public static String getVersionString(){\r
-        return COMMON_API;\r
-    }\r
-    public static String AuthorityItemCSID_REPLACE="${itemCSID}";\r
-\r
-    public static String showRelations_QP = "showRelations";\r
-    public static String showSiblings_QP = "showSiblings";\r
-    public static String showAllRelations_QP = "showAllRelations";\r
-    \r
-       public static final String GENERATE_BUNDLES = "core";\r
-       public static final String GENERATE_BINDINGS = "delta";\r
-\r
-}\r
-\r
+package org.collectionspace.services.common.api;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class CommonAPI {
+    public static final String COMMON_API = "services common api version 1";
+    public static String getVersionString(){
+        return COMMON_API;
+    }
+    public static String AuthorityItemCSID_REPLACE="${itemCSID}";
+
+    public static String showRelations_QP = "showRelations";
+    public static String showSiblings_QP = "showSiblings";
+    public static String showAllRelations_QP = "showAllRelations";
+    
+       public static final String GENERATE_BUNDLES = "core";
+       public static final String GENERATE_BINDINGS = "delta";
+
+}
+
index b7d65957ec99693088cd4e36aede3eec790c61e5..a22218542d27c02b1e531cd8b2b12523357e7ae3 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common.api;\r
-\r
-//  This class is designed to avoid dependencies, so it does not include logging, or apache commons.\r
-//  There is another cspace utility class, called\r
-//       org.collectionspace.services.common.FileUtils\r
-//  albeit with different functions, which does have dependencies.\r
-\r
-import java.io.*;\r
-import java.nio.charset.Charset;\r
-import java.nio.file.Files;\r
-import java.nio.file.Path;\r
-import java.nio.file.Paths;\r
-import java.nio.file.StandardOpenOption;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import java.util.UUID;\r
-\r
-import javax.xml.bind.JAXBContext;\r
-import javax.xml.bind.Unmarshaller;\r
-\r
-/**\r
- * @author Laramie Crocker\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class FileTools {\r
-    \r
-    public static String DEFAULT_ENCODING = "";\r
-    public static String UTF8_ENCODING = "UTF-8";\r
-    public static Charset UTF8_CHARSET = java.nio.charset.StandardCharsets.UTF_8;\r
-    public static boolean FORCE_CREATE_PARENT_DIRS = true;\r
-    private static String JAVA_TEMP_DIR_PROPERTY = "java.io.tmpdir";\r
-\r
-    /**\r
-     * getObjectFromStream get object of given class from given inputstream\r
-     * @param jaxbClass\r
-     * @param is stream to read to construct the object\r
-     * @return\r
-     * @throws Exception\r
-     */\r
-    static protected Object getObjectFromStream(Class<?> jaxbClass, InputStream is) throws Exception {\r
-        JAXBContext context = JAXBContext.newInstance(jaxbClass);\r
-        Unmarshaller unmarshaller = context.createUnmarshaller();\r
-        //note: setting schema to null will turn validator off\r
-        unmarshaller.setSchema(null);\r
-        return jaxbClass.cast(unmarshaller.unmarshal(is));\r
-    }\r
-\r
-    static public Object getJaxbObjectFromFile(Class<?> jaxbClass, String fileName)\r
-            throws Exception {\r
-\r
-        JAXBContext context = JAXBContext.newInstance(jaxbClass);\r
-        Unmarshaller unmarshaller = context.createUnmarshaller();\r
-        //note: setting schema to null will turn validator off\r
-        unmarshaller.setSchema(null);\r
-        ClassLoader tccl = Thread.currentThread().getContextClassLoader();\r
-        InputStream is = tccl.getResourceAsStream(fileName);\r
-        return getObjectFromStream(jaxbClass, is);\r
-    }\r
-\r
-       public static String convertStreamToString(InputStream is) {\r
-               /*\r
-                * To convert the InputStream to String we use the\r
-                * Reader.read(char[] buffer) method. We iterate until the\r
-                * Reader return -1 which means there's no more data to\r
-                * read. We use the StringWriter class to produce the string.\r
-                */\r
-               if (is != null) {\r
-                       Writer writer = new StringWriter();\r
-\r
-                       char[] buffer = new char[1024];\r
-                       try {\r
-                               Reader reader = new BufferedReader(\r
-                                               new InputStreamReader(is, "UTF-8"));\r
-                               int n;\r
-                               while ((n = reader.read(buffer)) != -1) {\r
-                                       writer.write(buffer, 0, n);\r
-                               }\r
-                       } catch (IOException e) {\r
-                               // TODO Auto-generated catch block\r
-                               e.printStackTrace();\r
-                       } finally {\r
-                               try {\r
-                                       is.close();\r
-                               } catch (IOException e) {\r
-                                       // TODO Auto-generated catch block\r
-                                       e.printStackTrace();\r
-                               }\r
-                       }\r
-                       return writer.toString();\r
-               } else {       \r
-                       return "";\r
-               }\r
-       }\r
-       \r
-    public static void forceParentDirectories(String filename) throws IOException {\r
-        File theFile = new File(filename);\r
-        String parent = theFile.getParent();\r
-        if (parent != null){\r
-            File p = new File(parent);\r
-            p.mkdirs();\r
-            System.out.println("Making directory: "+p.getCanonicalPath());\r
-        }\r
-    }\r
-\r
-    public static boolean copyFile(String sourceFileName, String destFileName, boolean forceParentDirs) throws IOException {\r
-        if (sourceFileName == null || destFileName == null)\r
-            return false;\r
-        if (sourceFileName.equals(destFileName))\r
-            return false;\r
-        if (forceParentDirs)\r
-            forceParentDirectories(destFileName);\r
-        try{\r
-            java.io.FileInputStream in = new java.io.FileInputStream(sourceFileName);\r
-            java.io.FileOutputStream out = new java.io.FileOutputStream(destFileName);\r
-            try {\r
-                byte[] buf = new byte[31000];\r
-                int read = in.read(buf);\r
-                while (read > -1){\r
-                    out.write(buf, 0, read);\r
-                    read = in.read(buf);\r
-                }\r
-            } finally {\r
-                in.close();\r
-                out.close();\r
-            }\r
-        } catch (Exception e) {\r
-            System.out.println(e.toString());\r
-            return false;\r
-        }\r
-        return true;\r
-    }\r
-\r
-    public static String readFile(String dir, String relPath){\r
-        File theFile = new File(dir, relPath);\r
-        return readFile(theFile);\r
-\r
-    }\r
-    \r
-    public static String readFile(File theFile){\r
-        try {\r
-            FileInputStream fis = new FileInputStream(theFile);\r
-            byte[] theData = new byte[(int) theFile.length()];\r
-            // need to check the number of bytes read here\r
-            int howmany = fis.read(theData);\r
-            if (howmany != theData.length){\r
-                System.out.println("ERROR: Couldn't read all of stream!  filesize: "+theData.length+"  read: "+howmany);\r
-            }\r
-            fis.close();\r
-            return new String(theData);\r
-        } catch (Exception e) {  // can't find the file\r
-            System.out.println("ERROR: "+e);\r
-            return null;\r
-        }\r
-    }\r
-    \r
-    public static List<String> readFileAsLines(String filePath) {\r
-        List<String> lines = new ArrayList<String>();\r
-        try {\r
-            Path path = Paths.get(filePath);\r
-            lines = Files.readAllLines(path, UTF8_CHARSET);\r
-        } catch (Exception e) {\r
-            System.out.println("ERROR: " + e);\r
-            return null;\r
-        }\r
-        return lines;\r
-    }\r
-    \r
-    public static void writeFileFromLines(String filePath, Iterable<? extends CharSequence> lines) {\r
-        try {\r
-            Path path = Paths.get(filePath);\r
-            Files.write(path, lines, UTF8_CHARSET, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);\r
-        } catch (Exception e) {\r
-            System.out.println("ERROR: " + e);\r
-        }\r
-    }\r
-\r
-    public static File saveFile(String dir, String relativeName, String content, boolean forceParentDirs) {\r
-        return saveFile(dir, relativeName, content, forceParentDirs, DEFAULT_ENCODING);\r
-    }\r
-    \r
-    public static File saveFile(String dir, String relativeName, String content, boolean forceParentDirs, String encoding) {\r
-        File result = null;\r
-        PrintWriter writer;\r
-        try{\r
-            if (forceParentDirs) forceParentDirectories(dir+'/'+relativeName);\r
-            result = new File(dir,relativeName);\r
-            if (Tools.notBlank(encoding)) {\r
-                writer = new PrintWriter(result, encoding);\r
-            } else {\r
-                writer = new PrintWriter(result);\r
-            }\r
-        }catch (Exception e){\r
-            System.out.println("Can't write to file in FileTools.saveFile: " + relativeName + " :: " + e);\r
-            return null;\r
-        }\r
-        writer.write(content);\r
-        writer.close();\r
-        return result;\r
-    }\r
-\r
-    // FIXME: Java 7 now offers an integral method for this purpose,\r
-    // java.nio.file.Files.createTempDirectory()\r
-    public static File createTmpDir(String filePrefix){\r
-        String tmpDir = System.getProperty(JAVA_TEMP_DIR_PROPERTY);\r
-               File result = new File(tmpDir, filePrefix + UUID.randomUUID().toString());\r
-               return result;\r
-    }\r
-    \r
-    /**\r
-     * Returns information about the Java temporary directory,\r
-     * including its path and selected access rights of the\r
-     * current code to that directory.\r
-     * \r
-     * This can potentially be helpful when troubleshooting issues\r
-     * related to code that uses that temporary directory, as per CSPACE-5766.\r
-     * \r
-     * @return information about the Java temporary directory.\r
-     */\r
-    public static String getJavaTmpDirInfo() {\r
-        StringBuffer strBuf = new StringBuffer("");\r
-        String tmpDirProperty = System.getProperty(JAVA_TEMP_DIR_PROPERTY);\r
-        strBuf.append("\n");\r
-        if (Tools.notBlank(tmpDirProperty)) {\r
-            strBuf.append("Java temporary directory property=");\r
-            strBuf.append(tmpDirProperty);\r
-            strBuf.append("\n");\r
-        } else {\r
-            strBuf.append("Could not get Java temporary directory property");\r
-            strBuf.append("\n");\r
-            return strBuf.toString();\r
-        }\r
-        File tmpDir = new File(tmpDirProperty); // Throws only NPE, if tmpDirProperty is null\r
-        boolean tmpDirExists = false;\r
-        boolean tmpDirIsDirectory = false;\r
-        try {\r
-            tmpDirExists = tmpDir.exists();\r
-            strBuf.append("Temporary directory exists=");\r
-            strBuf.append(tmpDirExists);\r
-            strBuf.append("\n");\r
-            tmpDirIsDirectory = tmpDir.isDirectory();\r
-            strBuf.append("Temporary directory is actually a directory=");\r
-            strBuf.append(tmpDirIsDirectory);\r
-            strBuf.append("\n");           \r
-        } catch (SecurityException se) {\r
-            strBuf.append("Security manager settings prohibit reading temporary directory: ");\r
-            strBuf.append(se.getMessage());\r
-            strBuf.append("\n");\r
-            return strBuf.toString();\r
-        }\r
-        if (tmpDirExists && tmpDirIsDirectory) {\r
-            try {\r
-                boolean tmpDirIsWriteable = tmpDir.canWrite();\r
-                strBuf.append("Temporary directory is writeable by application=");\r
-                strBuf.append(tmpDirIsWriteable);\r
-            } catch (SecurityException se) {\r
-                strBuf.append("Security manager settings prohibit writing to temporary directory: ");\r
-                strBuf.append(se.getMessage());\r
-           }           \r
-        }\r
-        return strBuf.toString();\r
-    }\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common.api;
+
+//  This class is designed to avoid dependencies, so it does not include logging, or apache commons.
+//  There is another cspace utility class, called
+//       org.collectionspace.services.common.FileUtils
+//  albeit with different functions, which does have dependencies.
+
+import java.io.*;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+
+/**
+ * @author Laramie Crocker
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class FileTools {
+    
+    public static String DEFAULT_ENCODING = "";
+    public static String UTF8_ENCODING = "UTF-8";
+    public static Charset UTF8_CHARSET = java.nio.charset.StandardCharsets.UTF_8;
+    public static boolean FORCE_CREATE_PARENT_DIRS = true;
+    private static String JAVA_TEMP_DIR_PROPERTY = "java.io.tmpdir";
+
+    /**
+     * getObjectFromStream get object of given class from given inputstream
+     * @param jaxbClass
+     * @param is stream to read to construct the object
+     * @return
+     * @throws Exception
+     */
+    static protected Object getObjectFromStream(Class<?> jaxbClass, InputStream is) throws Exception {
+        JAXBContext context = JAXBContext.newInstance(jaxbClass);
+        Unmarshaller unmarshaller = context.createUnmarshaller();
+        //note: setting schema to null will turn validator off
+        unmarshaller.setSchema(null);
+        return jaxbClass.cast(unmarshaller.unmarshal(is));
+    }
+
+    static public Object getJaxbObjectFromFile(Class<?> jaxbClass, String fileName)
+            throws Exception {
+
+        JAXBContext context = JAXBContext.newInstance(jaxbClass);
+        Unmarshaller unmarshaller = context.createUnmarshaller();
+        //note: setting schema to null will turn validator off
+        unmarshaller.setSchema(null);
+        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+        InputStream is = tccl.getResourceAsStream(fileName);
+        return getObjectFromStream(jaxbClass, is);
+    }
+
+       public static String convertStreamToString(InputStream is) {
+               /*
+                * To convert the InputStream to String we use the
+                * Reader.read(char[] buffer) method. We iterate until the
+                * Reader return -1 which means there's no more data to
+                * read. We use the StringWriter class to produce the string.
+                */
+               if (is != null) {
+                       Writer writer = new StringWriter();
+
+                       char[] buffer = new char[1024];
+                       try {
+                               Reader reader = new BufferedReader(
+                                               new InputStreamReader(is, "UTF-8"));
+                               int n;
+                               while ((n = reader.read(buffer)) != -1) {
+                                       writer.write(buffer, 0, n);
+                               }
+                       } catch (IOException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       } finally {
+                               try {
+                                       is.close();
+                               } catch (IOException e) {
+                                       // TODO Auto-generated catch block
+                                       e.printStackTrace();
+                               }
+                       }
+                       return writer.toString();
+               } else {       
+                       return "";
+               }
+       }
+       
+    public static void forceParentDirectories(String filename) throws IOException {
+        File theFile = new File(filename);
+        String parent = theFile.getParent();
+        if (parent != null){
+            File p = new File(parent);
+            p.mkdirs();
+            System.out.println("Making directory: "+p.getCanonicalPath());
+        }
+    }
+
+    public static boolean copyFile(String sourceFileName, String destFileName, boolean forceParentDirs) throws IOException {
+        if (sourceFileName == null || destFileName == null)
+            return false;
+        if (sourceFileName.equals(destFileName))
+            return false;
+        if (forceParentDirs)
+            forceParentDirectories(destFileName);
+        try{
+            java.io.FileInputStream in = new java.io.FileInputStream(sourceFileName);
+            java.io.FileOutputStream out = new java.io.FileOutputStream(destFileName);
+            try {
+                byte[] buf = new byte[31000];
+                int read = in.read(buf);
+                while (read > -1){
+                    out.write(buf, 0, read);
+                    read = in.read(buf);
+                }
+            } finally {
+                in.close();
+                out.close();
+            }
+        } catch (Exception e) {
+            System.out.println(e.toString());
+            return false;
+        }
+        return true;
+    }
+
+    public static String readFile(String dir, String relPath){
+        File theFile = new File(dir, relPath);
+        return readFile(theFile);
+
+    }
+    
+    public static String readFile(File theFile){
+        try {
+            FileInputStream fis = new FileInputStream(theFile);
+            byte[] theData = new byte[(int) theFile.length()];
+            // need to check the number of bytes read here
+            int howmany = fis.read(theData);
+            if (howmany != theData.length){
+                System.out.println("ERROR: Couldn't read all of stream!  filesize: "+theData.length+"  read: "+howmany);
+            }
+            fis.close();
+            return new String(theData);
+        } catch (Exception e) {  // can't find the file
+            System.out.println("ERROR: "+e);
+            return null;
+        }
+    }
+    
+    public static List<String> readFileAsLines(String filePath) {
+        List<String> lines = new ArrayList<String>();
+        try {
+            Path path = Paths.get(filePath);
+            lines = Files.readAllLines(path, UTF8_CHARSET);
+        } catch (Exception e) {
+            System.out.println("ERROR: " + e);
+            return null;
+        }
+        return lines;
+    }
+    
+    public static void writeFileFromLines(String filePath, Iterable<? extends CharSequence> lines) {
+        try {
+            Path path = Paths.get(filePath);
+            Files.write(path, lines, UTF8_CHARSET, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
+        } catch (Exception e) {
+            System.out.println("ERROR: " + e);
+        }
+    }
+
+    public static File saveFile(String dir, String relativeName, String content, boolean forceParentDirs) {
+        return saveFile(dir, relativeName, content, forceParentDirs, DEFAULT_ENCODING);
+    }
+    
+    public static File saveFile(String dir, String relativeName, String content, boolean forceParentDirs, String encoding) {
+        File result = null;
+        PrintWriter writer;
+        try{
+            if (forceParentDirs) forceParentDirectories(dir+'/'+relativeName);
+            result = new File(dir,relativeName);
+            if (Tools.notBlank(encoding)) {
+                writer = new PrintWriter(result, encoding);
+            } else {
+                writer = new PrintWriter(result);
+            }
+        }catch (Exception e){
+            System.out.println("Can't write to file in FileTools.saveFile: " + relativeName + " :: " + e);
+            return null;
+        }
+        writer.write(content);
+        writer.close();
+        return result;
+    }
+
+    // FIXME: Java 7 now offers an integral method for this purpose,
+    // java.nio.file.Files.createTempDirectory()
+    public static File createTmpDir(String filePrefix){
+        String tmpDir = System.getProperty(JAVA_TEMP_DIR_PROPERTY);
+               File result = new File(tmpDir, filePrefix + UUID.randomUUID().toString());
+               return result;
+    }
+    
+    /**
+     * Returns information about the Java temporary directory,
+     * including its path and selected access rights of the
+     * current code to that directory.
+     * 
+     * This can potentially be helpful when troubleshooting issues
+     * related to code that uses that temporary directory, as per CSPACE-5766.
+     * 
+     * @return information about the Java temporary directory.
+     */
+    public static String getJavaTmpDirInfo() {
+        StringBuffer strBuf = new StringBuffer("");
+        String tmpDirProperty = System.getProperty(JAVA_TEMP_DIR_PROPERTY);
+        strBuf.append("\n");
+        if (Tools.notBlank(tmpDirProperty)) {
+            strBuf.append("Java temporary directory property=");
+            strBuf.append(tmpDirProperty);
+            strBuf.append("\n");
+        } else {
+            strBuf.append("Could not get Java temporary directory property");
+            strBuf.append("\n");
+            return strBuf.toString();
+        }
+        File tmpDir = new File(tmpDirProperty); // Throws only NPE, if tmpDirProperty is null
+        boolean tmpDirExists = false;
+        boolean tmpDirIsDirectory = false;
+        try {
+            tmpDirExists = tmpDir.exists();
+            strBuf.append("Temporary directory exists=");
+            strBuf.append(tmpDirExists);
+            strBuf.append("\n");
+            tmpDirIsDirectory = tmpDir.isDirectory();
+            strBuf.append("Temporary directory is actually a directory=");
+            strBuf.append(tmpDirIsDirectory);
+            strBuf.append("\n");           
+        } catch (SecurityException se) {
+            strBuf.append("Security manager settings prohibit reading temporary directory: ");
+            strBuf.append(se.getMessage());
+            strBuf.append("\n");
+            return strBuf.toString();
+        }
+        if (tmpDirExists && tmpDirIsDirectory) {
+            try {
+                boolean tmpDirIsWriteable = tmpDir.canWrite();
+                strBuf.append("Temporary directory is writeable by application=");
+                strBuf.append(tmpDirIsWriteable);
+            } catch (SecurityException se) {
+                strBuf.append("Security manager settings prohibit writing to temporary directory: ");
+                strBuf.append(se.getMessage());
+           }           
+        }
+        return strBuf.toString();
+    }
+}
index dd03e1b3194f64afef1f789e5507a9fbc147e683..54b34ac21d870af2662db5b41683259405a4f94d 100644 (file)
-package org.collectionspace.services.common.api;\r
-\r
-import org.collectionspace.services.common.api.RefNameUtils.AuthorityInfo;\r
-import org.collectionspace.services.common.api.RefNameUtils.AuthorityTermInfo;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * Usage for this class, if you have a URN and would like to get at its fields,\r
- * is to call one of these methods:\r
- *\r
- * RefName.AuthorityItem item =\r
- * RefName.AuthorityItem.parse(RefName.AUTHORITY_ITEM_EXAMPLE); or\r
- * RefName.Authority authority =\r
- * RefName.Authority.parse(RefName.AUTHORITY_EXAMPLE);\r
- *\r
- * From the object returned, you may set/get any of the public fields.\r
- *\r
- * If you want to format a string urn, then you need to construct either a\r
- * RefName.AuthorityItem or RefName.Authority. You can parse a URN to do so, as\r
- * shown above, or you can construct one with a constructor, setting its fields\r
- * afterwards. A better way is to use one of the build*() methods on this class:\r
- *\r
- * RefName.Authority authority2 = RefName.buildAuthority(tenantName,\r
- * serviceName, authorityShortIdentifier, authorityDisplayName);\r
- *\r
- * RefName.AuthorityItem item2 = RefName.buildAuthorityItem(authority2,\r
- * RefName.EX_itemShortIdentifier, RefName.EX_itemDisplayName);\r
- *\r
- * Note that authority2 is an object, not a String, and is passed in to\r
- * RefName.buildAuthorityItem().\r
- *\r
- * Then simply call toString() on the object:\r
- *\r
- * String authorityURN = authority2.toString();\r
- *\r
- * String itemURN = item2.toString();\r
- *\r
- * These test cases are kept up-to-date in\r
- *\r
- * org.collectionspace.services.common.api.test.RefNameTest\r
- *\r
- * User: laramie\r
- */\r
-public class RefName {\r
-\r
-    /**\r
-     * The logger.\r
-     */\r
-    private static final Logger logger = LoggerFactory.getLogger(RefName.class);\r
-    public static final String URN_PREFIX = "urn:cspace:";\r
-    public static final String URN_NAME_PREFIX = "urn:cspace:name";\r
-    public static final String REFNAME = "refName";\r
-    \r
-    public static interface RefNameInterface {\r
-       public String toString();\r
-    }\r
-\r
-    public static class Authority implements RefNameInterface {\r
-\r
-        public String tenantName = "";\r
-        public String resource = "";\r
-        public String csid = null;\r
-        public String shortIdentifier = null;\r
-        public String displayName = "";\r
-\r
-        public static Authority parse(String urn) {\r
-            Authority authority;\r
-            try {\r
-                RefNameUtils.AuthorityInfo authorityInfo =\r
-                        RefNameUtils.parseAuthorityInfo(urn);\r
-                authority = authorityFromAuthorityInfo(authorityInfo, true);\r
-            } catch (IllegalArgumentException iae) {\r
-                return null;\r
-            }\r
-            return authority;\r
-        }\r
-\r
-        public String getDisplayName() {\r
-               return this.getDisplayName();\r
-        }\r
-        \r
-        public String getShortIdentifier() {\r
-            return this.shortIdentifier;\r
-        }\r
-\r
-        public String getCSID() {\r
-            return this.csid;\r
-        }\r
-\r
-        public boolean equals(Object other) {\r
-            if (other == null) {\r
-                return false;\r
-            }\r
-            if (other instanceof Authority) {\r
-                Authority ao = (Authority) other;\r
-                return (this.tenantName.equals(ao.tenantName)\r
-                        && this.resource.equals(ao.resource)\r
-                        && ((this.shortIdentifier != null &&\r
-                               this.shortIdentifier.equals(ao.shortIdentifier))\r
-                        || (this.csid != null && this.csid.equals(ao.csid))));\r
-            } else {\r
-                return false;\r
-            }\r
-        }\r
-\r
-        public String getRelativeUri() {\r
-               StringBuilder sb = new StringBuilder();\r
-               sb.append("/");\r
-               sb.append(resource);\r
-               sb.append("/");\r
-               if(csid!=null) {\r
-               sb.append(csid);\r
-               } else if(shortIdentifier!= null) {\r
-               sb.append(URN_NAME_PREFIX);\r
-               sb.append("(");\r
-               sb.append(shortIdentifier);\r
-               sb.append(")");\r
-               } else {\r
-                       throw new NullPointerException("Authority has neither CSID nor shortID!");\r
-               }\r
-            return sb.toString();\r
-        }\r
-\r
-        public String toString() {\r
-            String displaySuffix = (displayName != null && (!displayName.isEmpty())) ? '\'' + displayName + '\'' : "";\r
-            //return URN_PREFIX + tenantName + ':' + resource + ":" + "name" + "(" + shortIdentifier + ")" + displaySuffix;\r
-               StringBuilder sb = new StringBuilder();\r
-               sb.append(URN_PREFIX);\r
-               sb.append(tenantName);\r
-               sb.append(RefNameUtils.SEPARATOR);\r
-               sb.append(resource);\r
-               sb.append(RefNameUtils.SEPARATOR);\r
-               if(csid!=null) {\r
-               sb.append(RefNameUtils.ID_SPECIFIER);\r
-               sb.append("(");\r
-               sb.append(csid);\r
-               sb.append(")");\r
-               } else if(shortIdentifier!= null) {\r
-               sb.append(RefNameUtils.NAME_SPECIFIER);\r
-               sb.append("(");\r
-               sb.append(shortIdentifier);\r
-               sb.append(")");\r
-               } else {\r
-                       throw new NullPointerException("Authority has neither CSID nor shortID!");\r
-               }\r
-               sb.append(displaySuffix);\r
-            return sb.toString();\r
-        }\r
-\r
-        public static Authority buildAuthority(\r
-                       String tenantName, \r
-                       String serviceName, \r
-                       String csid, \r
-                       String authorityShortIdentifier, \r
-                       String authorityDisplayName) {\r
-            Authority authority = new Authority();\r
-            authority.tenantName = tenantName;\r
-            authority.resource = serviceName;\r
-            if (Tools.notEmpty(authority.resource)) {\r
-                authority.resource = authority.resource.toLowerCase();\r
-            }\r
-            authority.csid = csid;\r
-            authority.shortIdentifier = authorityShortIdentifier;\r
-            authority.displayName = authorityDisplayName;\r
-            return authority;\r
-        }\r
-    }\r
-\r
-    public static class AuthorityItem implements RefNameInterface {\r
-\r
-        public Authority inAuthority;\r
-        public String shortIdentifier = "";\r
-        public String displayName = "";\r
-\r
-        public static AuthorityItem parse(String urn) {\r
-            AuthorityItem authorityItem = null;\r
-            try {\r
-                RefNameUtils.AuthorityTermInfo termInfo =\r
-                        RefNameUtils.parseAuthorityTermInfo(urn);\r
-                authorityItem = authorityItemFromTermInfo(termInfo);\r
-            } catch (IllegalArgumentException iae) {\r
-                return null;\r
-            }\r
-            return authorityItem;\r
-        }\r
-\r
-        public String getDisplayName() {\r
-               return this.displayName;\r
-        }\r
-        \r
-        public String getParentShortIdentifier() {\r
-            return this.inAuthority.shortIdentifier;\r
-        }\r
-\r
-        public String getShortIdentifier() {\r
-            return this.shortIdentifier;\r
-        }\r
-\r
-        public boolean equals(Object other) {\r
-            if (other == null) {\r
-                return false;\r
-            }\r
-            if (other instanceof AuthorityItem) {\r
-                AuthorityItem aio = (AuthorityItem) other;\r
-                boolean ok = true;\r
-                ok = ok && aio.inAuthority != null;\r
-                ok = ok && aio.inAuthority.equals(this.inAuthority);\r
-                ok = ok && aio.shortIdentifier.equals(this.shortIdentifier);\r
-                ok = ok && aio.displayName.equals(this.displayName);\r
-                return ok;\r
-            } else {\r
-                return false;\r
-            }\r
-        }\r
-\r
-        public String getRelativeUri() {\r
-            return inAuthority.getRelativeUri() + "/items/" + URN_NAME_PREFIX + "(" + shortIdentifier + ")";\r
-        }\r
-\r
-        public String toString() {\r
-            String displaySuffix = (displayName != null && (!displayName.isEmpty())) ? '\'' + displayName + '\'' : "";\r
-            Authority ai = inAuthority;\r
-            if (ai == null) {\r
-                return URN_PREFIX + "ERROR:inAuthorityNotSet: (" + shortIdentifier + ")" + displaySuffix;\r
-            } else {\r
-                String base = URN_PREFIX + ai.tenantName + ':' + ai.resource + ":" + "name" + "(" + ai.shortIdentifier + ")";\r
-                String refname = base + ":item:name(" + shortIdentifier + ")" + displaySuffix;\r
-                return refname;\r
-            }\r
-        }\r
-    }\r
-\r
-    public static AuthorityItem buildAuthorityItem(String tenantName, String serviceName, String authorityShortID,\r
-            String itemShortID, String itemDisplayName) {\r
-        Authority authority = Authority.buildAuthority(tenantName, serviceName, null, authorityShortID, "");\r
-        return buildAuthorityItem(authority, itemShortID, itemDisplayName);\r
-    }\r
-\r
-    public static AuthorityItem buildAuthorityItem(String authorityRefName, String itemShortID, String itemDisplayName) {\r
-        Authority authority = Authority.parse(authorityRefName);\r
-        AuthorityItem item = buildAuthorityItem(authority, itemShortID, itemDisplayName);\r
-        return item;\r
-    }\r
-\r
-    public static AuthorityItem buildAuthorityItem(Authority authority, String itemShortID, String itemDisplayName) {\r
-        AuthorityItem item = new AuthorityItem();\r
-        item.inAuthority = authority;\r
-        item.shortIdentifier = itemShortID;\r
-        item.displayName = itemDisplayName;\r
-        return item;\r
-    }\r
-\r
-    /**\r
-     * Use this method to avoid formatting any urn's outside of this unit;\r
-     * Caller passes in a shortId, such as "TestAuthority", and method returns\r
-     * the correct urn path element, without any path delimiters such as '/' so\r
-     * that calling shortIdToPath("TestAuthority") returns\r
-     * "urn:cspace:name(TestAuthority)", and then this value may be put into a\r
-     * path, such as "/personauthorities/urn:cspace:name(TestAuthority)/items".\r
-     */\r
-    public static String shortIdToPath(String shortId) {\r
-        return URN_NAME_PREFIX + '(' + shortId + ')';\r
-    }\r
-\r
-    /**\r
-     * Glue to create an AuthorityTermInfo object, used in RefNameUtils, from the\r
-     * highly similar AuthorityItem object, used in this class.\r
-     *\r
-     * @param termInfo an AuthorityTermInfo object\r
-     * @return an AuthorityItem object\r
-     */\r
-    private static AuthorityItem authorityItemFromTermInfo(AuthorityTermInfo termInfo) {\r
-        if (termInfo == null) {\r
-            return null;\r
-        }\r
-        AuthorityItem authorityItem = new AuthorityItem();\r
-        authorityItem.inAuthority =\r
-                authorityFromAuthorityInfo(termInfo.inAuthority, false);\r
-        if (termInfo.name != null\r
-                && !termInfo.name.trim().isEmpty()) {\r
-            authorityItem.shortIdentifier = termInfo.name;\r
-        } else {\r
-            authorityItem.shortIdentifier = termInfo.csid;\r
-        }\r
-        authorityItem.displayName = termInfo.displayName;\r
-        return authorityItem;\r
-    }\r
-\r
-    /**\r
-     * Glue to create an AuthorityInfo object, used in RefNameUtils, from the\r
-     * highly similar Authority object, used in this class.\r
-     *\r
-     * @param authorityInfo an AuthorityInfo object\r
-     * @param includeDisplayName true to include the display name during creation;\r
-     *   false to exclude it.\r
-     * @return an Authority object\r
-     */\r
-    private static Authority authorityFromAuthorityInfo(AuthorityInfo authorityInfo,\r
-            boolean includeDisplayName) {\r
-        if (authorityInfo == null) {\r
-            return null;\r
-        }\r
-        Authority authority = new Authority();\r
-        authority.tenantName = authorityInfo.domain;\r
-        authority.resource = authorityInfo.resource;\r
-        if (authorityInfo.name != null\r
-                && !authorityInfo.name.trim().isEmpty()) {\r
-            authority.shortIdentifier = authorityInfo.name;\r
-        }\r
-        if (authorityInfo.csid != null\r
-                && !authorityInfo.csid.trim().isEmpty()) {\r
-            authority.csid = authorityInfo.csid;\r
-        }\r
-        if (includeDisplayName) {\r
-            authority.displayName = authorityInfo.displayName;\r
-        }\r
-        return authority;\r
-    }\r
-}\r
+package org.collectionspace.services.common.api;
+
+import org.collectionspace.services.common.api.RefNameUtils.AuthorityInfo;
+import org.collectionspace.services.common.api.RefNameUtils.AuthorityTermInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Usage for this class, if you have a URN and would like to get at its fields,
+ * is to call one of these methods:
+ *
+ * RefName.AuthorityItem item =
+ * RefName.AuthorityItem.parse(RefName.AUTHORITY_ITEM_EXAMPLE); or
+ * RefName.Authority authority =
+ * RefName.Authority.parse(RefName.AUTHORITY_EXAMPLE);
+ *
+ * From the object returned, you may set/get any of the public fields.
+ *
+ * If you want to format a string urn, then you need to construct either a
+ * RefName.AuthorityItem or RefName.Authority. You can parse a URN to do so, as
+ * shown above, or you can construct one with a constructor, setting its fields
+ * afterwards. A better way is to use one of the build*() methods on this class:
+ *
+ * RefName.Authority authority2 = RefName.buildAuthority(tenantName,
+ * serviceName, authorityShortIdentifier, authorityDisplayName);
+ *
+ * RefName.AuthorityItem item2 = RefName.buildAuthorityItem(authority2,
+ * RefName.EX_itemShortIdentifier, RefName.EX_itemDisplayName);
+ *
+ * Note that authority2 is an object, not a String, and is passed in to
+ * RefName.buildAuthorityItem().
+ *
+ * Then simply call toString() on the object:
+ *
+ * String authorityURN = authority2.toString();
+ *
+ * String itemURN = item2.toString();
+ *
+ * These test cases are kept up-to-date in
+ *
+ * org.collectionspace.services.common.api.test.RefNameTest
+ *
+ * User: laramie
+ */
+public class RefName {
+
+    /**
+     * The logger.
+     */
+    private static final Logger logger = LoggerFactory.getLogger(RefName.class);
+    public static final String URN_PREFIX = "urn:cspace:";
+    public static final String URN_NAME_PREFIX = "urn:cspace:name";
+    public static final String REFNAME = "refName";
+    
+    public static interface RefNameInterface {
+       public String toString();
+    }
+
+    public static class Authority implements RefNameInterface {
+
+        public String tenantName = "";
+        public String resource = "";
+        public String csid = null;
+        public String shortIdentifier = null;
+        public String displayName = "";
+
+        public static Authority parse(String urn) {
+            Authority authority;
+            try {
+                RefNameUtils.AuthorityInfo authorityInfo =
+                        RefNameUtils.parseAuthorityInfo(urn);
+                authority = authorityFromAuthorityInfo(authorityInfo, true);
+            } catch (IllegalArgumentException iae) {
+                return null;
+            }
+            return authority;
+        }
+
+        public String getDisplayName() {
+               return this.getDisplayName();
+        }
+        
+        public String getShortIdentifier() {
+            return this.shortIdentifier;
+        }
+
+        public String getCSID() {
+            return this.csid;
+        }
+
+        public boolean equals(Object other) {
+            if (other == null) {
+                return false;
+            }
+            if (other instanceof Authority) {
+                Authority ao = (Authority) other;
+                return (this.tenantName.equals(ao.tenantName)
+                        && this.resource.equals(ao.resource)
+                        && ((this.shortIdentifier != null &&
+                               this.shortIdentifier.equals(ao.shortIdentifier))
+                        || (this.csid != null && this.csid.equals(ao.csid))));
+            } else {
+                return false;
+            }
+        }
+
+        public String getRelativeUri() {
+               StringBuilder sb = new StringBuilder();
+               sb.append("/");
+               sb.append(resource);
+               sb.append("/");
+               if(csid!=null) {
+               sb.append(csid);
+               } else if(shortIdentifier!= null) {
+               sb.append(URN_NAME_PREFIX);
+               sb.append("(");
+               sb.append(shortIdentifier);
+               sb.append(")");
+               } else {
+                       throw new NullPointerException("Authority has neither CSID nor shortID!");
+               }
+            return sb.toString();
+        }
+
+        public String toString() {
+            String displaySuffix = (displayName != null && (!displayName.isEmpty())) ? '\'' + displayName + '\'' : "";
+            //return URN_PREFIX + tenantName + ':' + resource + ":" + "name" + "(" + shortIdentifier + ")" + displaySuffix;
+               StringBuilder sb = new StringBuilder();
+               sb.append(URN_PREFIX);
+               sb.append(tenantName);
+               sb.append(RefNameUtils.SEPARATOR);
+               sb.append(resource);
+               sb.append(RefNameUtils.SEPARATOR);
+               if(csid!=null) {
+               sb.append(RefNameUtils.ID_SPECIFIER);
+               sb.append("(");
+               sb.append(csid);
+               sb.append(")");
+               } else if(shortIdentifier!= null) {
+               sb.append(RefNameUtils.NAME_SPECIFIER);
+               sb.append("(");
+               sb.append(shortIdentifier);
+               sb.append(")");
+               } else {
+                       throw new NullPointerException("Authority has neither CSID nor shortID!");
+               }
+               sb.append(displaySuffix);
+            return sb.toString();
+        }
+
+        public static Authority buildAuthority(
+                       String tenantName, 
+                       String serviceName, 
+                       String csid, 
+                       String authorityShortIdentifier, 
+                       String authorityDisplayName) {
+            Authority authority = new Authority();
+            authority.tenantName = tenantName;
+            authority.resource = serviceName;
+            if (Tools.notEmpty(authority.resource)) {
+                authority.resource = authority.resource.toLowerCase();
+            }
+            authority.csid = csid;
+            authority.shortIdentifier = authorityShortIdentifier;
+            authority.displayName = authorityDisplayName;
+            return authority;
+        }
+    }
+
+    public static class AuthorityItem implements RefNameInterface {
+
+        public Authority inAuthority;
+        public String shortIdentifier = "";
+        public String displayName = "";
+
+        public static AuthorityItem parse(String urn) {
+            AuthorityItem authorityItem = null;
+            try {
+                RefNameUtils.AuthorityTermInfo termInfo =
+                        RefNameUtils.parseAuthorityTermInfo(urn);
+                authorityItem = authorityItemFromTermInfo(termInfo);
+            } catch (IllegalArgumentException iae) {
+                return null;
+            }
+            return authorityItem;
+        }
+
+        public String getDisplayName() {
+               return this.displayName;
+        }
+        
+        public String getParentShortIdentifier() {
+            return this.inAuthority.shortIdentifier;
+        }
+
+        public String getShortIdentifier() {
+            return this.shortIdentifier;
+        }
+
+        public boolean equals(Object other) {
+            if (other == null) {
+                return false;
+            }
+            if (other instanceof AuthorityItem) {
+                AuthorityItem aio = (AuthorityItem) other;
+                boolean ok = true;
+                ok = ok && aio.inAuthority != null;
+                ok = ok && aio.inAuthority.equals(this.inAuthority);
+                ok = ok && aio.shortIdentifier.equals(this.shortIdentifier);
+                ok = ok && aio.displayName.equals(this.displayName);
+                return ok;
+            } else {
+                return false;
+            }
+        }
+
+        public String getRelativeUri() {
+            return inAuthority.getRelativeUri() + "/items/" + URN_NAME_PREFIX + "(" + shortIdentifier + ")";
+        }
+
+        public String toString() {
+            String displaySuffix = (displayName != null && (!displayName.isEmpty())) ? '\'' + displayName + '\'' : "";
+            Authority ai = inAuthority;
+            if (ai == null) {
+                return URN_PREFIX + "ERROR:inAuthorityNotSet: (" + shortIdentifier + ")" + displaySuffix;
+            } else {
+                String base = URN_PREFIX + ai.tenantName + ':' + ai.resource + ":" + "name" + "(" + ai.shortIdentifier + ")";
+                String refname = base + ":item:name(" + shortIdentifier + ")" + displaySuffix;
+                return refname;
+            }
+        }
+    }
+
+    public static AuthorityItem buildAuthorityItem(String tenantName, String serviceName, String authorityShortID,
+            String itemShortID, String itemDisplayName) {
+        Authority authority = Authority.buildAuthority(tenantName, serviceName, null, authorityShortID, "");
+        return buildAuthorityItem(authority, itemShortID, itemDisplayName);
+    }
+
+    public static AuthorityItem buildAuthorityItem(String authorityRefName, String itemShortID, String itemDisplayName) {
+        Authority authority = Authority.parse(authorityRefName);
+        AuthorityItem item = buildAuthorityItem(authority, itemShortID, itemDisplayName);
+        return item;
+    }
+
+    public static AuthorityItem buildAuthorityItem(Authority authority, String itemShortID, String itemDisplayName) {
+        AuthorityItem item = new AuthorityItem();
+        item.inAuthority = authority;
+        item.shortIdentifier = itemShortID;
+        item.displayName = itemDisplayName;
+        return item;
+    }
+
+    /**
+     * Use this method to avoid formatting any urn's outside of this unit;
+     * Caller passes in a shortId, such as "TestAuthority", and method returns
+     * the correct urn path element, without any path delimiters such as '/' so
+     * that calling shortIdToPath("TestAuthority") returns
+     * "urn:cspace:name(TestAuthority)", and then this value may be put into a
+     * path, such as "/personauthorities/urn:cspace:name(TestAuthority)/items".
+     */
+    public static String shortIdToPath(String shortId) {
+        return URN_NAME_PREFIX + '(' + shortId + ')';
+    }
+
+    /**
+     * Glue to create an AuthorityTermInfo object, used in RefNameUtils, from the
+     * highly similar AuthorityItem object, used in this class.
+     *
+     * @param termInfo an AuthorityTermInfo object
+     * @return an AuthorityItem object
+     */
+    private static AuthorityItem authorityItemFromTermInfo(AuthorityTermInfo termInfo) {
+        if (termInfo == null) {
+            return null;
+        }
+        AuthorityItem authorityItem = new AuthorityItem();
+        authorityItem.inAuthority =
+                authorityFromAuthorityInfo(termInfo.inAuthority, false);
+        if (termInfo.name != null
+                && !termInfo.name.trim().isEmpty()) {
+            authorityItem.shortIdentifier = termInfo.name;
+        } else {
+            authorityItem.shortIdentifier = termInfo.csid;
+        }
+        authorityItem.displayName = termInfo.displayName;
+        return authorityItem;
+    }
+
+    /**
+     * Glue to create an AuthorityInfo object, used in RefNameUtils, from the
+     * highly similar Authority object, used in this class.
+     *
+     * @param authorityInfo an AuthorityInfo object
+     * @param includeDisplayName true to include the display name during creation;
+     *   false to exclude it.
+     * @return an Authority object
+     */
+    private static Authority authorityFromAuthorityInfo(AuthorityInfo authorityInfo,
+            boolean includeDisplayName) {
+        if (authorityInfo == null) {
+            return null;
+        }
+        Authority authority = new Authority();
+        authority.tenantName = authorityInfo.domain;
+        authority.resource = authorityInfo.resource;
+        if (authorityInfo.name != null
+                && !authorityInfo.name.trim().isEmpty()) {
+            authority.shortIdentifier = authorityInfo.name;
+        }
+        if (authorityInfo.csid != null
+                && !authorityInfo.csid.trim().isEmpty()) {
+            authority.csid = authorityInfo.csid;
+        }
+        if (includeDisplayName) {
+            authority.displayName = authorityInfo.displayName;
+        }
+        return authority;
+    }
+}
index 933ee30d2e5bec35c97a6d2af7a4381e59263dad..277155e1122a58493a18d7730c6bb1d0e50f81f7 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.common.api;\r
-\r
-import java.io.File;\r
-import  java.util.regex.Pattern;\r
-import java.util.regex.Matcher;\r
-\r
-/** General utility methods.\r
- *   @author Laramie Crocker\r
- * v.1.4\r
- */\r
-public class Tools {\r
-    /** @return first glued to second with the separator string, at most one time - useful for appending paths.\r
-     */\r
-    public static String glue(String first, String separator, String second){\r
-        if (first==null) { first = ""; }\r
-        if (second==null) { second = ""; }\r
-        if (separator==null) { separator = ""; }\r
-        if (first.startsWith(separator) && second.startsWith(separator)){\r
-            return first.substring(0, first.length()-separator.length()) + second;\r
-        }\r
-        if (first.endsWith(separator) || second.startsWith(separator)){\r
-            return first+second;\r
-        }\r
-        return first+separator+second;\r
-    }\r
-\r
-    /** Remove all whitespace from a String.  */\r
-    public static String squeeze(String s) {\r
-        return s.replaceAll("\\s+", "");\r
-    }\r
-\r
-    /** Milliseconds from start time as defined by the Date class. */\r
-    public static Long now(){\r
-        return new Long((new java.util.Date()).getTime());\r
-    }\r
-\r
-     public static String nowLocale(){\r
-        java.util.Date date = new java.util.Date();\r
-        String result = java.text.DateFormat.getDateTimeInstance().format(date);\r
-        date = null;\r
-        return result;\r
-    }\r
-\r
-    /** Handles null strings as empty.  */\r
-    public static boolean isEmpty(String str){\r
-        return !notEmpty(str);\r
-    }\r
-\r
-    /** nulls, empty strings, and empty after trim() are considered blank. */\r
-    public static boolean isBlank(String str){\r
-        return !notBlank(str);\r
-    }\r
-\r
-    /** Handles null strings as empty.  */\r
-    public static boolean notEmpty(String str){\r
-        if (str==null) return false;\r
-        if (str.length()==0) return false;\r
-        return true;\r
-    }\r
-    public static boolean notBlank(String str){\r
-        if (str==null) return false;\r
-        if (str.length()==0) return false;\r
-        if (str.trim().length()==0){\r
-            return false;\r
-        }\r
-        return true;\r
-    }\r
-\r
-    /** Handles null strings as false.  */\r
-    public static boolean isTrue(String test){\r
-        return notEmpty(test) && (new Boolean(test)).booleanValue();\r
-    }\r
-\r
-                    /*  Example usage of searchAndReplace:\r
-                        for (Map.Entry<String,String> entry : variablesMap.entrySet()){\r
-                            String key = entry.getKey();\r
-                            String replace = entry.getValue();\r
-                            String find = "\\$\\{"+key+"\\}";   //must add expression escapes\r
-                                                                //because $ and braces are "special", and we want to find "${object.CSID}"\r
-                            uri = Tools.searchAndReplace(uri, find, replace);\r
-                            System.out.println("---- REPLACE.uri:        "+initURI);\r
-                            System.out.println("---- REPLACE.find:       "+find);\r
-                            System.out.println("---- REPLACE.replace:    "+replace);\r
-                            System.out.println("---- REPLACE.uri result: "+uri);\r
-                        }\r
-                    */\r
-    public static String  searchAndReplace(String source, String find, String replace){\r
-        Pattern pattern = Pattern.compile(find);\r
-        Matcher matcher = pattern.matcher(source);\r
-        String output = matcher.replaceAll(replace);\r
-        return output;\r
-    }\r
-    \r
-    public static String searchAndReplaceWithQuoteReplacement(String source, String find, String replace){\r
-        Pattern pattern = Pattern.compile(find);\r
-        Matcher matcher = pattern.matcher(source);\r
-        String output = matcher.replaceAll(matcher.quoteReplacement(replace));\r
-        return output;\r
-    }\r
-\r
-    static boolean m_fileSystemIsDOS = "\\".equals(File.separator);\r
-    static boolean m_fileSystemIsMac = ":".equals(File.separator);\r
-    \r
-    public final static String FILE_EXTENSION_SEPARATOR = ".";\r
-\r
-    public static boolean fileSystemIsDOS(){return m_fileSystemIsDOS;}\r
-    public static boolean fileSystemIsMac(){return m_fileSystemIsMac;}\r
-\r
-    public static String fixFilename(String filename){\r
-        if ( m_fileSystemIsDOS ) {\r
-            return filename.replace('/', '\\');\r
-        }\r
-        if ( m_fileSystemIsMac ) {\r
-            String t = filename.replace('/', ':');\r
-            t = t.replace('\\', ':');\r
-            return t;\r
-        }\r
-        return filename.replace('\\','/');\r
-    }\r
-\r
-    public static String join(String dir, String file){\r
-        if ( dir.length() == 0 ) {\r
-            return file;\r
-        }\r
-        dir = Tools.fixFilename(dir);\r
-        file = Tools.fixFilename(file);\r
-        if ( ! dir.endsWith(File.separator) ) {\r
-            dir += File.separator;\r
-        }\r
-        if ( file.startsWith(File.separator) ) {\r
-            file = file.substring(1);\r
-        }\r
-        return dir + file;\r
-    }\r
-    \r
-    public static String getFilenameExtension(String filename) {\r
-        int dot = filename.lastIndexOf(FILE_EXTENSION_SEPARATOR);\r
-        return (dot>=0)?filename.substring(dot + 1):null;\r
-        }\r
-\r
-    public static String getFilenameBase(String filename) {\r
-        int dot = filename.lastIndexOf(FILE_EXTENSION_SEPARATOR);\r
-        if(dot<0)\r
-               dot = filename.length();\r
-        int sep = filename.lastIndexOf(File.separator); // Note: if -1, then sep+1=0, which is right\r
-        return filename.substring(sep + 1, dot);\r
-        }\r
-\r
-    public static String getStackTrace(Throwable e){\r
-        return getStackTrace(e, -1);\r
-    }\r
-    \r
-    public static String implode(String strings[], String sep) {\r
-               String implodedString;\r
-               if (strings.length == 0) {\r
-                       implodedString = "";\r
-               } else {\r
-                       StringBuffer sb = new StringBuffer();\r
-                       sb.append(strings[0]);\r
-                       for (int i = 1; i < strings.length; i++) {\r
-                               if (strings[i] != null && !strings[i].trim().isEmpty()) {\r
-                                       sb.append(sep);\r
-                                       sb.append(strings[i]);\r
-                               }\r
-                       }\r
-                       implodedString = sb.toString();\r
-               }\r
-               return implodedString;\r
-       }\r
-               \r
-\r
-\r
-\r
-    /** @param includeLines if zero, returns all lines */\r
-    public static String getStackTrace(Throwable e, int includeLines){\r
-        if (e==null){\r
-            return "";\r
-        }\r
-        java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();\r
-        java.io.PrintStream ps = new java.io.PrintStream(bos);\r
-        e.printStackTrace(ps);\r
-        String result = bos.toString();\r
-        try {\r
-            if(bos!=null)bos.reset();\r
-            else System.out.println("bos was null, not closing");\r
-        } catch (Exception e2)  {System.out.println("ERROR: couldn't reset() bos in Tools "+e2);}\r
-\r
-        if (includeLines == 0){\r
-            return result;   //return all.\r
-        }\r
-        StringBuffer sb = new StringBuffer();\r
-        int i = 0;\r
-        // BUG - \n is not the separator on all systems. Have to use the system line separator.\r
-        String[] foo = result.split("\n");\r
-        for (String line: foo){\r
-            i++;\r
-            if (i>includeLines){\r
-                sb.append("  ...first "+i+" lines. "+(foo.length-i)+" more.\r\n");\r
-                return sb.toString();\r
-            }\r
-            sb.append(line).append("\r\n");\r
-        }\r
-        return sb.toString();\r
-    }\r
-\r
-    public static String errorToString(Throwable e, boolean stackTraceOnException){\r
-        return errorToString(e, stackTraceOnException, 0);\r
-    }\r
-\r
-    /** Takes an Exception object and formats a message that provides more debug information\r
-      * suitable for developers for printing to System.out or for logging.  Not suitable for\r
-      * presentation of error messages to clients.\r
-     * @param includeLines if zero, return all lines of stack trace, otherwise return number of lines from top.\r
-      */\r
-    public static String errorToString(Throwable e, boolean stackTraceOnException, int includeLines){\r
-        if (e==null){\r
-            return "";\r
-        }\r
-        String s = e.toString() + "\r\n  -- message: " + e.getMessage();\r
-\r
-        StringBuffer causeBuffer = new StringBuffer();\r
-        Throwable cause = e.getCause();\r
-        while (cause != null){\r
-            causeBuffer.append(cause.getClass().getName()+"::"+cause.getMessage()+"\r\n");\r
-            cause = cause.getCause();\r
-        }\r
-        if (causeBuffer.length()>0) s = s + "\r\n  -- Causes: "+causeBuffer.toString();\r
-\r
-\r
-        s = s + "\r\n  -- Stack Trace: \r\n  --      " + getStackTrace(e, includeLines);\r
-        return s;\r
-    }\r
-\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.collectionspace.services.common.api;
+
+import java.io.File;
+import  java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+/** General utility methods.
+ *   @author Laramie Crocker
+ * v.1.4
+ */
+public class Tools {
+    /** @return first glued to second with the separator string, at most one time - useful for appending paths.
+     */
+    public static String glue(String first, String separator, String second){
+        if (first==null) { first = ""; }
+        if (second==null) { second = ""; }
+        if (separator==null) { separator = ""; }
+        if (first.startsWith(separator) && second.startsWith(separator)){
+            return first.substring(0, first.length()-separator.length()) + second;
+        }
+        if (first.endsWith(separator) || second.startsWith(separator)){
+            return first+second;
+        }
+        return first+separator+second;
+    }
+
+    /** Remove all whitespace from a String.  */
+    public static String squeeze(String s) {
+        return s.replaceAll("\\s+", "");
+    }
+
+    /** Milliseconds from start time as defined by the Date class. */
+    public static Long now(){
+        return new Long((new java.util.Date()).getTime());
+    }
+
+     public static String nowLocale(){
+        java.util.Date date = new java.util.Date();
+        String result = java.text.DateFormat.getDateTimeInstance().format(date);
+        date = null;
+        return result;
+    }
+
+    /** Handles null strings as empty.  */
+    public static boolean isEmpty(String str){
+        return !notEmpty(str);
+    }
+
+    /** nulls, empty strings, and empty after trim() are considered blank. */
+    public static boolean isBlank(String str){
+        return !notBlank(str);
+    }
+
+    /** Handles null strings as empty.  */
+    public static boolean notEmpty(String str){
+        if (str==null) return false;
+        if (str.length()==0) return false;
+        return true;
+    }
+    public static boolean notBlank(String str){
+        if (str==null) return false;
+        if (str.length()==0) return false;
+        if (str.trim().length()==0){
+            return false;
+        }
+        return true;
+    }
+
+    /** Handles null strings as false.  */
+    public static boolean isTrue(String test){
+        return notEmpty(test) && (new Boolean(test)).booleanValue();
+    }
+
+                    /*  Example usage of searchAndReplace:
+                        for (Map.Entry<String,String> entry : variablesMap.entrySet()){
+                            String key = entry.getKey();
+                            String replace = entry.getValue();
+                            String find = "\\$\\{"+key+"\\}";   //must add expression escapes
+                                                                //because $ and braces are "special", and we want to find "${object.CSID}"
+                            uri = Tools.searchAndReplace(uri, find, replace);
+                            System.out.println("---- REPLACE.uri:        "+initURI);
+                            System.out.println("---- REPLACE.find:       "+find);
+                            System.out.println("---- REPLACE.replace:    "+replace);
+                            System.out.println("---- REPLACE.uri result: "+uri);
+                        }
+                    */
+    public static String  searchAndReplace(String source, String find, String replace){
+        Pattern pattern = Pattern.compile(find);
+        Matcher matcher = pattern.matcher(source);
+        String output = matcher.replaceAll(replace);
+        return output;
+    }
+    
+    public static String searchAndReplaceWithQuoteReplacement(String source, String find, String replace){
+        Pattern pattern = Pattern.compile(find);
+        Matcher matcher = pattern.matcher(source);
+        String output = matcher.replaceAll(matcher.quoteReplacement(replace));
+        return output;
+    }
+
+    static boolean m_fileSystemIsDOS = "\\".equals(File.separator);
+    static boolean m_fileSystemIsMac = ":".equals(File.separator);
+    
+    public final static String FILE_EXTENSION_SEPARATOR = ".";
+
+    public static boolean fileSystemIsDOS(){return m_fileSystemIsDOS;}
+    public static boolean fileSystemIsMac(){return m_fileSystemIsMac;}
+
+    public static String fixFilename(String filename){
+        if ( m_fileSystemIsDOS ) {
+            return filename.replace('/', '\\');
+        }
+        if ( m_fileSystemIsMac ) {
+            String t = filename.replace('/', ':');
+            t = t.replace('\\', ':');
+            return t;
+        }
+        return filename.replace('\\','/');
+    }
+
+    public static String join(String dir, String file){
+        if ( dir.length() == 0 ) {
+            return file;
+        }
+        dir = Tools.fixFilename(dir);
+        file = Tools.fixFilename(file);
+        if ( ! dir.endsWith(File.separator) ) {
+            dir += File.separator;
+        }
+        if ( file.startsWith(File.separator) ) {
+            file = file.substring(1);
+        }
+        return dir + file;
+    }
+    
+    public static String getFilenameExtension(String filename) {
+        int dot = filename.lastIndexOf(FILE_EXTENSION_SEPARATOR);
+        return (dot>=0)?filename.substring(dot + 1):null;
+        }
+
+    public static String getFilenameBase(String filename) {
+        int dot = filename.lastIndexOf(FILE_EXTENSION_SEPARATOR);
+        if(dot<0)
+               dot = filename.length();
+        int sep = filename.lastIndexOf(File.separator); // Note: if -1, then sep+1=0, which is right
+        return filename.substring(sep + 1, dot);
+        }
+
+    public static String getStackTrace(Throwable e){
+        return getStackTrace(e, -1);
+    }
+    
+    public static String implode(String strings[], String sep) {
+               String implodedString;
+               if (strings.length == 0) {
+                       implodedString = "";
+               } else {
+                       StringBuffer sb = new StringBuffer();
+                       sb.append(strings[0]);
+                       for (int i = 1; i < strings.length; i++) {
+                               if (strings[i] != null && !strings[i].trim().isEmpty()) {
+                                       sb.append(sep);
+                                       sb.append(strings[i]);
+                               }
+                       }
+                       implodedString = sb.toString();
+               }
+               return implodedString;
+       }
+               
+
+
+
+    /** @param includeLines if zero, returns all lines */
+    public static String getStackTrace(Throwable e, int includeLines){
+        if (e==null){
+            return "";
+        }
+        java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
+        java.io.PrintStream ps = new java.io.PrintStream(bos);
+        e.printStackTrace(ps);
+        String result = bos.toString();
+        try {
+            if(bos!=null)bos.reset();
+            else System.out.println("bos was null, not closing");
+        } catch (Exception e2)  {System.out.println("ERROR: couldn't reset() bos in Tools "+e2);}
+
+        if (includeLines == 0){
+            return result;   //return all.
+        }
+        StringBuffer sb = new StringBuffer();
+        int i = 0;
+        // BUG - \n is not the separator on all systems. Have to use the system line separator.
+        String[] foo = result.split("\n");
+        for (String line: foo){
+            i++;
+            if (i>includeLines){
+                sb.append("  ...first "+i+" lines. "+(foo.length-i)+" more.\r\n");
+                return sb.toString();
+            }
+            sb.append(line).append("\r\n");
+        }
+        return sb.toString();
+    }
+
+    public static String errorToString(Throwable e, boolean stackTraceOnException){
+        return errorToString(e, stackTraceOnException, 0);
+    }
+
+    /** Takes an Exception object and formats a message that provides more debug information
+      * suitable for developers for printing to System.out or for logging.  Not suitable for
+      * presentation of error messages to clients.
+     * @param includeLines if zero, return all lines of stack trace, otherwise return number of lines from top.
+      */
+    public static String errorToString(Throwable e, boolean stackTraceOnException, int includeLines){
+        if (e==null){
+            return "";
+        }
+        String s = e.toString() + "\r\n  -- message: " + e.getMessage();
+
+        StringBuffer causeBuffer = new StringBuffer();
+        Throwable cause = e.getCause();
+        while (cause != null){
+            causeBuffer.append(cause.getClass().getName()+"::"+cause.getMessage()+"\r\n");
+            cause = cause.getCause();
+        }
+        if (causeBuffer.length()>0) s = s + "\r\n  -- Causes: "+causeBuffer.toString();
+
+
+        s = s + "\r\n  -- Stack Trace: \r\n  --      " + getStackTrace(e, includeLines);
+        return s;
+    }
+
+
+}
index f0aaa4be7c5c9c479427969eb5be16648cd5f433..f32deba1b25469c306f2ea56b7cf7b471462ebec 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common.api;\r
-\r
-import java.io.*;\r
-import java.util.*;\r
-import java.util.zip.*;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class ZipTools {\r
-\r
-    public static final void copyInputStream(InputStream in, OutputStream out) throws IOException {\r
-        try {\r
-            byte[] buffer = new byte[1024];\r
-            int len;\r
-            while ((len = in.read(buffer)) >= 0) {\r
-                out.write(buffer, 0, len);\r
-            }\r
-        } finally {\r
-            in.close();\r
-            out.close();\r
-        }\r
-    }\r
-\r
-    public static void forceParentDirectories(String filename) throws Exception {\r
-        File theFile = new File(filename);\r
-        String parent = theFile.getParent();\r
-        if (parent != null) {\r
-            File p = new File(parent);\r
-            p.mkdirs();\r
-            System.out.println("Making directory: " + p.getCanonicalPath());\r
-        }\r
-    }\r
-\r
-    /**\r
-     * It is HIGHLY recommended to use a baseOutputDir, such as "./", or\r
-     * a local directory you know, such as "/tmp/foo", to prevent\r
-     * files from being unzipped in your root directory.\r
-     */\r
-    public static final void unzip(String zipfileName, String baseOutputDir) {\r
-        Enumeration entries;\r
-        ZipFile zipFile;\r
-        try {\r
-            zipFile = new ZipFile(zipfileName);\r
-            entries = zipFile.entries();\r
-            while (entries.hasMoreElements()) {\r
-                ZipEntry entry = (ZipEntry) entries.nextElement();\r
-                String entryName = entry.getName();\r
-                String theName = baseOutputDir + '/' + entryName;\r
-                if (entry.isDirectory()) {\r
-                    // Assume directories are stored parents first then children.\r
-                    System.out.println("Extracting directory: " + entry.getName());\r
-                    // This is not robust, just for demonstration purposes.\r
-                    (new File(theName)).mkdirs();\r
-                    continue;\r
-                }\r
-                //(new File(theName)).mkdirs();\r
-                forceParentDirectories(theName);\r
-                System.out.println("Extracting file: " + theName);\r
-                copyInputStream(zipFile.getInputStream(entry), new BufferedOutputStream(new FileOutputStream(theName)));\r
-            }\r
-            zipFile.close();\r
-        } catch (Exception ioe) {\r
-            System.err.println("Unhandled exception:");\r
-            ioe.printStackTrace();\r
-            return;\r
-        }\r
-    }\r
-\r
-    public static void zipDiveDirectory(int stripLeadingPathChars, String directory, String zipFilename) throws Exception {\r
-        ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFilename));\r
-        zipDir(stripLeadingPathChars, directory, zos);\r
-        zos.close();\r
-    }\r
-\r
-    public static void zipDir(int stripLeadingPathChars, String dir2zip, ZipOutputStream zos) throws Exception {\r
-        File fzipDir = new File(dir2zip);\r
-        if (!fzipDir.exists()) {\r
-            System.out.println("dir doesn't exist: " + dir2zip);\r
-            return;\r
-        }\r
-        String[] dirList = fzipDir.list(); //get a listing of the directory content\r
-        byte[] readBuffer = new byte[2156];\r
-        int bytesIn = 0;\r
-        //loop through dirList, and zip the files\r
-        for (int i = 0; i < dirList.length; i++) {\r
-            File f = new File(fzipDir, dirList[i]);\r
-            if (f.isDirectory()) {\r
-                //if the File object is a directory, call this function again to add its content recursively\r
-                zipDir(stripLeadingPathChars, f.getPath(), zos); //DIVE!\r
-                continue;\r
-            }\r
-            //if we reached here, the File object f was not a directory\r
-            String fpath = f.getPath();\r
-            String nameInArchive = fpath.substring(stripLeadingPathChars, fpath.length());\r
-            addToZip(zos, fpath, nameInArchive);\r
-        }\r
-    }\r
-\r
-    public static void addToZip(ZipOutputStream zos, String filename, String nameInArchive) throws Exception {\r
-        File file = new File(filename);\r
-        if (!file.exists()) {\r
-            System.err.println("File does not exist, skipping: " + filename);\r
-            return;\r
-        }\r
-        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));\r
-        int bytesRead;\r
-        byte[] buffer = new byte[1024];\r
-        CRC32 crc = new CRC32();\r
-        crc.reset();\r
-        while ((bytesRead = bis.read(buffer)) != -1) {\r
-            crc.update(buffer, 0, bytesRead);\r
-        }\r
-        bis.close();\r
-        // Reset to beginning of input stream\r
-        bis = new BufferedInputStream(new FileInputStream(file));\r
-        String nameInArchiveFixed = nameInArchive.replace("\\", "/");\r
-        ZipEntry entry = new ZipEntry(nameInArchiveFixed);\r
-        entry.setMethod(ZipEntry.STORED);\r
-        entry.setCompressedSize(file.length());\r
-        entry.setSize(file.length());\r
-        entry.setCrc(crc.getValue());\r
-        zos.putNextEntry(entry);\r
-        while ((bytesRead = bis.read(buffer)) != -1) {\r
-            zos.write(buffer, 0, bytesRead);\r
-        }\r
-        bis.close();\r
-    }\r
-\r
-}\r
-\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common.api;
+
+import java.io.*;
+import java.util.*;
+import java.util.zip.*;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class ZipTools {
+
+    public static final void copyInputStream(InputStream in, OutputStream out) throws IOException {
+        try {
+            byte[] buffer = new byte[1024];
+            int len;
+            while ((len = in.read(buffer)) >= 0) {
+                out.write(buffer, 0, len);
+            }
+        } finally {
+            in.close();
+            out.close();
+        }
+    }
+
+    public static void forceParentDirectories(String filename) throws Exception {
+        File theFile = new File(filename);
+        String parent = theFile.getParent();
+        if (parent != null) {
+            File p = new File(parent);
+            p.mkdirs();
+            System.out.println("Making directory: " + p.getCanonicalPath());
+        }
+    }
+
+    /**
+     * It is HIGHLY recommended to use a baseOutputDir, such as "./", or
+     * a local directory you know, such as "/tmp/foo", to prevent
+     * files from being unzipped in your root directory.
+     */
+    public static final void unzip(String zipfileName, String baseOutputDir) {
+        Enumeration entries;
+        ZipFile zipFile;
+        try {
+            zipFile = new ZipFile(zipfileName);
+            entries = zipFile.entries();
+            while (entries.hasMoreElements()) {
+                ZipEntry entry = (ZipEntry) entries.nextElement();
+                String entryName = entry.getName();
+                String theName = baseOutputDir + '/' + entryName;
+                if (entry.isDirectory()) {
+                    // Assume directories are stored parents first then children.
+                    System.out.println("Extracting directory: " + entry.getName());
+                    // This is not robust, just for demonstration purposes.
+                    (new File(theName)).mkdirs();
+                    continue;
+                }
+                //(new File(theName)).mkdirs();
+                forceParentDirectories(theName);
+                System.out.println("Extracting file: " + theName);
+                copyInputStream(zipFile.getInputStream(entry), new BufferedOutputStream(new FileOutputStream(theName)));
+            }
+            zipFile.close();
+        } catch (Exception ioe) {
+            System.err.println("Unhandled exception:");
+            ioe.printStackTrace();
+            return;
+        }
+    }
+
+    public static void zipDiveDirectory(int stripLeadingPathChars, String directory, String zipFilename) throws Exception {
+        ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFilename));
+        zipDir(stripLeadingPathChars, directory, zos);
+        zos.close();
+    }
+
+    public static void zipDir(int stripLeadingPathChars, String dir2zip, ZipOutputStream zos) throws Exception {
+        File fzipDir = new File(dir2zip);
+        if (!fzipDir.exists()) {
+            System.out.println("dir doesn't exist: " + dir2zip);
+            return;
+        }
+        String[] dirList = fzipDir.list(); //get a listing of the directory content
+        byte[] readBuffer = new byte[2156];
+        int bytesIn = 0;
+        //loop through dirList, and zip the files
+        for (int i = 0; i < dirList.length; i++) {
+            File f = new File(fzipDir, dirList[i]);
+            if (f.isDirectory()) {
+                //if the File object is a directory, call this function again to add its content recursively
+                zipDir(stripLeadingPathChars, f.getPath(), zos); //DIVE!
+                continue;
+            }
+            //if we reached here, the File object f was not a directory
+            String fpath = f.getPath();
+            String nameInArchive = fpath.substring(stripLeadingPathChars, fpath.length());
+            addToZip(zos, fpath, nameInArchive);
+        }
+    }
+
+    public static void addToZip(ZipOutputStream zos, String filename, String nameInArchive) throws Exception {
+        File file = new File(filename);
+        if (!file.exists()) {
+            System.err.println("File does not exist, skipping: " + filename);
+            return;
+        }
+        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
+        int bytesRead;
+        byte[] buffer = new byte[1024];
+        CRC32 crc = new CRC32();
+        crc.reset();
+        while ((bytesRead = bis.read(buffer)) != -1) {
+            crc.update(buffer, 0, bytesRead);
+        }
+        bis.close();
+        // Reset to beginning of input stream
+        bis = new BufferedInputStream(new FileInputStream(file));
+        String nameInArchiveFixed = nameInArchive.replace("\\", "/");
+        ZipEntry entry = new ZipEntry(nameInArchiveFixed);
+        entry.setMethod(ZipEntry.STORED);
+        entry.setCompressedSize(file.length());
+        entry.setSize(file.length());
+        entry.setCrc(crc.getValue());
+        zos.putNextEntry(entry);
+        while ((bytesRead = bis.read(buffer)) != -1) {
+            zos.write(buffer, 0, bytesRead);
+        }
+        bis.close();
+    }
+
+}
+
index a91162f34b9aece6acb29899f1e90b97cf33d52f..17dc32807f2d0c3b9008ed3bf153152666c41a2f 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts for\r
- * CollectionSpace, an open source collections management system for museums and\r
- * related institutions:\r
- *\r
- * http://www.collectionspace.org http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0. You may\r
- * not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-package org.collectionspace.services.common.api.test;\r
-\r
-import org.collectionspace.services.common.api.RefName;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.testng.Assert;\r
-import org.testng.annotations.Test;\r
-\r
-/**\r
- * User: laramie $LastChangedRevision: $ $LastChangedDate: $\r
- */\r
-public class RefNameTest {\r
-    \r
-    private static final Logger logger = LoggerFactory.getLogger(RefName.class);\r
-\r
-    public static final String AUTHORITY_EXAMPLE = "urn:cspace:collectionspace.org:Loansin:name(shortID)'displayName'";\r
-    public static final String AUTHORITY_EXAMPLE2 = "urn:cspace:collectionspace.org:Loansin:name(shortID)";\r
-    public static final String AUTHORITY_ITEM_EXAMPLE = "urn:cspace:collectionspace.org:Loansin:name(shortID):item:name(itemShortID)'itemDisplayName'";\r
-    public static final String TENANT_DOMAIN_NAME = "collectionspace.org";\r
-    public static final String RESOURCE = "Loansin";\r
-    public static final String SHORT_IDENTIFIER = "shortID";\r
-    public static final String DISPLAY_NAME = "displayName";\r
-    public static final String ITEM_SHORT_IDENTIFIER = "itemShortID";\r
-    public static final String ITEM_DISPLAY_NAME = "itemDisplayName";\r
-    public static final String DISPLAY_NAME_WITH_COLONS = "itemDisplayName:itemDisplayName2:itemDisplayName3";\r
-    public static final String DISPLAY_NAME_WITH_PARENS = "itemDisplayName (in parens) and more";\r
-    public static final String DISPLAY_NAME_WITH_APOSTROPHE = "itemDisplayName O'Reilly";\r
-\r
-    \r
-\r
-    private void testBanner(String msg) {\r
-        String BANNER = "-------------------------------------------------------";\r
-        logger.debug("\r" + BANNER + "\r\n" + this.getClass().getName() + "\r\n" + msg + "\r\n" + BANNER);\r
-    }\r
-\r
-    private void check(String one, String two, String msg) {\r
-        if (one == null || two == null || !(one.equals(two))) {\r
-            logger.debug("equals check FAILED. (msg: " + msg + ")\r\none: " + one + "\r\ntwo: " + two + "\r\n");\r
-        } else {\r
-            logger.debug("equals check OK. (msg: " + msg + ")\r\none: " + one + "\r\ntwo: " + two + "\r\n");\r
-        }\r
-        Assert.assertEquals(one, two, msg);\r
-    }\r
-\r
-    @Test\r
-    public void testRoundTrip() {\r
-        testBanner("testRoundTrip");\r
-        RefName.AuthorityItem item = RefName.AuthorityItem.parse(AUTHORITY_ITEM_EXAMPLE);\r
-        check(item.toString(), AUTHORITY_ITEM_EXAMPLE, "Item refName");\r
-        check(item.displayName, ITEM_DISPLAY_NAME, "Item display name");\r
-        check(item.shortIdentifier, ITEM_SHORT_IDENTIFIER, "Item short identifier");\r
-        check(item.inAuthority.displayName, "", "displayName from inAuthority should be empty");\r
-\r
-        RefName.Authority authority = RefName.Authority.parse(AUTHORITY_EXAMPLE);\r
-        check(authority.toString(), AUTHORITY_EXAMPLE, "Authority refName");\r
-        check(authority.tenantName, TENANT_DOMAIN_NAME, "Authority tenant domain name");\r
-        check(authority.resource, RESOURCE, "Authority resource");\r
-        check(authority.displayName, DISPLAY_NAME, "Authority display name");\r
-        check(authority.shortIdentifier, SHORT_IDENTIFIER, "Authority short identifier");\r
-\r
-        Assert.assertEquals(authority, item.inAuthority, "inAuthority from AuthorityItem.parse() matches Authority from Authority.parse()");\r
-    }\r
-\r
-    @Test\r
-    public void testConstructors() {\r
-        testBanner("testConstructors");\r
-        RefName.AuthorityItem item = RefName.buildAuthorityItem(AUTHORITY_EXAMPLE2,\r
-                ITEM_SHORT_IDENTIFIER,\r
-                ITEM_DISPLAY_NAME);\r
-        RefName.AuthorityItem itemParsed = RefName.AuthorityItem.parse(AUTHORITY_ITEM_EXAMPLE);\r
-        check(item.toString(), itemParsed.toString(), "buildAuthorityItem from AUTHORITY_EXAMPLE2 vs. parse(AUTHORITY_ITEM_EXAMPLE)");\r
-        Assert.assertEquals(item, itemParsed);\r
-\r
-\r
-\r
-        RefName.Authority authority2 = RefName.Authority.parse(AUTHORITY_EXAMPLE2);\r
-        RefName.AuthorityItem item3 = RefName.buildAuthorityItem(authority2,\r
-                ITEM_SHORT_IDENTIFIER,\r
-                ITEM_DISPLAY_NAME);\r
-        check(item.toString(), item3.toString(), "buildAuthorityItem(Authority,str,str) from AUTHORITY_EXAMPLE2 vs. AUTHORITY_ITEM_EXAMPLE");\r
-        Assert.assertEquals(item, item3);\r
-    }\r
-\r
-    /**\r
-     * Test convenience getters that return short identifiers for authorities\r
-     * and authority items.\r
-     */\r
-    @Test\r
-    public void testShortIDGetters() {\r
-        testBanner("testShortIDGetters");\r
-        RefName.Authority authority = RefName.Authority.parse(AUTHORITY_EXAMPLE);\r
-        Assert.assertEquals(authority.getShortIdentifier(), SHORT_IDENTIFIER,\r
-                "Short identifier from parsing parent authority refName does not match value of Authority.getShortIdentifier().");\r
-\r
-        RefName.AuthorityItem item = RefName.buildAuthorityItem(AUTHORITY_EXAMPLE,\r
-                ITEM_SHORT_IDENTIFIER,\r
-                ITEM_DISPLAY_NAME);\r
-        Assert.assertEquals(item.getParentShortIdentifier(), SHORT_IDENTIFIER,\r
-                "Parent short identifier from parsing authority refName does not match value of AuthorityItem.getParentShortIdentifier().");\r
-        Assert.assertEquals(item.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,\r
-                "Short identifier from item does not match value of AuthorityItem.getShortIdentifier().");\r
-\r
-        RefName.AuthorityItem parsedItem = RefName.AuthorityItem.parse(AUTHORITY_ITEM_EXAMPLE);\r
-        Assert.assertEquals(parsedItem.getParentShortIdentifier(), SHORT_IDENTIFIER,\r
-                "Parent short identifier from parsing item refName does not match value of AuthorityItem.getParentShortIdentifier().");\r
-        Assert.assertEquals(parsedItem.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,\r
-                "Short identifier from parsing item refName does not match value of AuthorityItem.getShortIdentifier().");\r
-\r
-    }\r
-\r
-    /**\r
-     * Test display names containing refName separator characters, such as\r
-     * colons and parens, to ensure that these characters may be validly used\r
-     * in display names without adversely impacting refName parsing.\r
-     */\r
-    @Test\r
-    public void testSeparatorsInDisplayNames() {\r
-        testBanner("testSeparatorsInDisplayNames");\r
-        \r
-        RefName.AuthorityItem itemWithDisplayNameColons =\r
-                RefName.buildAuthorityItem(AUTHORITY_EXAMPLE2,\r
-                ITEM_SHORT_IDENTIFIER,\r
-                DISPLAY_NAME_WITH_COLONS);\r
-        Assert.assertEquals(itemWithDisplayNameColons.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,\r
-                "Short identifier from item " + itemWithDisplayNameColons.getShortIdentifier()\r
-                + "does not match expected value " + ITEM_SHORT_IDENTIFIER);\r
-        Assert.assertEquals(itemWithDisplayNameColons.displayName, DISPLAY_NAME_WITH_COLONS,\r
-                "Display name from item " + itemWithDisplayNameColons.displayName\r
-                + "does not match expected value " + DISPLAY_NAME_WITH_COLONS);\r
-        \r
-        RefName.AuthorityItem itemWithDisplayNameParens =\r
-                RefName.buildAuthorityItem(AUTHORITY_EXAMPLE2,\r
-                ITEM_SHORT_IDENTIFIER,\r
-                DISPLAY_NAME_WITH_PARENS);\r
-        Assert.assertEquals(itemWithDisplayNameParens.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,\r
-                "Short identifier from item " + itemWithDisplayNameParens.getShortIdentifier()\r
-                + "does not match expected value " + ITEM_SHORT_IDENTIFIER);\r
-        Assert.assertEquals(itemWithDisplayNameParens.displayName, DISPLAY_NAME_WITH_PARENS,\r
-                "Display name from item " + itemWithDisplayNameParens.displayName\r
-                + "does not match expected value " + DISPLAY_NAME_WITH_PARENS);\r
-        \r
-        RefName.AuthorityItem itemWithDisplayNameApostrophe =\r
-                RefName.buildAuthorityItem(AUTHORITY_EXAMPLE2,\r
-                ITEM_SHORT_IDENTIFIER,\r
-                DISPLAY_NAME_WITH_APOSTROPHE);\r
-        Assert.assertEquals(itemWithDisplayNameApostrophe.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,\r
-                "Short identifier from item " + itemWithDisplayNameApostrophe.getShortIdentifier()\r
-                + "does not match expected value " + ITEM_SHORT_IDENTIFIER);\r
-        Assert.assertEquals(itemWithDisplayNameApostrophe.displayName, DISPLAY_NAME_WITH_APOSTROPHE,\r
-                "Display name from item " + itemWithDisplayNameApostrophe.displayName\r
-                + "does not match expected value " + DISPLAY_NAME_WITH_APOSTROPHE);\r
-    }\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.collectionspace.services.common.api.test;
+
+import org.collectionspace.services.common.api.RefName;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * User: laramie $LastChangedRevision: $ $LastChangedDate: $
+ */
+public class RefNameTest {
+    
+    private static final Logger logger = LoggerFactory.getLogger(RefName.class);
+
+    public static final String AUTHORITY_EXAMPLE = "urn:cspace:collectionspace.org:Loansin:name(shortID)'displayName'";
+    public static final String AUTHORITY_EXAMPLE2 = "urn:cspace:collectionspace.org:Loansin:name(shortID)";
+    public static final String AUTHORITY_ITEM_EXAMPLE = "urn:cspace:collectionspace.org:Loansin:name(shortID):item:name(itemShortID)'itemDisplayName'";
+    public static final String TENANT_DOMAIN_NAME = "collectionspace.org";
+    public static final String RESOURCE = "Loansin";
+    public static final String SHORT_IDENTIFIER = "shortID";
+    public static final String DISPLAY_NAME = "displayName";
+    public static final String ITEM_SHORT_IDENTIFIER = "itemShortID";
+    public static final String ITEM_DISPLAY_NAME = "itemDisplayName";
+    public static final String DISPLAY_NAME_WITH_COLONS = "itemDisplayName:itemDisplayName2:itemDisplayName3";
+    public static final String DISPLAY_NAME_WITH_PARENS = "itemDisplayName (in parens) and more";
+    public static final String DISPLAY_NAME_WITH_APOSTROPHE = "itemDisplayName O'Reilly";
+
+    
+
+    private void testBanner(String msg) {
+        String BANNER = "-------------------------------------------------------";
+        logger.debug("\r" + BANNER + "\r\n" + this.getClass().getName() + "\r\n" + msg + "\r\n" + BANNER);
+    }
+
+    private void check(String one, String two, String msg) {
+        if (one == null || two == null || !(one.equals(two))) {
+            logger.debug("equals check FAILED. (msg: " + msg + ")\r\none: " + one + "\r\ntwo: " + two + "\r\n");
+        } else {
+            logger.debug("equals check OK. (msg: " + msg + ")\r\none: " + one + "\r\ntwo: " + two + "\r\n");
+        }
+        Assert.assertEquals(one, two, msg);
+    }
+
+    @Test
+    public void testRoundTrip() {
+        testBanner("testRoundTrip");
+        RefName.AuthorityItem item = RefName.AuthorityItem.parse(AUTHORITY_ITEM_EXAMPLE);
+        check(item.toString(), AUTHORITY_ITEM_EXAMPLE, "Item refName");
+        check(item.displayName, ITEM_DISPLAY_NAME, "Item display name");
+        check(item.shortIdentifier, ITEM_SHORT_IDENTIFIER, "Item short identifier");
+        check(item.inAuthority.displayName, "", "displayName from inAuthority should be empty");
+
+        RefName.Authority authority = RefName.Authority.parse(AUTHORITY_EXAMPLE);
+        check(authority.toString(), AUTHORITY_EXAMPLE, "Authority refName");
+        check(authority.tenantName, TENANT_DOMAIN_NAME, "Authority tenant domain name");
+        check(authority.resource, RESOURCE, "Authority resource");
+        check(authority.displayName, DISPLAY_NAME, "Authority display name");
+        check(authority.shortIdentifier, SHORT_IDENTIFIER, "Authority short identifier");
+
+        Assert.assertEquals(authority, item.inAuthority, "inAuthority from AuthorityItem.parse() matches Authority from Authority.parse()");
+    }
+
+    @Test
+    public void testConstructors() {
+        testBanner("testConstructors");
+        RefName.AuthorityItem item = RefName.buildAuthorityItem(AUTHORITY_EXAMPLE2,
+                ITEM_SHORT_IDENTIFIER,
+                ITEM_DISPLAY_NAME);
+        RefName.AuthorityItem itemParsed = RefName.AuthorityItem.parse(AUTHORITY_ITEM_EXAMPLE);
+        check(item.toString(), itemParsed.toString(), "buildAuthorityItem from AUTHORITY_EXAMPLE2 vs. parse(AUTHORITY_ITEM_EXAMPLE)");
+        Assert.assertEquals(item, itemParsed);
+
+
+
+        RefName.Authority authority2 = RefName.Authority.parse(AUTHORITY_EXAMPLE2);
+        RefName.AuthorityItem item3 = RefName.buildAuthorityItem(authority2,
+                ITEM_SHORT_IDENTIFIER,
+                ITEM_DISPLAY_NAME);
+        check(item.toString(), item3.toString(), "buildAuthorityItem(Authority,str,str) from AUTHORITY_EXAMPLE2 vs. AUTHORITY_ITEM_EXAMPLE");
+        Assert.assertEquals(item, item3);
+    }
+
+    /**
+     * Test convenience getters that return short identifiers for authorities
+     * and authority items.
+     */
+    @Test
+    public void testShortIDGetters() {
+        testBanner("testShortIDGetters");
+        RefName.Authority authority = RefName.Authority.parse(AUTHORITY_EXAMPLE);
+        Assert.assertEquals(authority.getShortIdentifier(), SHORT_IDENTIFIER,
+                "Short identifier from parsing parent authority refName does not match value of Authority.getShortIdentifier().");
+
+        RefName.AuthorityItem item = RefName.buildAuthorityItem(AUTHORITY_EXAMPLE,
+                ITEM_SHORT_IDENTIFIER,
+                ITEM_DISPLAY_NAME);
+        Assert.assertEquals(item.getParentShortIdentifier(), SHORT_IDENTIFIER,
+                "Parent short identifier from parsing authority refName does not match value of AuthorityItem.getParentShortIdentifier().");
+        Assert.assertEquals(item.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,
+                "Short identifier from item does not match value of AuthorityItem.getShortIdentifier().");
+
+        RefName.AuthorityItem parsedItem = RefName.AuthorityItem.parse(AUTHORITY_ITEM_EXAMPLE);
+        Assert.assertEquals(parsedItem.getParentShortIdentifier(), SHORT_IDENTIFIER,
+                "Parent short identifier from parsing item refName does not match value of AuthorityItem.getParentShortIdentifier().");
+        Assert.assertEquals(parsedItem.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,
+                "Short identifier from parsing item refName does not match value of AuthorityItem.getShortIdentifier().");
+
+    }
+
+    /**
+     * Test display names containing refName separator characters, such as
+     * colons and parens, to ensure that these characters may be validly used
+     * in display names without adversely impacting refName parsing.
+     */
+    @Test
+    public void testSeparatorsInDisplayNames() {
+        testBanner("testSeparatorsInDisplayNames");
+        
+        RefName.AuthorityItem itemWithDisplayNameColons =
+                RefName.buildAuthorityItem(AUTHORITY_EXAMPLE2,
+                ITEM_SHORT_IDENTIFIER,
+                DISPLAY_NAME_WITH_COLONS);
+        Assert.assertEquals(itemWithDisplayNameColons.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,
+                "Short identifier from item " + itemWithDisplayNameColons.getShortIdentifier()
+                + "does not match expected value " + ITEM_SHORT_IDENTIFIER);
+        Assert.assertEquals(itemWithDisplayNameColons.displayName, DISPLAY_NAME_WITH_COLONS,
+                "Display name from item " + itemWithDisplayNameColons.displayName
+                + "does not match expected value " + DISPLAY_NAME_WITH_COLONS);
+        
+        RefName.AuthorityItem itemWithDisplayNameParens =
+                RefName.buildAuthorityItem(AUTHORITY_EXAMPLE2,
+                ITEM_SHORT_IDENTIFIER,
+                DISPLAY_NAME_WITH_PARENS);
+        Assert.assertEquals(itemWithDisplayNameParens.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,
+                "Short identifier from item " + itemWithDisplayNameParens.getShortIdentifier()
+                + "does not match expected value " + ITEM_SHORT_IDENTIFIER);
+        Assert.assertEquals(itemWithDisplayNameParens.displayName, DISPLAY_NAME_WITH_PARENS,
+                "Display name from item " + itemWithDisplayNameParens.displayName
+                + "does not match expected value " + DISPLAY_NAME_WITH_PARENS);
+        
+        RefName.AuthorityItem itemWithDisplayNameApostrophe =
+                RefName.buildAuthorityItem(AUTHORITY_EXAMPLE2,
+                ITEM_SHORT_IDENTIFIER,
+                DISPLAY_NAME_WITH_APOSTROPHE);
+        Assert.assertEquals(itemWithDisplayNameApostrophe.getShortIdentifier(), ITEM_SHORT_IDENTIFIER,
+                "Short identifier from item " + itemWithDisplayNameApostrophe.getShortIdentifier()
+                + "does not match expected value " + ITEM_SHORT_IDENTIFIER);
+        Assert.assertEquals(itemWithDisplayNameApostrophe.displayName, DISPLAY_NAME_WITH_APOSTROPHE,
+                "Display name from item " + itemWithDisplayNameApostrophe.displayName
+                + "does not match expected value " + DISPLAY_NAME_WITH_APOSTROPHE);
+    }
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 315fd3bf377e02d91bbc1268ea059b1408cdc53e..c27710e594d4873286e32ac0ad0590cdf3b35e02 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.common</artifactId>\r
-    <name>services.common</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <dependencies>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.config</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.3rdparty.nuxeo.thumbnail</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common-api</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.publicitem.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.publicitem.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- \r
-        <dependency>\r
-                       <groupId>org.collectionspace.services</groupId>\r
-                       <artifactId>org.collectionspace.services.3rdparty.nuxeo.quote-api</artifactId>        \r
-            <version>${project.version}</version>\r
-        </dependency>\r
-         -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.hyperjaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-\r
-        <!-- Utilities -->\r
-        <!-- For NuxeoRESTClient.java class -->\r
-        <dependency>\r
-            <groupId>org.restlet</groupId>\r
-            <artifactId>org.restlet</artifactId>\r
-            <version>1.0.7</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>com.noelios.restlet</groupId>\r
-            <artifactId>com.noelios.restlet.ext.httpclient</artifactId>\r
-            <version>1.0.7</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>com.noelios.restlet</groupId>\r
-            <artifactId>com.noelios.restlet</artifactId>\r
-            <version>1.0.7</version>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>log4j</groupId>\r
-            <artifactId>log4j</artifactId>\r
-            <version>1.2.14</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.apache.commons</groupId>\r
-            <artifactId>commons-jexl</artifactId>\r
-            <version>2.0.1</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-dbcp</groupId>\r
-            <artifactId>commons-dbcp</artifactId>\r
-            <version>1.3-RC1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>commons-codec</groupId>\r
-                       <artifactId>commons-codec</artifactId>\r
-                       <version>1.4</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-lang</groupId>\r
-            <artifactId>commons-lang</artifactId>\r
-            <version>2.6</version>\r
-        </dependency>\r
-        <dependency>\r
-               <groupId>org.apache.tomcat</groupId>\r
-               <artifactId>dbcp</artifactId>\r
-               <version>6.0.33</version>\r
-               <scope>provided</scope>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.apache.tomcat</groupId>\r
-                       <artifactId>catalina</artifactId>\r
-               <version>6.0.33</version>\r
-               <scope>provided</scope>\r
-               </dependency>\r
-\r
-        <!-- javax -->\r
-        <dependency>\r
-            <groupId>javax.servlet</groupId>\r
-            <artifactId>servlet-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jacc</artifactId>\r
-            <version>1.0</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!--\r
-            <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        -->\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-                               <dependency>\r
-                                               <groupId>postgresql</groupId>\r
-                                               <artifactId>postgresql</artifactId>\r
-                                               <scope>provided</scope>\r
-                               </dependency>\r
-         <dependency>\r
-            <groupId>javax.persistence</groupId>\r
-            <artifactId>persistence-api</artifactId>\r
-        </dependency>\r
-\r
-        <!-- jboss -->\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>jaxrs-api</artifactId>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>org.hibernate</groupId>\r
-            <artifactId>hibernate-entitymanager</artifactId>\r
-        </dependency>\r
-        <!-- jboss -->\r
-        <dependency>\r
-                       <groupId>org.jboss.security</groupId>\r
-                       <artifactId>jbosssx</artifactId>\r
-                       <version>2.0.3.SP1</version>\r
-                       <scope>provided</scope>\r
-       </dependency>\r
-               <dependency>\r
-                       <groupId>org.jboss.remoting</groupId>\r
-                       <artifactId>jboss-remoting</artifactId>\r
-                       <scope>provided</scope>\r
-               </dependency>\r
-        <!-- nuxeo -->\r
-           <dependency>\r
-             <groupId>org.nuxeo.runtime</groupId>\r
-             <artifactId>nuxeo-runtime-launcher</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>\r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-mimetype-api</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-mimetype-core</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-types-api</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-types-core</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-imaging-core</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-imaging-api</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>\r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-filemanager-api</artifactId>\r
-                 <version>${nuxeo.platform.version}</version>        \r
-           </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.common</groupId>\r
-            <artifactId>nuxeo-common</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-client</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-query</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-schema</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-storage-sql</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-storage-sql-ra</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-io</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-convert</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-<!-- \r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-facade</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
- -->\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime-osgi</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-               <artifactId>nuxeo-opencmis-bindings</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.apache.chemistry.opencmis</groupId>\r
-            <artifactId>chemistry-opencmis-server-bindings</artifactId>\r
-            <version>0.6.0</version>\r
-            <classifier>classes</classifier>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.osgi</groupId>\r
-            <artifactId>org.osgi.core</artifactId>\r
-            <version>4.1.0</version>\r
-        </dependency>\r
-\r
-               <dependency>\r
-                   <groupId>commons-fileupload</groupId>\r
-                   <artifactId>commons-fileupload</artifactId>\r
-                   <version>1.2</version>\r
-               </dependency>\r
-        <dependency>\r
-            <groupId>ch.elca.el4j.modules</groupId>\r
-            <artifactId>module-xml_merge-common</artifactId>\r
-            <version>3.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-io</groupId>\r
-            <artifactId>commons-io</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.springframework.security</groupId>\r
-            <artifactId>spring-security-acl</artifactId>\r
-            <version>${spring.security.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-               <dependency>\r
-                       <groupId>org.springframework</groupId>\r
-                       <artifactId>spring-aop</artifactId>\r
-                       <version>${spring.version}</version>\r
-               </dependency>        \r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>collectionspace-services-common</finalName>\r
-       <defaultGoal>install</defaultGoal>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.jvnet.jaxb2.maven2</groupId>\r
-                <artifactId>maven-jaxb2-plugin</artifactId>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.common</artifactId>
+    <name>services.common</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.config</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.3rdparty.nuxeo.thumbnail</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.publicitem.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.publicitem.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- 
+        <dependency>
+                       <groupId>org.collectionspace.services</groupId>
+                       <artifactId>org.collectionspace.services.3rdparty.nuxeo.quote-api</artifactId>        
+            <version>${project.version}</version>
+        </dependency>
+         -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.hyperjaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authentication.service</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- Utilities -->
+        <!-- For NuxeoRESTClient.java class -->
+        <dependency>
+            <groupId>org.restlet</groupId>
+            <artifactId>org.restlet</artifactId>
+            <version>1.0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>com.noelios.restlet</groupId>
+            <artifactId>com.noelios.restlet.ext.httpclient</artifactId>
+            <version>1.0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>com.noelios.restlet</groupId>
+            <artifactId>com.noelios.restlet</artifactId>
+            <version>1.0.7</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.14</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-jexl</artifactId>
+            <version>2.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-dbcp</groupId>
+            <artifactId>commons-dbcp</artifactId>
+            <version>1.3-RC1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+                       <groupId>commons-codec</groupId>
+                       <artifactId>commons-codec</artifactId>
+                       <version>1.4</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.6</version>
+        </dependency>
+        <dependency>
+               <groupId>org.apache.tomcat</groupId>
+               <artifactId>dbcp</artifactId>
+               <version>6.0.33</version>
+               <scope>provided</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.tomcat</groupId>
+                       <artifactId>catalina</artifactId>
+               <version>6.0.33</version>
+               <scope>provided</scope>
+               </dependency>
+
+        <!-- javax -->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jacc</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--
+            <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>provided</scope>
+        </dependency>
+                               <dependency>
+                                               <groupId>postgresql</groupId>
+                                               <artifactId>postgresql</artifactId>
+                                               <scope>provided</scope>
+                               </dependency>
+         <dependency>
+            <groupId>javax.persistence</groupId>
+            <artifactId>persistence-api</artifactId>
+        </dependency>
+
+        <!-- jboss -->
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>jaxrs-api</artifactId>
+        </dependency>        
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-entitymanager</artifactId>
+        </dependency>
+        <!-- jboss -->
+        <dependency>
+                       <groupId>org.jboss.security</groupId>
+                       <artifactId>jbosssx</artifactId>
+                       <version>2.0.3.SP1</version>
+                       <scope>provided</scope>
+       </dependency>
+               <dependency>
+                       <groupId>org.jboss.remoting</groupId>
+                       <artifactId>jboss-remoting</artifactId>
+                       <scope>provided</scope>
+               </dependency>
+        <!-- nuxeo -->
+           <dependency>
+             <groupId>org.nuxeo.runtime</groupId>
+             <artifactId>nuxeo-runtime-launcher</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-mimetype-api</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>        
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-mimetype-core</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>        
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-types-api</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>        
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-types-core</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>        
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-imaging-core</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>        
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-imaging-api</artifactId>
+             <version>${nuxeo.platform.version}</version>
+           </dependency>
+           <dependency>
+             <groupId>org.nuxeo.ecm.platform</groupId>
+             <artifactId>nuxeo-platform-filemanager-api</artifactId>
+                 <version>${nuxeo.platform.version}</version>        
+           </dependency>
+        <dependency>
+            <groupId>org.nuxeo.common</groupId>
+            <artifactId>nuxeo-common</artifactId>
+            <version>${nuxeo.core.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.runtime</groupId>
+            <artifactId>nuxeo-runtime</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-client</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-query</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-schema</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-storage-sql</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-storage-sql-ra</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-io</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-convert</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+<!-- 
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-facade</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+ -->
+        <dependency>
+            <groupId>org.nuxeo.runtime</groupId>
+            <artifactId>nuxeo-runtime-osgi</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+               <artifactId>nuxeo-opencmis-bindings</artifactId>
+            <version>${nuxeo.core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.chemistry.opencmis</groupId>
+            <artifactId>chemistry-opencmis-server-bindings</artifactId>
+            <version>0.6.0</version>
+            <classifier>classes</classifier>
+        </dependency>        
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+
+               <dependency>
+                   <groupId>commons-fileupload</groupId>
+                   <artifactId>commons-fileupload</artifactId>
+                   <version>1.2</version>
+               </dependency>
+        <dependency>
+            <groupId>ch.elca.el4j.modules</groupId>
+            <artifactId>module-xml_merge-common</artifactId>
+            <version>3.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-acl</artifactId>
+            <version>${spring.security.version}</version>
+            <scope>provided</scope>
+        </dependency>
+               <dependency>
+                       <groupId>org.springframework</groupId>
+                       <artifactId>spring-aop</artifactId>
+                       <version>${spring.version}</version>
+               </dependency>        
+    </dependencies>
+
+    <build>
+        <finalName>collectionspace-services-common</finalName>
+       <defaultGoal>install</defaultGoal>
+        <plugins>
+            <plugin>
+                <groupId>org.jvnet.jaxb2.maven2</groupId>
+                <artifactId>maven-jaxb2-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index d85062628179ea2aff12a9427da4613c89ddd587..e4ff2d08949050d73d207a5d23061277099482da 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import java.util.List;\r
-\r
-import javax.ws.rs.GET;\r
-import javax.ws.rs.Path;\r
-import javax.ws.rs.Produces;\r
-import javax.ws.rs.WebApplicationException;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-import javax.ws.rs.core.UriInfo;\r
-\r
-import org.collectionspace.services.common.CSWebApplicationException;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.context.ServiceContextProperties;\r
-import org.collectionspace.services.common.document.BadRequestException;\r
-import org.collectionspace.services.common.document.DocumentException;\r
-import org.collectionspace.services.common.document.DocumentHandler;\r
-import org.collectionspace.services.common.document.DocumentNotFoundException;\r
-import org.collectionspace.services.common.document.TransactionException;\r
-import org.collectionspace.services.common.repository.RepositoryClient;\r
-import org.collectionspace.services.common.repository.RepositoryClientFactory;\r
-import org.collectionspace.services.common.security.UnauthorizedException;\r
-import org.collectionspace.services.common.storage.StorageClient;\r
-import org.collectionspace.services.common.storage.jpa.JpaStorageClientImpl;\r
-\r
-import org.jboss.resteasy.core.ResourceMethod;\r
-import org.jboss.resteasy.spi.HttpRequest;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * The Class AbstractCollectionSpaceResourceImpl.\r
- *\r
- * @param <IT> the generic type\r
- * @param <OT> the generic type\r
- */\r
-public abstract class AbstractCollectionSpaceResourceImpl<IT, OT>\r
-        implements CollectionSpaceResource<IT, OT> {\r
-\r
-    protected final Logger logger = LoggerFactory.getLogger(this.getClass());\r
-\r
-\r
-    // Fields for default client factory and client\r
-    /** The repository client factory. */\r
-    private RepositoryClientFactory repositoryClientFactory;\r
-    \r
-    /** The repository client. */\r
-    private RepositoryClient repositoryClient;\r
-    \r
-    /** The storage client. */\r
-    private StorageClient storageClient;\r
-\r
-    /**\r
-     * Extract id.\r
-     *\r
-     * @param res the res\r
-     * @return the string\r
-     */\r
-    protected static String extractId(Response res) {\r
-        MultivaluedMap<String, Object> mvm = res.getMetadata();\r
-        String uri = (String) ((List<Object>) mvm.get("Location")).get(0);\r
-        String[] segments = uri.split("/");\r
-        String id = segments[segments.length - 1];\r
-        return id;\r
-    }    \r
-    \r
-    /**\r
-     * Instantiates a new abstract collection space resource.\r
-     */\r
-    public AbstractCollectionSpaceResourceImpl() {\r
-        repositoryClientFactory = RepositoryClientFactory.getInstance();\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.common.CollectionSpaceResource#getServiceName()\r
-     */\r
-    @Override\r
-    abstract public String getServiceName();\r
-\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.common.CollectionSpaceResource#getRepositoryClient(org.collectionspace.services.common.context.ServiceContext)\r
-     */\r
-    @Override\r
-    synchronized public RepositoryClient getRepositoryClient(ServiceContext<IT, OT> ctx) {\r
-        if(repositoryClient != null){\r
-            return repositoryClient;\r
-        }\r
-        repositoryClient = repositoryClientFactory.getClient(ctx.getRepositoryClientName());\r
-        return repositoryClient;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.common.CollectionSpaceResource#getStorageClient(org.collectionspace.services.common.context.ServiceContext)\r
-     */\r
-    @Override\r
-    synchronized public StorageClient getStorageClient(ServiceContext<IT, OT> ctx) {\r
-        if(storageClient != null) {\r
-            return storageClient;\r
-        }\r
-        storageClient = new JpaStorageClientImpl();\r
-        return storageClient;\r
-    }\r
-    \r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.common.CollectionSpaceResource#createDocumentHandler(org.collectionspace.services.common.context.ServiceContext)\r
-     */\r
-    @Override\r
-    public DocumentHandler createDocumentHandler(ServiceContext<IT, OT> ctx) throws Exception {\r
-        DocumentHandler docHandler = createDocumentHandler(ctx, ctx.getInput());\r
-        return docHandler;\r
-    }\r
-    \r
-    /**\r
-     * Creates the document handler.\r
-     * \r
-     * @param ctx the ctx\r
-     * @param commonPart the common part\r
-     * \r
-     * @return the document handler\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    public DocumentHandler createDocumentHandler(ServiceContext<IT, OT> ctx,\r
-               Object commonPart) throws Exception {\r
-        DocumentHandler docHandler = ctx.getDocumentHandler();\r
-        docHandler.setCommonPart(commonPart);\r
-        return docHandler;\r
-    }    \r
-    \r
-    /**\r
-     * Creates the service context.\r
-     * \r
-     * @return the service context< i t, o t>\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    protected ServiceContext<IT, OT> createServiceContext() throws Exception {         \r
-        ServiceContext<IT, OT> ctx = createServiceContext(this.getServiceName(),\r
-                       (IT)null, //inputType\r
-                       null, // The resource map\r
-                       (UriInfo)null, // The query params\r
-                       this.getCommonPartClass());\r
-        return ctx;\r
-    }    \r
-    \r
-    /**\r
-     * Creates the service context.\r
-     * \r
-     * @param serviceName the service name\r
-     * \r
-     * @return the service context< i t, o t>\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    protected ServiceContext<IT, OT> createServiceContext(String serviceName) throws Exception {       \r
-        ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       serviceName,\r
-                       (IT)null, // The input part\r
-                       null, // The resource map\r
-                       (UriInfo)null, // The queryParams\r
-                       (Class<?>)null  /*input type's Class*/);\r
-        return ctx;\r
-    }\r
-    \r
-    protected ServiceContext<IT, OT> createServiceContext(String serviceName, UriInfo ui) throws Exception {           \r
-        ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       serviceName,\r
-                       (IT)null, // The input part\r
-                       null, // The resource map\r
-                       (UriInfo)null, // The queryParams\r
-                       (Class<?>)null  /*input type's Class*/);\r
-        ctx.setUriInfo(ui);\r
-        return ctx;\r
-    }    \r
-    \r
-    /**\r
-     * Creates the service context.\r
-     * \r
-     * @param serviceName the service name\r
-     * @param input the input\r
-     * \r
-     * @return the service context< i t, o t>\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    protected ServiceContext<IT, OT> createServiceContext(String serviceName,\r
-               IT input) throws Exception {            \r
-        ServiceContext<IT, OT> ctx = createServiceContext(serviceName,\r
-                       input,\r
-                       null, // The resource map\r
-                       (UriInfo)null, /*queryParams*/\r
-                       (Class<?>)null  /*input type's Class*/);\r
-        return ctx;\r
-    }\r
-    \r
-    protected ServiceContext<IT, OT> createServiceContext(String serviceName,\r
-               IT input,\r
-               UriInfo uriInfo) throws Exception {     \r
-        ServiceContext<IT, OT> ctx = createServiceContext(serviceName,\r
-                       input,\r
-                       null, // The resource map\r
-                       uriInfo, /*queryParams*/\r
-                       (Class<?>)null  /*input type's Class*/);\r
-        return ctx;\r
-    }\r
-    \r
-    protected ServiceContext<IT, OT> createServiceContext(UriInfo uriInfo) throws Exception {\r
-        ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       (IT)null, /*input*/\r
-                       uriInfo,\r
-                       (Class<?>)null  /*input type's Class*/);\r
-        return ctx;\r
-    }\r
-\r
-    /**\r
-     * Creates the service context.\r
-     * \r
-     * @param input the input\r
-     * \r
-     * @return the service context< i t, o t>\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    protected ServiceContext<IT, OT> createServiceContext(IT input) throws Exception {         \r
-        ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       input,\r
-                       (Class<?>)null /*input type's Class*/);\r
-        return ctx;\r
-    }\r
-    \r
-    protected ServiceContext<IT, OT> createServiceContext(IT input, UriInfo uriInfo) throws Exception {        \r
-        ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       input,\r
-                       uriInfo,\r
-                       null ); // The class param/argument\r
-        return ctx;\r
-    }    \r
-    \r
-    /**\r
-     * Creates the service context.\r
-     * \r
-     * @param input the input\r
-     * @param theClass the the class\r
-     * \r
-     * @return the service context\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    protected ServiceContext<IT, OT> createServiceContext(IT input, Class<?> theClass) throws Exception {      \r
-        ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       input,\r
-                       (UriInfo)null, //queryParams,\r
-                       theClass);\r
-        return ctx;\r
-    }\r
-    \r
-    protected ServiceContext<IT, OT> createServiceContext(IT input, Class<?> theClass, UriInfo uriInfo) throws Exception {     \r
-        ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       input,\r
-                       uriInfo,\r
-                       theClass);\r
-        return ctx;\r
-    }\r
-    \r
-    protected ServiceContext<IT, OT> createServiceContext(\r
-               String serviceName,\r
-               ResourceMap resourceMap,\r
-               UriInfo uriInfo) throws Exception {\r
-       ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       serviceName,\r
-                       null, // The input object\r
-                       resourceMap,\r
-                       uriInfo,\r
-                       null /* the class of the input type */);\r
-       return ctx;\r
-    }\r
-        \r
-    protected ServiceContext<IT, OT> createServiceContext(\r
-               IT input,\r
-               ResourceMap resourceMap,\r
-               UriInfo uriInfo) throws Exception {\r
-       ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       this.getServiceName(),\r
-                       input,\r
-                       resourceMap,\r
-                       uriInfo,\r
-                       null /* the class of the input type */);\r
-       return ctx;\r
-    }\r
-    \r
-    protected ServiceContext<IT, OT> createServiceContext(\r
-               String serviceName,\r
-               IT input,\r
-               ResourceMap resourceMap,\r
-               UriInfo uriInfo) throws Exception {\r
-       ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       serviceName,\r
-                       input,\r
-                       resourceMap,\r
-                       uriInfo,\r
-                       null /* the class of the input type */);\r
-       return ctx;\r
-    }\r
-        \r
-    /**\r
-     * Creates the service context.\r
-     * \r
-     * @param input the input\r
-     * @param queryParams the query params\r
-     * @param theClass the the class\r
-     * \r
-     * @return the service context< i t, o t>\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    private ServiceContext<IT, OT> createServiceContext(\r
-               IT input,\r
-               UriInfo uriInfo,\r
-               Class<?> theClass) throws Exception {\r
-       return createServiceContext(this.getServiceName(),\r
-                       input,\r
-                       null, // The resource map\r
-                       uriInfo,\r
-                       theClass);\r
-    }\r
-\r
-    /**\r
-     * Creates the service context.\r
-     * \r
-     * @param serviceName the service name\r
-     * @param input the input\r
-     * @param queryParams the query params\r
-     * @param theClass the the class\r
-     * \r
-     * @return the service context< i t, o t>\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    private ServiceContext<IT, OT> createServiceContext(\r
-               String serviceName,\r
-               IT input,\r
-               ResourceMap resourceMap,\r
-               UriInfo uriInfo,\r
-               Class<?> theClass) throws Exception {\r
-        ServiceContext<IT, OT> ctx = getServiceContextFactory().createServiceContext(\r
-                       serviceName,\r
-                       input,\r
-                       resourceMap,\r
-                       uriInfo,\r
-                       theClass != null ? theClass.getPackage().getName() : null,\r
-                       theClass != null ? theClass.getName() : null);\r
-        if (theClass != null) {\r
-            ctx.setProperty(ServiceContextProperties.ENTITY_CLASS, theClass);\r
-        }\r
-        \r
-        return ctx;\r
-    }\r
-        \r
-    /**\r
-     * Gets the version string.\r
-     * \r
-     * @return the version string\r
-     */\r
-    abstract protected String getVersionString();\r
-    \r
-    /**\r
-     * Gets the version.\r
-     * \r
-     * @return the version\r
-     */\r
-    @GET\r
-    @Path("/version")    \r
-    @Produces("application/xml")\r
-    public Version getVersion() {\r
-       Version result = new Version();\r
-       \r
-       result.setVersionString(getVersionString());\r
-       \r
-       return result;\r
-    }\r
-\r
-    public void checkResult(Object resultToCheck, String csid, String serviceMessage) throws CSWebApplicationException {\r
-        if (resultToCheck == null) {\r
-            Response response = Response.status(Response.Status.NOT_FOUND).entity(\r
-                    serviceMessage + "csid=" + csid\r
-                    + ": was not found.").type(\r
-                    "text/plain").build();\r
-            throw new CSWebApplicationException(response);\r
-        }\r
-    }\r
-\r
-    protected void ensureCSID(String csid, String crudType) throws CSWebApplicationException {\r
-        ensureCSID(csid, crudType, "csid");\r
-    }\r
-\r
-    protected void ensureCSID(String csid, String crudType, String whichCsid) throws CSWebApplicationException {\r
-           if (logger.isDebugEnabled()) {\r
-               logger.debug(crudType + " for " + getClass().getName() + " with csid=" + csid);\r
-           }\r
-           if (csid == null || "".equals(csid)) {\r
-               logger.error(crudType + " for " + getClass().getName() + " missing csid!");\r
-               Response response = Response.status(Response.Status.BAD_REQUEST).entity(crudType + " failed on " + getClass().getName() + ' '+whichCsid+'=' + csid).type("text/plain").build();\r
-               throw new CSWebApplicationException(response);\r
-           }\r
-       }\r
-\r
-    protected CSWebApplicationException bigReThrow(Exception e, String serviceMsg) throws CSWebApplicationException {\r
-        return bigReThrow(e, serviceMsg, "");\r
-    }\r
-\r
-    protected CSWebApplicationException bigReThrow(Exception e, String serviceMsg, String csid) throws CSWebApplicationException {\r
-       boolean logException = true;\r
-       CSWebApplicationException result = null;\r
-        Response response;\r
-        String detail = Tools.errorToString(e, true);\r
-        String detailNoTrace = Tools.errorToString(e, true, 3);\r
-        \r
-        if (e instanceof UnauthorizedException) {\r
-            response = Response.status(Response.Status.UNAUTHORIZED).entity(serviceMsg + e.getMessage()).type("text/plain").build();\r
-            result = new CSWebApplicationException(e, response);\r
-\r
-        } else if (e instanceof DocumentNotFoundException) {\r
-               //\r
-               // Don't log this error unless we're in 'trace' mode\r
-               //\r
-               logException = false;\r
-            response = Response.status(Response.Status.NOT_FOUND).entity(serviceMsg + " on " + getClass().getName() + " csid=" + csid).type("text/plain").build();\r
-            result = new CSWebApplicationException(e, response);\r
-            \r
-        } else if (e instanceof TransactionException) {\r
-            int code = ((TransactionException) e).getErrorCode();\r
-            response = Response.status(code).entity(e.getMessage()).type("text/plain").build();\r
-            result = new CSWebApplicationException(e, response);\r
-\r
-        } else if (e instanceof BadRequestException) {\r
-            int code = ((BadRequestException) e).getErrorCode();\r
-            if (code == 0) {\r
-                code = Response.Status.BAD_REQUEST.getStatusCode();\r
-            }\r
-            // CSPACE-1110\r
-            response = Response.status(code).entity(serviceMsg + e.getMessage()).type("text/plain").build();\r
-            // return new WebApplicationException(e, code);\r
-            result = new CSWebApplicationException(e, response);\r
-\r
-        } else if (e instanceof DocumentException) {\r
-            int code = ((DocumentException) e).getErrorCode();\r
-            if (code == 0){\r
-               code = Response.Status.BAD_REQUEST.getStatusCode();\r
-            }\r
-            // CSPACE-1110\r
-            response = Response.status(code).entity(serviceMsg + e.getMessage()).type("text/plain").build();\r
-            // return new WebApplicationException(e, code);\r
-            result = new CSWebApplicationException(e, response);\r
-           \r
-        } else if (e instanceof CSWebApplicationException) {\r
-            // subresource may have already thrown this exception\r
-            // so just pass it on\r
-            result = (CSWebApplicationException) e;\r
-\r
-        } else { // e is now instanceof Exception\r
-            response = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(serviceMsg + " detail: " + detailNoTrace).type("text/plain").build();\r
-            result = new CSWebApplicationException(e, response);\r
-        }\r
-        //\r
-        // Some exceptions like DocumentNotFoundException won't be logged unless we're in 'trace' mode\r
-        //\r
-        boolean traceEnabled = logger.isTraceEnabled();\r
-        if (logException == true || traceEnabled == true) {\r
-               if (traceEnabled == true) {\r
-                       logger.error(getClass().getName() + " detail: " + detail, e);\r
-               } else {\r
-                       logger.error(getClass().getName() + " detail: " + detailNoTrace);\r
-               }\r
-        }\r
-        \r
-        return result;\r
-    }\r
-    \r
-       @Override\r
-       public boolean allowAnonymousAccess(HttpRequest request,\r
-                       ResourceMethod method) {\r
-               return false;\r
-       }    \r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common;
+
+import java.util.List;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+import org.collectionspace.services.common.CSWebApplicationException;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.context.ServiceContextProperties;
+import org.collectionspace.services.common.document.BadRequestException;
+import org.collectionspace.services.common.document.DocumentException;
+import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentNotFoundException;
+import org.collectionspace.services.common.document.TransactionException;
+import org.collectionspace.services.common.repository.RepositoryClient;
+import org.collectionspace.services.common.repository.RepositoryClientFactory;
+import org.collectionspace.services.common.security.UnauthorizedException;
+import org.collectionspace.services.common.storage.StorageClient;
+import org.collectionspace.services.common.storage.jpa.JpaStorageClientImpl;
+
+import org.jboss.resteasy.core.ResourceMethod;
+import org.jboss.resteasy.spi.HttpRequest;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class AbstractCollectionSpaceResourceImpl.
+ *
+ * @param <IT> the generic type
+ * @param <OT> the generic type
+ */
+public abstract class AbstractCollectionSpaceResourceImpl<IT, OT>
+        implements CollectionSpaceResource<IT, OT> {
+
+    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+
+    // Fields for default client factory and client
+    /** The repository client factory. */
+    private RepositoryClientFactory repositoryClientFactory;
+    
+    /** The repository client. */
+    private RepositoryClient repositoryClient;
+    
+    /** The storage client. */
+    private StorageClient storageClient;
+
+    /**
+     * Extract id.
+     *
+     * @param res the res
+     * @return the string
+     */
+    protected static String extractId(Response res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        String uri = (String) ((List<Object>) mvm.get("Location")).get(0);
+        String[] segments = uri.split("/");
+        String id = segments[segments.length - 1];
+        return id;
+    }    
+    
+    /**
+     * Instantiates a new abstract collection space resource.
+     */
+    public AbstractCollectionSpaceResourceImpl() {
+        repositoryClientFactory = RepositoryClientFactory.getInstance();
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.CollectionSpaceResource#getServiceName()
+     */
+    @Override
+    abstract public String getServiceName();
+
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.CollectionSpaceResource#getRepositoryClient(org.collectionspace.services.common.context.ServiceContext)
+     */
+    @Override
+    synchronized public RepositoryClient getRepositoryClient(ServiceContext<IT, OT> ctx) {
+        if(repositoryClient != null){
+            return repositoryClient;
+        }
+        repositoryClient = repositoryClientFactory.getClient(ctx.getRepositoryClientName());
+        return repositoryClient;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.CollectionSpaceResource#getStorageClient(org.collectionspace.services.common.context.ServiceContext)
+     */
+    @Override
+    synchronized public StorageClient getStorageClient(ServiceContext<IT, OT> ctx) {
+        if(storageClient != null) {
+            return storageClient;
+        }
+        storageClient = new JpaStorageClientImpl();
+        return storageClient;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.CollectionSpaceResource#createDocumentHandler(org.collectionspace.services.common.context.ServiceContext)
+     */
+    @Override
+    public DocumentHandler createDocumentHandler(ServiceContext<IT, OT> ctx) throws Exception {
+        DocumentHandler docHandler = createDocumentHandler(ctx, ctx.getInput());
+        return docHandler;
+    }
+    
+    /**
+     * Creates the document handler.
+     * 
+     * @param ctx the ctx
+     * @param commonPart the common part
+     * 
+     * @return the document handler
+     * 
+     * @throws Exception the exception
+     */
+    public DocumentHandler createDocumentHandler(ServiceContext<IT, OT> ctx,
+               Object commonPart) throws Exception {
+        DocumentHandler docHandler = ctx.getDocumentHandler();
+        docHandler.setCommonPart(commonPart);
+        return docHandler;
+    }    
+    
+    /**
+     * Creates the service context.
+     * 
+     * @return the service context< i t, o t>
+     * 
+     * @throws Exception the exception
+     */
+    protected ServiceContext<IT, OT> createServiceContext() throws Exception {         
+        ServiceContext<IT, OT> ctx = createServiceContext(this.getServiceName(),
+                       (IT)null, //inputType
+                       null, // The resource map
+                       (UriInfo)null, // The query params
+                       this.getCommonPartClass());
+        return ctx;
+    }    
+    
+    /**
+     * Creates the service context.
+     * 
+     * @param serviceName the service name
+     * 
+     * @return the service context< i t, o t>
+     * 
+     * @throws Exception the exception
+     */
+    protected ServiceContext<IT, OT> createServiceContext(String serviceName) throws Exception {       
+        ServiceContext<IT, OT> ctx = createServiceContext(
+                       serviceName,
+                       (IT)null, // The input part
+                       null, // The resource map
+                       (UriInfo)null, // The queryParams
+                       (Class<?>)null  /*input type's Class*/);
+        return ctx;
+    }
+    
+    protected ServiceContext<IT, OT> createServiceContext(String serviceName, UriInfo ui) throws Exception {           
+        ServiceContext<IT, OT> ctx = createServiceContext(
+                       serviceName,
+                       (IT)null, // The input part
+                       null, // The resource map
+                       (UriInfo)null, // The queryParams
+                       (Class<?>)null  /*input type's Class*/);
+        ctx.setUriInfo(ui);
+        return ctx;
+    }    
+    
+    /**
+     * Creates the service context.
+     * 
+     * @param serviceName the service name
+     * @param input the input
+     * 
+     * @return the service context< i t, o t>
+     * 
+     * @throws Exception the exception
+     */
+    protected ServiceContext<IT, OT> createServiceContext(String serviceName,
+               IT input) throws Exception {            
+        ServiceContext<IT, OT> ctx = createServiceContext(serviceName,
+                       input,
+                       null, // The resource map
+                       (UriInfo)null, /*queryParams*/
+                       (Class<?>)null  /*input type's Class*/);
+        return ctx;
+    }
+    
+    protected ServiceContext<IT, OT> createServiceContext(String serviceName,
+               IT input,
+               UriInfo uriInfo) throws Exception {     
+        ServiceContext<IT, OT> ctx = createServiceContext(serviceName,
+                       input,
+                       null, // The resource map
+                       uriInfo, /*queryParams*/
+                       (Class<?>)null  /*input type's Class*/);
+        return ctx;
+    }
+    
+    protected ServiceContext<IT, OT> createServiceContext(UriInfo uriInfo) throws Exception {
+        ServiceContext<IT, OT> ctx = createServiceContext(
+                       (IT)null, /*input*/
+                       uriInfo,
+                       (Class<?>)null  /*input type's Class*/);
+        return ctx;
+    }
+
+    /**
+     * Creates the service context.
+     * 
+     * @param input the input
+     * 
+     * @return the service context< i t, o t>
+     * 
+     * @throws Exception the exception
+     */
+    protected ServiceContext<IT, OT> createServiceContext(IT input) throws Exception {         
+        ServiceContext<IT, OT> ctx = createServiceContext(
+                       input,
+                       (Class<?>)null /*input type's Class*/);
+        return ctx;
+    }
+    
+    protected ServiceContext<IT, OT> createServiceContext(IT input, UriInfo uriInfo) throws Exception {        
+        ServiceContext<IT, OT> ctx = createServiceContext(
+                       input,
+                       uriInfo,
+                       null ); // The class param/argument
+        return ctx;
+    }    
+    
+    /**
+     * Creates the service context.
+     * 
+     * @param input the input
+     * @param theClass the the class
+     * 
+     * @return the service context
+     * 
+     * @throws Exception the exception
+     */
+    protected ServiceContext<IT, OT> createServiceContext(IT input, Class<?> theClass) throws Exception {      
+        ServiceContext<IT, OT> ctx = createServiceContext(
+                       input,
+                       (UriInfo)null, //queryParams,
+                       theClass);
+        return ctx;
+    }
+    
+    protected ServiceContext<IT, OT> createServiceContext(IT input, Class<?> theClass, UriInfo uriInfo) throws Exception {     
+        ServiceContext<IT, OT> ctx = createServiceContext(
+                       input,
+                       uriInfo,
+                       theClass);
+        return ctx;
+    }
+    
+    protected ServiceContext<IT, OT> createServiceContext(
+               String serviceName,
+               ResourceMap resourceMap,
+               UriInfo uriInfo) throws Exception {
+       ServiceContext<IT, OT> ctx = createServiceContext(
+                       serviceName,
+                       null, // The input object
+                       resourceMap,
+                       uriInfo,
+                       null /* the class of the input type */);
+       return ctx;
+    }
+        
+    protected ServiceContext<IT, OT> createServiceContext(
+               IT input,
+               ResourceMap resourceMap,
+               UriInfo uriInfo) throws Exception {
+       ServiceContext<IT, OT> ctx = createServiceContext(
+                       this.getServiceName(),
+                       input,
+                       resourceMap,
+                       uriInfo,
+                       null /* the class of the input type */);
+       return ctx;
+    }
+    
+    protected ServiceContext<IT, OT> createServiceContext(
+               String serviceName,
+               IT input,
+               ResourceMap resourceMap,
+               UriInfo uriInfo) throws Exception {
+       ServiceContext<IT, OT> ctx = createServiceContext(
+                       serviceName,
+                       input,
+                       resourceMap,
+                       uriInfo,
+                       null /* the class of the input type */);
+       return ctx;
+    }
+        
+    /**
+     * Creates the service context.
+     * 
+     * @param input the input
+     * @param queryParams the query params
+     * @param theClass the the class
+     * 
+     * @return the service context< i t, o t>
+     * 
+     * @throws Exception the exception
+     */
+    private ServiceContext<IT, OT> createServiceContext(
+               IT input,
+               UriInfo uriInfo,
+               Class<?> theClass) throws Exception {
+       return createServiceContext(this.getServiceName(),
+                       input,
+                       null, // The resource map
+                       uriInfo,
+                       theClass);
+    }
+
+    /**
+     * Creates the service context.
+     * 
+     * @param serviceName the service name
+     * @param input the input
+     * @param queryParams the query params
+     * @param theClass the the class
+     * 
+     * @return the service context< i t, o t>
+     * 
+     * @throws Exception the exception
+     */
+    private ServiceContext<IT, OT> createServiceContext(
+               String serviceName,
+               IT input,
+               ResourceMap resourceMap,
+               UriInfo uriInfo,
+               Class<?> theClass) throws Exception {
+        ServiceContext<IT, OT> ctx = getServiceContextFactory().createServiceContext(
+                       serviceName,
+                       input,
+                       resourceMap,
+                       uriInfo,
+                       theClass != null ? theClass.getPackage().getName() : null,
+                       theClass != null ? theClass.getName() : null);
+        if (theClass != null) {
+            ctx.setProperty(ServiceContextProperties.ENTITY_CLASS, theClass);
+        }
+        
+        return ctx;
+    }
+        
+    /**
+     * Gets the version string.
+     * 
+     * @return the version string
+     */
+    abstract protected String getVersionString();
+    
+    /**
+     * Gets the version.
+     * 
+     * @return the version
+     */
+    @GET
+    @Path("/version")    
+    @Produces("application/xml")
+    public Version getVersion() {
+       Version result = new Version();
+       
+       result.setVersionString(getVersionString());
+       
+       return result;
+    }
+
+    public void checkResult(Object resultToCheck, String csid, String serviceMessage) throws CSWebApplicationException {
+        if (resultToCheck == null) {
+            Response response = Response.status(Response.Status.NOT_FOUND).entity(
+                    serviceMessage + "csid=" + csid
+                    + ": was not found.").type(
+                    "text/plain").build();
+            throw new CSWebApplicationException(response);
+        }
+    }
+
+    protected void ensureCSID(String csid, String crudType) throws CSWebApplicationException {
+        ensureCSID(csid, crudType, "csid");
+    }
+
+    protected void ensureCSID(String csid, String crudType, String whichCsid) throws CSWebApplicationException {
+           if (logger.isDebugEnabled()) {
+               logger.debug(crudType + " for " + getClass().getName() + " with csid=" + csid);
+           }
+           if (csid == null || "".equals(csid)) {
+               logger.error(crudType + " for " + getClass().getName() + " missing csid!");
+               Response response = Response.status(Response.Status.BAD_REQUEST).entity(crudType + " failed on " + getClass().getName() + ' '+whichCsid+'=' + csid).type("text/plain").build();
+               throw new CSWebApplicationException(response);
+           }
+       }
+
+    protected CSWebApplicationException bigReThrow(Exception e, String serviceMsg) throws CSWebApplicationException {
+        return bigReThrow(e, serviceMsg, "");
+    }
+
+    protected CSWebApplicationException bigReThrow(Exception e, String serviceMsg, String csid) throws CSWebApplicationException {
+       boolean logException = true;
+       CSWebApplicationException result = null;
+        Response response;
+        String detail = Tools.errorToString(e, true);
+        String detailNoTrace = Tools.errorToString(e, true, 3);
+        
+        if (e instanceof UnauthorizedException) {
+            response = Response.status(Response.Status.UNAUTHORIZED).entity(serviceMsg + e.getMessage()).type("text/plain").build();
+            result = new CSWebApplicationException(e, response);
+
+        } else if (e instanceof DocumentNotFoundException) {
+               //
+               // Don't log this error unless we're in 'trace' mode
+               //
+               logException = false;
+            response = Response.status(Response.Status.NOT_FOUND).entity(serviceMsg + " on " + getClass().getName() + " csid=" + csid).type("text/plain").build();
+            result = new CSWebApplicationException(e, response);
+            
+        } else if (e instanceof TransactionException) {
+            int code = ((TransactionException) e).getErrorCode();
+            response = Response.status(code).entity(e.getMessage()).type("text/plain").build();
+            result = new CSWebApplicationException(e, response);
+
+        } else if (e instanceof BadRequestException) {
+            int code = ((BadRequestException) e).getErrorCode();
+            if (code == 0) {
+                code = Response.Status.BAD_REQUEST.getStatusCode();
+            }
+            // CSPACE-1110
+            response = Response.status(code).entity(serviceMsg + e.getMessage()).type("text/plain").build();
+            // return new WebApplicationException(e, code);
+            result = new CSWebApplicationException(e, response);
+
+        } else if (e instanceof DocumentException) {
+            int code = ((DocumentException) e).getErrorCode();
+            if (code == 0){
+               code = Response.Status.BAD_REQUEST.getStatusCode();
+            }
+            // CSPACE-1110
+            response = Response.status(code).entity(serviceMsg + e.getMessage()).type("text/plain").build();
+            // return new WebApplicationException(e, code);
+            result = new CSWebApplicationException(e, response);
+           
+        } else if (e instanceof CSWebApplicationException) {
+            // subresource may have already thrown this exception
+            // so just pass it on
+            result = (CSWebApplicationException) e;
+
+        } else { // e is now instanceof Exception
+            response = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(serviceMsg + " detail: " + detailNoTrace).type("text/plain").build();
+            result = new CSWebApplicationException(e, response);
+        }
+        //
+        // Some exceptions like DocumentNotFoundException won't be logged unless we're in 'trace' mode
+        //
+        boolean traceEnabled = logger.isTraceEnabled();
+        if (logException == true || traceEnabled == true) {
+               if (traceEnabled == true) {
+                       logger.error(getClass().getName() + " detail: " + detail, e);
+               } else {
+                       logger.error(getClass().getName() + " detail: " + detailNoTrace);
+               }
+        }
+        
+        return result;
+    }
+    
+       @Override
+       public boolean allowAnonymousAccess(HttpRequest request,
+                       ResourceMethod method) {
+               return false;
+       }    
+}
index 726b1420d8557805d355be61340bd0145233ae3f..1dcc3db3540846e939d88f8c259acb9d58295990 100644 (file)
-/**    \r
- * AbstractMultiPartCollectionSpaceResourceImpl.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import java.util.Iterator;\r
-import java.util.List;\r
-\r
-import javax.ws.rs.GET;\r
-import javax.ws.rs.PUT;\r
-import javax.ws.rs.Path;\r
-import javax.ws.rs.PathParam;\r
-import javax.ws.rs.core.Context;\r
-import javax.ws.rs.core.UriInfo;\r
-\r
-import org.collectionspace.services.client.PayloadOutputPart;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.client.workflow.WorkflowClient;\r
-import org.collectionspace.services.common.context.MultipartServiceContext;\r
-import org.collectionspace.services.common.context.MultipartServiceContextFactory;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.context.ServiceContextFactory;\r
-import org.collectionspace.services.common.document.DocumentHandler;\r
-import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;\r
-import org.collectionspace.services.lifecycle.Lifecycle;\r
-import org.collectionspace.services.lifecycle.TransitionDef;\r
-import org.collectionspace.services.workflow.WorkflowCommon;\r
-import org.dom4j.DocumentException;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * The Class AbstractMultiPartCollectionSpaceResourceImpl.\r
- */\r
-public abstract class AbstractMultiPartCollectionSpaceResourceImpl extends AbstractCollectionSpaceResourceImpl<PoxPayloadIn, PoxPayloadOut> {\r
-\r
-    protected final Logger logger = LoggerFactory.getLogger(this.getClass());\r
-\r
-    @Override\r
-    public ServiceContextFactory<PoxPayloadIn, PoxPayloadOut> getServiceContextFactory() {\r
-        return MultipartServiceContextFactory.get();\r
-    }\r
-    \r
-    abstract protected String getOrderByField(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx);    \r
-\r
-       abstract protected String getPartialTermMatchField(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx);\r
-    \r
-    @Override\r
-    public DocumentHandler createDocumentHandler(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {\r
-        return createDocumentHandler(ctx, ctx.getCommonPartLabel(), getCommonPartClass());\r
-    }\r
-\r
-    /**\r
-     * Creates the document handler.\r
-     * \r
-     * @param serviceContext the service context\r
-     * @param schemaName the schema name\r
-     * @param commonClass the common class\r
-     * \r
-     * @return the document handler\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    public DocumentHandler createDocumentHandler(ServiceContext<PoxPayloadIn, PoxPayloadOut> serviceContext,\r
-            String schemaName,\r
-            Class<?> commonClass) throws Exception {\r
-        DocumentHandler result = null;\r
-\r
-        MultipartServiceContext ctx = (MultipartServiceContext) serviceContext;\r
-        Object commonPart = null;\r
-        if (ctx.getInput() != null) {\r
-            commonPart = ctx.getInputPart(schemaName);\r
-        }\r
-        result = super.createDocumentHandler(ctx, commonPart);\r
-\r
-        return result;\r
-    }\r
-\r
-    /**\r
-     * Creates the document handler.\r
-     * \r
-     * @param ctx the ctx\r
-     * @param commonClass the common class\r
-     * \r
-     * @return the document handler\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    public DocumentHandler createDocumentHandler(\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            Class<Object> commonClass) throws Exception {\r
-        return createDocumentHandler(ctx, ctx.getCommonPartLabel(), commonClass);\r
-    }\r
-\r
-    /**\r
-     * Creates the contact document handler.\r
-     * \r
-     * @param ctx the ctx\r
-     * @param inAuthority the in authority\r
-     * @param inItem the in item\r
-     * \r
-     * @return the document handler\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    protected WorkflowDocumentModelHandler createWorkflowDocumentHandler(\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {\r
-\r
-        WorkflowDocumentModelHandler docHandler = (WorkflowDocumentModelHandler) createDocumentHandler(ctx,\r
-                WorkflowClient.SERVICE_COMMONPART_NAME,\r
-                WorkflowCommon.class);\r
-\r
-        return docHandler;\r
-    }\r
-\r
-    /*\r
-     * JAX-RS Annotated methods\r
-     */\r
-    @GET\r
-    @Path(WorkflowClient.SERVICE_PATH)\r
-    public Lifecycle getWorkflow(@Context UriInfo uriInfo) {\r
-       Lifecycle result;\r
-\r
-        String documentType = "undefined";\r
-        MultipartServiceContext ctx = null;\r
-        try {\r
-            ctx = (MultipartServiceContext) createServiceContext(uriInfo);\r
-            DocumentHandler handler = ctx.getDocumentHandler();\r
-            result = handler.getLifecycle();\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.READ_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, ctx.getDocumentType());\r
-        }\r
-\r
-        if (result == null) {\r
-               result = new Lifecycle();\r
-               result.setName("No life cycle defined for:" + documentType);\r
-        }\r
-        \r
-        return result;\r
-    }\r
-    \r
-    /*\r
-     * JAX-RS Annotated methods\r
-     */\r
-    \r
-    /*\r
-     * We should change this method.  The RepositoryClient (from call to getRepositoryClient) should support a call getWorkflowTransition() instead.\r
-     */    \r
-    @GET\r
-    @Path("{csid}" + WorkflowClient.SERVICE_PATH)\r
-    public byte[] getWorkflow(\r
-               @Context UriInfo uriInfo,\r
-            @PathParam("csid") String csid) {\r
-        PoxPayloadOut result = null;\r
-\r
-        try {\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx = createServiceContext(uriInfo);\r
-            String parentWorkspaceName = parentCtx.getRepositoryWorkspaceName();\r
-\r
-            MultipartServiceContext ctx = (MultipartServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME, uriInfo);\r
-            WorkflowDocumentModelHandler handler = createWorkflowDocumentHandler(ctx);\r
-            ctx.setRespositoryWorkspaceName(parentWorkspaceName); //find the document in the parent's workspace\r
-            getRepositoryClient(ctx).get(ctx, csid, handler);\r
-            result = ctx.getOutput();\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.READ_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, csid);\r
-        }\r
-\r
-        return result.getBytes();\r
-    }\r
-    \r
-    protected TransitionDef getTransitionDef(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx, String transition) {\r
-       TransitionDef result = null;\r
-       \r
-       try {\r
-                       Lifecycle lifecycle = ctx.getDocumentHandler().getLifecycle();\r
-                       List<TransitionDef> transitionDefList = lifecycle.getTransitionDefList().getTransitionDef();\r
-                       Iterator<TransitionDef> iter = transitionDefList.iterator();\r
-                       boolean found = false;\r
-                       while (iter.hasNext() && found == false) {\r
-                               TransitionDef transitionDef = iter.next();\r
-                               if (transitionDef.getName().equalsIgnoreCase(transition)) {\r
-                                       result = transitionDef;\r
-                                       found = true;\r
-                               }\r
-                       }\r
-               } catch (Exception e) {\r
-                       logger.error("Exception trying to retreive life cycle information for: " + ctx.getDocumentType());\r
-               }\r
-       \r
-       return result;\r
-    }\r
-    \r
-    private PoxPayloadIn synthEmptyWorkflowInput() {\r
-       PoxPayloadIn result = null;\r
-       \r
-        PoxPayloadOut output = new PoxPayloadOut(WorkflowClient.SERVICE_PAYLOAD_NAME);\r
-       WorkflowCommon workflowCommons = new WorkflowCommon();\r
-        PayloadOutputPart commonPart = output.addPart(WorkflowClient.SERVICE_COMMONPART_NAME, workflowCommons);\r
-        String payloadXML = output.toXML();\r
-        try {\r
-                       result = new PoxPayloadIn(payloadXML);\r
-               } catch (DocumentException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-        \r
-       return result;\r
-    }\r
-    \r
-    /*\r
-     * We should change this code.  The RepositoryClient (from call to getRepositoryClient) should support a call doWorkflowTransition() instead.\r
-     */\r
-    //FIXME: This method is almost identical to the method org.collectionspace.services.common.vocabulary.updateWorkflowWithTransition() so\r
-    // they should be consolidated -be DRY (don't repeat yourself).\r
-\r
-    @PUT\r
-    @Path("{csid}" + WorkflowClient.SERVICE_PATH + "/" + "{transition}")\r
-    public byte[] updateWorkflowWithTransition(\r
-               @Context UriInfo uriInfo,\r
-               @PathParam("csid") String csid,\r
-               @PathParam("transition") String transition) {\r
-        PoxPayloadOut result = null;\r
-                \r
-        try {\r
-               //\r
-               // Create an empty workflow_commons input part and set it into a new "workflow" sub-resource context\r
-               PoxPayloadIn input = new PoxPayloadIn(WorkflowClient.SERVICE_PAYLOAD_NAME, new WorkflowCommon(), \r
-                               WorkflowClient.SERVICE_COMMONPART_NAME);\r
-            MultipartServiceContext ctx = (MultipartServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME, input, uriInfo);\r
-               \r
-            // Create a service context and document handler for the parent resource.\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx = createServiceContext(uriInfo);\r
-            DocumentHandler parentDocHandler = this.createDocumentHandler(parentCtx);      \r
-            ctx.setProperty(WorkflowClient.PARENT_DOCHANDLER, parentDocHandler); //added as a context param for the workflow document handler -it will call the parent's dochandler "prepareForWorkflowTranstion" method\r
-\r
-            // When looking for the document, we need to use the parent's workspace name -not the "workflow" workspace name\r
-            String parentWorkspaceName = parentCtx.getRepositoryWorkspaceName();\r
-            ctx.setRespositoryWorkspaceName(parentWorkspaceName); //find the document in the parent's workspace\r
-            \r
-               // Get the type of transition we're being asked to make and store it as a context parameter -used by the workflow document handler\r
-            TransitionDef transitionDef = getTransitionDef(parentCtx, transition);\r
-            ctx.setProperty(WorkflowClient.TRANSITION_ID, transitionDef);\r
-\r
-            WorkflowDocumentModelHandler handler = createWorkflowDocumentHandler(ctx);\r
-            getRepositoryClient(ctx).update(ctx, csid, handler);\r
-            result = ctx.getOutput();\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.UPDATE_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, csid);\r
-        }\r
-        return result.getBytes();\r
-    }\r
-    \r
-}\r
+/**    
+ * AbstractMultiPartCollectionSpaceResourceImpl.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.client.workflow.WorkflowClient;
+import org.collectionspace.services.common.context.MultipartServiceContext;
+import org.collectionspace.services.common.context.MultipartServiceContextFactory;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.context.ServiceContextFactory;
+import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;
+import org.collectionspace.services.lifecycle.Lifecycle;
+import org.collectionspace.services.lifecycle.TransitionDef;
+import org.collectionspace.services.workflow.WorkflowCommon;
+import org.dom4j.DocumentException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class AbstractMultiPartCollectionSpaceResourceImpl.
+ */
+public abstract class AbstractMultiPartCollectionSpaceResourceImpl extends AbstractCollectionSpaceResourceImpl<PoxPayloadIn, PoxPayloadOut> {
+
+    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Override
+    public ServiceContextFactory<PoxPayloadIn, PoxPayloadOut> getServiceContextFactory() {
+        return MultipartServiceContextFactory.get();
+    }
+    
+    abstract protected String getOrderByField(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx);    
+
+       abstract protected String getPartialTermMatchField(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx);
+    
+    @Override
+    public DocumentHandler createDocumentHandler(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {
+        return createDocumentHandler(ctx, ctx.getCommonPartLabel(), getCommonPartClass());
+    }
+
+    /**
+     * Creates the document handler.
+     * 
+     * @param serviceContext the service context
+     * @param schemaName the schema name
+     * @param commonClass the common class
+     * 
+     * @return the document handler
+     * 
+     * @throws Exception the exception
+     */
+    public DocumentHandler createDocumentHandler(ServiceContext<PoxPayloadIn, PoxPayloadOut> serviceContext,
+            String schemaName,
+            Class<?> commonClass) throws Exception {
+        DocumentHandler result = null;
+
+        MultipartServiceContext ctx = (MultipartServiceContext) serviceContext;
+        Object commonPart = null;
+        if (ctx.getInput() != null) {
+            commonPart = ctx.getInputPart(schemaName);
+        }
+        result = super.createDocumentHandler(ctx, commonPart);
+
+        return result;
+    }
+
+    /**
+     * Creates the document handler.
+     * 
+     * @param ctx the ctx
+     * @param commonClass the common class
+     * 
+     * @return the document handler
+     * 
+     * @throws Exception the exception
+     */
+    public DocumentHandler createDocumentHandler(
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            Class<Object> commonClass) throws Exception {
+        return createDocumentHandler(ctx, ctx.getCommonPartLabel(), commonClass);
+    }
+
+    /**
+     * Creates the contact document handler.
+     * 
+     * @param ctx the ctx
+     * @param inAuthority the in authority
+     * @param inItem the in item
+     * 
+     * @return the document handler
+     * 
+     * @throws Exception the exception
+     */
+    protected WorkflowDocumentModelHandler createWorkflowDocumentHandler(
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {
+
+        WorkflowDocumentModelHandler docHandler = (WorkflowDocumentModelHandler) createDocumentHandler(ctx,
+                WorkflowClient.SERVICE_COMMONPART_NAME,
+                WorkflowCommon.class);
+
+        return docHandler;
+    }
+
+    /*
+     * JAX-RS Annotated methods
+     */
+    @GET
+    @Path(WorkflowClient.SERVICE_PATH)
+    public Lifecycle getWorkflow(@Context UriInfo uriInfo) {
+       Lifecycle result;
+
+        String documentType = "undefined";
+        MultipartServiceContext ctx = null;
+        try {
+            ctx = (MultipartServiceContext) createServiceContext(uriInfo);
+            DocumentHandler handler = ctx.getDocumentHandler();
+            result = handler.getLifecycle();
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.READ_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, ctx.getDocumentType());
+        }
+
+        if (result == null) {
+               result = new Lifecycle();
+               result.setName("No life cycle defined for:" + documentType);
+        }
+        
+        return result;
+    }
+    
+    /*
+     * JAX-RS Annotated methods
+     */
+    
+    /*
+     * We should change this method.  The RepositoryClient (from call to getRepositoryClient) should support a call getWorkflowTransition() instead.
+     */    
+    @GET
+    @Path("{csid}" + WorkflowClient.SERVICE_PATH)
+    public byte[] getWorkflow(
+               @Context UriInfo uriInfo,
+            @PathParam("csid") String csid) {
+        PoxPayloadOut result = null;
+
+        try {
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx = createServiceContext(uriInfo);
+            String parentWorkspaceName = parentCtx.getRepositoryWorkspaceName();
+
+            MultipartServiceContext ctx = (MultipartServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME, uriInfo);
+            WorkflowDocumentModelHandler handler = createWorkflowDocumentHandler(ctx);
+            ctx.setRespositoryWorkspaceName(parentWorkspaceName); //find the document in the parent's workspace
+            getRepositoryClient(ctx).get(ctx, csid, handler);
+            result = ctx.getOutput();
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.READ_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, csid);
+        }
+
+        return result.getBytes();
+    }
+    
+    protected TransitionDef getTransitionDef(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx, String transition) {
+       TransitionDef result = null;
+       
+       try {
+                       Lifecycle lifecycle = ctx.getDocumentHandler().getLifecycle();
+                       List<TransitionDef> transitionDefList = lifecycle.getTransitionDefList().getTransitionDef();
+                       Iterator<TransitionDef> iter = transitionDefList.iterator();
+                       boolean found = false;
+                       while (iter.hasNext() && found == false) {
+                               TransitionDef transitionDef = iter.next();
+                               if (transitionDef.getName().equalsIgnoreCase(transition)) {
+                                       result = transitionDef;
+                                       found = true;
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error("Exception trying to retreive life cycle information for: " + ctx.getDocumentType());
+               }
+       
+       return result;
+    }
+    
+    private PoxPayloadIn synthEmptyWorkflowInput() {
+       PoxPayloadIn result = null;
+       
+        PoxPayloadOut output = new PoxPayloadOut(WorkflowClient.SERVICE_PAYLOAD_NAME);
+       WorkflowCommon workflowCommons = new WorkflowCommon();
+        PayloadOutputPart commonPart = output.addPart(WorkflowClient.SERVICE_COMMONPART_NAME, workflowCommons);
+        String payloadXML = output.toXML();
+        try {
+                       result = new PoxPayloadIn(payloadXML);
+               } catch (DocumentException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+        
+       return result;
+    }
+    
+    /*
+     * We should change this code.  The RepositoryClient (from call to getRepositoryClient) should support a call doWorkflowTransition() instead.
+     */
+    //FIXME: This method is almost identical to the method org.collectionspace.services.common.vocabulary.updateWorkflowWithTransition() so
+    // they should be consolidated -be DRY (don't repeat yourself).
+
+    @PUT
+    @Path("{csid}" + WorkflowClient.SERVICE_PATH + "/" + "{transition}")
+    public byte[] updateWorkflowWithTransition(
+               @Context UriInfo uriInfo,
+               @PathParam("csid") String csid,
+               @PathParam("transition") String transition) {
+        PoxPayloadOut result = null;
+                
+        try {
+               //
+               // Create an empty workflow_commons input part and set it into a new "workflow" sub-resource context
+               PoxPayloadIn input = new PoxPayloadIn(WorkflowClient.SERVICE_PAYLOAD_NAME, new WorkflowCommon(), 
+                               WorkflowClient.SERVICE_COMMONPART_NAME);
+            MultipartServiceContext ctx = (MultipartServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME, input, uriInfo);
+               
+            // Create a service context and document handler for the parent resource.
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx = createServiceContext(uriInfo);
+            DocumentHandler parentDocHandler = this.createDocumentHandler(parentCtx);      
+            ctx.setProperty(WorkflowClient.PARENT_DOCHANDLER, parentDocHandler); //added as a context param for the workflow document handler -it will call the parent's dochandler "prepareForWorkflowTranstion" method
+
+            // When looking for the document, we need to use the parent's workspace name -not the "workflow" workspace name
+            String parentWorkspaceName = parentCtx.getRepositoryWorkspaceName();
+            ctx.setRespositoryWorkspaceName(parentWorkspaceName); //find the document in the parent's workspace
+            
+               // Get the type of transition we're being asked to make and store it as a context parameter -used by the workflow document handler
+            TransitionDef transitionDef = getTransitionDef(parentCtx, transition);
+            ctx.setProperty(WorkflowClient.TRANSITION_ID, transitionDef);
+
+            WorkflowDocumentModelHandler handler = createWorkflowDocumentHandler(ctx);
+            getRepositoryClient(ctx).update(ctx, csid, handler);
+            result = ctx.getOutput();
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.UPDATE_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, csid);
+        }
+        return result.getBytes();
+    }
+    
+}
index 53477a4bc2f55eea11625433de56626b243fecd9..078988fe4c235efcc76abfdd494c6f6f57bc4c76 100644 (file)
@@ -1,65 +1,65 @@
-package org.collectionspace.services.common;\r
-\r
-public class ConfigurationException extends ServiceException {\r
-       /**\r
-        * \r
-        */\r
-       private static final long serialVersionUID = -6399176494104282779L;\r
-       \r
-       final public static int HTTP_CODE = 500;\r
-\r
-    /**\r
-     * Creates a new instance of <code>BadRequestException</code> without detail message.\r
-     */\r
-    public ConfigurationException() {\r
-        super(HTTP_CODE);\r
-    }\r
-\r
-    /**\r
-     * Constructs an instance of <code>BadRequestException</code> with the specified detail message.\r
-     * @param msg the detail message.\r
-     */\r
-    public ConfigurationException(String msg) {\r
-        super(msg);\r
-        setErrorCode(HTTP_CODE);\r
-    }\r
-\r
-    /**\r
-     * Constructs a new exception with the specified detail message and\r
-     * cause.  <p>Note that the detail message associated with\r
-     * <code>cause</code> is <i>not</i> automatically incorporated in\r
-     * this exception's detail message.\r
-     *\r
-     * @param  message the detail message (which is saved for later retrieval\r
-     *         by the {@link #getMessage()} method).\r
-     * @param  cause the cause (which is saved for later retrieval by the\r
-     *         {@link #getCause()} method).  (A <tt>null</tt> value is\r
-     *         permitted, and indicates that the cause is nonexistent or\r
-     *         unknown.)\r
-     * @since  1.4\r
-     */\r
-    public ConfigurationException(String message, Throwable cause) {\r
-        super(message, cause);\r
-        setErrorCode(HTTP_CODE);\r
-    }\r
-    \r
-    /**\r
-     * Constructs a new exception with the specified cause and a detail\r
-     * message of <tt>(cause==null ? null : cause.toString())</tt> (which\r
-     * typically contains the class and detail message of <tt>cause</tt>).\r
-     * This constructor is useful for exceptions that are little more than\r
-     * wrappers for other throwables (for example, {@link\r
-     * java.security.PrivilegedActionException}).\r
-     *\r
-     * @param  cause the cause (which is saved for later retrieval by the\r
-     *         {@link #getCause()} method).  (A <tt>null</tt> value is\r
-     *         permitted, and indicates that the cause is nonexistent or\r
-     *         unknown.)\r
-     * @since  1.4\r
-     */\r
-    public ConfigurationException(Throwable cause) {\r
-        super(cause);\r
-        setErrorCode(HTTP_CODE);\r
-    }\r
-    \r
-}\r
+package org.collectionspace.services.common;
+
+public class ConfigurationException extends ServiceException {
+       /**
+        * 
+        */
+       private static final long serialVersionUID = -6399176494104282779L;
+       
+       final public static int HTTP_CODE = 500;
+
+    /**
+     * Creates a new instance of <code>BadRequestException</code> without detail message.
+     */
+    public ConfigurationException() {
+        super(HTTP_CODE);
+    }
+
+    /**
+     * Constructs an instance of <code>BadRequestException</code> with the specified detail message.
+     * @param msg the detail message.
+     */
+    public ConfigurationException(String msg) {
+        super(msg);
+        setErrorCode(HTTP_CODE);
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message and
+     * cause.  <p>Note that the detail message associated with
+     * <code>cause</code> is <i>not</i> automatically incorporated in
+     * this exception's detail message.
+     *
+     * @param  message the detail message (which is saved for later retrieval
+     *         by the {@link #getMessage()} method).
+     * @param  cause the cause (which is saved for later retrieval by the
+     *         {@link #getCause()} method).  (A <tt>null</tt> value is
+     *         permitted, and indicates that the cause is nonexistent or
+     *         unknown.)
+     * @since  1.4
+     */
+    public ConfigurationException(String message, Throwable cause) {
+        super(message, cause);
+        setErrorCode(HTTP_CODE);
+    }
+    
+    /**
+     * Constructs a new exception with the specified cause and a detail
+     * message of <tt>(cause==null ? null : cause.toString())</tt> (which
+     * typically contains the class and detail message of <tt>cause</tt>).
+     * This constructor is useful for exceptions that are little more than
+     * wrappers for other throwables (for example, {@link
+     * java.security.PrivilegedActionException}).
+     *
+     * @param  cause the cause (which is saved for later retrieval by the
+     *         {@link #getCause()} method).  (A <tt>null</tt> value is
+     *         permitted, and indicates that the cause is nonexistent or
+     *         unknown.)
+     * @since  1.4
+     */
+    public ConfigurationException(Throwable cause) {
+        super(cause);
+        setErrorCode(HTTP_CODE);
+    }
+    
+}
index e4fd7cb72d2923cc714eec2a0fcae57e9c4f72f4..c3750ce5ce11397246b85bc5a92ee26b15727de8 100644 (file)
-package org.collectionspace.services.common;\r
-import java.io.*;\r
-import java.net.*;\r
-import java.util.*;\r
-\r
-// This class downloads a file from a URL.\r
-public class Download extends Observable implements Runnable {\r
-    \r
-    public static URL verifyUrl(String url) {\r
-        // Only allow HTTP URLs.\r
-        if (!url.toLowerCase().startsWith("http://"))\r
-            return null;\r
-        \r
-        // Verify format of URL.\r
-        URL verifiedUrl = null;\r
-        try {\r
-            verifiedUrl = new URL(url);\r
-        } catch (Exception e) {\r
-            return null;\r
-        }\r
-        \r
-        // Make sure URL specifies a file.\r
-        if (verifiedUrl.getFile().length() < 2)\r
-            return null;\r
-        \r
-        return verifiedUrl;\r
-    }\r
-    \r
-    // Max size of download buffer.\r
-    private static final int MAX_BUFFER_SIZE = 1024;\r
-    \r
-    // These are the status names.\r
-    public static final String STATUSES[] = {"Downloading",\r
-    "Paused", "Complete", "Cancelled", "Error"};\r
-    \r
-    // These are the status codes.\r
-    public static final int DOWNLOADING = 0;\r
-    public static final int PAUSED = 1;\r
-    public static final int COMPLETE = 2;\r
-    public static final int CANCELLED = 3;\r
-    public static final int ERROR = 4;\r
-    \r
-    private String errorMessage = null;\r
-    private String filePath = null;\r
-    private File downloadedFile = null;\r
-    private String destDir = null; // the location of the downloaded file\r
-    private URL url; // download URL\r
-    private int size; // size of download in bytes\r
-    private int downloaded; // number of bytes downloaded\r
-    private int status; // current status of download\r
-    \r
-    private void doDownload(URL url, String destDir) {\r
-        size = -1;\r
-        downloaded = 0;\r
-        status = DOWNLOADING;\r
-        this.url = url;\r
-        setDestDir(destDir);\r
-       \r
-        // Begin the download.\r
-        download();\r
-    }\r
-    \r
-    public Download(URL url, String destDir) {\r
-        doDownload(url, destDir);\r
-    }\r
-\r
-    // Constructor for Download.  File is uploaded to system temp directory.\r
-    public Download(URL url) {\r
-       String tmpdir = System.getProperty("java.io.tmpdir");\r
-       if (tmpdir.endsWith(File.separator) == false) {\r
-               tmpdir = tmpdir + File.separator;\r
-       }\r
-       doDownload(url, tmpdir\r
-                       + UUID.randomUUID() + File.separator);\r
-    }\r
-    \r
-    private void setDestDir(String destDir) {\r
-        if (destDir.endsWith(File.separator) != true) {\r
-               destDir = destDir + File.separator;\r
-        }\r
-        //\r
-        // Check if the destDir exists, if not try to create it.\r
-        //\r
-        File destDirFile = new File(destDir);\r
-        boolean destDirExists = destDirFile.exists();\r
-        if (destDirExists == false) {\r
-               destDirExists = destDirFile.mkdir();\r
-        } else {\r
-               destDirExists = destDirFile.isDirectory();\r
-        }\r
-        //\r
-        // If we couldn't create the directory or if it is already a file then fail.\r
-        //\r
-        if (destDirExists = true) {\r
-               this.destDir = destDir;\r
-        } else {\r
-               error("Could not download file to: " + destDir);\r
-        }\r
-    }\r
-    \r
-    \r
-    public File getFile() {\r
-       return this.downloadedFile;\r
-    }\r
-    \r
-    public String getFilePath() {\r
-       return this.filePath;\r
-    }\r
-    \r
-    public String getDestDir() {\r
-       return this.destDir;\r
-    }\r
-    \r
-    // Get this download's URL.\r
-    public String getUrl() {\r
-        return url.toString();\r
-    }\r
-    \r
-    // Get this download's size.\r
-    public int getSize() {\r
-        return size;\r
-    }\r
-    \r
-    // Get this download's progress.\r
-    public float getProgress() {\r
-        return ((float) downloaded / size) * 100;\r
-    }\r
-    \r
-    // Get this download's status.\r
-    public int getStatus() {\r
-        return status;\r
-    }\r
-    \r
-    // Pause this download.\r
-    public void pause() {\r
-        status = PAUSED;\r
-        stateChanged();\r
-    }\r
-    \r
-    // Resume this download.\r
-    public void resume() {\r
-        status = DOWNLOADING;\r
-        stateChanged();\r
-        download();\r
-    }\r
-    \r
-    // Cancel this download.\r
-    public void cancel() {\r
-        status = CANCELLED;\r
-        stateChanged();\r
-    }\r
-    \r
-    // Mark this download as having an error.\r
-    private void error() {\r
-        status = ERROR;\r
-        stateChanged();\r
-    }\r
-    \r
-    // Mark this download as having an error.\r
-    private void error(String message) {\r
-        this.errorMessage = message;\r
-        error();\r
-    }    \r
-    \r
-    // Start or resume downloading.\r
-    private void download() {\r
-//        Thread thread = new Thread(this);\r
-//        thread.start();\r
-       run();\r
-    }\r
-    \r
-    // Get file name portion of URL.\r
-    private String getFileName(URL url) {\r
-       String result = null;\r
-       \r
-       String destDir = this.getDestDir();\r
-        String fileName = url.getFile();\r
-        fileName = fileName.substring(fileName.lastIndexOf('/') + 1);\r
-        result = filePath = destDir + fileName;\r
-        \r
-        return result;\r
-    }\r
-    \r
-    // Download file.\r
-    public void run() {\r
-        RandomAccessFile file = null;\r
-        InputStream stream = null;\r
-        \r
-        try {\r
-            // Open connection to URL.\r
-            HttpURLConnection connection =\r
-                    (HttpURLConnection) url.openConnection();\r
-            \r
-            // Specify what portion of file to download.\r
-            connection.setRequestProperty("Range",\r
-                    "bytes=" + downloaded + "-");\r
-            \r
-            // Connect to server.\r
-            connection.connect();\r
-            \r
-            // Make sure response code is in the 200 range.\r
-            int responseCode = connection.getResponseCode();\r
-            if (responseCode / 100 != 2) {\r
-                error();\r
-            }\r
-            \r
-            // Check for valid content length.\r
-            int contentLength = connection.getContentLength();\r
-            if (contentLength < 1) {\r
-                error();\r
-            }\r
-            \r
-      /* Set the size for this download if it\r
-         hasn't been already set. */\r
-            if (size == -1) {\r
-                size = contentLength;\r
-                stateChanged();\r
-            }\r
-            \r
-            // Open file and seek to the end of it.\r
-            File javaFile = new File(getFileName(url));\r
-            file = new RandomAccessFile(javaFile, "rw");\r
-            file.seek(downloaded);\r
-            \r
-            stream = connection.getInputStream();\r
-            while (status == DOWNLOADING) {\r
-        /* Size buffer according to how much of the\r
-           file is left to download. */\r
-                byte buffer[];\r
-                if (size - downloaded > MAX_BUFFER_SIZE) {\r
-                    buffer = new byte[MAX_BUFFER_SIZE];\r
-                } else {\r
-                    buffer = new byte[size - downloaded];\r
-                }\r
-                \r
-                // Read from server into buffer.\r
-                int read = stream.read(buffer);\r
-                if (read == -1)\r
-                    break;\r
-                \r
-                // Write buffer to file.\r
-                file.write(buffer, 0, read);\r
-                downloaded += read;\r
-                stateChanged();\r
-            }\r
-            \r
-      /* Change status to complete if this point was\r
-         reached because downloading has finished. */\r
-            if (status == DOWNLOADING) {\r
-                status = COMPLETE;\r
-                downloadedFile = new File(this.getFilePath());\r
-                stateChanged();\r
-            }\r
-        } catch (Exception e) {\r
-               e.printStackTrace();\r
-            error();\r
-        } finally {\r
-            // Close file.\r
-            if (file != null) {\r
-                try {\r
-                    file.close();\r
-                } catch (Exception e) {\r
-                       e.printStackTrace();\r
-                }\r
-            }\r
-            \r
-            // Close connection to server.\r
-            if (stream != null) {\r
-                try {\r
-                    stream.close();\r
-                } catch (Exception e) {\r
-                       e.printStackTrace();\r
-                }\r
-            }\r
-        }\r
-    }\r
-    \r
-    // Notify observers that this download's status has changed.\r
-    private void stateChanged() {\r
-        setChanged();\r
-        notifyObservers();\r
-    }\r
+package org.collectionspace.services.common;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+// This class downloads a file from a URL.
+public class Download extends Observable implements Runnable {
+    
+    public static URL verifyUrl(String url) {
+        // Only allow HTTP URLs.
+        if (!url.toLowerCase().startsWith("http://"))
+            return null;
+        
+        // Verify format of URL.
+        URL verifiedUrl = null;
+        try {
+            verifiedUrl = new URL(url);
+        } catch (Exception e) {
+            return null;
+        }
+        
+        // Make sure URL specifies a file.
+        if (verifiedUrl.getFile().length() < 2)
+            return null;
+        
+        return verifiedUrl;
+    }
+    
+    // Max size of download buffer.
+    private static final int MAX_BUFFER_SIZE = 1024;
+    
+    // These are the status names.
+    public static final String STATUSES[] = {"Downloading",
+    "Paused", "Complete", "Cancelled", "Error"};
+    
+    // These are the status codes.
+    public static final int DOWNLOADING = 0;
+    public static final int PAUSED = 1;
+    public static final int COMPLETE = 2;
+    public static final int CANCELLED = 3;
+    public static final int ERROR = 4;
+    
+    private String errorMessage = null;
+    private String filePath = null;
+    private File downloadedFile = null;
+    private String destDir = null; // the location of the downloaded file
+    private URL url; // download URL
+    private int size; // size of download in bytes
+    private int downloaded; // number of bytes downloaded
+    private int status; // current status of download
+    
+    private void doDownload(URL url, String destDir) {
+        size = -1;
+        downloaded = 0;
+        status = DOWNLOADING;
+        this.url = url;
+        setDestDir(destDir);
+       
+        // Begin the download.
+        download();
+    }
+    
+    public Download(URL url, String destDir) {
+        doDownload(url, destDir);
+    }
+
+    // Constructor for Download.  File is uploaded to system temp directory.
+    public Download(URL url) {
+       String tmpdir = System.getProperty("java.io.tmpdir");
+       if (tmpdir.endsWith(File.separator) == false) {
+               tmpdir = tmpdir + File.separator;
+       }
+       doDownload(url, tmpdir
+                       + UUID.randomUUID() + File.separator);
+    }
+    
+    private void setDestDir(String destDir) {
+        if (destDir.endsWith(File.separator) != true) {
+               destDir = destDir + File.separator;
+        }
+        //
+        // Check if the destDir exists, if not try to create it.
+        //
+        File destDirFile = new File(destDir);
+        boolean destDirExists = destDirFile.exists();
+        if (destDirExists == false) {
+               destDirExists = destDirFile.mkdir();
+        } else {
+               destDirExists = destDirFile.isDirectory();
+        }
+        //
+        // If we couldn't create the directory or if it is already a file then fail.
+        //
+        if (destDirExists = true) {
+               this.destDir = destDir;
+        } else {
+               error("Could not download file to: " + destDir);
+        }
+    }
+    
+    
+    public File getFile() {
+       return this.downloadedFile;
+    }
+    
+    public String getFilePath() {
+       return this.filePath;
+    }
+    
+    public String getDestDir() {
+       return this.destDir;
+    }
+    
+    // Get this download's URL.
+    public String getUrl() {
+        return url.toString();
+    }
+    
+    // Get this download's size.
+    public int getSize() {
+        return size;
+    }
+    
+    // Get this download's progress.
+    public float getProgress() {
+        return ((float) downloaded / size) * 100;
+    }
+    
+    // Get this download's status.
+    public int getStatus() {
+        return status;
+    }
+    
+    // Pause this download.
+    public void pause() {
+        status = PAUSED;
+        stateChanged();
+    }
+    
+    // Resume this download.
+    public void resume() {
+        status = DOWNLOADING;
+        stateChanged();
+        download();
+    }
+    
+    // Cancel this download.
+    public void cancel() {
+        status = CANCELLED;
+        stateChanged();
+    }
+    
+    // Mark this download as having an error.
+    private void error() {
+        status = ERROR;
+        stateChanged();
+    }
+    
+    // Mark this download as having an error.
+    private void error(String message) {
+        this.errorMessage = message;
+        error();
+    }    
+    
+    // Start or resume downloading.
+    private void download() {
+//        Thread thread = new Thread(this);
+//        thread.start();
+       run();
+    }
+    
+    // Get file name portion of URL.
+    private String getFileName(URL url) {
+       String result = null;
+       
+       String destDir = this.getDestDir();
+        String fileName = url.getFile();
+        fileName = fileName.substring(fileName.lastIndexOf('/') + 1);
+        result = filePath = destDir + fileName;
+        
+        return result;
+    }
+    
+    // Download file.
+    public void run() {
+        RandomAccessFile file = null;
+        InputStream stream = null;
+        
+        try {
+            // Open connection to URL.
+            HttpURLConnection connection =
+                    (HttpURLConnection) url.openConnection();
+            
+            // Specify what portion of file to download.
+            connection.setRequestProperty("Range",
+                    "bytes=" + downloaded + "-");
+            
+            // Connect to server.
+            connection.connect();
+            
+            // Make sure response code is in the 200 range.
+            int responseCode = connection.getResponseCode();
+            if (responseCode / 100 != 2) {
+                error();
+            }
+            
+            // Check for valid content length.
+            int contentLength = connection.getContentLength();
+            if (contentLength < 1) {
+                error();
+            }
+            
+      /* Set the size for this download if it
+         hasn't been already set. */
+            if (size == -1) {
+                size = contentLength;
+                stateChanged();
+            }
+            
+            // Open file and seek to the end of it.
+            File javaFile = new File(getFileName(url));
+            file = new RandomAccessFile(javaFile, "rw");
+            file.seek(downloaded);
+            
+            stream = connection.getInputStream();
+            while (status == DOWNLOADING) {
+        /* Size buffer according to how much of the
+           file is left to download. */
+                byte buffer[];
+                if (size - downloaded > MAX_BUFFER_SIZE) {
+                    buffer = new byte[MAX_BUFFER_SIZE];
+                } else {
+                    buffer = new byte[size - downloaded];
+                }
+                
+                // Read from server into buffer.
+                int read = stream.read(buffer);
+                if (read == -1)
+                    break;
+                
+                // Write buffer to file.
+                file.write(buffer, 0, read);
+                downloaded += read;
+                stateChanged();
+            }
+            
+      /* Change status to complete if this point was
+         reached because downloading has finished. */
+            if (status == DOWNLOADING) {
+                status = COMPLETE;
+                downloadedFile = new File(this.getFilePath());
+                stateChanged();
+            }
+        } catch (Exception e) {
+               e.printStackTrace();
+            error();
+        } finally {
+            // Close file.
+            if (file != null) {
+                try {
+                    file.close();
+                } catch (Exception e) {
+                       e.printStackTrace();
+                }
+            }
+            
+            // Close connection to server.
+            if (stream != null) {
+                try {
+                    stream.close();
+                } catch (Exception e) {
+                       e.printStackTrace();
+                }
+            }
+        }
+    }
+    
+    // Notify observers that this download's status has changed.
+    private void stateChanged() {
+        setChanged();
+        notifyObservers();
+    }
 }
\ No newline at end of file
index 7727fbc69da023521b83c977cc34908433565cda..1b59b588086e96a40ffb36da41df832dbcd915bc 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-//import java.io.*;\r
-import javax.servlet.http.HttpServletRequest;\r
-\r
-import java.io.*;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-import java.util.UUID;\r
-\r
-//import java.io.IOException;\r
-\r
-//import java.util.UUID;\r
-//import java.util.regex.Pattern;\r
-//import java.util.regex.Matcher;\r
-\r
-//import javax.servlet.ServletException;\r
-//import javax.servlet.http.HttpServlet;\r
-\r
-import net.sf.jmimemagic.Magic;\r
-import net.sf.jmimemagic.MagicException;\r
-import net.sf.jmimemagic.MagicMatch;\r
-import net.sf.jmimemagic.MagicMatchNotFoundException;\r
-import net.sf.jmimemagic.MagicParseException;\r
-\r
-import org.apache.commons.fileupload.FileItemFactory;\r
-import org.apache.commons.fileupload.FileItem;\r
-import org.apache.commons.fileupload.servlet.ServletFileUpload;\r
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-// TODO: Auto-generated Javadoc\r
-/**\r
- * The Class FileUtils.\r
- */\r
-public class FileUtils {\r
-       /** The Constant logger. */\r
-       private static final Logger logger = LoggerFactory.getLogger(FileUtils.class);\r
-       \r
-       /** The Constant TMP_FILE_PREFIX. */\r
-       public static final String TMP_BLOB_PREFIX = "cspace_blob_";\r
-       public static final String DEFAULT_BLOB_NAME = "blob";\r
-       private static final String FILE_FORM_FIELD = "file";\r
-       \r
-    public static String getExtension(File file) {\r
-       return getExtension(file.getName());\r
-    }\r
-    \r
-    // Call this method to get the extension by passing the file name\r
-    public static String getExtension(String fileName) {\r
-        if (fileName == null) {\r
-            return null;\r
-        }\r
\r
-        int index = fileName.lastIndexOf(".");\r
-        if (index == -1) {\r
-            return "";\r
-        }\r
\r
-        return fileName.substring(index + 1);\r
-    }\r
-    \r
-       /*\r
-        * Creates a copy of the srcFile to a temp file\r
-        */\r
-       static public File createTmpFile(File srcFile, String prefix) throws Exception {\r
-               String fileExtension = FileUtils.getExtension(srcFile);\r
-               File result = createTmpFile(new FileInputStream(srcFile), prefix, fileExtension);\r
-               return result;\r
-       }\r
-       \r
-       /**\r
-        * Creates the tmp file.\r
-        *\r
-        * @param streamIn the stream in\r
-        * @param filePrefix the file prefix\r
-        * @return the file\r
-        */\r
-       static public File createTmpFile(InputStream streamIn,\r
-                       String filePrefix) {\r
-               return createTmpFile(streamIn, filePrefix, null);\r
-       }\r
-       \r
-       /**\r
-        * Creates the tmp file.\r
-        *\r
-        * @param streamIn the stream in\r
-        * @param filePrefix the file prefix\r
-        * @param fileExtension the file extension\r
-        * @return the file\r
-        */\r
-       static public File createTmpFile(InputStream streamIn,\r
-                       String filePrefix, String fileExtension) {\r
-               File result = null;\r
-               \r
-               filePrefix = filePrefix != null ? filePrefix : "";\r
-               fileExtension = fileExtension != null ? "." + fileExtension : "";\r
-               String tmpDir = System.getProperty("java.io.tmpdir");\r
-               result = new File(tmpDir, filePrefix + UUID.randomUUID().toString() + fileExtension);\r
-               if (logger.isDebugEnabled() == true) {\r
-                       logger.debug("Creating temp file at:" + result.getAbsolutePath());\r
-               }\r
-               \r
-               try {\r
-               FileOutputStream streamOut = new FileOutputStream(result);\r
-                       int c;\r
-               while ((c = streamIn.read()) != -1) \r
-               {\r
-                  streamOut.write(c);\r
-               }\r
-       \r
-               streamIn.close();\r
-               streamOut.close();\r
-               } catch (Exception e) {\r
-                       logger.error(e.getMessage(), e);\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       static public String getMimeType(File file) {\r
-               String result = null;\r
-               \r
-               Magic parser = new Magic() ;\r
-               // getMagicMatch accepts Files or byte[],\r
-               // which is nice if you want to test streams\r
-               MagicMatch match = null;\r
-               try {\r
-                       match = parser.getMagicMatch(file, true);\r
-               } catch (MagicParseException e) {\r
-                       logger.debug("MagicParseException encountered trying to get MIME type for "\r
-                                       + file.getAbsolutePath(), e);\r
-               } catch (MagicMatchNotFoundException e) {\r
-                       logger.debug("MagicMatchNotFoundException encountered trying to get MIME type for "\r
-                                       + file.getAbsolutePath(), e);\r
-               } catch (MagicException e) {\r
-                       logger.debug("MagicException encountered trying to get MIME type for "\r
-                                       + file.getAbsolutePath(), e);\r
-               }\r
-               \r
-               if (match != null) {\r
-                       result = match.getMimeType();\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       /**\r
-        * Look for an uploaded file from the HTTP request of type "multipart/form-data".\r
-        *\r
-        * @param request the request\r
-        * @return the file\r
-        */\r
-       static public File createTmpFile(HttpServletRequest request) {\r
-               File result = null;\r
-               \r
-               FileItemFactory factory = new DiskFileItemFactory();\r
-               ServletFileUpload upload = new ServletFileUpload(factory);\r
-\r
-               try {\r
-                       List<FileItem>  items = upload.parseRequest(request);\r
-                       Iterator<FileItem> iter = items.iterator();\r
-\r
-                       while (iter.hasNext()) {\r
-                               FileItem item = iter.next();\r
-                               String formFieldName = item.getFieldName();\r
-                               if (logger.isTraceEnabled() == true) {\r
-                                       logger.trace("HTTP Request form field:" + formFieldName);\r
-                               }\r
-                               if (formFieldName.equalsIgnoreCase(FILE_FORM_FIELD)) {\r
-                                       if (item.isFormField() == true) {\r
-                                               logger.warn("Form field '" + FILE_FORM_FIELD + "': part is marked as a form field.");\r
-                                       }\r
-                                       String fileName = item.getName();\r
-                                       if (logger.isTraceEnabled() == true) {\r
-                                               logger.trace("Uploaded File Name:" + (fileName != null ? fileName : "<empty>"));\r
-                                       }\r
-                                       if (fileName == null) {\r
-                                               fileName = DEFAULT_BLOB_NAME; //if there's no file name then set it to an empty string\r
-                                               logger.warn("File was posted to the services without a file name.");\r
-                                       }\r
-                                       //\r
-                                       // To avoid name collisions and to preserve the posted file name, create a temp directory for the\r
-                                       // file.\r
-                                       //\r
-                                       File tmpDir = new File(System.getProperty("java.io.tmpdir"));\r
-                                       String fileTmpDirPath = tmpDir.getPath() + File.separatorChar + UUID.randomUUID();\r
-                                       File fileTmpDir = new File(fileTmpDirPath);\r
-                                       File savedFile = null;\r
-                                       if (fileTmpDir.mkdir() == true) {\r
-                                               savedFile = new File(fileTmpDirPath + File.separatorChar + fileName);\r
-                                               if (savedFile.createNewFile() == false) {\r
-                                                       savedFile = null;\r
-                                               }\r
-                                       }\r
-                                       \r
-                                       if (savedFile != null) {\r
-                                               item.write(savedFile);\r
-//                                             item.getInputStream();//FIXME: REM - We should make a version of this method that returns the input stream\r
-                                               result = savedFile;\r
-                                       } else {\r
-                                               logger.error("Could not create temporary file: " + fileTmpDirPath +\r
-                                                               File.separatorChar + fileName);                                         \r
-                                       }\r
-                               }\r
-                       }\r
-               } catch (Exception e) {\r
-                       logger.error(e.getMessage(), e);\r
-               }\r
-               \r
-               return result;\r
-       }\r
-\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common;
+
+//import java.io.*;
+import javax.servlet.http.HttpServletRequest;
+
+import java.io.*;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+
+//import java.io.IOException;
+
+//import java.util.UUID;
+//import java.util.regex.Pattern;
+//import java.util.regex.Matcher;
+
+//import javax.servlet.ServletException;
+//import javax.servlet.http.HttpServlet;
+
+import net.sf.jmimemagic.Magic;
+import net.sf.jmimemagic.MagicException;
+import net.sf.jmimemagic.MagicMatch;
+import net.sf.jmimemagic.MagicMatchNotFoundException;
+import net.sf.jmimemagic.MagicParseException;
+
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class FileUtils.
+ */
+public class FileUtils {
+       /** The Constant logger. */
+       private static final Logger logger = LoggerFactory.getLogger(FileUtils.class);
+       
+       /** The Constant TMP_FILE_PREFIX. */
+       public static final String TMP_BLOB_PREFIX = "cspace_blob_";
+       public static final String DEFAULT_BLOB_NAME = "blob";
+       private static final String FILE_FORM_FIELD = "file";
+       
+    public static String getExtension(File file) {
+       return getExtension(file.getName());
+    }
+    
+    // Call this method to get the extension by passing the file name
+    public static String getExtension(String fileName) {
+        if (fileName == null) {
+            return null;
+        }
+        int index = fileName.lastIndexOf(".");
+        if (index == -1) {
+            return "";
+        }
+        return fileName.substring(index + 1);
+    }
+    
+       /*
+        * Creates a copy of the srcFile to a temp file
+        */
+       static public File createTmpFile(File srcFile, String prefix) throws Exception {
+               String fileExtension = FileUtils.getExtension(srcFile);
+               File result = createTmpFile(new FileInputStream(srcFile), prefix, fileExtension);
+               return result;
+       }
+       
+       /**
+        * Creates the tmp file.
+        *
+        * @param streamIn the stream in
+        * @param filePrefix the file prefix
+        * @return the file
+        */
+       static public File createTmpFile(InputStream streamIn,
+                       String filePrefix) {
+               return createTmpFile(streamIn, filePrefix, null);
+       }
+       
+       /**
+        * Creates the tmp file.
+        *
+        * @param streamIn the stream in
+        * @param filePrefix the file prefix
+        * @param fileExtension the file extension
+        * @return the file
+        */
+       static public File createTmpFile(InputStream streamIn,
+                       String filePrefix, String fileExtension) {
+               File result = null;
+               
+               filePrefix = filePrefix != null ? filePrefix : "";
+               fileExtension = fileExtension != null ? "." + fileExtension : "";
+               String tmpDir = System.getProperty("java.io.tmpdir");
+               result = new File(tmpDir, filePrefix + UUID.randomUUID().toString() + fileExtension);
+               if (logger.isDebugEnabled() == true) {
+                       logger.debug("Creating temp file at:" + result.getAbsolutePath());
+               }
+               
+               try {
+               FileOutputStream streamOut = new FileOutputStream(result);
+                       int c;
+               while ((c = streamIn.read()) != -1) 
+               {
+                  streamOut.write(c);
+               }
+       
+               streamIn.close();
+               streamOut.close();
+               } catch (Exception e) {
+                       logger.error(e.getMessage(), e);
+               }
+               
+               return result;
+       }
+       
+       static public String getMimeType(File file) {
+               String result = null;
+               
+               Magic parser = new Magic() ;
+               // getMagicMatch accepts Files or byte[],
+               // which is nice if you want to test streams
+               MagicMatch match = null;
+               try {
+                       match = parser.getMagicMatch(file, true);
+               } catch (MagicParseException e) {
+                       logger.debug("MagicParseException encountered trying to get MIME type for "
+                                       + file.getAbsolutePath(), e);
+               } catch (MagicMatchNotFoundException e) {
+                       logger.debug("MagicMatchNotFoundException encountered trying to get MIME type for "
+                                       + file.getAbsolutePath(), e);
+               } catch (MagicException e) {
+                       logger.debug("MagicException encountered trying to get MIME type for "
+                                       + file.getAbsolutePath(), e);
+               }
+               
+               if (match != null) {
+                       result = match.getMimeType();
+               }
+               
+               return result;
+       }
+       
+       /**
+        * Look for an uploaded file from the HTTP request of type "multipart/form-data".
+        *
+        * @param request the request
+        * @return the file
+        */
+       static public File createTmpFile(HttpServletRequest request) {
+               File result = null;
+               
+               FileItemFactory factory = new DiskFileItemFactory();
+               ServletFileUpload upload = new ServletFileUpload(factory);
+
+               try {
+                       List<FileItem>  items = upload.parseRequest(request);
+                       Iterator<FileItem> iter = items.iterator();
+
+                       while (iter.hasNext()) {
+                               FileItem item = iter.next();
+                               String formFieldName = item.getFieldName();
+                               if (logger.isTraceEnabled() == true) {
+                                       logger.trace("HTTP Request form field:" + formFieldName);
+                               }
+                               if (formFieldName.equalsIgnoreCase(FILE_FORM_FIELD)) {
+                                       if (item.isFormField() == true) {
+                                               logger.warn("Form field '" + FILE_FORM_FIELD + "': part is marked as a form field.");
+                                       }
+                                       String fileName = item.getName();
+                                       if (logger.isTraceEnabled() == true) {
+                                               logger.trace("Uploaded File Name:" + (fileName != null ? fileName : "<empty>"));
+                                       }
+                                       if (fileName == null) {
+                                               fileName = DEFAULT_BLOB_NAME; //if there's no file name then set it to an empty string
+                                               logger.warn("File was posted to the services without a file name.");
+                                       }
+                                       //
+                                       // To avoid name collisions and to preserve the posted file name, create a temp directory for the
+                                       // file.
+                                       //
+                                       File tmpDir = new File(System.getProperty("java.io.tmpdir"));
+                                       String fileTmpDirPath = tmpDir.getPath() + File.separatorChar + UUID.randomUUID();
+                                       File fileTmpDir = new File(fileTmpDirPath);
+                                       File savedFile = null;
+                                       if (fileTmpDir.mkdir() == true) {
+                                               savedFile = new File(fileTmpDirPath + File.separatorChar + fileName);
+                                               if (savedFile.createNewFile() == false) {
+                                                       savedFile = null;
+                                               }
+                                       }
+                                       
+                                       if (savedFile != null) {
+                                               item.write(savedFile);
+//                                             item.getInputStream();//FIXME: REM - We should make a version of this method that returns the input stream
+                                               result = savedFile;
+                                       } else {
+                                               logger.error("Could not create temporary file: " + fileTmpDirPath +
+                                                               File.separatorChar + fileName);                                         
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(e.getMessage(), e);
+               }
+               
+               return result;
+       }
+
+}
index 5a31f4919ae6dddabfbc56808c530260d549ff80..15dbf632618b60bccab751f458bd99e74480cc1e 100644 (file)
@@ -1,56 +1,56 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2011 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import org.dom4j.Document;\r
-import org.dom4j.Element;\r
-\r
-/** Define this interface to listen for events from the driving class:\r
- *   org.collectionspace.services.common.XmlSaxFragmenter , so that\r
- *   the XmlSaxFragmenter class may be passed a large file or InputSource (stream)\r
- *   and it will be parsed with SAX, but you will get fragments from it that you can\r
- *   parse with DOM.\r
- *\r
- *  You will be passed a Document context, which is a Dom4j document that represents the\r
- *  skeleton of the document you started with, but without any fragments, so the Document\r
- *  will just be context information of how the XmlSaxFragmenter found this fragment.\r
- *\r
- *  You will receive onFragmentReady() events whenever a fragment is parsed completely.\r
- *  the fragment parameter will be just the inner XML String of fragmentParent, and will\r
- *  not be represented in the DOM of the Document context.\r
- *\r
- *  @author Laramie Crocker\r
- */\r
-public interface IFragmentHandler {\r
-    /** @param fragmentIndex is the zero-based index of the current fragment; you will first get this event\r
-     *  on fragmentIndex==0, which is a fragmentCount of 1. */\r
-    public void onFragmentReady(Document context,\r
-                                Element fragmentParent,\r
-                                String currentPath,\r
-                                int fragmentIndex,\r
-                                String fragment);\r
-\r
-    /** @param fragmentCount is the count of fragments processed - a value of 1 means 1 fragment was found. */\r
-    public void onEndDocument(Document context, int fragmentCount);\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2011 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+
+/** Define this interface to listen for events from the driving class:
+ *   org.collectionspace.services.common.XmlSaxFragmenter , so that
+ *   the XmlSaxFragmenter class may be passed a large file or InputSource (stream)
+ *   and it will be parsed with SAX, but you will get fragments from it that you can
+ *   parse with DOM.
+ *
+ *  You will be passed a Document context, which is a Dom4j document that represents the
+ *  skeleton of the document you started with, but without any fragments, so the Document
+ *  will just be context information of how the XmlSaxFragmenter found this fragment.
+ *
+ *  You will receive onFragmentReady() events whenever a fragment is parsed completely.
+ *  the fragment parameter will be just the inner XML String of fragmentParent, and will
+ *  not be represented in the DOM of the Document context.
+ *
+ *  @author Laramie Crocker
+ */
+public interface IFragmentHandler {
+    /** @param fragmentIndex is the zero-based index of the current fragment; you will first get this event
+     *  on fragmentIndex==0, which is a fragmentCount of 1. */
+    public void onFragmentReady(Document context,
+                                Element fragmentParent,
+                                String currentPath,
+                                int fragmentIndex,
+                                String fragment);
+
+    /** @param fragmentCount is the count of fragments processed - a value of 1 means 1 fragment was found. */
+    public void onEndDocument(Document context, int fragmentCount);
+}
index b7780a657bf7a2f4b3f15147f4f5f48f0f2a1d65..fee1cde932addce1732294937973d8e445dae137 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-\r
-import java.lang.reflect.Constructor;\r
-import java.lang.reflect.Method;\r
-\r
-/** User: laramie\r
- *  $LastChangedRevision:  $\r
- *  $LastChangedDate:  $\r
- */\r
-public class ReflectionMapper {\r
-\r
-    public static boolean isSetter(Method method) {\r
-        if (!method.getName().startsWith("set")) return false;\r
-        if (method.getParameterTypes().length != 1) return false;\r
-        return true;\r
-    }\r
-\r
-    public static Object fireSetMethod(Method setMethod, Object target, Object arg) throws Exception {\r
-        if (target != null && setMethod != null) {\r
-            return setMethod.invoke(target, arg);\r
-        }\r
-        return null;\r
-    }\r
-\r
-    public static Object fireGetMethod(Method getMethod, Object target) throws Exception {\r
-        if (target != null && getMethod != null) {\r
-            Object[] arg = new Object[0];\r
-            //System.out.println("\r\n~~~~~~~~ fireGetMethod("+getMethod+")");\r
-            return getMethod.invoke(target, arg);\r
-        }\r
-        return null;\r
-    }\r
-\r
-    public static enum STATUS {OK, NO_SUCH_METHOD, EXCEPTION};\r
-                                                                           \r
-    public static STATUS callSetterUncaught(Object target, String name, Object arg) throws Exception {\r
-        if (Tools.isEmpty(name)){\r
-            return STATUS.NO_SUCH_METHOD;\r
-        }\r
-        if (target==null){\r
-            return STATUS.EXCEPTION;\r
-        }\r
-        Class aClass = target.getClass();\r
-        Method m;\r
-\r
-        Class[] cls = new Class[1];\r
-        cls[0] = String.class;\r
-        try {\r
-            m = aClass.getMethod(name, cls);\r
-        } catch (NoSuchMethodException nsm){\r
-            m = null;\r
-        }\r
-        if (m==null){\r
-             m = aClass.getMethod(name, Object.class); //throws NoSuchMethodException if not found.\r
-        }\r
-        //todo: if m==null, call callSetterCaseInsensitive().\r
-        fireSetMethod(m, target, arg);\r
-        return STATUS.OK;\r
-    }\r
-\r
-    public static STATUS callSetter(Object target, String name, Object arg) {\r
-        try {\r
-            callSetterUncaught(target, name, arg);\r
-        } catch (NoSuchMethodException nsm) {\r
-            System.out.println("ERROR in ReflectionMapper.callSetter(target:"+target+", name:"+name+", arg:"+arg+"): "+nsm);\r
-            return STATUS.NO_SUCH_METHOD;\r
-        } catch (Exception e) {\r
-            System.out.println("ERROR in ReflectionMapper.callSetter(target:"+target+", name:"+name+", arg:"+arg+"): "+e);\r
-            return STATUS.EXCEPTION;\r
-        }\r
-        return STATUS.OK;\r
-    }\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
-        Constructor co = cl.getConstructor(classParm);\r
-        Object item = co.newInstance(objectParm);\r
-        return item;\r
-    }\r
-\r
-    // EXPERIMENTAL:\r
-    public static void callSetterCaseInsensitive(Class aClass, Object target, Object args){\r
-        boolean showInheritedMethods = false;\r
-        Method[] methods = aClass.getMethods();\r
-        for (Method method : methods) {\r
-            Class dc = method.getDeclaringClass();\r
-            boolean sameClass = aClass.equals(dc);\r
-            if (showInheritedMethods || sameClass) {\r
-                if (isSetter(method) && method.getParameterTypes().length==1) {\r
-                    String id = method.getName();\r
-                    Method setMethod = method;\r
-                    String dataClass = method.getParameterTypes()[0].getName();\r
-\r
-                    args = "MyNewValue";\r
-                    //todo: fireSetMethod(setMethod, target, args);\r
-                    System.out.println("setter: " + method + " in class: " + dc);\r
-                }\r
-            }\r
-        }\r
-    }\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common;
+
+import org.collectionspace.services.common.api.Tools;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/** User: laramie
+ *  $LastChangedRevision:  $
+ *  $LastChangedDate:  $
+ */
+public class ReflectionMapper {
+
+    public static boolean isSetter(Method method) {
+        if (!method.getName().startsWith("set")) return false;
+        if (method.getParameterTypes().length != 1) return false;
+        return true;
+    }
+
+    public static Object fireSetMethod(Method setMethod, Object target, Object arg) throws Exception {
+        if (target != null && setMethod != null) {
+            return setMethod.invoke(target, arg);
+        }
+        return null;
+    }
+
+    public static Object fireGetMethod(Method getMethod, Object target) throws Exception {
+        if (target != null && getMethod != null) {
+            Object[] arg = new Object[0];
+            //System.out.println("\r\n~~~~~~~~ fireGetMethod("+getMethod+")");
+            return getMethod.invoke(target, arg);
+        }
+        return null;
+    }
+
+    public static enum STATUS {OK, NO_SUCH_METHOD, EXCEPTION};
+                                                                           
+    public static STATUS callSetterUncaught(Object target, String name, Object arg) throws Exception {
+        if (Tools.isEmpty(name)){
+            return STATUS.NO_SUCH_METHOD;
+        }
+        if (target==null){
+            return STATUS.EXCEPTION;
+        }
+        Class aClass = target.getClass();
+        Method m;
+
+        Class[] cls = new Class[1];
+        cls[0] = String.class;
+        try {
+            m = aClass.getMethod(name, cls);
+        } catch (NoSuchMethodException nsm){
+            m = null;
+        }
+        if (m==null){
+             m = aClass.getMethod(name, Object.class); //throws NoSuchMethodException if not found.
+        }
+        //todo: if m==null, call callSetterCaseInsensitive().
+        fireSetMethod(m, target, arg);
+        return STATUS.OK;
+    }
+
+    public static STATUS callSetter(Object target, String name, Object arg) {
+        try {
+            callSetterUncaught(target, name, arg);
+        } catch (NoSuchMethodException nsm) {
+            System.out.println("ERROR in ReflectionMapper.callSetter(target:"+target+", name:"+name+", arg:"+arg+"): "+nsm);
+            return STATUS.NO_SUCH_METHOD;
+        } catch (Exception e) {
+            System.out.println("ERROR in ReflectionMapper.callSetter(target:"+target+", name:"+name+", arg:"+arg+"): "+e);
+            return STATUS.EXCEPTION;
+        }
+        return STATUS.OK;
+    }
+
+    public static Object instantiate(String classname) throws Exception {
+        if (classname == null) {
+            throw new Exception("classname was null in ReflectionMapper.instantiate()");
+        }
+        classname = classname.trim();
+        Class cl = Class.forName(classname);
+        Class [] classParm = null;
+        Object [] objectParm = null;
+        Constructor co = cl.getConstructor(classParm);
+        Object item = co.newInstance(objectParm);
+        return item;
+    }
+
+    // EXPERIMENTAL:
+    public static void callSetterCaseInsensitive(Class aClass, Object target, Object args){
+        boolean showInheritedMethods = false;
+        Method[] methods = aClass.getMethods();
+        for (Method method : methods) {
+            Class dc = method.getDeclaringClass();
+            boolean sameClass = aClass.equals(dc);
+            if (showInheritedMethods || sameClass) {
+                if (isSetter(method) && method.getParameterTypes().length==1) {
+                    String id = method.getName();
+                    Method setMethod = method;
+                    String dataClass = method.getParameterTypes()[0].getName();
+
+                    args = "MyNewValue";
+                    //todo: fireSetMethod(setMethod, target, args);
+                    System.out.println("setter: " + method + " in class: " + dc);
+                }
+            }
+        }
+    }
+}
index 92bb9d8160dc1e54cc227a6e00fed7243c038fb9..4ded3611f1f64d6346a43680b0b65705b9cbd82e 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2010 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import javax.ws.rs.*;\r
-import javax.ws.rs.core.*;\r
-\r
-import org.collectionspace.services.client.IClientQueryParams;\r
-import org.collectionspace.services.client.IQueryManager;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.common.api.RefName;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
-import org.collectionspace.services.common.config.ServiceConfigUtils;\r
-import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;\r
-import org.collectionspace.services.common.context.RemoteServiceContext;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.DocumentFilter;\r
-import org.collectionspace.services.common.document.DocumentHandler;\r
-import org.collectionspace.services.common.document.DocumentNotFoundException;\r
-import org.collectionspace.services.common.query.QueryManager;\r
-import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;\r
-import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthRefConfigInfo;\r
-import org.collectionspace.services.config.ClientType;\r
-import org.collectionspace.services.config.service.DocHandlerParams;\r
-import org.collectionspace.services.config.service.ListResultField;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;\r
-import org.collectionspace.services.nuxeo.client.java.RepositoryInstanceInterface;\r
-import org.collectionspace.services.nuxeo.util.NuxeoUtils;\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-import org.jboss.resteasy.util.HttpResponseCodes;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import org.nuxeo.ecm.core.api.DocumentModelList;\r
-import org.nuxeo.ecm.core.api.repository.RepositoryInstance;\r
-\r
-\r
-/**\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- * Author: Laramie Crocker\r
- */\r
-public abstract class ResourceBase\r
-        extends AbstractMultiPartCollectionSpaceResourceImpl {\r
-\r
-    public static final String CREATE = "create";\r
-    public static final String READ = "get";\r
-    public static final String UPDATE = "update";\r
-    public static final String DELETE = "delete";\r
-    public static final String LIST = "list";\r
-    //FIXME retrieve client type from configuration\r
-    static ClientType CLIENT_TYPE;\r
-\r
-    /*\r
-     * REM - 11/14/2011 - I discovered this static block of code and don't understand why it exists.  However, a side-effect of this static block is that ServiceMain is trying\r
-     * to create a valid instance of entire CSpace services include an embedded Nuxeo instance.  This block of code seems goofy and unnecessary and probably should be removed?\r
-     */\r
-    static {\r
-        try {\r
-            // I put this in a try-catch static block instead of file-level static var initializer so that static methods of\r
-            // *Resource classes may be called statically from test cases.\r
-            // Without this catch, you can't even access static methods of a *Resource class for testing.\r
-            CLIENT_TYPE = ServiceMain.getInstance().getClientType();\r
-            //System.out.println("Static initializer in ResourceBase. CLIENT_TYPE:"+CLIENT_TYPE);\r
-        } catch (Throwable t) {\r
-            System.out.println("Static initializer failed in ResourceBase because not running from deployment.  OK to use Resource classes statically for tests.");\r
-        }\r
-    }\r
-    \r
-    //======================= CREATE ====================================================\r
-    \r
-    @POST\r
-    public Response create(\r
-               @Context ResourceMap resourceMap,\r
-               @Context UriInfo ui,\r
-            String xmlPayload) {\r
-        return this.create(null, resourceMap, ui, xmlPayload); \r
-    }\r
-    \r
-    public Response create(ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx, // REM: 8/13/2012 - Some sub-classes will override this method -e.g., MediaResource does.\r
-               ResourceMap resourceMap,\r
-               UriInfo uriInfo,\r
-            String xmlPayload) {\r
-       Response result = null;\r
-       \r
-        try {\r
-            PoxPayloadIn input = new PoxPayloadIn(xmlPayload);\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(input, resourceMap, uriInfo);\r
-            ctx.setResourceMap(resourceMap);\r
-            if (parentCtx != null && parentCtx.getCurrentRepositorySession() != null) {\r
-               ctx.setCurrentRepositorySession(parentCtx.getCurrentRepositorySession()); // Reuse the current repo session if one exists\r
-            }            \r
-            result = create(input, ctx);\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.CREATE_FAILED);\r
-        }\r
-        \r
-        return result;\r
-    }    \r
-    \r
-    protected Response create(PoxPayloadIn input, ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {\r
-        try {\r
-            DocumentHandler<PoxPayloadIn, PoxPayloadOut, DocumentModel, DocumentModelList> handler = createDocumentHandler(ctx);\r
-            UriBuilder path = UriBuilder.fromResource(this.getClass());\r
-            return create(input, ctx, handler, path); //==> CALL implementation method, which subclasses may override.\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.CREATE_FAILED);\r
-        }\r
-    }\r
-\r
-    /** Subclasses may override this overload, which gets called from @see #create(MultipartInput)   */\r
-    protected Response create(PoxPayloadIn input,\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            DocumentHandler<PoxPayloadIn, PoxPayloadOut, DocumentModel, DocumentModelList> handler,\r
-            UriBuilder path)\r
-            throws Exception {\r
-        String csid = getRepositoryClient(ctx).create(ctx, handler);\r
-        path.path("" + csid);\r
-        Response response = Response.created(path.build()).build();\r
-        return response;\r
-    }\r
-\r
-    //======================= UPDATE ====================================================\r
-    @PUT\r
-    @Path("{csid}")\r
-    public byte[] update(@Context ResourceMap resourceMap,\r
-               @Context UriInfo uriInfo,\r
-               @PathParam("csid") String csid,\r
-               String xmlPayload) {\r
-        return this.update(null, resourceMap, uriInfo, csid, xmlPayload); \r
-    }\r
-\r
-    public byte[] update(ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx, // REM: 8/13/2012 - Some sub-classes will override this method -e.g., MediaResource does.\r
-               @Context ResourceMap resourceMap,\r
-               @Context UriInfo uriInfo,\r
-               @PathParam("csid") String csid,\r
-               String xmlPayload) {\r
-        PoxPayloadOut result = null;\r
-        ensureCSID(csid, UPDATE);\r
-        try {\r
-            PoxPayloadIn theUpdate = new PoxPayloadIn(xmlPayload);\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(theUpdate, uriInfo);\r
-            ctx.setResourceMap(resourceMap);\r
-            if (parentCtx != null && parentCtx.getCurrentRepositorySession() != null) {\r
-               ctx.setCurrentRepositorySession(parentCtx.getCurrentRepositorySession()); // Reuse the current repo session if one exists\r
-            }            \r
-            result = update(csid, theUpdate, ctx); //==> CALL implementation method, which subclasses may override.\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.UPDATE_FAILED, csid);\r
-        }\r
-        return result.getBytes();\r
-    }\r
-\r
-    /** Subclasses may override this overload, which gets called from #udpate(String,MultipartInput)   */\r
-    protected PoxPayloadOut update(String csid,\r
-            PoxPayloadIn theUpdate,\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx)\r
-            throws Exception {\r
-        DocumentHandler handler = createDocumentHandler(ctx);\r
-        getRepositoryClient(ctx).update(ctx, csid, handler);\r
-        return ctx.getOutput();\r
-    }\r
-\r
-    /** Subclasses may override this overload, which gets called from #udpate(String,MultipartInput)   */\r
-    protected PoxPayloadOut update(String csid,\r
-            MultipartInput theUpdate,\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            DocumentHandler handler)\r
-            throws Exception {\r
-        getRepositoryClient(ctx).update(ctx, csid, handler);\r
-        return ctx.getOutput();\r
-    }\r
-\r
-    //======================= DELETE ====================================================\r
-    @DELETE\r
-    @Path("{csid}")\r
-    public Response delete(@PathParam("csid") String csid) {\r
-        ensureCSID(csid, DELETE);\r
-        try {\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();\r
-            return delete(ctx, csid);  //==> CALL implementation method, which subclasses may override.\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.DELETE_FAILED, csid);\r
-        }\r
-    }\r
-\r
-    /** subclasses may override this method, which is called from #delete(String)\r
-     *  which handles setup of ServiceContext, and does Exception handling.  */\r
-    protected Response delete(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx, String csid)\r
-            throws Exception {\r
-       DocumentHandler<PoxPayloadIn, PoxPayloadOut, DocumentModel, DocumentModelList> handler = createDocumentHandler(ctx);\r
-        getRepositoryClient(ctx).delete(ctx, csid, handler);\r
-        return Response.status(HttpResponseCodes.SC_OK).build();\r
-    }\r
-    \r
-    public Response deleteWithParentCtx(ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx,\r
-               String csid)\r
-            throws Exception {\r
-        ensureCSID(csid, DELETE);\r
-        try {\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();\r
-            if (parentCtx != null && parentCtx.getCurrentRepositorySession() != null) {\r
-               ctx.setCurrentRepositorySession(parentCtx.getCurrentRepositorySession()); // reuse the repo session if one exists\r
-            }\r
-            return delete(ctx, csid);  //==> CALL implementation method, which subclasses may override.\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.DELETE_FAILED, csid);\r
-        }\r
-    }    \r
-\r
-    //======================= GET ====================================================\r
-    @GET\r
-    @Path("{csid}")\r
-    public byte[] get(\r
-            @Context Request request,                  \r
-            @Context UriInfo uriInfo,\r
-            @PathParam("csid") String csid) {\r
-        PoxPayloadOut result = null;\r
-        ensureCSID(csid, READ);\r
-        try {\r
-            RemoteServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = (RemoteServiceContext<PoxPayloadIn, PoxPayloadOut>) createServiceContext(uriInfo);\r
-            result = get(csid, ctx);// ==> CALL implementation method, which subclasses may override.\r
-            if (result == null) {\r
-                Response response = Response.status(Response.Status.NOT_FOUND).entity(\r
-                        ServiceMessages.READ_FAILED + ServiceMessages.resourceNotFoundMsg(csid)).type("text/plain").build();\r
-                throw new CSWebApplicationException(response);\r
-            }\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.READ_FAILED, csid);\r
-        }\r
-\r
-        return result.getBytes();\r
-    }\r
-\r
-    protected PoxPayloadOut get(@PathParam("csid") String csid,\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {\r
-        PoxPayloadOut result = null;\r
-\r
-        ensureCSID(csid, READ);\r
-        DocumentHandler handler = createDocumentHandler(ctx);\r
-        result = get(csid, ctx, handler);\r
-        if (result == null) {\r
-            String msg = "Could not find document with id = " + csid;\r
-            if (logger.isErrorEnabled() == true) {\r
-                logger.error(msg);\r
-            }\r
-            throw new DocumentNotFoundException(msg);\r
-        }\r
-\r
-        return result;\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
-    protected PoxPayloadOut get(String csid,\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            DocumentHandler handler)\r
-            throws Exception {\r
-        getRepositoryClient(ctx).get(ctx, csid, handler);\r
-        return ctx.getOutput();\r
-    }\r
-    \r
-    protected boolean isGetAllRequest(MultivaluedMap<String, String> queryParams) {\r
-       boolean result = false;\r
-       \r
-        String keywords = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_KW);\r
-        String advancedSearch = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_AS);\r
-        String partialTerm = queryParams.getFirst(IQueryManager.SEARCH_TYPE_PARTIALTERM);\r
-        \r
-        if (Tools.isBlank(keywords) && Tools.isBlank(advancedSearch) && Tools.isBlank(partialTerm)) {\r
-               result = true;\r
-        }\r
-        \r
-       return result;\r
-    }\r
-\r
-    //======================= GET without csid. List, search, etc. =====================================\r
-    @GET\r
-    public AbstractCommonList getList(@Context UriInfo ui) {\r
-        AbstractCommonList list = null;\r
-        \r
-        MultivaluedMap<String, String> queryParams = ui.getQueryParameters();\r
-        if (isGetAllRequest(queryParams) == false) {\r
-            String orderBy = queryParams.getFirst(IClientQueryParams.ORDER_BY_PARAM);\r
-            String keywords = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_KW);\r
-            String advancedSearch = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_AS);\r
-            String partialTerm = queryParams.getFirst(IQueryManager.SEARCH_TYPE_PARTIALTERM);\r
-            list = search(ui, orderBy, keywords, advancedSearch, partialTerm);\r
-        } else {\r
-            list = getCommonList(ui);\r
-        }\r
-        \r
-        return list;\r
-    }\r
-    \r
-    protected AbstractCommonList getCommonList(UriInfo uriInfo) {\r
-        try {\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(uriInfo);\r
-            DocumentHandler handler = createDocumentHandler(ctx);\r
-            getRepositoryClient(ctx).getFiltered(ctx, handler);\r
-            AbstractCommonList list = (AbstractCommonList) handler.getCommonPartList();\r
-            return list;\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.LIST_FAILED);\r
-        }\r
-    }\r
-\r
-    protected AbstractCommonList finish_getList(ServiceContext ctx, DocumentHandler handler) {\r
-        try {\r
-            getRepositoryClient(ctx).getFiltered(ctx, handler); // REM - Side effect of this call sets the handler's common part list value\r
-            return (AbstractCommonList) handler.getCommonPartList();\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.LIST_FAILED);\r
-        }\r
-    }\r
-\r
-    protected AbstractCommonList search(\r
-               ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-               DocumentHandler handler, \r
-               UriInfo ui,\r
-               String orderBy,\r
-               String keywords,\r
-               String advancedSearch,\r
-               String partialTerm) throws Exception {\r
-        DocumentFilter docFilter = handler.getDocumentFilter();      \r
-        if (orderBy == null || orderBy.isEmpty()) {\r
-            String orderByField = getOrderByField(ctx);\r
-            docFilter.setOrderByClause(orderByField);\r
-        }\r
-        \r
-        //\r
-        // NOTE: Partial-term (PT) queries are mutually exclusive to keyword and\r
-        // partial-term queries trump keyword queries.\r
-        //\r
-        if (partialTerm != null && !partialTerm.isEmpty()) {\r
-               String partialTermMatchField = getPartialTermMatchField(ctx);\r
-            String ptClause = QueryManager.createWhereClauseForPartialMatch(ctx, partialTermMatchField,\r
-                       partialTerm);\r
-            docFilter.appendWhereClause(ptClause, IQueryManager.SEARCH_QUALIFIER_AND);\r
-        } else if (keywords != null && !keywords.isEmpty()) {\r
-            String whereClause = QueryManager.createWhereClauseFromKeywords(keywords);\r
-            if (Tools.isEmpty(whereClause) == false) {\r
-               docFilter.appendWhereClause(whereClause, IQueryManager.SEARCH_QUALIFIER_AND);\r
-                   if (logger.isDebugEnabled()) {\r
-                       logger.debug("The WHERE clause is: " + docFilter.getWhereClause());\r
-                   }\r
-            } else {\r
-                if (logger.isWarnEnabled()) {\r
-                       logger.warn("The WHERE clause is empty for keywords: ["+keywords+"]");\r
-                }\r
-            }\r
-        }\r
-                \r
-        //\r
-        // Add an advance search clause if one was specified -even if PT search was requested?\r
-        //\r
-        if (advancedSearch != null && !advancedSearch.isEmpty()) {\r
-            String whereClause = QueryManager.createWhereClauseFromAdvancedSearch(advancedSearch);\r
-            docFilter.appendWhereClause(whereClause, IQueryManager.SEARCH_QUALIFIER_AND);\r
-            if (logger.isDebugEnabled()) {\r
-                logger.debug("The WHERE clause is: " + docFilter.getWhereClause());\r
-            }\r
-        }\r
-        \r
-        getRepositoryClient(ctx).getFiltered(ctx, handler);        \r
-        return (AbstractCommonList) handler.getCommonPartList();\r
-    }\r
-\r
-    private AbstractCommonList search(\r
-               UriInfo uriInfo,\r
-               String orderBy,\r
-               String keywords,\r
-               String advancedSearch,\r
-               String partialTerm) {\r
-       AbstractCommonList result = null;\r
-\r
-       ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx;\r
-       try {\r
-               ctx = createServiceContext(uriInfo);\r
-               DocumentHandler handler = createDocumentHandler(ctx);\r
-               result = search(ctx, handler, uriInfo, orderBy, keywords, advancedSearch, partialTerm);\r
-       } catch (Exception e) {\r
-               throw bigReThrow(e, ServiceMessages.SEARCH_FAILED);\r
-       }\r
-\r
-       return result;\r
-    }\r
-    \r
-    //FIXME: REM - This should not be @Deprecated since we may want to implement this -it has been on the wish list.\r
-    @Deprecated\r
-    public AbstractCommonList getList(List<String> csidList) {\r
-        try {\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();\r
-            DocumentHandler handler = createDocumentHandler(ctx);\r
-            getRepositoryClient(ctx).get(ctx, csidList, handler);\r
-            return (AbstractCommonList) handler.getCommonPartList();\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.LIST_FAILED);\r
-        }\r
-    }\r
-\r
-    //======================== GET : getAuthorityRefs ========================================\r
-    @GET\r
-    @Path("{csid}/authorityrefs")\r
-    @Produces("application/xml")\r
-    public AuthorityRefList getAuthorityRefs(\r
-            @PathParam("csid") String csid,\r
-            @Context UriInfo uriInfo) {\r
-        AuthorityRefList authRefList = null;\r
-        try {\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(uriInfo);\r
-            DocumentModelHandler<PoxPayloadIn, PoxPayloadOut> handler = (DocumentModelHandler<PoxPayloadIn, PoxPayloadOut>) createDocumentHandler(ctx);\r
-            List<AuthRefConfigInfo> authRefsInfo = RefNameServiceUtils.getConfiguredAuthorityRefs(ctx);\r
-            authRefList = handler.getAuthorityRefs(csid, authRefsInfo);\r
-        } catch (Exception e) {\r
-            throw bigReThrow(e, ServiceMessages.AUTH_REFS_FAILED, csid);\r
-        }\r
-        return authRefList;\r
-    }\r
-    \r
-    //======================== UTILITY : getDocModelForRefName ========================================\r
-\r
-    /*\r
-     * Used get the order by field for list results if one is not specified with an HTTP query param.\r
-     * \r
-     * (non-Javadoc)\r
-     * @see org.collectionspace.services.common.document.AbstractDocumentHandlerImpl#getOrderByField()\r
-     */\r
-    @Override\r
-    protected String getOrderByField(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {\r
-       String result = null;\r
-       \r
-       // We only want to use the partial term field to order the results if a PT query param exists\r
-        String partialTerm = ctx.getQueryParams().getFirst(IQueryManager.SEARCH_TYPE_PARTIALTERM);\r
-        if (Tools.notBlank(partialTerm) == true) {\r
-               DocHandlerParams.Params params = null;\r
-               try {\r
-                               result = getPartialTermMatchField(ctx);\r
-                               if (result == null) {\r
-                                       throw new Exception();\r
-                               }\r
-               } catch (Exception e) {\r
-                               if (logger.isWarnEnabled()) {\r
-                                       logger.warn(String.format("Call failed to getOrderByField() for class %s", this.getClass().getName()));\r
-                               }\r
-               }\r
-        }\r
-               \r
-       return result;\r
-    }\r
-\r
-    @Override\r
-       protected String getPartialTermMatchField(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {\r
-       String result = null;\r
-       \r
-       DocHandlerParams.Params params = null;\r
-       try {\r
-                       params = ServiceConfigUtils.getDocHandlerParams(ctx);\r
-                       ListResultField field = params.getRefnameDisplayNameField();\r
-                       String schema = field.getSchema();\r
-                       if (schema == null || schema.trim().isEmpty()) {\r
-                               schema = ctx.getCommonPartLabel();\r
-                       }\r
-                       result = schema + ":" + field.getXpath();\r
-       } catch (Exception e) {\r
-                       if (logger.isWarnEnabled()) {\r
-                               logger.warn(String.format("Call failed to getPartialTermMatchField() for class %s", this.getClass().getName()));\r
-                       }\r
-       }\r
-       \r
-       return result;\r
-       }\r
-       \r
-    /*\r
-     * ResourceBase create and update calls will set the resourceMap into the service context\r
-     * for all inheriting resource classes. Just use ServiceContext.getResourceMap() to get\r
-     * the map, and pass it in.\r
-     */\r
-    public static DocumentModel getDocModelForRefName(RepositoryInstanceInterface repoSession, String refName, ResourceMap resourceMap) \r
-                       throws Exception, DocumentNotFoundException {\r
-       RefName.AuthorityItem item = RefName.AuthorityItem.parse(refName);\r
-       if(item != null) {\r
-               ResourceBase resource = resourceMap.get(item.inAuthority.resource);\r
-               return resource.getDocModelForAuthorityItem(repoSession, item);\r
-       }\r
-       RefName.Authority authority = RefName.Authority.parse(refName);\r
-       // Handle case of objects refNames, which must be csid based.\r
-       if(authority != null && !Tools.isEmpty(authority.csid)) {\r
-               ResourceBase resource = resourceMap.get(authority.resource);\r
-            // Ensure we have the right context.\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = \r
-                       resource.createServiceContext(authority.resource);\r
-            // HACK - this really must be moved to the doc handler, not here. No Nuxeo specific stuff here!\r
-            DocumentModel docModel = NuxeoUtils.getDocFromCsid(ctx, repoSession, authority.csid);\r
-            return docModel;\r
-       }\r
-       return null;\r
-    }\r
-\r
-    // THis is ugly, but prevents us parsing the refName twice. Once we make refName a little more\r
-    // general, and less Authority(Item) specific, this will look better.\r
-       public DocumentModel getDocModelForAuthorityItem(RepositoryInstanceInterface repoSession, RefName.AuthorityItem item) \r
-                       throws Exception, DocumentNotFoundException {\r
-               logger.warn("Default (ResourceBase) getDocModelForAuthorityItem called - should not happen!");\r
-               return null;\r
-       }\r
-\r
-    public DocumentModel getDocModelForRefName(RepositoryInstanceInterface repoSession, String refName) \r
-                       throws Exception, DocumentNotFoundException {\r
-       return getDocModelForAuthorityItem(repoSession, RefName.AuthorityItem.parse(refName));\r
-    }\r
-    \r
-    protected String getDocType(String tenantId) {\r
-        return getDocType(tenantId, getServiceName());\r
-    }\r
-\r
-    /**\r
-     * Returns the Nuxeo document type associated with a specified service, within a specified tenant.\r
-     * \r
-     * @param tenantId a tenant ID\r
-     * @param serviceName a service name\r
-     * @return the Nuxeo document type associated with that service and tenant.\r
-     */\r
-    // FIXME: This method may properly belong in a different services package or class.\r
-    // Also, we need to check for any existing methods that may duplicate this one.\r
-    protected String getDocType(String tenantId, String serviceName) {\r
-        String docType = "";\r
-        if (Tools.isBlank(tenantId)) {\r
-            return docType;\r
-        }\r
-        ServiceBindingType sb = getTenantBindingsReader().getServiceBinding(tenantId, serviceName);\r
-        if (sb == null) {\r
-            return docType;\r
-        }\r
-        docType = sb.getObject().getName(); // Reads the Nuxeo Document Type from tenant bindings configuration\r
-        return docType;\r
-    }\r
-    \r
-    /**\r
-     * Returns a UriRegistry entry: a map of tenant-qualified URI templates\r
-     * for the current resource, for all tenants\r
-     * \r
-     * @return a map of URI templates for the current resource, for all tenants\r
-     */\r
-    public Map<UriTemplateRegistryKey,StoredValuesUriTemplate> getUriRegistryEntries() {\r
-        Map<UriTemplateRegistryKey,StoredValuesUriTemplate> uriRegistryEntriesMap =\r
-                new HashMap<UriTemplateRegistryKey,StoredValuesUriTemplate>();\r
-        List<String> tenantIds = getTenantBindingsReader().getTenantIds();\r
-        for (String tenantId : tenantIds) {\r
-                uriRegistryEntriesMap.putAll(getUriRegistryEntries(tenantId, getDocType(tenantId), UriTemplateFactory.RESOURCE));\r
-        }\r
-        return uriRegistryEntriesMap;\r
-    }\r
-    \r
-    /**\r
-     * Returns a UriRegistry entry: a map of tenant-qualified URI templates\r
-     * for the current resource, for a specified tenants\r
-     * \r
-     * @return a map of URI templates for the current resource, for a specified tenant\r
-     */\r
-    protected Map<UriTemplateRegistryKey,StoredValuesUriTemplate> getUriRegistryEntries(String tenantId,\r
-            String docType, UriTemplateFactory.UriTemplateType type) {\r
-        Map<UriTemplateRegistryKey,StoredValuesUriTemplate> uriRegistryEntriesMap =\r
-                new HashMap<UriTemplateRegistryKey,StoredValuesUriTemplate>();\r
-        UriTemplateRegistryKey key;\r
-        if (Tools.isBlank(tenantId) || Tools.isBlank(docType)) {\r
-            return uriRegistryEntriesMap;\r
-        }\r
-        key = new UriTemplateRegistryKey();\r
-        key.setTenantId(tenantId);\r
-        key.setDocType(docType); \r
-        uriRegistryEntriesMap.put(key, getUriTemplate(type));\r
-        return uriRegistryEntriesMap;\r
-    }\r
-    \r
-    /**\r
-     * Returns a URI template of the appropriate type, populated with the\r
-     * current service name as one of its stored values.\r
-     *      * \r
-     * @param type a URI template type\r
-     * @return a URI template of the appropriate type.\r
-     */\r
-    protected StoredValuesUriTemplate getUriTemplate(UriTemplateFactory.UriTemplateType type) {\r
-        Map<String,String> storedValuesMap = new HashMap<String,String>();\r
-        storedValuesMap.put(UriTemplateFactory.SERVICENAME_VAR, getServiceName());\r
-        StoredValuesUriTemplate template =\r
-                UriTemplateFactory.getURITemplate(type, storedValuesMap);\r
-        return template;\r
-    }\r
-\r
-    /**\r
-     * Returns a reader for reading values from tenant bindings configuration\r
-     * \r
-     * @return a tenant bindings configuration reader\r
-     */\r
-    protected TenantBindingConfigReaderImpl getTenantBindingsReader() {\r
-        return ServiceMain.getInstance().getTenantBindingConfigReader();\r
-    }\r
-\r
-\r
-    \r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2010 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.*;
+
+import org.collectionspace.services.client.IClientQueryParams;
+import org.collectionspace.services.client.IQueryManager;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.api.RefName;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
+import org.collectionspace.services.common.config.ServiceConfigUtils;
+import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
+import org.collectionspace.services.common.context.RemoteServiceContext;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.DocumentFilter;
+import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentNotFoundException;
+import org.collectionspace.services.common.query.QueryManager;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthRefConfigInfo;
+import org.collectionspace.services.config.ClientType;
+import org.collectionspace.services.config.service.DocHandlerParams;
+import org.collectionspace.services.config.service.ListResultField;
+import org.collectionspace.services.config.service.ServiceBindingType;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
+import org.collectionspace.services.nuxeo.client.java.RepositoryInstanceInterface;
+import org.collectionspace.services.nuxeo.util.NuxeoUtils;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
+import org.jboss.resteasy.util.HttpResponseCodes;
+import org.nuxeo.ecm.core.api.DocumentModel;
+import org.nuxeo.ecm.core.api.DocumentModelList;
+import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
+
+
+/**
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ * Author: Laramie Crocker
+ */
+public abstract class ResourceBase
+        extends AbstractMultiPartCollectionSpaceResourceImpl {
+
+    public static final String CREATE = "create";
+    public static final String READ = "get";
+    public static final String UPDATE = "update";
+    public static final String DELETE = "delete";
+    public static final String LIST = "list";
+    //FIXME retrieve client type from configuration
+    static ClientType CLIENT_TYPE;
+
+    /*
+     * REM - 11/14/2011 - I discovered this static block of code and don't understand why it exists.  However, a side-effect of this static block is that ServiceMain is trying
+     * to create a valid instance of entire CSpace services include an embedded Nuxeo instance.  This block of code seems goofy and unnecessary and probably should be removed?
+     */
+    static {
+        try {
+            // I put this in a try-catch static block instead of file-level static var initializer so that static methods of
+            // *Resource classes may be called statically from test cases.
+            // Without this catch, you can't even access static methods of a *Resource class for testing.
+            CLIENT_TYPE = ServiceMain.getInstance().getClientType();
+            //System.out.println("Static initializer in ResourceBase. CLIENT_TYPE:"+CLIENT_TYPE);
+        } catch (Throwable t) {
+            System.out.println("Static initializer failed in ResourceBase because not running from deployment.  OK to use Resource classes statically for tests.");
+        }
+    }
+    
+    //======================= CREATE ====================================================
+    
+    @POST
+    public Response create(
+               @Context ResourceMap resourceMap,
+               @Context UriInfo ui,
+            String xmlPayload) {
+        return this.create(null, resourceMap, ui, xmlPayload); 
+    }
+    
+    public Response create(ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx, // REM: 8/13/2012 - Some sub-classes will override this method -e.g., MediaResource does.
+               ResourceMap resourceMap,
+               UriInfo uriInfo,
+            String xmlPayload) {
+       Response result = null;
+       
+        try {
+            PoxPayloadIn input = new PoxPayloadIn(xmlPayload);
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(input, resourceMap, uriInfo);
+            ctx.setResourceMap(resourceMap);
+            if (parentCtx != null && parentCtx.getCurrentRepositorySession() != null) {
+               ctx.setCurrentRepositorySession(parentCtx.getCurrentRepositorySession()); // Reuse the current repo session if one exists
+            }            
+            result = create(input, ctx);
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.CREATE_FAILED);
+        }
+        
+        return result;
+    }    
+    
+    protected Response create(PoxPayloadIn input, ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {
+        try {
+            DocumentHandler<PoxPayloadIn, PoxPayloadOut, DocumentModel, DocumentModelList> handler = createDocumentHandler(ctx);
+            UriBuilder path = UriBuilder.fromResource(this.getClass());
+            return create(input, ctx, handler, path); //==> CALL implementation method, which subclasses may override.
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.CREATE_FAILED);
+        }
+    }
+
+    /** Subclasses may override this overload, which gets called from @see #create(MultipartInput)   */
+    protected Response create(PoxPayloadIn input,
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            DocumentHandler<PoxPayloadIn, PoxPayloadOut, DocumentModel, DocumentModelList> handler,
+            UriBuilder path)
+            throws Exception {
+        String csid = getRepositoryClient(ctx).create(ctx, handler);
+        path.path("" + csid);
+        Response response = Response.created(path.build()).build();
+        return response;
+    }
+
+    //======================= UPDATE ====================================================
+    @PUT
+    @Path("{csid}")
+    public byte[] update(@Context ResourceMap resourceMap,
+               @Context UriInfo uriInfo,
+               @PathParam("csid") String csid,
+               String xmlPayload) {
+        return this.update(null, resourceMap, uriInfo, csid, xmlPayload); 
+    }
+
+    public byte[] update(ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx, // REM: 8/13/2012 - Some sub-classes will override this method -e.g., MediaResource does.
+               @Context ResourceMap resourceMap,
+               @Context UriInfo uriInfo,
+               @PathParam("csid") String csid,
+               String xmlPayload) {
+        PoxPayloadOut result = null;
+        ensureCSID(csid, UPDATE);
+        try {
+            PoxPayloadIn theUpdate = new PoxPayloadIn(xmlPayload);
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(theUpdate, uriInfo);
+            ctx.setResourceMap(resourceMap);
+            if (parentCtx != null && parentCtx.getCurrentRepositorySession() != null) {
+               ctx.setCurrentRepositorySession(parentCtx.getCurrentRepositorySession()); // Reuse the current repo session if one exists
+            }            
+            result = update(csid, theUpdate, ctx); //==> CALL implementation method, which subclasses may override.
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.UPDATE_FAILED, csid);
+        }
+        return result.getBytes();
+    }
+
+    /** Subclasses may override this overload, which gets called from #udpate(String,MultipartInput)   */
+    protected PoxPayloadOut update(String csid,
+            PoxPayloadIn theUpdate,
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx)
+            throws Exception {
+        DocumentHandler handler = createDocumentHandler(ctx);
+        getRepositoryClient(ctx).update(ctx, csid, handler);
+        return ctx.getOutput();
+    }
+
+    /** Subclasses may override this overload, which gets called from #udpate(String,MultipartInput)   */
+    protected PoxPayloadOut update(String csid,
+            MultipartInput theUpdate,
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            DocumentHandler handler)
+            throws Exception {
+        getRepositoryClient(ctx).update(ctx, csid, handler);
+        return ctx.getOutput();
+    }
+
+    //======================= DELETE ====================================================
+    @DELETE
+    @Path("{csid}")
+    public Response delete(@PathParam("csid") String csid) {
+        ensureCSID(csid, DELETE);
+        try {
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();
+            return delete(ctx, csid);  //==> CALL implementation method, which subclasses may override.
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.DELETE_FAILED, csid);
+        }
+    }
+
+    /** subclasses may override this method, which is called from #delete(String)
+     *  which handles setup of ServiceContext, and does Exception handling.  */
+    protected Response delete(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx, String csid)
+            throws Exception {
+       DocumentHandler<PoxPayloadIn, PoxPayloadOut, DocumentModel, DocumentModelList> handler = createDocumentHandler(ctx);
+        getRepositoryClient(ctx).delete(ctx, csid, handler);
+        return Response.status(HttpResponseCodes.SC_OK).build();
+    }
+    
+    public Response deleteWithParentCtx(ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx,
+               String csid)
+            throws Exception {
+        ensureCSID(csid, DELETE);
+        try {
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();
+            if (parentCtx != null && parentCtx.getCurrentRepositorySession() != null) {
+               ctx.setCurrentRepositorySession(parentCtx.getCurrentRepositorySession()); // reuse the repo session if one exists
+            }
+            return delete(ctx, csid);  //==> CALL implementation method, which subclasses may override.
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.DELETE_FAILED, csid);
+        }
+    }    
+
+    //======================= GET ====================================================
+    @GET
+    @Path("{csid}")
+    public byte[] get(
+            @Context Request request,                  
+            @Context UriInfo uriInfo,
+            @PathParam("csid") String csid) {
+        PoxPayloadOut result = null;
+        ensureCSID(csid, READ);
+        try {
+            RemoteServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = (RemoteServiceContext<PoxPayloadIn, PoxPayloadOut>) createServiceContext(uriInfo);
+            result = get(csid, ctx);// ==> CALL implementation method, which subclasses may override.
+            if (result == null) {
+                Response response = Response.status(Response.Status.NOT_FOUND).entity(
+                        ServiceMessages.READ_FAILED + ServiceMessages.resourceNotFoundMsg(csid)).type("text/plain").build();
+                throw new CSWebApplicationException(response);
+            }
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.READ_FAILED, csid);
+        }
+
+        return result.getBytes();
+    }
+
+    protected PoxPayloadOut get(@PathParam("csid") String csid,
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {
+        PoxPayloadOut result = null;
+
+        ensureCSID(csid, READ);
+        DocumentHandler handler = createDocumentHandler(ctx);
+        result = get(csid, ctx, handler);
+        if (result == null) {
+            String msg = "Could not find document with id = " + csid;
+            if (logger.isErrorEnabled() == true) {
+                logger.error(msg);
+            }
+            throw new DocumentNotFoundException(msg);
+        }
+
+        return result;
+    }
+
+    /** subclasses may override this method, which is called from #get(String)
+     *  which handles setup of ServiceContext and DocumentHandler, and Exception handling.*/
+    protected PoxPayloadOut get(String csid,
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            DocumentHandler handler)
+            throws Exception {
+        getRepositoryClient(ctx).get(ctx, csid, handler);
+        return ctx.getOutput();
+    }
+    
+    protected boolean isGetAllRequest(MultivaluedMap<String, String> queryParams) {
+       boolean result = false;
+       
+        String keywords = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_KW);
+        String advancedSearch = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_AS);
+        String partialTerm = queryParams.getFirst(IQueryManager.SEARCH_TYPE_PARTIALTERM);
+        
+        if (Tools.isBlank(keywords) && Tools.isBlank(advancedSearch) && Tools.isBlank(partialTerm)) {
+               result = true;
+        }
+        
+       return result;
+    }
+
+    //======================= GET without csid. List, search, etc. =====================================
+    @GET
+    public AbstractCommonList getList(@Context UriInfo ui) {
+        AbstractCommonList list = null;
+        
+        MultivaluedMap<String, String> queryParams = ui.getQueryParameters();
+        if (isGetAllRequest(queryParams) == false) {
+            String orderBy = queryParams.getFirst(IClientQueryParams.ORDER_BY_PARAM);
+            String keywords = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_KW);
+            String advancedSearch = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_AS);
+            String partialTerm = queryParams.getFirst(IQueryManager.SEARCH_TYPE_PARTIALTERM);
+            list = search(ui, orderBy, keywords, advancedSearch, partialTerm);
+        } else {
+            list = getCommonList(ui);
+        }
+        
+        return list;
+    }
+    
+    protected AbstractCommonList getCommonList(UriInfo uriInfo) {
+        try {
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(uriInfo);
+            DocumentHandler handler = createDocumentHandler(ctx);
+            getRepositoryClient(ctx).getFiltered(ctx, handler);
+            AbstractCommonList list = (AbstractCommonList) handler.getCommonPartList();
+            return list;
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.LIST_FAILED);
+        }
+    }
+
+    protected AbstractCommonList finish_getList(ServiceContext ctx, DocumentHandler handler) {
+        try {
+            getRepositoryClient(ctx).getFiltered(ctx, handler); // REM - Side effect of this call sets the handler's common part list value
+            return (AbstractCommonList) handler.getCommonPartList();
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.LIST_FAILED);
+        }
+    }
+
+    protected AbstractCommonList search(
+               ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+               DocumentHandler handler, 
+               UriInfo ui,
+               String orderBy,
+               String keywords,
+               String advancedSearch,
+               String partialTerm) throws Exception {
+        DocumentFilter docFilter = handler.getDocumentFilter();      
+        if (orderBy == null || orderBy.isEmpty()) {
+            String orderByField = getOrderByField(ctx);
+            docFilter.setOrderByClause(orderByField);
+        }
+        
+        //
+        // NOTE: Partial-term (PT) queries are mutually exclusive to keyword and
+        // partial-term queries trump keyword queries.
+        //
+        if (partialTerm != null && !partialTerm.isEmpty()) {
+               String partialTermMatchField = getPartialTermMatchField(ctx);
+            String ptClause = QueryManager.createWhereClauseForPartialMatch(ctx, partialTermMatchField,
+                       partialTerm);
+            docFilter.appendWhereClause(ptClause, IQueryManager.SEARCH_QUALIFIER_AND);
+        } else if (keywords != null && !keywords.isEmpty()) {
+            String whereClause = QueryManager.createWhereClauseFromKeywords(keywords);
+            if (Tools.isEmpty(whereClause) == false) {
+               docFilter.appendWhereClause(whereClause, IQueryManager.SEARCH_QUALIFIER_AND);
+                   if (logger.isDebugEnabled()) {
+                       logger.debug("The WHERE clause is: " + docFilter.getWhereClause());
+                   }
+            } else {
+                if (logger.isWarnEnabled()) {
+                       logger.warn("The WHERE clause is empty for keywords: ["+keywords+"]");
+                }
+            }
+        }
+                
+        //
+        // Add an advance search clause if one was specified -even if PT search was requested?
+        //
+        if (advancedSearch != null && !advancedSearch.isEmpty()) {
+            String whereClause = QueryManager.createWhereClauseFromAdvancedSearch(advancedSearch);
+            docFilter.appendWhereClause(whereClause, IQueryManager.SEARCH_QUALIFIER_AND);
+            if (logger.isDebugEnabled()) {
+                logger.debug("The WHERE clause is: " + docFilter.getWhereClause());
+            }
+        }
+        
+        getRepositoryClient(ctx).getFiltered(ctx, handler);        
+        return (AbstractCommonList) handler.getCommonPartList();
+    }
+
+    private AbstractCommonList search(
+               UriInfo uriInfo,
+               String orderBy,
+               String keywords,
+               String advancedSearch,
+               String partialTerm) {
+       AbstractCommonList result = null;
+
+       ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx;
+       try {
+               ctx = createServiceContext(uriInfo);
+               DocumentHandler handler = createDocumentHandler(ctx);
+               result = search(ctx, handler, uriInfo, orderBy, keywords, advancedSearch, partialTerm);
+       } catch (Exception e) {
+               throw bigReThrow(e, ServiceMessages.SEARCH_FAILED);
+       }
+
+       return result;
+    }
+    
+    //FIXME: REM - This should not be @Deprecated since we may want to implement this -it has been on the wish list.
+    @Deprecated
+    public AbstractCommonList getList(List<String> csidList) {
+        try {
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();
+            DocumentHandler handler = createDocumentHandler(ctx);
+            getRepositoryClient(ctx).get(ctx, csidList, handler);
+            return (AbstractCommonList) handler.getCommonPartList();
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.LIST_FAILED);
+        }
+    }
+
+    //======================== GET : getAuthorityRefs ========================================
+    @GET
+    @Path("{csid}/authorityrefs")
+    @Produces("application/xml")
+    public AuthorityRefList getAuthorityRefs(
+            @PathParam("csid") String csid,
+            @Context UriInfo uriInfo) {
+        AuthorityRefList authRefList = null;
+        try {
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(uriInfo);
+            DocumentModelHandler<PoxPayloadIn, PoxPayloadOut> handler = (DocumentModelHandler<PoxPayloadIn, PoxPayloadOut>) createDocumentHandler(ctx);
+            List<AuthRefConfigInfo> authRefsInfo = RefNameServiceUtils.getConfiguredAuthorityRefs(ctx);
+            authRefList = handler.getAuthorityRefs(csid, authRefsInfo);
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.AUTH_REFS_FAILED, csid);
+        }
+        return authRefList;
+    }
+    
+    //======================== UTILITY : getDocModelForRefName ========================================
+
+    /*
+     * Used get the order by field for list results if one is not specified with an HTTP query param.
+     * 
+     * (non-Javadoc)
+     * @see org.collectionspace.services.common.document.AbstractDocumentHandlerImpl#getOrderByField()
+     */
+    @Override
+    protected String getOrderByField(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {
+       String result = null;
+       
+       // We only want to use the partial term field to order the results if a PT query param exists
+        String partialTerm = ctx.getQueryParams().getFirst(IQueryManager.SEARCH_TYPE_PARTIALTERM);
+        if (Tools.notBlank(partialTerm) == true) {
+               DocHandlerParams.Params params = null;
+               try {
+                               result = getPartialTermMatchField(ctx);
+                               if (result == null) {
+                                       throw new Exception();
+                               }
+               } catch (Exception e) {
+                               if (logger.isWarnEnabled()) {
+                                       logger.warn(String.format("Call failed to getOrderByField() for class %s", this.getClass().getName()));
+                               }
+               }
+        }
+               
+       return result;
+    }
+
+    @Override
+       protected String getPartialTermMatchField(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {
+       String result = null;
+       
+       DocHandlerParams.Params params = null;
+       try {
+                       params = ServiceConfigUtils.getDocHandlerParams(ctx);
+                       ListResultField field = params.getRefnameDisplayNameField();
+                       String schema = field.getSchema();
+                       if (schema == null || schema.trim().isEmpty()) {
+                               schema = ctx.getCommonPartLabel();
+                       }
+                       result = schema + ":" + field.getXpath();
+       } catch (Exception e) {
+                       if (logger.isWarnEnabled()) {
+                               logger.warn(String.format("Call failed to getPartialTermMatchField() for class %s", this.getClass().getName()));
+                       }
+       }
+       
+       return result;
+       }
+       
+    /*
+     * ResourceBase create and update calls will set the resourceMap into the service context
+     * for all inheriting resource classes. Just use ServiceContext.getResourceMap() to get
+     * the map, and pass it in.
+     */
+    public static DocumentModel getDocModelForRefName(RepositoryInstanceInterface repoSession, String refName, ResourceMap resourceMap) 
+                       throws Exception, DocumentNotFoundException {
+       RefName.AuthorityItem item = RefName.AuthorityItem.parse(refName);
+       if(item != null) {
+               ResourceBase resource = resourceMap.get(item.inAuthority.resource);
+               return resource.getDocModelForAuthorityItem(repoSession, item);
+       }
+       RefName.Authority authority = RefName.Authority.parse(refName);
+       // Handle case of objects refNames, which must be csid based.
+       if(authority != null && !Tools.isEmpty(authority.csid)) {
+               ResourceBase resource = resourceMap.get(authority.resource);
+            // Ensure we have the right context.
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = 
+                       resource.createServiceContext(authority.resource);
+            // HACK - this really must be moved to the doc handler, not here. No Nuxeo specific stuff here!
+            DocumentModel docModel = NuxeoUtils.getDocFromCsid(ctx, repoSession, authority.csid);
+            return docModel;
+       }
+       return null;
+    }
+
+    // THis is ugly, but prevents us parsing the refName twice. Once we make refName a little more
+    // general, and less Authority(Item) specific, this will look better.
+       public DocumentModel getDocModelForAuthorityItem(RepositoryInstanceInterface repoSession, RefName.AuthorityItem item) 
+                       throws Exception, DocumentNotFoundException {
+               logger.warn("Default (ResourceBase) getDocModelForAuthorityItem called - should not happen!");
+               return null;
+       }
+
+    public DocumentModel getDocModelForRefName(RepositoryInstanceInterface repoSession, String refName) 
+                       throws Exception, DocumentNotFoundException {
+       return getDocModelForAuthorityItem(repoSession, RefName.AuthorityItem.parse(refName));
+    }
+    
+    protected String getDocType(String tenantId) {
+        return getDocType(tenantId, getServiceName());
+    }
+
+    /**
+     * Returns the Nuxeo document type associated with a specified service, within a specified tenant.
+     * 
+     * @param tenantId a tenant ID
+     * @param serviceName a service name
+     * @return the Nuxeo document type associated with that service and tenant.
+     */
+    // FIXME: This method may properly belong in a different services package or class.
+    // Also, we need to check for any existing methods that may duplicate this one.
+    protected String getDocType(String tenantId, String serviceName) {
+        String docType = "";
+        if (Tools.isBlank(tenantId)) {
+            return docType;
+        }
+        ServiceBindingType sb = getTenantBindingsReader().getServiceBinding(tenantId, serviceName);
+        if (sb == null) {
+            return docType;
+        }
+        docType = sb.getObject().getName(); // Reads the Nuxeo Document Type from tenant bindings configuration
+        return docType;
+    }
+    
+    /**
+     * Returns a UriRegistry entry: a map of tenant-qualified URI templates
+     * for the current resource, for all tenants
+     * 
+     * @return a map of URI templates for the current resource, for all tenants
+     */
+    public Map<UriTemplateRegistryKey,StoredValuesUriTemplate> getUriRegistryEntries() {
+        Map<UriTemplateRegistryKey,StoredValuesUriTemplate> uriRegistryEntriesMap =
+                new HashMap<UriTemplateRegistryKey,StoredValuesUriTemplate>();
+        List<String> tenantIds = getTenantBindingsReader().getTenantIds();
+        for (String tenantId : tenantIds) {
+                uriRegistryEntriesMap.putAll(getUriRegistryEntries(tenantId, getDocType(tenantId), UriTemplateFactory.RESOURCE));
+        }
+        return uriRegistryEntriesMap;
+    }
+    
+    /**
+     * Returns a UriRegistry entry: a map of tenant-qualified URI templates
+     * for the current resource, for a specified tenants
+     * 
+     * @return a map of URI templates for the current resource, for a specified tenant
+     */
+    protected Map<UriTemplateRegistryKey,StoredValuesUriTemplate> getUriRegistryEntries(String tenantId,
+            String docType, UriTemplateFactory.UriTemplateType type) {
+        Map<UriTemplateRegistryKey,StoredValuesUriTemplate> uriRegistryEntriesMap =
+                new HashMap<UriTemplateRegistryKey,StoredValuesUriTemplate>();
+        UriTemplateRegistryKey key;
+        if (Tools.isBlank(tenantId) || Tools.isBlank(docType)) {
+            return uriRegistryEntriesMap;
+        }
+        key = new UriTemplateRegistryKey();
+        key.setTenantId(tenantId);
+        key.setDocType(docType); 
+        uriRegistryEntriesMap.put(key, getUriTemplate(type));
+        return uriRegistryEntriesMap;
+    }
+    
+    /**
+     * Returns a URI template of the appropriate type, populated with the
+     * current service name as one of its stored values.
+     *      * 
+     * @param type a URI template type
+     * @return a URI template of the appropriate type.
+     */
+    protected StoredValuesUriTemplate getUriTemplate(UriTemplateFactory.UriTemplateType type) {
+        Map<String,String> storedValuesMap = new HashMap<String,String>();
+        storedValuesMap.put(UriTemplateFactory.SERVICENAME_VAR, getServiceName());
+        StoredValuesUriTemplate template =
+                UriTemplateFactory.getURITemplate(type, storedValuesMap);
+        return template;
+    }
+
+    /**
+     * Returns a reader for reading values from tenant bindings configuration
+     * 
+     * @return a tenant bindings configuration reader
+     */
+    protected TenantBindingConfigReaderImpl getTenantBindingsReader() {
+        return ServiceMain.getInstance().getTenantBindingConfigReader();
+    }
+
+
+    
+}
index eecf51c6c9f713329f9e6f97f16c9e9e0a4845f6..d1d990cb369cd45f613affea54a1e371340c5818 100644 (file)
@@ -1,10 +1,10 @@
-package org.collectionspace.services.common;\r
-\r
-import java.util.Map;\r
-\r
-/*\r
- * Maps service names to Resource instances. Use the Service Client Class to get the service name. \r
- */\r
-public interface ResourceMap extends Map<String, ResourceBase> {\r
-\r
-}\r
+package org.collectionspace.services.common;
+
+import java.util.Map;
+
+/*
+ * Maps service names to Resource instances. Use the Service Client Class to get the service name. 
+ */
+public interface ResourceMap extends Map<String, ResourceBase> {
+
+}
index 7bb298669c5247bf2b63e74cc832274dfc206def..950ec7c3a993459f0443a6d1b2c165ea010934b1 100644 (file)
@@ -1,5 +1,5 @@
-package org.collectionspace.services.common;\r
-\r
-public interface ResourceMapHolder {\r
-       public ResourceMap getResourceMap();\r
-}\r
+package org.collectionspace.services.common;
+
+public interface ResourceMapHolder {
+       public ResourceMap getResourceMap();
+}
index 4845d997180608da74bfc67f2322dcb2cd38e783..a49b6865b9440478d9217dbdd3b80f22945b5d46 100644 (file)
@@ -1,7 +1,7 @@
-package org.collectionspace.services.common;\r
-\r
-import java.util.HashMap;\r
-\r
-public class ResourceMapImpl extends HashMap<String, ResourceBase> implements ResourceMap {\r
-\r
-}\r
+package org.collectionspace.services.common;
+
+import java.util.HashMap;
+
+public class ResourceMapImpl extends HashMap<String, ResourceBase> implements ResourceMap {
+
+}
index b38e41d3bbba3780aaae5beb86a646dc7938f7f2..db2ee3fbdb830c44392247766c556a01d5bc168a 100644 (file)
-/**\r
- * Copyright 2009-2010 University of California at Berkeley\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import java.io.File;\r
-import java.io.FileInputStream;\r
-import java.io.FileNotFoundException;\r
-import java.io.InputStream;\r
-import java.sql.Connection;\r
-import java.sql.PreparedStatement;\r
-import java.sql.ResultSet;\r
-import java.sql.SQLException;\r
-import java.sql.Statement;\r
-import java.util.*;\r
-\r
-import javax.naming.NamingException;\r
-import javax.servlet.ServletContext;\r
-import javax.sql.DataSource;\r
-\r
-import org.apache.tomcat.dbcp.dbcp.BasicDataSource;\r
-import org.collectionspace.authentication.AuthN;\r
-import org.collectionspace.services.common.api.JEEServerDeployment;\r
-import org.collectionspace.services.common.api.FileTools;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.authorization_mgt.AuthorizationCommon;\r
-import org.collectionspace.services.common.config.ConfigReader;\r
-import org.collectionspace.services.common.config.ConfigUtils;\r
-import org.collectionspace.services.common.config.ServicesConfigReaderImpl;\r
-import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;\r
-import org.collectionspace.services.common.context.ServiceBindingUtils;\r
-import org.collectionspace.services.common.init.AddIndices;\r
-import org.collectionspace.services.config.service.InitHandler.Params.Field;\r
-import org.collectionspace.services.common.init.IInitHandler;\r
-import org.collectionspace.services.common.storage.DatabaseProductType;\r
-import org.collectionspace.services.common.storage.JDBCTools;\r
-import org.collectionspace.services.config.ClientType;\r
-import org.collectionspace.services.config.ServiceConfig;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-import org.collectionspace.services.config.tenant.RepositoryDomainType;\r
-import org.collectionspace.services.config.tenant.TenantBindingType;\r
-import org.collectionspace.services.config.types.PropertyItemType;\r
-import org.collectionspace.services.config.types.PropertyType;\r
-import org.collectionspace.services.nuxeo.client.java.NuxeoConnectorEmbedded;\r
-import org.collectionspace.services.nuxeo.client.java.TenantRepository;\r
-import org.jboss.resteasy.spi.ResteasyProviderFactory;\r
-import org.dom4j.Document;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * Main class for Services layer. It reads configuration and performs service\r
- * level initialization. It is a singleton.\r
- * @author \r
- */\r
-public class ServiceMain {\r
-\r
-    final Logger logger = LoggerFactory.getLogger(ServiceMain.class);\r
-    /**\r
-     * volatile is used here to assume about ordering (post JDK 1.5)\r
-     */\r
-    private static volatile ServiceMain instance = null;\r
-    private static volatile boolean initFailed = false;\r
-\r
-    private static final String SERVER_HOME_PROPERTY = "catalina.home";\r
-       private static final boolean USE_APP_GENERATED_CONFIG = true;\r
-       \r
-       private static ServletContext servletContext = null;\r
-    \r
-       private NuxeoConnectorEmbedded nuxeoConnector;\r
-    private String serverRootDir = null;\r
-    private ServicesConfigReaderImpl servicesConfigReader;\r
-    private TenantBindingConfigReaderImpl tenantBindingConfigReader;\r
-    private UriTemplateRegistry uriTemplateRegistry = new UriTemplateRegistry();\r
-    \r
-    \r
-    private static final String COMPONENT_EXTENSION_XPATH = "/component/extension[@point='%s']";\r
-    private static final String REPOSITORY_EXTENSION_POINT_XPATH =\r
-            String.format(COMPONENT_EXTENSION_XPATH, "repository");\r
-    private static final String REPOSITORIES_EXTENSION_POINT_XPATH =\r
-            String.format(COMPONENT_EXTENSION_XPATH, "repositories");\r
-    \r
-    private static final String DROP_DATABASE_SQL_CMD = "DROP DATABASE";\r
-    private static final String DROP_DATABASE_IF_EXISTS_SQL_CMD = DROP_DATABASE_SQL_CMD + " IF EXISTS %s;";\r
-    private static final String DROP_USER_SQL_CMD = "DROP USER";\r
-    private static final String DROP_USER_IF_EXISTS_SQL_CMD = DROP_USER_SQL_CMD + " IF EXISTS %s;";\r
-    private static final String DROP_OBJECTS_SQL_COMMENT = "-- drop all the objects before dropping roles";\r
-\r
-            \r
-    private ServiceMain() {\r
-       //empty\r
-    }\r
-    \r
-    /*\r
-     * \r
-     * Set this singletons ServletContext without any call to initialize\r
-     */\r
-    private static void setServletContext(ServletContext servletContext) {\r
-               if (servletContext != null) {\r
-               synchronized (ServiceMain.class) {\r
-                       ServiceMain.servletContext = servletContext;\r
-               }\r
-               }\r
-    }\r
-        \r
-    public String getCspaceDatabaseName() {\r
-       return getServiceConfig().getDbCspaceName();\r
-    }\r
-        \r
-    public boolean inServletContext() {\r
-       return ServiceMain.servletContext != null;\r
-    }\r
-    \r
-    public static ServiceMain getInstance(ServletContext servletContext) {\r
-       setServletContext(servletContext);\r
-       return ServiceMain.getInstance();\r
-    }\r
-    \r
-    /**\r
-     * getInstance returns the ServiceMain singleton instance after proper\r
-     * initialization in a thread-safe manner\r
-     * @return\r
-     */\r
-    public static ServiceMain getInstance() {\r
-        if (instance == null && initFailed == false) {\r
-            synchronized (ServiceMain.class) {\r
-                if (instance == null && initFailed == false) {\r
-                    ServiceMain newInstance = new ServiceMain();\r
-                    try {\r
-                       //assume the worse\r
-                       initFailed = true;\r
-                       newInstance.initialize();\r
-                       //celebrate success\r
-                        initFailed = false;\r
-                    } catch (Exception e) {\r
-                        instance = null;\r
-                        if (e instanceof RuntimeException) {\r
-                            throw (RuntimeException) e;\r
-                        } else {\r
-                            throw new RuntimeException(e);\r
-                        }\r
-                    }\r
-                    instance = newInstance;\r
-                }\r
-            }\r
-        }\r
-        \r
-        if (instance == null) {\r
-               throw new RuntimeException("Could not initialize the CollectionSpace services.  Please see the CollectionSpace services log file(s) for details.");\r
-        }\r
-        \r
-        return instance;\r
-    }\r
-\r
-    private void initialize() throws Exception {\r
-       // set our root directory\r
-       setServerRootDir();\r
-       \r
-       // read in and set our Services config\r
-       readAndSetServicesConfig();\r
-       \r
-       // Set our AuthN's datasource to for the cspaceDataSource\r
-       AuthN.setDataSource(JDBCTools.getDataSource(JDBCTools.CSPACE_DATASOURCE_NAME));\r
-       \r
-       // In each tenant, set properties that don't already have values\r
-       // to their default values.\r
-        propagateConfiguredProperties();\r
-        \r
-        // Create or update Nuxeo's per-repository configuration files.\r
-        createOrUpdateNuxeoRepositoryConfigFiles();\r
-        \r
-        // Create the Nuxeo-managed databases, along with the requisite\r
-        // access rights to each.\r
-       HashSet<String> dbsCheckedOrCreated = createNuxeoDatabases();\r
-        \r
-        // Update the SQL script that drops databases and users,\r
-        // to include DROP statements for each of the Nuxeo-managed\r
-        // database names and for each relevant datasource user.\r
-        String[] dataSourceNames = {JDBCTools.NUXEO_DATASOURCE_NAME, JDBCTools.NUXEO_READER_DATASOURCE_NAME};\r
-        updateInitializationScript(getNuxeoDatabasesInitScriptFilename(),\r
-                dbsCheckedOrCreated, dataSourceNames);\r
-\r
-        //\r
-        // Start up and initialize our embedded Nuxeo instance.\r
-        //\r
-        if (getClientType().equals(ClientType.JAVA)) {\r
-            nuxeoConnector = NuxeoConnectorEmbedded.getInstance();\r
-            nuxeoConnector.initialize(\r
-                       getServerRootDir(),\r
-                       getServicesConfigReader().getConfiguration().getRepositoryClient(),\r
-                       ServiceMain.servletContext);\r
-        } else {\r
-               //\r
-               // Exit if we don't have the correct/known client type\r
-               //\r
-               throw new RuntimeException("Unknown CollectionSpace services client type: " + getClientType());\r
-        }\r
-        //\r
-        // Create all the default user accounts and permissions.  Since some of our "cspace" database config files\r
-        // for Spring need to be created at build time, the "cspace" database already will be suffixed with the\r
-        // correct 'cspaceInstanceId' so we don't need to pass it to the JDBCTools methods.\r
-        //\r
-               try {\r
-                       AuthorizationCommon.createDefaultWorkflowPermissions(tenantBindingConfigReader);\r
-                       String cspaceDatabaseName = getCspaceDatabaseName();\r
-                       DatabaseProductType databaseProductType = JDBCTools.getDatabaseProductType(JDBCTools.CSPACE_DATASOURCE_NAME,\r
-                                       cspaceDatabaseName);\r
-                       AuthorizationCommon.createDefaultAccounts(tenantBindingConfigReader, databaseProductType,\r
-                                       cspaceDatabaseName);\r
-               } catch (Exception e) {\r
-                       logger.error("Default accounts and permissions setup failed with exception(s): " +\r
-                                       e.getLocalizedMessage(), e);\r
-                       throw e;\r
-               }\r
-        \r
-        /*\r
-         * This might be useful for something, but the reader grants are better handled in the ReportPostInitHandler.\r
-        try {\r
-               handlePostNuxeoInitDBTasks();\r
-        } catch(Throwable e) {         \r
-               logger.error("handlePostNuxeoInitDBTasks failed with exception(s): " + e.getLocalizedMessage(), e);\r
-        }\r
-        */\r
-    }\r
-\r
-    /**\r
-     * release releases all resources occupied by service layer infrastructure\r
-     * but not necessarily those occupied by individual services\r
-     */\r
-    public void release() {\r
-        try {\r
-            if (nuxeoConnector != null) {\r
-                nuxeoConnector.release();\r
-            }\r
-            instance = null;\r
-        } catch (Exception e) {\r
-            e.printStackTrace();\r
-            //gobble it\r
-        }\r
-    }\r
-\r
-    private void readAndSetServicesConfig() throws Exception {\r
-        //read service config\r
-        servicesConfigReader = new ServicesConfigReaderImpl(getServerRootDir());\r
-        servicesConfigReader.read(USE_APP_GENERATED_CONFIG);\r
-        \r
-        Boolean useAppGeneratedBindings = servicesConfigReader.getConfiguration().isUseAppGeneratedTenantBindings();\r
-        tenantBindingConfigReader = new TenantBindingConfigReaderImpl(getServerRootDir()); \r
-        tenantBindingConfigReader.read(useAppGeneratedBindings);\r
-    }\r
-\r
-    private void propagateConfiguredProperties() {\r
-        List<PropertyType> repoPropListHolder =\r
-                servicesConfigReader.getConfiguration().getRepositoryClient().getProperties();\r
-        if (repoPropListHolder != null && !repoPropListHolder.isEmpty()) {\r
-            List<PropertyItemType> propList = repoPropListHolder.get(0).getItem();\r
-            if (propList != null && !propList.isEmpty()) {\r
-                tenantBindingConfigReader.setDefaultPropertiesOnTenants(propList, true);\r
-            }\r
-        }\r
-    }\r
-    \r
-       /**\r
-        * Create required indexes (aka indices) in database tables not associated\r
-        * with any specific tenant.\r
-        * \r
-        * We need to loop over each repository/db declared in the tenant bindings.\r
-        * The assumption here is that each repo/db is a Nuxeo repo/DB.\r
-        * \r
-        * @throws Exception\r
-        */\r
-       void createRequiredIndices() throws Exception {\r
-        Hashtable<String, TenantBindingType> tenantBindingTypeMap = tenantBindingConfigReader.getTenantBindings();\r
-\r
-        //\r
-        //Loop through all tenants in tenant-bindings.xml\r
-        //\r
-        String cspaceInstanceId = getCspaceInstanceId();\r
-        for (TenantBindingType tbt : tenantBindingTypeMap.values()) {\r
-               List<String> repositoryNameList = ConfigUtils.getRepositoryNameList(tbt);\r
-                       if (repositoryNameList != null && repositoryNameList.isEmpty() == false) {\r
-                               //\r
-                               // Loop through each repo/DB defined in a tenant bindings file\r
-                               //\r
-                               for (String repositoryName : repositoryNameList) {\r
-                                       // Define a set of columns (fields) and their associated\r
-                                       // tables, on which database indexes should always be created\r
-                                       final String COLLECTIONSPACE_CORE_TABLE_NAME = "collectionspace_core";\r
-                                       final String NUXEO_FULLTEXT_TABLE_NAME = "fulltext";\r
-                                       final String NUXEO_HIERARCHY_TABLE_NAME = "hierarchy";\r
-                       \r
-                                       Map<Integer, List<String>> fieldsToIndex = new HashMap<Integer, List<String>>();\r
-                                       fieldsToIndex.put(1, new ArrayList<String>(Arrays.asList(COLLECTIONSPACE_CORE_TABLE_NAME, "tenantid")));\r
-                                       fieldsToIndex.put(2, new ArrayList<String>(Arrays.asList(COLLECTIONSPACE_CORE_TABLE_NAME, "updatedat")));\r
-                                       fieldsToIndex.put(3, new ArrayList<String>(Arrays.asList(NUXEO_FULLTEXT_TABLE_NAME, "jobid")));\r
-                                       fieldsToIndex.put(4, new ArrayList<String>(Arrays.asList(NUXEO_HIERARCHY_TABLE_NAME, "name")));\r
-                       \r
-                                       // Invoke existing post-init code to create these indexes,\r
-                                       // sending in the set of values above, in contrast to\r
-                                       // drawing these values from per-tenant configuration.\r
-//                                     DataSource dataSource = JDBCTools.getDataSource(JDBCTools.NUXEO_DATASOURCE_NAME);\r
-                                       AddIndices addindices = new AddIndices();\r
-                                       List<Field> fields = new ArrayList<Field>();\r
-                                       for (Map.Entry<Integer, List<String>> entry : fieldsToIndex.entrySet()) {\r
-                                               Field field = new Field();\r
-                                               field.setTable(entry.getValue().get(0)); // Table name from List\r
-                                                                                                                                       // item 0\r
-                                               field.setCol(entry.getValue().get(1)); // Column name from List item\r
-                                                                                                                               // 1\r
-                                               fields.add(field);\r
-                                       }\r
-                                       addindices.onRepositoryInitialized(JDBCTools.NUXEO_DATASOURCE_NAME, repositoryName, cspaceInstanceId,\r
-                                                       null, fields, null);\r
-                               }\r
-                       } else {\r
-                               String errMsg = "repositoryNameList was empty or null.";\r
-                               logger.error(errMsg);\r
-                               throw new Exception(errMsg);\r
-                       }\r
-        }\r
-       }\r
-\r
-    public void firePostInitHandlers() throws Exception {\r
-        Hashtable<String, TenantBindingType> tenantBindingTypeMap = tenantBindingConfigReader.getTenantBindings();\r
-        //\r
-        //Loop through all tenants in tenant-bindings.xml\r
-        //\r
-        String cspaceInstanceId = getCspaceInstanceId();\r
-        for (TenantBindingType tbt : tenantBindingTypeMap.values()) {\r
-               //\r
-               //Loop through all the services in this tenant\r
-               //\r
-            List<ServiceBindingType> sbtList = tbt.getServiceBindings();\r
-            for (ServiceBindingType sbt: sbtList) {\r
-               String repositoryName = null;\r
-               if (sbt.getType().equalsIgnoreCase(ServiceBindingUtils.SERVICE_TYPE_SECURITY) == false) {\r
-                       repositoryName = ConfigUtils.getRepositoryName(tbt, sbt.getRepositoryDomain()); // Each service can have a different repo domain\r
-               }\r
-                //Get the list of InitHandler elements, extract the first one (only one supported right now) and fire it using reflection.\r
-                List<org.collectionspace.services.config.service.InitHandler> list = sbt.getInitHandler();\r
-                if (list != null && list.size() > 0) {\r
-                       org.collectionspace.services.config.service.InitHandler handlerType = list.get(0);  // REM - 12/2012: We might want to think about supporting multiple post-init handlers\r
-                    String initHandlerClassname = handlerType.getClassname();\r
-                    if (Tools.isEmpty(initHandlerClassname)) {\r
-                        continue;\r
-                    }\r
-                    if (logger.isInfoEnabled()) {\r
-                        logger.info(String.format("Firing post-init handler %s ...", initHandlerClassname));\r
-                    }\r
-\r
-                    List<org.collectionspace.services.config.service.InitHandler.Params.Field>\r
-                            fields = handlerType.getParams().getField();\r
-\r
-                    List<org.collectionspace.services.config.service.InitHandler.Params.Property>\r
-                            props = handlerType.getParams().getProperty();\r
-\r
-                    //org.collectionspace.services.common.service.InitHandler.Fields ft = handlerType.getFields();\r
-                    //List<String> fields = ft.getField();\r
-                    Object o = instantiate(initHandlerClassname, IInitHandler.class);\r
-                    if (o != null && o instanceof IInitHandler){\r
-                        IInitHandler handler = (IInitHandler)o;\r
-                        handler.onRepositoryInitialized(JDBCTools.NUXEO_DATASOURCE_NAME, repositoryName, cspaceInstanceId,\r
-                                       sbt, fields, props);\r
-                        //The InitHandler may be the default one,\r
-                        //  or specialized classes which still implement this interface and are registered in tenant-bindings.xml.\r
-                    }\r
-                }\r
-            }\r
-        }\r
-    }\r
-\r
-    /*\r
-     * A generic mechanism for instantiating a instance/object from a class name.\r
-     */\r
-    public Object instantiate(String clazz, Class<?> castTo) throws Exception {\r
-        ClassLoader tccl = Thread.currentThread().getContextClassLoader();\r
-        clazz = clazz.trim();\r
-        Class<?> c = tccl.loadClass(clazz);\r
-        if (castTo.isAssignableFrom(c)) {\r
-            return c.newInstance();\r
-        }\r
-        return null;\r
-    }\r
-\r
-    void retrieveAllWorkspaceIds() throws Exception {\r
-        //all configs are read, connector is initialized, retrieve workspaceids\r
-        Hashtable<String, TenantBindingType> tenantBindings =\r
-               tenantBindingConfigReader.getTenantBindings();\r
-        TenantRepository.get().setup(tenantBindings);\r
-    }\r
-\r
-    /**\r
-     * getWorkspaceId returns workspace id for given tenant and service name\r
-     * @param tenantId\r
-     * @param serviceName\r
-     * @return\r
-     */\r
-    public String getWorkspaceId(String tenantId, String serviceName) {\r
-        return TenantRepository.get().getWorkspaceId(tenantId, serviceName);\r
-    }\r
-\r
-    /**\r
-     * @return the nuxeoConnector\r
-     */\r
-    public NuxeoConnectorEmbedded getNuxeoConnector() {\r
-        return nuxeoConnector;\r
-    }\r
-    \r
-    /**\r
-     * @return the serverRootDir\r
-     */\r
-    public String getServerRootDir() {\r
-        return serverRootDir;\r
-    }\r
-\r
-    private String getCspaceServicesConfigDir() {\r
-        return getServerRootDir() + File.separator + JEEServerDeployment.CSPACE_CONFIG_SERVICES_DIR_PATH;\r
-    }\r
-    \r
-    private String getNuxeoConfigDir() {\r
-        return getServerRootDir() + File.separator + JEEServerDeployment.NUXEO_SERVER_CONFIG_DIR;\r
-    }\r
-    \r
-    private String getNuxeoProtoConfigFilename() {\r
-        return JEEServerDeployment.NUXEO_PROTOTYPE_CONFIG_FILENAME;\r
-    }\r
-        \r
-    private String getNuxeoConfigFilename(String reponame) {\r
-        return reponame + JEEServerDeployment.NUXEO_REPO_CONFIG_FILENAME_SUFFIX;\r
-    }\r
-    \r
-    private String getDatabaseScriptsPath() {\r
-        DatabaseProductType dbType;\r
-        String databaseProductName;\r
-        String databaseScriptsPath = "";\r
-        try {\r
-            // This call makes a connection to the database server, using a default database\r
-            // name and retrieves the database product name from metadata provided by the server.\r
-            dbType = JDBCTools.getDatabaseProductType(JDBCTools.CSADMIN_DATASOURCE_NAME,\r
-                       getServiceConfig().getDbCsadminName());\r
-            databaseProductName = dbType.getName();\r
-            databaseScriptsPath = getServerRootDir() + File.separator\r
-                    + JEEServerDeployment.DATABASE_SCRIPTS_DIR_PATH + File.separator + databaseProductName;\r
-            // An Exception occurring here will cause an empty path to be returned, ultimately\r
-            // resulting in a failure to find the Nuxeo databases initialization script file.\r
-        } catch (Exception e) {\r
-            logger.warn(String.format("Could not get database product type: %s", e.getMessage()));\r
-        }\r
-        return databaseScriptsPath;\r
-\r
-    }\r
-    \r
-    /**\r
-     * Returns the full filesystem path to the Nuxeo databases initialization script file.\r
-     * \r
-     * @return the full path to the Nuxeo databases initialization script file.\r
-     * Returns an empty String for the path if the database scripts path is null or empty.\r
-     */\r
-    private String getNuxeoDatabasesInitScriptFilename() {\r
-        return Tools.notBlank(getDatabaseScriptsPath()) ?\r
-                getDatabaseScriptsPath() + File.separator + JEEServerDeployment.NUXEO_DB_INIT_SCRIPT_FILENAME : "";\r
-    }\r
-    \r
-    /**\r
-     * @return the server resources path\r
-     */\r
-    public String getServerResourcesPath() {\r
-        return getServerRootDir() + File.separator + ConfigReader.RESOURCES_DIR_PATH + File.separator;\r
-    }\r
-    \r
-    public InputStream getResourceAsStream(String resourceName) throws FileNotFoundException {\r
-       InputStream result = new FileInputStream(new File(getServerResourcesPath() + resourceName));\r
-       return result;\r
-    }    \r
-    \r
-    public String getCspaceInstanceId() {\r
-       String result = getServiceConfig().getCspaceInstanceId();\r
-       \r
-       if (result == null || result.trim().isEmpty()) {\r
-               result = ""; //empty string\r
-       }\r
-       \r
-       return result;\r
-    }\r
-    /*\r
-     * Look through the tenant bindings and create the required Nuxeo databases -each tenant can declare\r
-     * their own Nuxeo repository/database.\r
-        * Get the NuxeoDS info and create the necessary databases.\r
-        * Consider the tenant bindings to find and get the data sources for each tenant.\r
-        * There may be only one, one per tenant, or something in between.\r
-     * \r
-     */\r
-    private HashSet<String> createNuxeoDatabases() throws Exception {\r
-        String nuxeoUser = getBasicDataSourceUsername(JDBCTools.NUXEO_DATASOURCE_NAME);\r
-       String nuxeoPW = getBasicDataSourcePassword(JDBCTools.NUXEO_DATASOURCE_NAME);\r
-\r
-        String readerUser = getBasicDataSourceUsername(JDBCTools.NUXEO_READER_DATASOURCE_NAME);\r
-       String readerPW = getBasicDataSourcePassword(JDBCTools.NUXEO_READER_DATASOURCE_NAME);\r
-       \r
-       DatabaseProductType dbType = JDBCTools.getDatabaseProductType(JDBCTools.CSADMIN_DATASOURCE_NAME,\r
-                       getServiceConfig().getDbCsadminName());\r
-\r
-       Hashtable<String, TenantBindingType> tenantBindings =\r
-                       tenantBindingConfigReader.getTenantBindings();\r
-       HashSet<String> nuxeoDBsChecked = new HashSet<String>();\r
-\r
-        // First check and create the roles as needed. (nuxeo and reader)\r
-        for (TenantBindingType tenantBinding : tenantBindings.values()) {\r
-                String tId = tenantBinding.getId();\r
-                String tName = tenantBinding.getName();\r
-                List<RepositoryDomainType> repoDomainList = tenantBinding.getRepositoryDomain();\r
-                for (RepositoryDomainType repoDomain : repoDomainList) {\r
-                        String repoDomainName = repoDomain.getName();\r
-                        String repositoryName = repoDomain.getRepositoryName();\r
-                        String cspaceInstanceId = getCspaceInstanceId();\r
-                        String dbName = JDBCTools.getDatabaseName(repositoryName, cspaceInstanceId);\r
-                        if (nuxeoDBsChecked.contains(dbName)) {\r
-                                if (logger.isDebugEnabled()) {\r
-                                        logger.debug("Another user of db: " + dbName + ": Repo: " + repoDomainName\r
-                                                        + " and tenant: " + tName + " (id:" + tId + ")");\r
-                                }\r
-                        } else {\r
-                                if (logger.isDebugEnabled()) {\r
-                                        logger.debug("Need to prepare db: " + dbName + " for Repo: " + repoDomainName\r
-                                                        + " and tenant: " + tName + " (id:" + tId + ")");\r
-                                }\r
-                                boolean dbExists = JDBCTools.hasDatabase(dbType, dbName);\r
-                                if (dbExists) {\r
-                                        if (logger.isDebugEnabled()) {\r
-                                                logger.debug("Database: " + dbName + " already exists.");\r
-                                        }\r
-                                } else {\r
-                                        // Create the user as needed\r
-                                        JDBCTools.createNewDatabaseUser(JDBCTools.CSADMIN_DATASOURCE_NAME, repositoryName, cspaceInstanceId, dbType, nuxeoUser, nuxeoPW);\r
-                                        if (readerUser != null) {\r
-                                            JDBCTools.createNewDatabaseUser(JDBCTools.CSADMIN_DATASOURCE_NAME, repositoryName, cspaceInstanceId, dbType, readerUser, readerPW);\r
-                                        }\r
-                                        // Create the database\r
-                                        createDatabaseWithRights(dbType, dbName, nuxeoUser, nuxeoPW, readerUser, readerPW);\r
-                                }\r
-                                nuxeoDBsChecked.add(dbName);\r
-                        }\r
-                } // Loop on repos for tenant\r
-        } // Loop on tenants\r
-                \r
-        return nuxeoDBsChecked;\r
-       \r
-    }\r
-    \r
-        /**\r
-         * Creates a Nuxeo-managed database, sets up an owner for that\r
-         * database, and adds (at least) connection privileges to a reader\r
-         * of that database.\r
-         * \r
-         * @param conn\r
-         * @param dbType\r
-         * @param dbName\r
-         * @param ownerName\r
-         * @param ownerPW\r
-         * @param readerName\r
-         * @param readerPW\r
-         * @throws Exception \r
-         */\r
-       private void createDatabaseWithRights(DatabaseProductType dbType, String dbName, String ownerName,\r
-                       String ownerPW, String readerName, String readerPW) throws Exception {\r
-                Connection conn = null;\r
-               Statement stmt = null;\r
-               try {\r
-                       DataSource csadminDataSource = JDBCTools.getDataSource(JDBCTools.CSADMIN_DATASOURCE_NAME);\r
-                       conn = csadminDataSource.getConnection();\r
-                       stmt = conn.createStatement();\r
-                       if (dbType == DatabaseProductType.POSTGRESQL) {\r
-                               // PostgreSQL does not need passwords in grant statements.\r
-                               String sql = "CREATE DATABASE " + dbName + " ENCODING 'UTF8' OWNER " + ownerName;\r
-                               stmt.executeUpdate(sql);\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("Created db: '" + dbName + "' with owner: '" + ownerName + "'");\r
-                               }\r
-                               if (readerName != null) {\r
-                                       sql = "GRANT CONNECT ON DATABASE " + dbName + " TO " + readerName;\r
-                                       stmt.executeUpdate(sql);\r
-                                       if (logger.isDebugEnabled()) {\r
-                                               logger.debug(" Granted connect rights on: '" + dbName + "' to reader: '" + readerName + "'");\r
-                                       }\r
-                               }\r
-                               // Note that select rights for reader must be granted after\r
-                               // Nuxeo startup.\r
-                       } else if (dbType == DatabaseProductType.MYSQL) {\r
-                               String sql = "CREATE database " + dbName + " DEFAULT CHARACTER SET utf8";\r
-                               stmt.executeUpdate(sql);\r
-                               sql = "GRANT ALL PRIVILEGES ON " + dbName + ".* TO '" + ownerName + "'@'localhost' IDENTIFIED BY '"\r
-                                               + ownerPW + "' WITH GRANT OPTION";\r
-                               stmt.executeUpdate(sql);\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("Created db: '" + dbName + "' with owner: '" + ownerName + "'");\r
-                               }\r
-                               if (readerName != null) {\r
-                                       sql = "GRANT SELECT ON " + dbName + ".* TO '" + readerName + "'@'localhost' IDENTIFIED BY '"\r
-                                                       + readerPW + "' WITH GRANT OPTION";\r
-                                       stmt.executeUpdate(sql);\r
-                                       if (logger.isDebugEnabled()) {\r
-                                               logger.debug(" Granted SELECT rights on: '" + dbName + "' to reader: '" + readerName + "'");\r
-                                       }\r
-                               }\r
-                       } else {\r
-                               throw new UnsupportedOperationException("createDatabaseWithRights only supports PSQL - MySQL NYI!");\r
-                       }\r
-               } catch (Exception e) {\r
-                       logger.error("createDatabaseWithRights failed on exception: " + e.getLocalizedMessage());\r
-                       throw e; // propagate\r
-               } finally { // close resources\r
-                       try {\r
-                               if (stmt != null) {\r
-                                       stmt.close();\r
-                               }\r
-                                if (conn != null) {\r
-                                        conn.close();\r
-                                }\r
-                       } catch (SQLException se) {\r
-                               se.printStackTrace();\r
-                       }\r
-               }\r
-\r
-       }\r
-        \r
-        private BasicDataSource getBasicDataSource(String dataSourceName) {\r
-            BasicDataSource basicDataSource = null;\r
-            if (Tools.isBlank(dataSourceName)) {\r
-                return basicDataSource;\r
-            }\r
-            try {\r
-                DataSource dataSource = JDBCTools.getDataSource(dataSourceName);\r
-                basicDataSource = (BasicDataSource) dataSource;\r
-            } catch (NamingException ne) {\r
-                logger.warn("Error attempting to retrieve basic datasource '%s': %s",\r
-                        dataSourceName, ne.getMessage());\r
-                return basicDataSource;\r
-            }\r
-            return basicDataSource;\r
-        }\r
-        \r
-        private String getBasicDataSourceUsername(String dataSourceName) {\r
-            String username = null;\r
-            BasicDataSource basicDataSource = getBasicDataSource(dataSourceName);\r
-            if (basicDataSource == null) {\r
-                return username;\r
-            }\r
-            username = basicDataSource.getUsername();\r
-            return username;\r
-        }\r
-        \r
-        private String getBasicDataSourcePassword(String dataSourceName) {\r
-            String password = null;\r
-            BasicDataSource basicDataSource = getBasicDataSource(dataSourceName);\r
-            if (basicDataSource == null) {\r
-                return password;\r
-            }\r
-            password = basicDataSource.getPassword();\r
-            return password;\r
-        }\r
-     \r
-    /*\r
-     * This might be useful for something, but the reader grants are better handled in the ReportPostInitHandler.\r
-     * \r
-     * \r
-     */\r
-/*     \r
-    private void handlePostNuxeoInitDBTasks() throws Exception {\r
-       Statement stmt = null;\r
-               Connection conn = null;\r
-               \r
-       try {\r
-               DataSource nuxeoMgrDataSource = JDBCTools.getDataSource(JDBCTools.NUXEO_MANAGER_DATASOURCE_NAME);\r
-               DataSource nuxeoReaderDataSource = JDBCTools.getDataSource(JDBCTools.NUXEO_READER_DATASOURCE_NAME);\r
-               \r
-               if(nuxeoReaderDataSource!=null) {\r
-                       // We need to fetch the user name and password from the nuxeoDataSource, to do grants below\r
-                       org.apache.tomcat.dbcp.dbcp.BasicDataSource tomcatDataSource =\r
-                                       (org.apache.tomcat.dbcp.dbcp.BasicDataSource)nuxeoReaderDataSource;\r
-                       // Get the template URL value from the JNDI datasource and substitute the databaseName\r
-                       String readerUser = tomcatDataSource.getUsername();\r
-                       DatabaseProductType dbType = JDBCTools.getDatabaseProductType(\r
-                                       JDBCTools.CSPACE_DATASOURCE_NAME,\r
-                                       JDBCTools.DEFAULT_CSPACE_DATABASE_NAME); // only returns PG or MYSQL\r
-       \r
-                       conn = nuxeoMgrDataSource.getConnection();\r
-                       stmt = conn.createStatement();\r
-                       if(dbType==DatabaseProductType.POSTGRESQL) {\r
-                               // Note that select rights for reader must be granted after Nuxeo startup.\r
-                               String sql = "GRANT SELECT ON ALL TABLES IN SCHEMA public TO "+readerUser;\r
-                               stmt.executeUpdate(sql);\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug(" Granted SELECT rights on all public tables to reader: '"+readerUser+"'");\r
-                               }\r
-                       } else if(dbType==DatabaseProductType.MYSQL) {\r
-                       } else {\r
-                               throw new UnsupportedOperationException("handlePostNuxeoInitDBTasks only supports Postgres/MySQL.");\r
-                       }\r
-               }\r
-       } catch(Exception e) {\r
-               logger.error("handlePostNuxeoInitDBTasks failed on exception: " + e.getLocalizedMessage());\r
-               throw e;        // propagate\r
-       } finally {   //close resources\r
-               try {\r
-                       if(stmt!=null) {\r
-                               stmt.close();\r
-                       }\r
-               } catch(SQLException se) {\r
-                       // nothing we can do\r
-               }\r
-       }\r
-\r
-    }\r
-*/\r
-    \r
-    private void setServerRootDir() {\r
-        serverRootDir = System.getProperty(SERVER_HOME_PROPERTY);\r
-        if (serverRootDir == null) {\r
-            serverRootDir = "."; //assume server is started from server root, e.g. server/cspace\r
-            String msg = String.format("System property '%s' was not set.  Using '%s' instead.",\r
-                       SERVER_HOME_PROPERTY, serverRootDir);\r
-            logger.warn(msg);\r
-        }\r
-    }\r
-\r
-\r
-    /**\r
-     * @return the serviceConfig\r
-     */\r
-    public ServiceConfig getServiceConfig() {\r
-        return getServicesConfigReader().getConfiguration();\r
-    }\r
-\r
-    /**\r
-     * @return the clientType\r
-     */\r
-    public ClientType getClientType() {\r
-        return getServicesConfigReader().getClientType();\r
-    }\r
-\r
-    /**\r
-     * @return the servicesConfigReader\r
-     */\r
-    public ServicesConfigReaderImpl getServicesConfigReader() {\r
-        return servicesConfigReader;\r
-    }\r
-\r
-    /**\r
-     * @return the tenantBindingConfigReader\r
-     */\r
-    public TenantBindingConfigReaderImpl getTenantBindingConfigReader() {\r
-        return tenantBindingConfigReader;\r
-    }\r
-    \r
-    /**\r
-     *  Populate a registry of URI templates by querying each resource\r
-     *  for its own entries in the registry.\r
-     * \r
-     *  These entries consist of one or more URI templates associated\r
-     *  with that resource, for building URIs to access that resource.\r
-     */\r
-    private synchronized void populateUriTemplateRegistry() {\r
-       if (uriTemplateRegistry.isEmpty()) {\r
-            ResourceBase resource = null;\r
-            ResourceMap resourceMap = ResteasyProviderFactory.getContextData(ResourceMap.class);\r
-            for (Map.Entry<String, ResourceBase> entry : resourceMap.entrySet()) {\r
-                resource = entry.getValue();\r
-                Map<UriTemplateRegistryKey, StoredValuesUriTemplate> entries =\r
-                        resource.getUriRegistryEntries();\r
-                uriTemplateRegistry.putAll(entries);\r
-            }\r
-\r
-            // FIXME: Contacts itself should not have an entry in the URI template registry;\r
-            // there should be a Contacts entry in that registry only for use in\r
-            // building URIs for resources that have contacts as a sub-resource\r
-            // (This may also fall out during implementation of CSPACE-2698.)\r
-       }\r
-    }\r
-\r
-    public UriTemplateRegistry getUriTemplateRegistry() {\r
-        if (uriTemplateRegistry.isEmpty()) {\r
-            populateUriTemplateRegistry();\r
-        }\r
-        return uriTemplateRegistry;\r
-    }\r
-   /**\r
-    * Ensure that Nuxeo repository configuration files exist for each repository\r
-    * specified in tenant bindings. Create or update these files, as needed.\r
-    */\r
-    private void createOrUpdateNuxeoRepositoryConfigFiles() throws Exception {\r
-        \r
-        // Get the prototype copy of the Nuxeo repository config file.\r
-        File prototypeNuxeoConfigFile =\r
-                new File(getCspaceServicesConfigDir() + File.separator + getNuxeoProtoConfigFilename());\r
-        // FIXME: Consider checking for the presence of existing configuration files,\r
-        // rather than always failing outright if the prototype file for creating\r
-        // new or updated files can't be located.\r
-        if (! prototypeNuxeoConfigFile.canRead()) {\r
-            String msg = String.format("Could not find and/or read the prototype Nuxeo config file '%s'. "\r
-                    + "Please redeploy this file by running 'ant deploy' from the Services layer source code's '3rdparty/nuxeo' module.",\r
-                    prototypeNuxeoConfigFile.getCanonicalPath());\r
-            throw new RuntimeException(msg);\r
-        }\r
-        if (logger.isTraceEnabled()) {\r
-            logger.trace("Found and can read prototype Nuxeo config file at path %s", prototypeNuxeoConfigFile.getAbsolutePath());\r
-        }\r
-        Document prototypeConfigDoc = XmlTools.fileToXMLDocument(prototypeNuxeoConfigFile);\r
-        Document repositoryConfigDoc = null;\r
-        // FIXME: Can the variable below reasonably be made a class variable? Its value\r
-        // is used in at least one other method in this class.\r
-        Hashtable<String, TenantBindingType> tenantBindingTypeMap = tenantBindingConfigReader.getTenantBindings();\r
-        for (TenantBindingType tbt : tenantBindingTypeMap.values()) {\r
-            List<String> repositoryNameList = ConfigUtils.getRepositoryNameList(tbt);\r
-            if (logger.isTraceEnabled()) {\r
-                logger.trace("Getting repository name(s) for tenant " + tbt.getName());\r
-            }\r
-            if (repositoryNameList == null || repositoryNameList.isEmpty() == true) {\r
-              logger.warn(String.format("Could not get repository name(s) for tenant %s", tbt.getName()));\r
-              continue; //break out of loop\r
-            } else {\r
-                for (String repositoryName : repositoryNameList) {\r
-                    if (Tools.isBlank(repositoryName)) {\r
-                        continue;\r
-                    }\r
-                    if (logger.isTraceEnabled()) {\r
-                        logger.trace(String.format("Repository name is %s", repositoryName));\r
-                    }\r
-                    // FIXME: As per above, we might check for the presence of an existing\r
-                    // config file for this repository and, if present, not fail even if\r
-                    // the code below fails to update that file on any given system startup.\r
-                    //\r
-                    // Clone the prototype copy of the Nuxeo repository config file,\r
-                    // thus creating a separate config file for the current repository.\r
-                    repositoryConfigDoc = (Document) prototypeConfigDoc.clone();\r
-                    // Update this config file by inserting values pertinent to the\r
-                    // current repository.\r
-                    String binaryStorePath = tbt.getBinaryStorePath();\r
-                    repositoryConfigDoc = updateRepositoryConfigDoc(repositoryConfigDoc, repositoryName,\r
-                               this.getCspaceInstanceId(), binaryStorePath);\r
-                    if (logger.isTraceEnabled()) {\r
-                        logger.trace("Updated Nuxeo repo config file contents=\n" + repositoryConfigDoc.asXML());\r
-                    }\r
-                    // Write this config file to the Nuxeo server config directory.\r
-                    File repofile = new File(getNuxeoConfigDir() + File.separator +\r
-                            repositoryName + JEEServerDeployment.NUXEO_REPO_CONFIG_FILENAME_SUFFIX);\r
-                    if (logger.isTraceEnabled()) {\r
-                        logger.trace(String.format("Attempting to write Nuxeo repo config file to %s", repofile.getAbsolutePath()));\r
-                    }\r
-                    XmlTools.xmlDocumentToFile(repositoryConfigDoc, repofile);\r
-                }\r
-            }\r
-        }\r
-    }\r
-    \r
-    /*\r
-     * This method is filling out the proto-repo-config.xml file with tenant specific repository information.\r
-     */\r
-    private Document updateRepositoryConfigDoc(Document repoConfigDoc, String repositoryName,\r
-               String cspaceInstanceId, String binaryStorePath) {\r
-        String databaseName = JDBCTools.getDatabaseName(repositoryName, cspaceInstanceId);\r
-\r
-        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc, "/component", "name",\r
-                String.format("config:%s-repository", repositoryName));\r
-        \r
-        // Text substitutions within first extension point, "repository"\r
-        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,\r
-                REPOSITORY_EXTENSION_POINT_XPATH + "/repository", "name",\r
-                repositoryName);\r
-        \r
-        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,\r
-                REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository", "name",\r
-                repositoryName);\r
-        \r
-        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,\r
-                REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository/binaryStore", "path",\r
-                Tools.isBlank(binaryStorePath) ? repositoryName : binaryStorePath);  // Can be either partial or full path.  Partial path will be relative to Nuxeo's data directory\r
-\r
-        /* Create the JDBC url options if any exist */\r
-        String jdbcOptions = XmlTools.getElementValue(repoConfigDoc,\r
-                REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository/property[@name='JDBCOptions']");\r
-        jdbcOptions = Tools.isBlank(jdbcOptions) ? "" : "?" + jdbcOptions;\r
-        \r
-        repoConfigDoc = XmlTools.setElementValue(repoConfigDoc,\r
-                REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository/property[@name='DatabaseName']",\r
-                databaseName + jdbcOptions);\r
-        \r
-        // Text substitutions within second extension point, "repositories" \r
-        repoConfigDoc = XmlTools.setElementValue(repoConfigDoc,\r
-                REPOSITORIES_EXTENSION_POINT_XPATH + "/documentation",\r
-                String.format("The %s repository", repositoryName));\r
-        \r
-        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,\r
-                REPOSITORIES_EXTENSION_POINT_XPATH + "/repository", "name",\r
-                repositoryName);\r
-        \r
-        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,\r
-                REPOSITORIES_EXTENSION_POINT_XPATH + "/repository", "label",\r
-                String.format("%s Repository", repositoryName));\r
-        \r
-        return repoConfigDoc;\r
-    }\r
-\r
-    /**\r
-     * Update the current copy of the Nuxeo databases initialization script file by\r
-     * \r
-     * <ul>\r
-     *   <li>Removing all existing DROP DATABASE commands</li>\r
-     *   <li>Removing all existing DROP USER commands</li>\r
-     *   <li>Adding a DROP DATABASE command for each current database, at the top of that file.</li>\r
-     *   <li>Adding DROP USER commands for each provided datasource, following the DROP DATABASE commands.</li>\r
-     * </ul>\r
-     * \r
-     * @param dbInitializationScriptFilePath\r
-     * @param dbsCheckedOrCreated \r
-     */\r
-    private void updateInitializationScript(String dbInitializationScriptFilePath,\r
-            HashSet<String> dbsCheckedOrCreated, String[] dataSourceNames) {\r
-        // Get the current copy of the Nuxeo databases initialization script file,\r
-        // if that file exists, and read all of its lines except for those which\r
-        // drop databases.\r
-        List<String> lines = null;\r
-        // "If the given string" for the pathname provided here "is the empty string, then the\r
-        // result is the empty abstract pathname," according to Oracle's Javadoc for File.\r
-        // An empty path string might be provided here if a call to get the database product name failed earlier.\r
-        File nuxeoDatabasesInitScriptFile = new File(dbInitializationScriptFilePath);\r
-        try {\r
-            if (! nuxeoDatabasesInitScriptFile.canRead()) {\r
-                String msg = String.format("Could not find and/or read the Nuxeo databases initialization script file '%s'",\r
-                        nuxeoDatabasesInitScriptFile.getCanonicalPath());\r
-                logger.warn(msg);\r
-            } else {\r
-                // Note: Exceptions are written only to the console, not thrown, by\r
-                // the readFileAsLines() method in the common-api package.\r
-                lines = FileTools.readFileAsLines(dbInitializationScriptFilePath);\r
-                Iterator<String> linesIterator = lines.iterator();\r
-                String currentLine;\r
-                while (linesIterator.hasNext()) {\r
-                    currentLine = linesIterator.next();\r
-                    // Elide all existing DROP DATABASE statements.\r
-                    if (currentLine.toLowerCase().contains(DROP_DATABASE_SQL_CMD.toLowerCase())) {\r
-                        linesIterator.remove();\r
-                    }\r
-                    // Elide a comment pertaining to the existing\r
-                    // DROP DATABASE statements.\r
-                    if (currentLine.toLowerCase().contains(DROP_OBJECTS_SQL_COMMENT.toLowerCase())) {\r
-                        linesIterator.remove();\r
-                    }\r
-                    // Elide all existing DROP USER statements.\r
-                    if (currentLine.toLowerCase().contains(DROP_USER_SQL_CMD.toLowerCase())) {\r
-                        linesIterator.remove();\r
-                    }\r
-                }\r
-            }\r
-            List<String> replacementLines = new ArrayList<String>();\r
-            // Add back the comment elided above\r
-            replacementLines.add(DROP_OBJECTS_SQL_COMMENT);\r
-            // Add new DROP DATABASE lines for every Nuxeo-managed database.\r
-            for (String dbName : dbsCheckedOrCreated) {\r
-              if (Tools.notBlank(dbName)) {\r
-                  replacementLines.add(String.format(DROP_DATABASE_IF_EXISTS_SQL_CMD, dbName));\r
-              }\r
-            }\r
-            // Add new DROP USER commands for every provided datasource.\r
-            String username;\r
-            for (String dataSourceName : dataSourceNames) {\r
-                username = getBasicDataSourceUsername(dataSourceName);\r
-                if (Tools.notBlank(username)) {\r
-                    replacementLines.add(String.format(DROP_USER_IF_EXISTS_SQL_CMD, username));\r
-                }\r
-            }\r
-            // Now append all existing lines from that file, except for\r
-            // any lines that were elided above.\r
-            if (lines != null && ! lines.isEmpty()) {\r
-                replacementLines.addAll(lines);\r
-            }\r
-            if (! nuxeoDatabasesInitScriptFile.canWrite()) {\r
-                String msg = String.format("Could not find and/or write the Nuxeo databases initialization script file '%s'",\r
-                        nuxeoDatabasesInitScriptFile.getCanonicalPath());\r
-                logger.warn(msg);\r
-            } else {\r
-                // Note: Exceptions are written only to the console, not thrown, by\r
-                // the writeFileFromLines() method in the common-api package.\r
-                FileTools.writeFileFromLines(dbInitializationScriptFilePath, replacementLines);\r
-            }\r
-        } catch (Exception e) {\r
-\r
-        }\r
-\r
-    }\r
-}\r
+/**
+ * Copyright 2009-2010 University of California at Berkeley
+ */
+package org.collectionspace.services.common;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.*;
+
+import javax.naming.NamingException;
+import javax.servlet.ServletContext;
+import javax.sql.DataSource;
+
+import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
+import org.collectionspace.authentication.AuthN;
+import org.collectionspace.services.common.api.JEEServerDeployment;
+import org.collectionspace.services.common.api.FileTools;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.authorization_mgt.AuthorizationCommon;
+import org.collectionspace.services.common.config.ConfigReader;
+import org.collectionspace.services.common.config.ConfigUtils;
+import org.collectionspace.services.common.config.ServicesConfigReaderImpl;
+import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
+import org.collectionspace.services.common.context.ServiceBindingUtils;
+import org.collectionspace.services.common.init.AddIndices;
+import org.collectionspace.services.config.service.InitHandler.Params.Field;
+import org.collectionspace.services.common.init.IInitHandler;
+import org.collectionspace.services.common.storage.DatabaseProductType;
+import org.collectionspace.services.common.storage.JDBCTools;
+import org.collectionspace.services.config.ClientType;
+import org.collectionspace.services.config.ServiceConfig;
+import org.collectionspace.services.config.service.ServiceBindingType;
+import org.collectionspace.services.config.tenant.RepositoryDomainType;
+import org.collectionspace.services.config.tenant.TenantBindingType;
+import org.collectionspace.services.config.types.PropertyItemType;
+import org.collectionspace.services.config.types.PropertyType;
+import org.collectionspace.services.nuxeo.client.java.NuxeoConnectorEmbedded;
+import org.collectionspace.services.nuxeo.client.java.TenantRepository;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.dom4j.Document;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Main class for Services layer. It reads configuration and performs service
+ * level initialization. It is a singleton.
+ * @author 
+ */
+public class ServiceMain {
+
+    final Logger logger = LoggerFactory.getLogger(ServiceMain.class);
+    /**
+     * volatile is used here to assume about ordering (post JDK 1.5)
+     */
+    private static volatile ServiceMain instance = null;
+    private static volatile boolean initFailed = false;
+
+    private static final String SERVER_HOME_PROPERTY = "catalina.home";
+       private static final boolean USE_APP_GENERATED_CONFIG = true;
+       
+       private static ServletContext servletContext = null;
+    
+       private NuxeoConnectorEmbedded nuxeoConnector;
+    private String serverRootDir = null;
+    private ServicesConfigReaderImpl servicesConfigReader;
+    private TenantBindingConfigReaderImpl tenantBindingConfigReader;
+    private UriTemplateRegistry uriTemplateRegistry = new UriTemplateRegistry();
+    
+    
+    private static final String COMPONENT_EXTENSION_XPATH = "/component/extension[@point='%s']";
+    private static final String REPOSITORY_EXTENSION_POINT_XPATH =
+            String.format(COMPONENT_EXTENSION_XPATH, "repository");
+    private static final String REPOSITORIES_EXTENSION_POINT_XPATH =
+            String.format(COMPONENT_EXTENSION_XPATH, "repositories");
+    
+    private static final String DROP_DATABASE_SQL_CMD = "DROP DATABASE";
+    private static final String DROP_DATABASE_IF_EXISTS_SQL_CMD = DROP_DATABASE_SQL_CMD + " IF EXISTS %s;";
+    private static final String DROP_USER_SQL_CMD = "DROP USER";
+    private static final String DROP_USER_IF_EXISTS_SQL_CMD = DROP_USER_SQL_CMD + " IF EXISTS %s;";
+    private static final String DROP_OBJECTS_SQL_COMMENT = "-- drop all the objects before dropping roles";
+
+            
+    private ServiceMain() {
+       //empty
+    }
+    
+    /*
+     * 
+     * Set this singletons ServletContext without any call to initialize
+     */
+    private static void setServletContext(ServletContext servletContext) {
+               if (servletContext != null) {
+               synchronized (ServiceMain.class) {
+                       ServiceMain.servletContext = servletContext;
+               }
+               }
+    }
+        
+    public String getCspaceDatabaseName() {
+       return getServiceConfig().getDbCspaceName();
+    }
+        
+    public boolean inServletContext() {
+       return ServiceMain.servletContext != null;
+    }
+    
+    public static ServiceMain getInstance(ServletContext servletContext) {
+       setServletContext(servletContext);
+       return ServiceMain.getInstance();
+    }
+    
+    /**
+     * getInstance returns the ServiceMain singleton instance after proper
+     * initialization in a thread-safe manner
+     * @return
+     */
+    public static ServiceMain getInstance() {
+        if (instance == null && initFailed == false) {
+            synchronized (ServiceMain.class) {
+                if (instance == null && initFailed == false) {
+                    ServiceMain newInstance = new ServiceMain();
+                    try {
+                       //assume the worse
+                       initFailed = true;
+                       newInstance.initialize();
+                       //celebrate success
+                        initFailed = false;
+                    } catch (Exception e) {
+                        instance = null;
+                        if (e instanceof RuntimeException) {
+                            throw (RuntimeException) e;
+                        } else {
+                            throw new RuntimeException(e);
+                        }
+                    }
+                    instance = newInstance;
+                }
+            }
+        }
+        
+        if (instance == null) {
+               throw new RuntimeException("Could not initialize the CollectionSpace services.  Please see the CollectionSpace services log file(s) for details.");
+        }
+        
+        return instance;
+    }
+
+    private void initialize() throws Exception {
+       // set our root directory
+       setServerRootDir();
+       
+       // read in and set our Services config
+       readAndSetServicesConfig();
+       
+       // Set our AuthN's datasource to for the cspaceDataSource
+       AuthN.setDataSource(JDBCTools.getDataSource(JDBCTools.CSPACE_DATASOURCE_NAME));
+       
+       // In each tenant, set properties that don't already have values
+       // to their default values.
+        propagateConfiguredProperties();
+        
+        // Create or update Nuxeo's per-repository configuration files.
+        createOrUpdateNuxeoRepositoryConfigFiles();
+        
+        // Create the Nuxeo-managed databases, along with the requisite
+        // access rights to each.
+       HashSet<String> dbsCheckedOrCreated = createNuxeoDatabases();
+        
+        // Update the SQL script that drops databases and users,
+        // to include DROP statements for each of the Nuxeo-managed
+        // database names and for each relevant datasource user.
+        String[] dataSourceNames = {JDBCTools.NUXEO_DATASOURCE_NAME, JDBCTools.NUXEO_READER_DATASOURCE_NAME};
+        updateInitializationScript(getNuxeoDatabasesInitScriptFilename(),
+                dbsCheckedOrCreated, dataSourceNames);
+
+        //
+        // Start up and initialize our embedded Nuxeo instance.
+        //
+        if (getClientType().equals(ClientType.JAVA)) {
+            nuxeoConnector = NuxeoConnectorEmbedded.getInstance();
+            nuxeoConnector.initialize(
+                       getServerRootDir(),
+                       getServicesConfigReader().getConfiguration().getRepositoryClient(),
+                       ServiceMain.servletContext);
+        } else {
+               //
+               // Exit if we don't have the correct/known client type
+               //
+               throw new RuntimeException("Unknown CollectionSpace services client type: " + getClientType());
+        }
+        //
+        // Create all the default user accounts and permissions.  Since some of our "cspace" database config files
+        // for Spring need to be created at build time, the "cspace" database already will be suffixed with the
+        // correct 'cspaceInstanceId' so we don't need to pass it to the JDBCTools methods.
+        //
+               try {
+                       AuthorizationCommon.createDefaultWorkflowPermissions(tenantBindingConfigReader);
+                       String cspaceDatabaseName = getCspaceDatabaseName();
+                       DatabaseProductType databaseProductType = JDBCTools.getDatabaseProductType(JDBCTools.CSPACE_DATASOURCE_NAME,
+                                       cspaceDatabaseName);
+                       AuthorizationCommon.createDefaultAccounts(tenantBindingConfigReader, databaseProductType,
+                                       cspaceDatabaseName);
+               } catch (Exception e) {
+                       logger.error("Default accounts and permissions setup failed with exception(s): " +
+                                       e.getLocalizedMessage(), e);
+                       throw e;
+               }
+        
+        /*
+         * This might be useful for something, but the reader grants are better handled in the ReportPostInitHandler.
+        try {
+               handlePostNuxeoInitDBTasks();
+        } catch(Throwable e) {         
+               logger.error("handlePostNuxeoInitDBTasks failed with exception(s): " + e.getLocalizedMessage(), e);
+        }
+        */
+    }
+
+    /**
+     * release releases all resources occupied by service layer infrastructure
+     * but not necessarily those occupied by individual services
+     */
+    public void release() {
+        try {
+            if (nuxeoConnector != null) {
+                nuxeoConnector.release();
+            }
+            instance = null;
+        } catch (Exception e) {
+            e.printStackTrace();
+            //gobble it
+        }
+    }
+
+    private void readAndSetServicesConfig() throws Exception {
+        //read service config
+        servicesConfigReader = new ServicesConfigReaderImpl(getServerRootDir());
+        servicesConfigReader.read(USE_APP_GENERATED_CONFIG);
+        
+        Boolean useAppGeneratedBindings = servicesConfigReader.getConfiguration().isUseAppGeneratedTenantBindings();
+        tenantBindingConfigReader = new TenantBindingConfigReaderImpl(getServerRootDir()); 
+        tenantBindingConfigReader.read(useAppGeneratedBindings);
+    }
+
+    private void propagateConfiguredProperties() {
+        List<PropertyType> repoPropListHolder =
+                servicesConfigReader.getConfiguration().getRepositoryClient().getProperties();
+        if (repoPropListHolder != null && !repoPropListHolder.isEmpty()) {
+            List<PropertyItemType> propList = repoPropListHolder.get(0).getItem();
+            if (propList != null && !propList.isEmpty()) {
+                tenantBindingConfigReader.setDefaultPropertiesOnTenants(propList, true);
+            }
+        }
+    }
+    
+       /**
+        * Create required indexes (aka indices) in database tables not associated
+        * with any specific tenant.
+        * 
+        * We need to loop over each repository/db declared in the tenant bindings.
+        * The assumption here is that each repo/db is a Nuxeo repo/DB.
+        * 
+        * @throws Exception
+        */
+       void createRequiredIndices() throws Exception {
+        Hashtable<String, TenantBindingType> tenantBindingTypeMap = tenantBindingConfigReader.getTenantBindings();
+
+        //
+        //Loop through all tenants in tenant-bindings.xml
+        //
+        String cspaceInstanceId = getCspaceInstanceId();
+        for (TenantBindingType tbt : tenantBindingTypeMap.values()) {
+               List<String> repositoryNameList = ConfigUtils.getRepositoryNameList(tbt);
+                       if (repositoryNameList != null && repositoryNameList.isEmpty() == false) {
+                               //
+                               // Loop through each repo/DB defined in a tenant bindings file
+                               //
+                               for (String repositoryName : repositoryNameList) {
+                                       // Define a set of columns (fields) and their associated
+                                       // tables, on which database indexes should always be created
+                                       final String COLLECTIONSPACE_CORE_TABLE_NAME = "collectionspace_core";
+                                       final String NUXEO_FULLTEXT_TABLE_NAME = "fulltext";
+                                       final String NUXEO_HIERARCHY_TABLE_NAME = "hierarchy";
+                       
+                                       Map<Integer, List<String>> fieldsToIndex = new HashMap<Integer, List<String>>();
+                                       fieldsToIndex.put(1, new ArrayList<String>(Arrays.asList(COLLECTIONSPACE_CORE_TABLE_NAME, "tenantid")));
+                                       fieldsToIndex.put(2, new ArrayList<String>(Arrays.asList(COLLECTIONSPACE_CORE_TABLE_NAME, "updatedat")));
+                                       fieldsToIndex.put(3, new ArrayList<String>(Arrays.asList(NUXEO_FULLTEXT_TABLE_NAME, "jobid")));
+                                       fieldsToIndex.put(4, new ArrayList<String>(Arrays.asList(NUXEO_HIERARCHY_TABLE_NAME, "name")));
+                       
+                                       // Invoke existing post-init code to create these indexes,
+                                       // sending in the set of values above, in contrast to
+                                       // drawing these values from per-tenant configuration.
+//                                     DataSource dataSource = JDBCTools.getDataSource(JDBCTools.NUXEO_DATASOURCE_NAME);
+                                       AddIndices addindices = new AddIndices();
+                                       List<Field> fields = new ArrayList<Field>();
+                                       for (Map.Entry<Integer, List<String>> entry : fieldsToIndex.entrySet()) {
+                                               Field field = new Field();
+                                               field.setTable(entry.getValue().get(0)); // Table name from List
+                                                                                                                                       // item 0
+                                               field.setCol(entry.getValue().get(1)); // Column name from List item
+                                                                                                                               // 1
+                                               fields.add(field);
+                                       }
+                                       addindices.onRepositoryInitialized(JDBCTools.NUXEO_DATASOURCE_NAME, repositoryName, cspaceInstanceId,
+                                                       null, fields, null);
+                               }
+                       } else {
+                               String errMsg = "repositoryNameList was empty or null.";
+                               logger.error(errMsg);
+                               throw new Exception(errMsg);
+                       }
+        }
+       }
+
+    public void firePostInitHandlers() throws Exception {
+        Hashtable<String, TenantBindingType> tenantBindingTypeMap = tenantBindingConfigReader.getTenantBindings();
+        //
+        //Loop through all tenants in tenant-bindings.xml
+        //
+        String cspaceInstanceId = getCspaceInstanceId();
+        for (TenantBindingType tbt : tenantBindingTypeMap.values()) {
+               //
+               //Loop through all the services in this tenant
+               //
+            List<ServiceBindingType> sbtList = tbt.getServiceBindings();
+            for (ServiceBindingType sbt: sbtList) {
+               String repositoryName = null;
+               if (sbt.getType().equalsIgnoreCase(ServiceBindingUtils.SERVICE_TYPE_SECURITY) == false) {
+                       repositoryName = ConfigUtils.getRepositoryName(tbt, sbt.getRepositoryDomain()); // Each service can have a different repo domain
+               }
+                //Get the list of InitHandler elements, extract the first one (only one supported right now) and fire it using reflection.
+                List<org.collectionspace.services.config.service.InitHandler> list = sbt.getInitHandler();
+                if (list != null && list.size() > 0) {
+                       org.collectionspace.services.config.service.InitHandler handlerType = list.get(0);  // REM - 12/2012: We might want to think about supporting multiple post-init handlers
+                    String initHandlerClassname = handlerType.getClassname();
+                    if (Tools.isEmpty(initHandlerClassname)) {
+                        continue;
+                    }
+                    if (logger.isInfoEnabled()) {
+                        logger.info(String.format("Firing post-init handler %s ...", initHandlerClassname));
+                    }
+
+                    List<org.collectionspace.services.config.service.InitHandler.Params.Field>
+                            fields = handlerType.getParams().getField();
+
+                    List<org.collectionspace.services.config.service.InitHandler.Params.Property>
+                            props = handlerType.getParams().getProperty();
+
+                    //org.collectionspace.services.common.service.InitHandler.Fields ft = handlerType.getFields();
+                    //List<String> fields = ft.getField();
+                    Object o = instantiate(initHandlerClassname, IInitHandler.class);
+                    if (o != null && o instanceof IInitHandler){
+                        IInitHandler handler = (IInitHandler)o;
+                        handler.onRepositoryInitialized(JDBCTools.NUXEO_DATASOURCE_NAME, repositoryName, cspaceInstanceId,
+                                       sbt, fields, props);
+                        //The InitHandler may be the default one,
+                        //  or specialized classes which still implement this interface and are registered in tenant-bindings.xml.
+                    }
+                }
+            }
+        }
+    }
+
+    /*
+     * A generic mechanism for instantiating a instance/object from a class name.
+     */
+    public Object instantiate(String clazz, Class<?> castTo) throws Exception {
+        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+        clazz = clazz.trim();
+        Class<?> c = tccl.loadClass(clazz);
+        if (castTo.isAssignableFrom(c)) {
+            return c.newInstance();
+        }
+        return null;
+    }
+
+    void retrieveAllWorkspaceIds() throws Exception {
+        //all configs are read, connector is initialized, retrieve workspaceids
+        Hashtable<String, TenantBindingType> tenantBindings =
+               tenantBindingConfigReader.getTenantBindings();
+        TenantRepository.get().setup(tenantBindings);
+    }
+
+    /**
+     * getWorkspaceId returns workspace id for given tenant and service name
+     * @param tenantId
+     * @param serviceName
+     * @return
+     */
+    public String getWorkspaceId(String tenantId, String serviceName) {
+        return TenantRepository.get().getWorkspaceId(tenantId, serviceName);
+    }
+
+    /**
+     * @return the nuxeoConnector
+     */
+    public NuxeoConnectorEmbedded getNuxeoConnector() {
+        return nuxeoConnector;
+    }
+    
+    /**
+     * @return the serverRootDir
+     */
+    public String getServerRootDir() {
+        return serverRootDir;
+    }
+
+    private String getCspaceServicesConfigDir() {
+        return getServerRootDir() + File.separator + JEEServerDeployment.CSPACE_CONFIG_SERVICES_DIR_PATH;
+    }
+    
+    private String getNuxeoConfigDir() {
+        return getServerRootDir() + File.separator + JEEServerDeployment.NUXEO_SERVER_CONFIG_DIR;
+    }
+    
+    private String getNuxeoProtoConfigFilename() {
+        return JEEServerDeployment.NUXEO_PROTOTYPE_CONFIG_FILENAME;
+    }
+        
+    private String getNuxeoConfigFilename(String reponame) {
+        return reponame + JEEServerDeployment.NUXEO_REPO_CONFIG_FILENAME_SUFFIX;
+    }
+    
+    private String getDatabaseScriptsPath() {
+        DatabaseProductType dbType;
+        String databaseProductName;
+        String databaseScriptsPath = "";
+        try {
+            // This call makes a connection to the database server, using a default database
+            // name and retrieves the database product name from metadata provided by the server.
+            dbType = JDBCTools.getDatabaseProductType(JDBCTools.CSADMIN_DATASOURCE_NAME,
+                       getServiceConfig().getDbCsadminName());
+            databaseProductName = dbType.getName();
+            databaseScriptsPath = getServerRootDir() + File.separator
+                    + JEEServerDeployment.DATABASE_SCRIPTS_DIR_PATH + File.separator + databaseProductName;
+            // An Exception occurring here will cause an empty path to be returned, ultimately
+            // resulting in a failure to find the Nuxeo databases initialization script file.
+        } catch (Exception e) {
+            logger.warn(String.format("Could not get database product type: %s", e.getMessage()));
+        }
+        return databaseScriptsPath;
+
+    }
+    
+    /**
+     * Returns the full filesystem path to the Nuxeo databases initialization script file.
+     * 
+     * @return the full path to the Nuxeo databases initialization script file.
+     * Returns an empty String for the path if the database scripts path is null or empty.
+     */
+    private String getNuxeoDatabasesInitScriptFilename() {
+        return Tools.notBlank(getDatabaseScriptsPath()) ?
+                getDatabaseScriptsPath() + File.separator + JEEServerDeployment.NUXEO_DB_INIT_SCRIPT_FILENAME : "";
+    }
+    
+    /**
+     * @return the server resources path
+     */
+    public String getServerResourcesPath() {
+        return getServerRootDir() + File.separator + ConfigReader.RESOURCES_DIR_PATH + File.separator;
+    }
+    
+    public InputStream getResourceAsStream(String resourceName) throws FileNotFoundException {
+       InputStream result = new FileInputStream(new File(getServerResourcesPath() + resourceName));
+       return result;
+    }    
+    
+    public String getCspaceInstanceId() {
+       String result = getServiceConfig().getCspaceInstanceId();
+       
+       if (result == null || result.trim().isEmpty()) {
+               result = ""; //empty string
+       }
+       
+       return result;
+    }
+    /*
+     * Look through the tenant bindings and create the required Nuxeo databases -each tenant can declare
+     * their own Nuxeo repository/database.
+        * Get the NuxeoDS info and create the necessary databases.
+        * Consider the tenant bindings to find and get the data sources for each tenant.
+        * There may be only one, one per tenant, or something in between.
+     * 
+     */
+    private HashSet<String> createNuxeoDatabases() throws Exception {
+        String nuxeoUser = getBasicDataSourceUsername(JDBCTools.NUXEO_DATASOURCE_NAME);
+       String nuxeoPW = getBasicDataSourcePassword(JDBCTools.NUXEO_DATASOURCE_NAME);
+
+        String readerUser = getBasicDataSourceUsername(JDBCTools.NUXEO_READER_DATASOURCE_NAME);
+       String readerPW = getBasicDataSourcePassword(JDBCTools.NUXEO_READER_DATASOURCE_NAME);
+       
+       DatabaseProductType dbType = JDBCTools.getDatabaseProductType(JDBCTools.CSADMIN_DATASOURCE_NAME,
+                       getServiceConfig().getDbCsadminName());
+
+       Hashtable<String, TenantBindingType> tenantBindings =
+                       tenantBindingConfigReader.getTenantBindings();
+       HashSet<String> nuxeoDBsChecked = new HashSet<String>();
+
+        // First check and create the roles as needed. (nuxeo and reader)
+        for (TenantBindingType tenantBinding : tenantBindings.values()) {
+                String tId = tenantBinding.getId();
+                String tName = tenantBinding.getName();
+                List<RepositoryDomainType> repoDomainList = tenantBinding.getRepositoryDomain();
+                for (RepositoryDomainType repoDomain : repoDomainList) {
+                        String repoDomainName = repoDomain.getName();
+                        String repositoryName = repoDomain.getRepositoryName();
+                        String cspaceInstanceId = getCspaceInstanceId();
+                        String dbName = JDBCTools.getDatabaseName(repositoryName, cspaceInstanceId);
+                        if (nuxeoDBsChecked.contains(dbName)) {
+                                if (logger.isDebugEnabled()) {
+                                        logger.debug("Another user of db: " + dbName + ": Repo: " + repoDomainName
+                                                        + " and tenant: " + tName + " (id:" + tId + ")");
+                                }
+                        } else {
+                                if (logger.isDebugEnabled()) {
+                                        logger.debug("Need to prepare db: " + dbName + " for Repo: " + repoDomainName
+                                                        + " and tenant: " + tName + " (id:" + tId + ")");
+                                }
+                                boolean dbExists = JDBCTools.hasDatabase(dbType, dbName);
+                                if (dbExists) {
+                                        if (logger.isDebugEnabled()) {
+                                                logger.debug("Database: " + dbName + " already exists.");
+                                        }
+                                } else {
+                                        // Create the user as needed
+                                        JDBCTools.createNewDatabaseUser(JDBCTools.CSADMIN_DATASOURCE_NAME, repositoryName, cspaceInstanceId, dbType, nuxeoUser, nuxeoPW);
+                                        if (readerUser != null) {
+                                            JDBCTools.createNewDatabaseUser(JDBCTools.CSADMIN_DATASOURCE_NAME, repositoryName, cspaceInstanceId, dbType, readerUser, readerPW);
+                                        }
+                                        // Create the database
+                                        createDatabaseWithRights(dbType, dbName, nuxeoUser, nuxeoPW, readerUser, readerPW);
+                                }
+                                nuxeoDBsChecked.add(dbName);
+                        }
+                } // Loop on repos for tenant
+        } // Loop on tenants
+                
+        return nuxeoDBsChecked;
+       
+    }
+    
+        /**
+         * Creates a Nuxeo-managed database, sets up an owner for that
+         * database, and adds (at least) connection privileges to a reader
+         * of that database.
+         * 
+         * @param conn
+         * @param dbType
+         * @param dbName
+         * @param ownerName
+         * @param ownerPW
+         * @param readerName
+         * @param readerPW
+         * @throws Exception 
+         */
+       private void createDatabaseWithRights(DatabaseProductType dbType, String dbName, String ownerName,
+                       String ownerPW, String readerName, String readerPW) throws Exception {
+                Connection conn = null;
+               Statement stmt = null;
+               try {
+                       DataSource csadminDataSource = JDBCTools.getDataSource(JDBCTools.CSADMIN_DATASOURCE_NAME);
+                       conn = csadminDataSource.getConnection();
+                       stmt = conn.createStatement();
+                       if (dbType == DatabaseProductType.POSTGRESQL) {
+                               // PostgreSQL does not need passwords in grant statements.
+                               String sql = "CREATE DATABASE " + dbName + " ENCODING 'UTF8' OWNER " + ownerName;
+                               stmt.executeUpdate(sql);
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("Created db: '" + dbName + "' with owner: '" + ownerName + "'");
+                               }
+                               if (readerName != null) {
+                                       sql = "GRANT CONNECT ON DATABASE " + dbName + " TO " + readerName;
+                                       stmt.executeUpdate(sql);
+                                       if (logger.isDebugEnabled()) {
+                                               logger.debug(" Granted connect rights on: '" + dbName + "' to reader: '" + readerName + "'");
+                                       }
+                               }
+                               // Note that select rights for reader must be granted after
+                               // Nuxeo startup.
+                       } else if (dbType == DatabaseProductType.MYSQL) {
+                               String sql = "CREATE database " + dbName + " DEFAULT CHARACTER SET utf8";
+                               stmt.executeUpdate(sql);
+                               sql = "GRANT ALL PRIVILEGES ON " + dbName + ".* TO '" + ownerName + "'@'localhost' IDENTIFIED BY '"
+                                               + ownerPW + "' WITH GRANT OPTION";
+                               stmt.executeUpdate(sql);
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("Created db: '" + dbName + "' with owner: '" + ownerName + "'");
+                               }
+                               if (readerName != null) {
+                                       sql = "GRANT SELECT ON " + dbName + ".* TO '" + readerName + "'@'localhost' IDENTIFIED BY '"
+                                                       + readerPW + "' WITH GRANT OPTION";
+                                       stmt.executeUpdate(sql);
+                                       if (logger.isDebugEnabled()) {
+                                               logger.debug(" Granted SELECT rights on: '" + dbName + "' to reader: '" + readerName + "'");
+                                       }
+                               }
+                       } else {
+                               throw new UnsupportedOperationException("createDatabaseWithRights only supports PSQL - MySQL NYI!");
+                       }
+               } catch (Exception e) {
+                       logger.error("createDatabaseWithRights failed on exception: " + e.getLocalizedMessage());
+                       throw e; // propagate
+               } finally { // close resources
+                       try {
+                               if (stmt != null) {
+                                       stmt.close();
+                               }
+                                if (conn != null) {
+                                        conn.close();
+                                }
+                       } catch (SQLException se) {
+                               se.printStackTrace();
+                       }
+               }
+
+       }
+        
+        private BasicDataSource getBasicDataSource(String dataSourceName) {
+            BasicDataSource basicDataSource = null;
+            if (Tools.isBlank(dataSourceName)) {
+                return basicDataSource;
+            }
+            try {
+                DataSource dataSource = JDBCTools.getDataSource(dataSourceName);
+                basicDataSource = (BasicDataSource) dataSource;
+            } catch (NamingException ne) {
+                logger.warn("Error attempting to retrieve basic datasource '%s': %s",
+                        dataSourceName, ne.getMessage());
+                return basicDataSource;
+            }
+            return basicDataSource;
+        }
+        
+        private String getBasicDataSourceUsername(String dataSourceName) {
+            String username = null;
+            BasicDataSource basicDataSource = getBasicDataSource(dataSourceName);
+            if (basicDataSource == null) {
+                return username;
+            }
+            username = basicDataSource.getUsername();
+            return username;
+        }
+        
+        private String getBasicDataSourcePassword(String dataSourceName) {
+            String password = null;
+            BasicDataSource basicDataSource = getBasicDataSource(dataSourceName);
+            if (basicDataSource == null) {
+                return password;
+            }
+            password = basicDataSource.getPassword();
+            return password;
+        }
+     
+    /*
+     * This might be useful for something, but the reader grants are better handled in the ReportPostInitHandler.
+     * 
+     * 
+     */
+/*     
+    private void handlePostNuxeoInitDBTasks() throws Exception {
+       Statement stmt = null;
+               Connection conn = null;
+               
+       try {
+               DataSource nuxeoMgrDataSource = JDBCTools.getDataSource(JDBCTools.NUXEO_MANAGER_DATASOURCE_NAME);
+               DataSource nuxeoReaderDataSource = JDBCTools.getDataSource(JDBCTools.NUXEO_READER_DATASOURCE_NAME);
+               
+               if(nuxeoReaderDataSource!=null) {
+                       // We need to fetch the user name and password from the nuxeoDataSource, to do grants below
+                       org.apache.tomcat.dbcp.dbcp.BasicDataSource tomcatDataSource =
+                                       (org.apache.tomcat.dbcp.dbcp.BasicDataSource)nuxeoReaderDataSource;
+                       // Get the template URL value from the JNDI datasource and substitute the databaseName
+                       String readerUser = tomcatDataSource.getUsername();
+                       DatabaseProductType dbType = JDBCTools.getDatabaseProductType(
+                                       JDBCTools.CSPACE_DATASOURCE_NAME,
+                                       JDBCTools.DEFAULT_CSPACE_DATABASE_NAME); // only returns PG or MYSQL
+       
+                       conn = nuxeoMgrDataSource.getConnection();
+                       stmt = conn.createStatement();
+                       if(dbType==DatabaseProductType.POSTGRESQL) {
+                               // Note that select rights for reader must be granted after Nuxeo startup.
+                               String sql = "GRANT SELECT ON ALL TABLES IN SCHEMA public TO "+readerUser;
+                               stmt.executeUpdate(sql);
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug(" Granted SELECT rights on all public tables to reader: '"+readerUser+"'");
+                               }
+                       } else if(dbType==DatabaseProductType.MYSQL) {
+                       } else {
+                               throw new UnsupportedOperationException("handlePostNuxeoInitDBTasks only supports Postgres/MySQL.");
+                       }
+               }
+       } catch(Exception e) {
+               logger.error("handlePostNuxeoInitDBTasks failed on exception: " + e.getLocalizedMessage());
+               throw e;        // propagate
+       } finally {   //close resources
+               try {
+                       if(stmt!=null) {
+                               stmt.close();
+                       }
+               } catch(SQLException se) {
+                       // nothing we can do
+               }
+       }
+
+    }
+*/
+    
+    private void setServerRootDir() {
+        serverRootDir = System.getProperty(SERVER_HOME_PROPERTY);
+        if (serverRootDir == null) {
+            serverRootDir = "."; //assume server is started from server root, e.g. server/cspace
+            String msg = String.format("System property '%s' was not set.  Using '%s' instead.",
+                       SERVER_HOME_PROPERTY, serverRootDir);
+            logger.warn(msg);
+        }
+    }
+
+
+    /**
+     * @return the serviceConfig
+     */
+    public ServiceConfig getServiceConfig() {
+        return getServicesConfigReader().getConfiguration();
+    }
+
+    /**
+     * @return the clientType
+     */
+    public ClientType getClientType() {
+        return getServicesConfigReader().getClientType();
+    }
+
+    /**
+     * @return the servicesConfigReader
+     */
+    public ServicesConfigReaderImpl getServicesConfigReader() {
+        return servicesConfigReader;
+    }
+
+    /**
+     * @return the tenantBindingConfigReader
+     */
+    public TenantBindingConfigReaderImpl getTenantBindingConfigReader() {
+        return tenantBindingConfigReader;
+    }
+    
+    /**
+     *  Populate a registry of URI templates by querying each resource
+     *  for its own entries in the registry.
+     * 
+     *  These entries consist of one or more URI templates associated
+     *  with that resource, for building URIs to access that resource.
+     */
+    private synchronized void populateUriTemplateRegistry() {
+       if (uriTemplateRegistry.isEmpty()) {
+            ResourceBase resource = null;
+            ResourceMap resourceMap = ResteasyProviderFactory.getContextData(ResourceMap.class);
+            for (Map.Entry<String, ResourceBase> entry : resourceMap.entrySet()) {
+                resource = entry.getValue();
+                Map<UriTemplateRegistryKey, StoredValuesUriTemplate> entries =
+                        resource.getUriRegistryEntries();
+                uriTemplateRegistry.putAll(entries);
+            }
+
+            // FIXME: Contacts itself should not have an entry in the URI template registry;
+            // there should be a Contacts entry in that registry only for use in
+            // building URIs for resources that have contacts as a sub-resource
+            // (This may also fall out during implementation of CSPACE-2698.)
+       }
+    }
+
+    public UriTemplateRegistry getUriTemplateRegistry() {
+        if (uriTemplateRegistry.isEmpty()) {
+            populateUriTemplateRegistry();
+        }
+        return uriTemplateRegistry;
+    }
+   /**
+    * Ensure that Nuxeo repository configuration files exist for each repository
+    * specified in tenant bindings. Create or update these files, as needed.
+    */
+    private void createOrUpdateNuxeoRepositoryConfigFiles() throws Exception {
+        
+        // Get the prototype copy of the Nuxeo repository config file.
+        File prototypeNuxeoConfigFile =
+                new File(getCspaceServicesConfigDir() + File.separator + getNuxeoProtoConfigFilename());
+        // FIXME: Consider checking for the presence of existing configuration files,
+        // rather than always failing outright if the prototype file for creating
+        // new or updated files can't be located.
+        if (! prototypeNuxeoConfigFile.canRead()) {
+            String msg = String.format("Could not find and/or read the prototype Nuxeo config file '%s'. "
+                    + "Please redeploy this file by running 'ant deploy' from the Services layer source code's '3rdparty/nuxeo' module.",
+                    prototypeNuxeoConfigFile.getCanonicalPath());
+            throw new RuntimeException(msg);
+        }
+        if (logger.isTraceEnabled()) {
+            logger.trace("Found and can read prototype Nuxeo config file at path %s", prototypeNuxeoConfigFile.getAbsolutePath());
+        }
+        Document prototypeConfigDoc = XmlTools.fileToXMLDocument(prototypeNuxeoConfigFile);
+        Document repositoryConfigDoc = null;
+        // FIXME: Can the variable below reasonably be made a class variable? Its value
+        // is used in at least one other method in this class.
+        Hashtable<String, TenantBindingType> tenantBindingTypeMap = tenantBindingConfigReader.getTenantBindings();
+        for (TenantBindingType tbt : tenantBindingTypeMap.values()) {
+            List<String> repositoryNameList = ConfigUtils.getRepositoryNameList(tbt);
+            if (logger.isTraceEnabled()) {
+                logger.trace("Getting repository name(s) for tenant " + tbt.getName());
+            }
+            if (repositoryNameList == null || repositoryNameList.isEmpty() == true) {
+              logger.warn(String.format("Could not get repository name(s) for tenant %s", tbt.getName()));
+              continue; //break out of loop
+            } else {
+                for (String repositoryName : repositoryNameList) {
+                    if (Tools.isBlank(repositoryName)) {
+                        continue;
+                    }
+                    if (logger.isTraceEnabled()) {
+                        logger.trace(String.format("Repository name is %s", repositoryName));
+                    }
+                    // FIXME: As per above, we might check for the presence of an existing
+                    // config file for this repository and, if present, not fail even if
+                    // the code below fails to update that file on any given system startup.
+                    //
+                    // Clone the prototype copy of the Nuxeo repository config file,
+                    // thus creating a separate config file for the current repository.
+                    repositoryConfigDoc = (Document) prototypeConfigDoc.clone();
+                    // Update this config file by inserting values pertinent to the
+                    // current repository.
+                    String binaryStorePath = tbt.getBinaryStorePath();
+                    repositoryConfigDoc = updateRepositoryConfigDoc(repositoryConfigDoc, repositoryName,
+                               this.getCspaceInstanceId(), binaryStorePath);
+                    if (logger.isTraceEnabled()) {
+                        logger.trace("Updated Nuxeo repo config file contents=\n" + repositoryConfigDoc.asXML());
+                    }
+                    // Write this config file to the Nuxeo server config directory.
+                    File repofile = new File(getNuxeoConfigDir() + File.separator +
+                            repositoryName + JEEServerDeployment.NUXEO_REPO_CONFIG_FILENAME_SUFFIX);
+                    if (logger.isTraceEnabled()) {
+                        logger.trace(String.format("Attempting to write Nuxeo repo config file to %s", repofile.getAbsolutePath()));
+                    }
+                    XmlTools.xmlDocumentToFile(repositoryConfigDoc, repofile);
+                }
+            }
+        }
+    }
+    
+    /*
+     * This method is filling out the proto-repo-config.xml file with tenant specific repository information.
+     */
+    private Document updateRepositoryConfigDoc(Document repoConfigDoc, String repositoryName,
+               String cspaceInstanceId, String binaryStorePath) {
+        String databaseName = JDBCTools.getDatabaseName(repositoryName, cspaceInstanceId);
+
+        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc, "/component", "name",
+                String.format("config:%s-repository", repositoryName));
+        
+        // Text substitutions within first extension point, "repository"
+        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,
+                REPOSITORY_EXTENSION_POINT_XPATH + "/repository", "name",
+                repositoryName);
+        
+        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,
+                REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository", "name",
+                repositoryName);
+        
+        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,
+                REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository/binaryStore", "path",
+                Tools.isBlank(binaryStorePath) ? repositoryName : binaryStorePath);  // Can be either partial or full path.  Partial path will be relative to Nuxeo's data directory
+
+        /* Create the JDBC url options if any exist */
+        String jdbcOptions = XmlTools.getElementValue(repoConfigDoc,
+                REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository/property[@name='JDBCOptions']");
+        jdbcOptions = Tools.isBlank(jdbcOptions) ? "" : "?" + jdbcOptions;
+        
+        repoConfigDoc = XmlTools.setElementValue(repoConfigDoc,
+                REPOSITORY_EXTENSION_POINT_XPATH + "/repository/repository/property[@name='DatabaseName']",
+                databaseName + jdbcOptions);
+        
+        // Text substitutions within second extension point, "repositories" 
+        repoConfigDoc = XmlTools.setElementValue(repoConfigDoc,
+                REPOSITORIES_EXTENSION_POINT_XPATH + "/documentation",
+                String.format("The %s repository", repositoryName));
+        
+        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,
+                REPOSITORIES_EXTENSION_POINT_XPATH + "/repository", "name",
+                repositoryName);
+        
+        repoConfigDoc = XmlTools.setAttributeValue(repoConfigDoc,
+                REPOSITORIES_EXTENSION_POINT_XPATH + "/repository", "label",
+                String.format("%s Repository", repositoryName));
+        
+        return repoConfigDoc;
+    }
+
+    /**
+     * Update the current copy of the Nuxeo databases initialization script file by
+     * 
+     * <ul>
+     *   <li>Removing all existing DROP DATABASE commands</li>
+     *   <li>Removing all existing DROP USER commands</li>
+     *   <li>Adding a DROP DATABASE command for each current database, at the top of that file.</li>
+     *   <li>Adding DROP USER commands for each provided datasource, following the DROP DATABASE commands.</li>
+     * </ul>
+     * 
+     * @param dbInitializationScriptFilePath
+     * @param dbsCheckedOrCreated 
+     */
+    private void updateInitializationScript(String dbInitializationScriptFilePath,
+            HashSet<String> dbsCheckedOrCreated, String[] dataSourceNames) {
+        // Get the current copy of the Nuxeo databases initialization script file,
+        // if that file exists, and read all of its lines except for those which
+        // drop databases.
+        List<String> lines = null;
+        // "If the given string" for the pathname provided here "is the empty string, then the
+        // result is the empty abstract pathname," according to Oracle's Javadoc for File.
+        // An empty path string might be provided here if a call to get the database product name failed earlier.
+        File nuxeoDatabasesInitScriptFile = new File(dbInitializationScriptFilePath);
+        try {
+            if (! nuxeoDatabasesInitScriptFile.canRead()) {
+                String msg = String.format("Could not find and/or read the Nuxeo databases initialization script file '%s'",
+                        nuxeoDatabasesInitScriptFile.getCanonicalPath());
+                logger.warn(msg);
+            } else {
+                // Note: Exceptions are written only to the console, not thrown, by
+                // the readFileAsLines() method in the common-api package.
+                lines = FileTools.readFileAsLines(dbInitializationScriptFilePath);
+                Iterator<String> linesIterator = lines.iterator();
+                String currentLine;
+                while (linesIterator.hasNext()) {
+                    currentLine = linesIterator.next();
+                    // Elide all existing DROP DATABASE statements.
+                    if (currentLine.toLowerCase().contains(DROP_DATABASE_SQL_CMD.toLowerCase())) {
+                        linesIterator.remove();
+                    }
+                    // Elide a comment pertaining to the existing
+                    // DROP DATABASE statements.
+                    if (currentLine.toLowerCase().contains(DROP_OBJECTS_SQL_COMMENT.toLowerCase())) {
+                        linesIterator.remove();
+                    }
+                    // Elide all existing DROP USER statements.
+                    if (currentLine.toLowerCase().contains(DROP_USER_SQL_CMD.toLowerCase())) {
+                        linesIterator.remove();
+                    }
+                }
+            }
+            List<String> replacementLines = new ArrayList<String>();
+            // Add back the comment elided above
+            replacementLines.add(DROP_OBJECTS_SQL_COMMENT);
+            // Add new DROP DATABASE lines for every Nuxeo-managed database.
+            for (String dbName : dbsCheckedOrCreated) {
+              if (Tools.notBlank(dbName)) {
+                  replacementLines.add(String.format(DROP_DATABASE_IF_EXISTS_SQL_CMD, dbName));
+              }
+            }
+            // Add new DROP USER commands for every provided datasource.
+            String username;
+            for (String dataSourceName : dataSourceNames) {
+                username = getBasicDataSourceUsername(dataSourceName);
+                if (Tools.notBlank(username)) {
+                    replacementLines.add(String.format(DROP_USER_IF_EXISTS_SQL_CMD, username));
+                }
+            }
+            // Now append all existing lines from that file, except for
+            // any lines that were elided above.
+            if (lines != null && ! lines.isEmpty()) {
+                replacementLines.addAll(lines);
+            }
+            if (! nuxeoDatabasesInitScriptFile.canWrite()) {
+                String msg = String.format("Could not find and/or write the Nuxeo databases initialization script file '%s'",
+                        nuxeoDatabasesInitScriptFile.getCanonicalPath());
+                logger.warn(msg);
+            } else {
+                // Note: Exceptions are written only to the console, not thrown, by
+                // the writeFileFromLines() method in the common-api package.
+                FileTools.writeFileFromLines(dbInitializationScriptFilePath, replacementLines);
+            }
+        } catch (Exception e) {
+
+        }
+
+    }
+}
index 2d126652a0a240b69cbdbc647e128dd5290b7c34..44622c02b332ac10f4e9d2dacdd9217a92170d9e 100644 (file)
-package org.collectionspace.services.common;\r
-\r
-\r
-import java.io.UnsupportedEncodingException;\r
-import java.net.URLDecoder;\r
-import java.net.URLEncoder;\r
-import java.util.Enumeration;\r
-\r
-import javax.servlet.http.Cookie;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-public class ServletTools {\r
-\r
-    public final static int BROWSER_NOT_SET             = -1;\r
-    public final static int BROWSER_UNKNOWN             = 0;\r
-    public final static int BROWSER_IE4                 = 1;\r
-    public final static int BROWSER_NETSCAPE_COMPATIBLE = 20;\r
-    public final static int BROWSER_NETSCAPE_4          = 21;\r
-    public final static int BROWSER_NETSCAPE_5          = 22;\r
-    public final static int BROWSER_NETSCAPE_6          = 23;\r
-    public final static int BROWSER_IE                  = 24;\r
-    public final static int BROWSER_DYNAMIDE_TEXT       = 50;\r
-\r
-    public final static String BROWSER_STRING_UNKNOWN = "*";\r
-    public final static String BROWSER_STRING_IE = "IE";\r
-    public final static String BROWSER_STRING_NETSCAPE_COMPATIBLE = "NS";\r
-\r
-    public final static String getBrowserStringFromID(int id){\r
-        switch ( id ) {\r
-            case BROWSER_UNKNOWN : return BROWSER_STRING_UNKNOWN;\r
-            case BROWSER_IE : return BROWSER_STRING_IE;\r
-            case BROWSER_NETSCAPE_COMPATIBLE : return BROWSER_STRING_NETSCAPE_COMPATIBLE;\r
-            default: return BROWSER_STRING_UNKNOWN;\r
-        }\r
-    }\r
-\r
-    /** Different from ServletRequest.getParameter in that this function will never return a null, always and empty string if param not found.\r
-     */\r
-    public static String getParameterValue(HttpServletRequest request, String paramName){\r
-        if (request == null){\r
-            return "";\r
-        }\r
-        String value = request.getParameter(paramName);\r
-        value = (value == null) ? "" : value;\r
-        return value;\r
-    }\r
-\r
-    public static String getURL(HttpServletRequest request){\r
-         if (request == null){\r
-            return "";\r
-         }\r
-         String qs = request.getQueryString();\r
-         String qstr = (qs != null && qs.length() > 0)\r
-                ? "?"+qs\r
-                : "";\r
-         return request.getRequestURI()+qstr;\r
-    }\r
-\r
-    public static String getFullURL(HttpServletRequest request){\r
-         return getProtoHostPort(request)+getURL(request);\r
-    }\r
-\r
-    /** @return "http" or "https", without the "://" part.\r
-     */\r
-    public static String getProto(HttpServletRequest request){\r
-         if (request==null){\r
-            return "";\r
-         }\r
-         String prot = request.getAuthType();\r
-         String protocol = prot != null && prot.equals("SSL") ? "https" : "http";\r
-         return protocol;\r
-    }\r
-\r
-    public static String getProtoHostPort(HttpServletRequest request){\r
-         if (request==null){\r
-            return "";\r
-         }\r
-         String protocol = getProto(request);\r
-         int port = request.getServerPort();\r
-         String portstr;\r
-         if ( protocol.equals("https") ) {\r
-            portstr = (port != 443) ? ":"+port : "";\r
-         } else {\r
-            portstr =  (port != 80)  ? ":"+port : "";\r
-         }\r
-         return protocol+"://"+request.getServerName()+portstr;\r
-    }\r
-\r
-    public static String getProtoHostPort(java.net.URL url){\r
-         if (url==null){\r
-            return "";\r
-         }\r
-         String protocol = url.getProtocol();\r
-         int port = url.getPort();\r
-         String portstr;\r
-         if ( protocol.equals("https") ) {\r
-            portstr = (port != 443) ? ":"+port : "";\r
-         } else {\r
-            portstr =  (port != 80)  ? ":"+port : "";\r
-         }\r
-         return protocol+"://"+url.getHost()+portstr;\r
-    }\r
-\r
-    public static String decodeURLString(HttpServletRequest request, String paramName) throws UnsupportedEncodingException{\r
-        if ( request == null ) {\r
-            return "";\r
-        }\r
-        String value = request.getParameter(paramName);\r
-        return decodeURLString(value);\r
-    }\r
-\r
-    public static String decodeURLString(String URLString) throws UnsupportedEncodingException{\r
-        if ( URLString == null ) {\r
-            return "";\r
-        }\r
-        return URLDecoder.decode(URLString, "UTF-8");\r
-    }\r
-\r
-    public static String encodeURLString(String s){\r
-        return URLEncoder.encode(s);\r
-    }\r
-\r
-    public static String dumpRequestInfo(HttpServletRequest request){\r
-        return dumpRequestInfo(request, true, "#FFAD00", true);\r
-    }\r
-\r
-    public static String dumpRequestInfo(HttpServletRequest request, boolean html, String headerColor, boolean dumpHeaders){\r
-        if (request==null){\r
-            return "NULL REQUEST";\r
-        }\r
-        String result;\r
-        if (dumpHeaders){\r
-            result = dumpRequestHeaders(request, html);\r
-        } else {\r
-            result = "URL: " +  getFullURL(request);\r
-        }\r
-\r
-        if ( html ) {\r
-           result = result + "\r\n<br />Params: ";\r
-        } else {\r
-           result = result + "\r\nParams: ";\r
-        }\r
-        result = result + dumpRequestParams(request, html, headerColor);\r
-        return result;\r
-    }\r
-\r
-    public static String dumpRequestHeaders(HttpServletRequest request, boolean html){\r
-        if (request==null){\r
-            return "NULL REQUEST";\r
-        }\r
-        String headers = "";\r
-        String nl = html ? "\r\n<br />" : "\r\n";\r
-        for(Enumeration headernames = request.getHeaderNames(); headernames.hasMoreElements();){\r
-            String headername =  (String)headernames.nextElement();\r
-            headers += nl + headername+": "+request.getHeader(headername);\r
-        }\r
-        String result;\r
-        if ( html ) {\r
-            result = "<pre>";\r
-        } else {\r
-            result = "";\r
-        }\r
-        result = result + "\r\nHeaders: "+ headers\r
-          +"\r\nmethod: " + request.getMethod()\r
-          +"\r\nProtocol: " + getProto(request)\r
-          +"\r\nURL: " +  getFullURL(request);\r
-          //+"\r\nQuery String: " +  getQueryString()\r
-          //+"\r\nContent: " + getContent();\r
-          if ( html ) {\r
-            result = result + "</pre>";\r
-          }\r
-        return result;\r
-    }\r
-\r
-    public static String dumpRequestParams(HttpServletRequest request){\r
-        return dumpRequestParams(request, true, "#FFAD00");\r
-    }\r
-    public static String dumpRequestParams(HttpServletRequest request, boolean html, String headerColor){\r
-        if (request==null){\r
-            return "NULL REQUEST";\r
-        }\r
-        StringBuffer result = new StringBuffer();\r
-        if (html) result.append( "<TABLE BORDER='1' cellpadding='0' cellspacing='0'>\n" +\r
-                "<TR BGCOLOR='"+headerColor+"'>\n" +\r
-                "<TH>Parameter Name</TH><TH>Parameter Value(s)</TH></TR>");\r
-        Enumeration paramNames = request.getParameterNames();\r
-        while(paramNames.hasMoreElements()) {\r
-            String paramName = (String)paramNames.nextElement();\r
-\r
-            if (html) result.append("\r\n<TR><TD>" + paramName + "\r\n</TD><TD>");\r
-            else      result.append(paramName).append("=");\r
-\r
-            String[] paramValues = request.getParameterValues(paramName);\r
-            if (paramValues.length == 1) {\r
-                String paramValue = paramValues[0];\r
-                if (paramValue.length() == 0){\r
-                    if (html) result.append("<I>No Value</I>");\r
-                    else result.append("\"\"");\r
-                } else {\r
-                    if (html) result.append(paramValue);\r
-                    else      result.append('\"'+paramValue+'\"');\r
-                }\r
-            } else {\r
-                if (html) result.append("<UL>");\r
-                for(int i=0; i<paramValues.length; i++) {\r
-                    if (html) result.append("<LI>" + paramValues[i]+"</LI>");\r
-                    else      result.append('\"'+paramValues[i]+'\"');\r
-                }\r
-                if (html) result.append("</UL>");\r
-            }\r
-            if (html) result.append("</TD>\r\n</TR>");\r
-            else      result.append("\r\n");\r
-        }\r
-        if (html) result.append("</TABLE>");\r
-        return result.toString();\r
-    }\r
-\r
-\r
-\r
-    public static class UserIDPassword {\r
-        public String user_id = "";\r
-        public String password = "";\r
-    }\r
-\r
-    /*\r
-\r
-    public String getUserName(){\r
-        String remoteUserName = getRemoteUser().user_id;\r
-        if (remoteUserName.length() > 0){\r
-            return remoteUserName;\r
-        } else {\r
-            String name = getFieldValue("USER");\r
-            if ( name != null && name.length()>0 ) {\r
-                return name;\r
-            }\r
-        }\r
-        return "";\r
-     }\r
-    */\r
-    public static UserIDPassword getRemoteUser(HttpServletRequest request){\r
-        return getRemoteUser(request.getHeader("Authorization"));\r
-    }\r
-\r
-    protected static UserIDPassword getRemoteUser(String authString){\r
-        UserIDPassword uip = new UserIDPassword();\r
-        try {   // Decode and decompose the Authorization headervalue\r
-                if (authString == null){\r
-                    return uip;\r
-                }\r
-                authString = authString.substring(6).trim();\r
-                byte mydata[];\r
-//                sun.misc.BASE64Decoder base64 = new sun.misc.BASE64Decoder();\r
-                org.apache.commons.codec.binary.Base64 base64 = new org.apache.commons.codec.binary.Base64();\r
-//                mydata = base64.decodeBuffer(authString);\r
-                mydata = base64.decode(authString);\r
-                String loginInfo = new String(mydata);\r
-                int index = loginInfo.indexOf(":");\r
-                if( index != -1 ){\r
-                    uip.password = loginInfo.substring(index +1);\r
-                    uip.user_id = loginInfo.substring(0, index);\r
-                }\r
-        } catch(Exception e) {\r
-            //result will have empty user name\r
-            System.out.println("ServletTools.getRemoteUser() failed to obtain Authorization info");\r
-        }\r
-        return uip;\r
-    }\r
-\r
-    public static String browserVersion(HttpServletRequest request){\r
-        String agent = request.getHeader("User-Agent");\r
-        //Examples:\r
-        //curl/7.5.1\r
-        //Mozilla/4.0\r
-        //Mozilla/4.08 [en] (Win95; U ;Nav)\r
-        //Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; FMRCo cfg. 5.01.2.1a)\r
-        //Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; FMRCo cfg. 5.01.2.1a)\r
-               if ( agent == null ) {\r
-                       return "null";//don't just return "" since this value may be used in a Tcl eval, and it would then disappear.\r
-               }\r
-        int start, stop;\r
-        if ( agent.indexOf("MSIE ") > -1 ) {\r
-            start = agent.indexOf("MSIE ");\r
-            stop = agent.indexOf(";", start);\r
-            stop = stop > -1 ? stop : agent.length(); //safety\r
-            return agent.substring(start+5, stop).trim();\r
-        } else {\r
-            start = agent.indexOf("/");\r
-            stop = agent.indexOf(" ");\r
-            stop = stop > -1 ? stop : agent.length(); //for JSSE, there is no space: User-Agent: Java1.3.0_02\r
-            return agent.substring(start+1, stop).trim();\r
-        }\r
-    }\r
-\r
-\r
-    /**\r
-     * Mozilla/4.79 [en] (Windows NT 5.0; U)\r
-     * Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6\r
-     * Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1\r
-     * Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)\r
-     */\r
-    public static int findBrowserID(HttpServletRequest request){\r
-        String browserString = request.getHeader("User-Agent");\r
-        if (browserString == null)\r
-            return BROWSER_UNKNOWN;\r
-        if (browserString.indexOf("MSIE") > -1)\r
-            return BROWSER_IE4;\r
-        int iMozilla = browserString.indexOf("Mozilla");\r
-        if (iMozilla > -1){\r
-            String ver = browserString.substring(iMozilla + ("Mozilla/".length()) );\r
-            int iSpace = ver.indexOf(" ");\r
-            if (iSpace>-1){\r
-                ver = ver.substring(0, iSpace);\r
-            }\r
-            try {\r
-                Double majorminor =  new Double(ver);\r
-                if (majorminor.longValue()==4){\r
-                    return BROWSER_NETSCAPE_4;\r
-                }\r
-                if (majorminor.longValue()==5){\r
-                    return BROWSER_NETSCAPE_5;\r
-                }\r
-                if (majorminor.longValue()==6){\r
-                    return BROWSER_NETSCAPE_6;\r
-                }\r
-            } catch (Exception e)  {\r
-                System.out.println("ERROR: silent after catching error converting browser minor version."+browserString);\r
-                return BROWSER_NETSCAPE_COMPATIBLE;\r
-            }\r
-            return BROWSER_NETSCAPE_COMPATIBLE;\r
-        }\r
-        return BROWSER_UNKNOWN;\r
-    }\r
-\r
-    public static boolean isBrowserIE(int bid){\r
-      return (bid == BROWSER_IE4 || bid == BROWSER_IE)  ? true : false ;\r
-    }\r
-\r
-    public static boolean isBrowserNS4x(int bid){\r
-      return (bid == BROWSER_NETSCAPE_4) ;\r
-    }\r
-\r
-    public static String getCookieValue(HttpServletRequest request, String name ){\r
-        Cookie result = findCookie(request, name);\r
-        if ( result != null ) {\r
-            return result.getValue();\r
-        }\r
-        return "";\r
-    }\r
-\r
-    public static Cookie findCookie(HttpServletRequest request, String name ){\r
-        if (request == null || name == null) {\r
-            return null;\r
-        }\r
-        Cookie [] cookies = request.getCookies();\r
-        if ( cookies == null ) {\r
-            return null;\r
-        }\r
-        int cookies_len = cookies.length;\r
-        for (int i=0; i < cookies_len; i++) {\r
-            Cookie cookie = cookies[i];\r
-            if (cookie != null && name.equals(cookie.getName())){\r
-                return cookie;\r
-            }\r
-        }\r
-        return null;\r
-    }\r
-\r
-    public static Cookie setCookie(HttpServletResponse response, String name, String value){\r
-        return setCookie(response, name, value, "/", 365*24*60*60);\r
-    }\r
-\r
-    public static Cookie setCookie(HttpServletResponse response, String name, String value, String path, int maxAge){\r
-        Cookie cookie = new javax.servlet.http.Cookie(name, value);\r
-        cookie.setMaxAge(maxAge);\r
-        cookie.setPath(path);\r
-        response.addCookie(cookie);\r
-        return cookie;\r
-    }\r
-\r
-\r
-\r
-}\r
-\r
+package org.collectionspace.services.common;
+
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.util.Enumeration;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class ServletTools {
+
+    public final static int BROWSER_NOT_SET             = -1;
+    public final static int BROWSER_UNKNOWN             = 0;
+    public final static int BROWSER_IE4                 = 1;
+    public final static int BROWSER_NETSCAPE_COMPATIBLE = 20;
+    public final static int BROWSER_NETSCAPE_4          = 21;
+    public final static int BROWSER_NETSCAPE_5          = 22;
+    public final static int BROWSER_NETSCAPE_6          = 23;
+    public final static int BROWSER_IE                  = 24;
+    public final static int BROWSER_DYNAMIDE_TEXT       = 50;
+
+    public final static String BROWSER_STRING_UNKNOWN = "*";
+    public final static String BROWSER_STRING_IE = "IE";
+    public final static String BROWSER_STRING_NETSCAPE_COMPATIBLE = "NS";
+
+    public final static String getBrowserStringFromID(int id){
+        switch ( id ) {
+            case BROWSER_UNKNOWN : return BROWSER_STRING_UNKNOWN;
+            case BROWSER_IE : return BROWSER_STRING_IE;
+            case BROWSER_NETSCAPE_COMPATIBLE : return BROWSER_STRING_NETSCAPE_COMPATIBLE;
+            default: return BROWSER_STRING_UNKNOWN;
+        }
+    }
+
+    /** Different from ServletRequest.getParameter in that this function will never return a null, always and empty string if param not found.
+     */
+    public static String getParameterValue(HttpServletRequest request, String paramName){
+        if (request == null){
+            return "";
+        }
+        String value = request.getParameter(paramName);
+        value = (value == null) ? "" : value;
+        return value;
+    }
+
+    public static String getURL(HttpServletRequest request){
+         if (request == null){
+            return "";
+         }
+         String qs = request.getQueryString();
+         String qstr = (qs != null && qs.length() > 0)
+                ? "?"+qs
+                : "";
+         return request.getRequestURI()+qstr;
+    }
+
+    public static String getFullURL(HttpServletRequest request){
+         return getProtoHostPort(request)+getURL(request);
+    }
+
+    /** @return "http" or "https", without the "://" part.
+     */
+    public static String getProto(HttpServletRequest request){
+         if (request==null){
+            return "";
+         }
+         String prot = request.getAuthType();
+         String protocol = prot != null && prot.equals("SSL") ? "https" : "http";
+         return protocol;
+    }
+
+    public static String getProtoHostPort(HttpServletRequest request){
+         if (request==null){
+            return "";
+         }
+         String protocol = getProto(request);
+         int port = request.getServerPort();
+         String portstr;
+         if ( protocol.equals("https") ) {
+            portstr = (port != 443) ? ":"+port : "";
+         } else {
+            portstr =  (port != 80)  ? ":"+port : "";
+         }
+         return protocol+"://"+request.getServerName()+portstr;
+    }
+
+    public static String getProtoHostPort(java.net.URL url){
+         if (url==null){
+            return "";
+         }
+         String protocol = url.getProtocol();
+         int port = url.getPort();
+         String portstr;
+         if ( protocol.equals("https") ) {
+            portstr = (port != 443) ? ":"+port : "";
+         } else {
+            portstr =  (port != 80)  ? ":"+port : "";
+         }
+         return protocol+"://"+url.getHost()+portstr;
+    }
+
+    public static String decodeURLString(HttpServletRequest request, String paramName) throws UnsupportedEncodingException{
+        if ( request == null ) {
+            return "";
+        }
+        String value = request.getParameter(paramName);
+        return decodeURLString(value);
+    }
+
+    public static String decodeURLString(String URLString) throws UnsupportedEncodingException{
+        if ( URLString == null ) {
+            return "";
+        }
+        return URLDecoder.decode(URLString, "UTF-8");
+    }
+
+    public static String encodeURLString(String s){
+        return URLEncoder.encode(s);
+    }
+
+    public static String dumpRequestInfo(HttpServletRequest request){
+        return dumpRequestInfo(request, true, "#FFAD00", true);
+    }
+
+    public static String dumpRequestInfo(HttpServletRequest request, boolean html, String headerColor, boolean dumpHeaders){
+        if (request==null){
+            return "NULL REQUEST";
+        }
+        String result;
+        if (dumpHeaders){
+            result = dumpRequestHeaders(request, html);
+        } else {
+            result = "URL: " +  getFullURL(request);
+        }
+
+        if ( html ) {
+           result = result + "\r\n<br />Params: ";
+        } else {
+           result = result + "\r\nParams: ";
+        }
+        result = result + dumpRequestParams(request, html, headerColor);
+        return result;
+    }
+
+    public static String dumpRequestHeaders(HttpServletRequest request, boolean html){
+        if (request==null){
+            return "NULL REQUEST";
+        }
+        String headers = "";
+        String nl = html ? "\r\n<br />" : "\r\n";
+        for(Enumeration headernames = request.getHeaderNames(); headernames.hasMoreElements();){
+            String headername =  (String)headernames.nextElement();
+            headers += nl + headername+": "+request.getHeader(headername);
+        }
+        String result;
+        if ( html ) {
+            result = "<pre>";
+        } else {
+            result = "";
+        }
+        result = result + "\r\nHeaders: "+ headers
+          +"\r\nmethod: " + request.getMethod()
+          +"\r\nProtocol: " + getProto(request)
+          +"\r\nURL: " +  getFullURL(request);
+          //+"\r\nQuery String: " +  getQueryString()
+          //+"\r\nContent: " + getContent();
+          if ( html ) {
+            result = result + "</pre>";
+          }
+        return result;
+    }
+
+    public static String dumpRequestParams(HttpServletRequest request){
+        return dumpRequestParams(request, true, "#FFAD00");
+    }
+    public static String dumpRequestParams(HttpServletRequest request, boolean html, String headerColor){
+        if (request==null){
+            return "NULL REQUEST";
+        }
+        StringBuffer result = new StringBuffer();
+        if (html) result.append( "<TABLE BORDER='1' cellpadding='0' cellspacing='0'>\n" +
+                "<TR BGCOLOR='"+headerColor+"'>\n" +
+                "<TH>Parameter Name</TH><TH>Parameter Value(s)</TH></TR>");
+        Enumeration paramNames = request.getParameterNames();
+        while(paramNames.hasMoreElements()) {
+            String paramName = (String)paramNames.nextElement();
+
+            if (html) result.append("\r\n<TR><TD>" + paramName + "\r\n</TD><TD>");
+            else      result.append(paramName).append("=");
+
+            String[] paramValues = request.getParameterValues(paramName);
+            if (paramValues.length == 1) {
+                String paramValue = paramValues[0];
+                if (paramValue.length() == 0){
+                    if (html) result.append("<I>No Value</I>");
+                    else result.append("\"\"");
+                } else {
+                    if (html) result.append(paramValue);
+                    else      result.append('\"'+paramValue+'\"');
+                }
+            } else {
+                if (html) result.append("<UL>");
+                for(int i=0; i<paramValues.length; i++) {
+                    if (html) result.append("<LI>" + paramValues[i]+"</LI>");
+                    else      result.append('\"'+paramValues[i]+'\"');
+                }
+                if (html) result.append("</UL>");
+            }
+            if (html) result.append("</TD>\r\n</TR>");
+            else      result.append("\r\n");
+        }
+        if (html) result.append("</TABLE>");
+        return result.toString();
+    }
+
+
+
+    public static class UserIDPassword {
+        public String user_id = "";
+        public String password = "";
+    }
+
+    /*
+
+    public String getUserName(){
+        String remoteUserName = getRemoteUser().user_id;
+        if (remoteUserName.length() > 0){
+            return remoteUserName;
+        } else {
+            String name = getFieldValue("USER");
+            if ( name != null && name.length()>0 ) {
+                return name;
+            }
+        }
+        return "";
+     }
+    */
+    public static UserIDPassword getRemoteUser(HttpServletRequest request){
+        return getRemoteUser(request.getHeader("Authorization"));
+    }
+
+    protected static UserIDPassword getRemoteUser(String authString){
+        UserIDPassword uip = new UserIDPassword();
+        try {   // Decode and decompose the Authorization headervalue
+                if (authString == null){
+                    return uip;
+                }
+                authString = authString.substring(6).trim();
+                byte mydata[];
+//                sun.misc.BASE64Decoder base64 = new sun.misc.BASE64Decoder();
+                org.apache.commons.codec.binary.Base64 base64 = new org.apache.commons.codec.binary.Base64();
+//                mydata = base64.decodeBuffer(authString);
+                mydata = base64.decode(authString);
+                String loginInfo = new String(mydata);
+                int index = loginInfo.indexOf(":");
+                if( index != -1 ){
+                    uip.password = loginInfo.substring(index +1);
+                    uip.user_id = loginInfo.substring(0, index);
+                }
+        } catch(Exception e) {
+            //result will have empty user name
+            System.out.println("ServletTools.getRemoteUser() failed to obtain Authorization info");
+        }
+        return uip;
+    }
+
+    public static String browserVersion(HttpServletRequest request){
+        String agent = request.getHeader("User-Agent");
+        //Examples:
+        //curl/7.5.1
+        //Mozilla/4.0
+        //Mozilla/4.08 [en] (Win95; U ;Nav)
+        //Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; FMRCo cfg. 5.01.2.1a)
+        //Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; FMRCo cfg. 5.01.2.1a)
+               if ( agent == null ) {
+                       return "null";//don't just return "" since this value may be used in a Tcl eval, and it would then disappear.
+               }
+        int start, stop;
+        if ( agent.indexOf("MSIE ") > -1 ) {
+            start = agent.indexOf("MSIE ");
+            stop = agent.indexOf(";", start);
+            stop = stop > -1 ? stop : agent.length(); //safety
+            return agent.substring(start+5, stop).trim();
+        } else {
+            start = agent.indexOf("/");
+            stop = agent.indexOf(" ");
+            stop = stop > -1 ? stop : agent.length(); //for JSSE, there is no space: User-Agent: Java1.3.0_02
+            return agent.substring(start+1, stop).trim();
+        }
+    }
+
+
+    /**
+     * Mozilla/4.79 [en] (Windows NT 5.0; U)
+     * Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6
+     * Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1
+     * Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
+     */
+    public static int findBrowserID(HttpServletRequest request){
+        String browserString = request.getHeader("User-Agent");
+        if (browserString == null)
+            return BROWSER_UNKNOWN;
+        if (browserString.indexOf("MSIE") > -1)
+            return BROWSER_IE4;
+        int iMozilla = browserString.indexOf("Mozilla");
+        if (iMozilla > -1){
+            String ver = browserString.substring(iMozilla + ("Mozilla/".length()) );
+            int iSpace = ver.indexOf(" ");
+            if (iSpace>-1){
+                ver = ver.substring(0, iSpace);
+            }
+            try {
+                Double majorminor =  new Double(ver);
+                if (majorminor.longValue()==4){
+                    return BROWSER_NETSCAPE_4;
+                }
+                if (majorminor.longValue()==5){
+                    return BROWSER_NETSCAPE_5;
+                }
+                if (majorminor.longValue()==6){
+                    return BROWSER_NETSCAPE_6;
+                }
+            } catch (Exception e)  {
+                System.out.println("ERROR: silent after catching error converting browser minor version."+browserString);
+                return BROWSER_NETSCAPE_COMPATIBLE;
+            }
+            return BROWSER_NETSCAPE_COMPATIBLE;
+        }
+        return BROWSER_UNKNOWN;
+    }
+
+    public static boolean isBrowserIE(int bid){
+      return (bid == BROWSER_IE4 || bid == BROWSER_IE)  ? true : false ;
+    }
+
+    public static boolean isBrowserNS4x(int bid){
+      return (bid == BROWSER_NETSCAPE_4) ;
+    }
+
+    public static String getCookieValue(HttpServletRequest request, String name ){
+        Cookie result = findCookie(request, name);
+        if ( result != null ) {
+            return result.getValue();
+        }
+        return "";
+    }
+
+    public static Cookie findCookie(HttpServletRequest request, String name ){
+        if (request == null || name == null) {
+            return null;
+        }
+        Cookie [] cookies = request.getCookies();
+        if ( cookies == null ) {
+            return null;
+        }
+        int cookies_len = cookies.length;
+        for (int i=0; i < cookies_len; i++) {
+            Cookie cookie = cookies[i];
+            if (cookie != null && name.equals(cookie.getName())){
+                return cookie;
+            }
+        }
+        return null;
+    }
+
+    public static Cookie setCookie(HttpServletResponse response, String name, String value){
+        return setCookie(response, name, value, "/", 365*24*60*60);
+    }
+
+    public static Cookie setCookie(HttpServletResponse response, String name, String value, String path, int maxAge){
+        Cookie cookie = new javax.servlet.http.Cookie(name, value);
+        cookie.setMaxAge(maxAge);
+        cookie.setPath(path);
+        response.addCookie(cookie);
+        return cookie;
+    }
+
+
+
+}
+
index 30e265a979bbcb95fc5c8e36c323c5b38f1989a7..2fe719c98129dc108469c137fbe0786a0a4edac3 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts for\r
- * CollectionSpace, an open source collections management system for museums and\r
- * related institutions:\r
- *\r
- * http://www.collectionspace.org http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009-2012 University of California, Berkeley\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0. You may\r
- * not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- *\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import java.net.URI;\r
-import java.util.Map;\r
-import javax.ws.rs.core.UriBuilder;\r
-import javax.ws.rs.core.UriBuilderException;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.UriTemplateFactory.UriTemplateType;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * UriTemplate.java\r
- *\r
- * Generates URI strings by combining a URI template with provided values, which\r
- * replace variables within the template.\r
- */\r
-public abstract class UriTemplate {\r
-\r
-    private static final Logger logger = LoggerFactory.getLogger(UriTemplate.class);\r
-    private UriTemplateType uriTemplateType = null;\r
-    private String uriPath = "";\r
-    private UriBuilder builder = null;\r
-    private final static String EMPTY_STRING = "";\r
-\r
-\r
-    public UriTemplate(UriTemplateType type, String path) {\r
-        setUriTemplateType(type);\r
-        setUriPath(path);\r
-        setBuilder();\r
-    }\r
-    \r
-    private void setUriTemplateType(UriTemplateType type) {\r
-        if (type != null) {\r
-            this.uriTemplateType = type;\r
-        }\r
-    }\r
-\r
-    public UriTemplateType getUriTemplateType() {\r
-        return this.uriTemplateType;\r
-    }\r
-\r
-    private void setUriPath(String path) {\r
-        if (Tools.notBlank(path)) {\r
-            this.uriPath = path;\r
-        }\r
-    }\r
-\r
-    private String getUriPath() {\r
-        return this.uriPath;\r
-    }\r
-\r
-    private void setBuilder() {\r
-        if (builder == null) {\r
-            try {\r
-                builder = UriBuilder.fromPath(getUriPath());\r
-            } catch (IllegalArgumentException iae) {\r
-                logger.warn("URI path was null when attempting to creating new UriTemplate.");\r
-                // No other checking of path format, other than for null values,\r
-                // is performed automatically by this Exception handling.\r
-            }\r
-        }\r
-    }\r
-\r
-    private UriBuilder getBuilder() {\r
-        if (builder == null) {\r
-            setBuilder();\r
-        }\r
-        return builder;\r
-    }\r
-\r
-    @Override\r
-    public String toString() {\r
-        return getUriPath();\r
-    }\r
-\r
-    public String buildUri(Map<String, String> valuesMap) {\r
-        URI uri = null;\r
-        try {\r
-            if (valuesMap == null || valuesMap.isEmpty()) {\r
-                throw new IllegalArgumentException("Map of values for building URI string was null or empty");\r
-            }\r
-            uri = getBuilder().buildFromMap(valuesMap);\r
-        } catch (IllegalArgumentException iae) {\r
-            logger.warn("One or more required values were missing "\r
-                    + "when building URI string: " + iae.getMessage());\r
-        } catch (UriBuilderException ube) {\r
-            logger.warn("URI string can't be constructed due to state of URIBuilder: " + ube.getMessage());\r
-        } finally {\r
-            if (uri != null) {\r
-                return uri.toString();\r
-            } else {\r
-                return EMPTY_STRING;\r
-            }\r
-        }\r
-    }\r
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright © 2009-2012 University of California, Berkeley
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.collectionspace.services.common;
+
+import java.net.URI;
+import java.util.Map;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriBuilderException;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.UriTemplateFactory.UriTemplateType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * UriTemplate.java
+ *
+ * Generates URI strings by combining a URI template with provided values, which
+ * replace variables within the template.
+ */
+public abstract class UriTemplate {
+
+    private static final Logger logger = LoggerFactory.getLogger(UriTemplate.class);
+    private UriTemplateType uriTemplateType = null;
+    private String uriPath = "";
+    private UriBuilder builder = null;
+    private final static String EMPTY_STRING = "";
+
+
+    public UriTemplate(UriTemplateType type, String path) {
+        setUriTemplateType(type);
+        setUriPath(path);
+        setBuilder();
+    }
+    
+    private void setUriTemplateType(UriTemplateType type) {
+        if (type != null) {
+            this.uriTemplateType = type;
+        }
+    }
+
+    public UriTemplateType getUriTemplateType() {
+        return this.uriTemplateType;
+    }
+
+    private void setUriPath(String path) {
+        if (Tools.notBlank(path)) {
+            this.uriPath = path;
+        }
+    }
+
+    private String getUriPath() {
+        return this.uriPath;
+    }
+
+    private void setBuilder() {
+        if (builder == null) {
+            try {
+                builder = UriBuilder.fromPath(getUriPath());
+            } catch (IllegalArgumentException iae) {
+                logger.warn("URI path was null when attempting to creating new UriTemplate.");
+                // No other checking of path format, other than for null values,
+                // is performed automatically by this Exception handling.
+            }
+        }
+    }
+
+    private UriBuilder getBuilder() {
+        if (builder == null) {
+            setBuilder();
+        }
+        return builder;
+    }
+
+    @Override
+    public String toString() {
+        return getUriPath();
+    }
+
+    public String buildUri(Map<String, String> valuesMap) {
+        URI uri = null;
+        try {
+            if (valuesMap == null || valuesMap.isEmpty()) {
+                throw new IllegalArgumentException("Map of values for building URI string was null or empty");
+            }
+            uri = getBuilder().buildFromMap(valuesMap);
+        } catch (IllegalArgumentException iae) {
+            logger.warn("One or more required values were missing "
+                    + "when building URI string: " + iae.getMessage());
+        } catch (UriBuilderException ube) {
+            logger.warn("URI string can't be constructed due to state of URIBuilder: " + ube.getMessage());
+        } finally {
+            if (uri != null) {
+                return uri.toString();
+            } else {
+                return EMPTY_STRING;
+            }
+        }
+    }
 }
\ No newline at end of file
index 4876c15b54e0415c6aab1ca56c710caedcafbbcf..183be45b12cdd9aa2ef316f28f9a32e8b08ab77a 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts for\r
- * CollectionSpace, an open source collections management system for museums and\r
- * related institutions:\r
- *\r
- * http://www.collectionspace.org http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009-2012 University of California, Berkeley\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0. You may\r
- * not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- *\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import java.util.Map;\r
-import org.collectionspace.services.client.AuthorityClient;\r
-\r
-/**\r
- * UriTemplateFactory.java\r
- *\r
- * A factory for building instances of subclasses of URITemplate, based on a\r
- * provided template type.\r
- */\r
-public class UriTemplateFactory {\r
-    \r
-    // For coding convenience, each item in the enum is also available as a field\r
-    // in the enclosing class.\r
-    public final static UriTemplateType RESOURCE = UriTemplateType.RESOURCE;\r
-    public final static UriTemplateType ITEM = UriTemplateType.ITEM;\r
-    public final static UriTemplateType CONTACT = UriTemplateType.CONTACT;\r
-\r
-    public enum UriTemplateType {\r
-\r
-        RESOURCE, ITEM, CONTACT\r
-    };\r
-    \r
-    public final static String SERVICENAME_VAR = "servicename";\r
-    public final static String IDENTIFIER_VAR = "identifier";\r
-    public final static String ITEM_IDENTIFIER_VAR = "itemIdentifier";\r
-    public final static String CONTACT_IDENTIFIER_VAR = "contactIdentifier";\r
-    \r
-    public final static String AUTHORITY_ITEM_PATH_COMPONENT = AuthorityClient.ITEMS;\r
-    // FIXME: Get this currently hard-coded value from an external authoritative source.\r
-    // The only candidate so far identified is ContactClient.SERVICE_PATH_COMPONENT;\r
-    // is this appropriate?\r
-    public final static String CONTACT_PATH_COMPONENT = "contacts";\r
-\r
-    public final static String RESOURCE_PATH_PATTERN =\r
-            "/"\r
-            + "{" + SERVICENAME_VAR + "}"\r
-            + "/"\r
-            + "{" + IDENTIFIER_VAR + "}";\r
-    public final static String ITEM_PATH_PATTERN =\r
-            RESOURCE_PATH_PATTERN\r
-            + "/"\r
-            + AUTHORITY_ITEM_PATH_COMPONENT\r
-            + "/"\r
-            + "{" + ITEM_IDENTIFIER_VAR + "}";\r
-    public final static String CONTACT_PATH_PATTERN =\r
-            ITEM_PATH_PATTERN\r
-            + "/"\r
-            + CONTACT_PATH_COMPONENT\r
-            + "/"\r
-            + "{" + CONTACT_IDENTIFIER_VAR + "}";\r
-\r
-    public static StoredValuesUriTemplate getURITemplate(UriTemplateType type) {\r
-        return new StoredValuesUriTemplate(type, getUriPathPattern(type));\r
-    }\r
-    \r
-    public static StoredValuesUriTemplate getURITemplate(UriTemplateType type, Map<String,String> storedValuesMap) {\r
-        return new StoredValuesUriTemplate(type, getUriPathPattern(type), storedValuesMap);\r
-    }\r
-\r
-    private static String getUriPathPattern(UriTemplateType type) {\r
-        switch (type) {\r
-            case RESOURCE:\r
-                return RESOURCE_PATH_PATTERN;\r
-\r
-            case ITEM:\r
-                return ITEM_PATH_PATTERN;\r
-\r
-            case CONTACT:\r
-                return CONTACT_PATH_PATTERN;\r
-\r
-            default:\r
-                return RESOURCE_PATH_PATTERN;\r
-        }\r
-    }\r
-\r
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright © 2009-2012 University of California, Berkeley
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.collectionspace.services.common;
+
+import java.util.Map;
+import org.collectionspace.services.client.AuthorityClient;
+
+/**
+ * UriTemplateFactory.java
+ *
+ * A factory for building instances of subclasses of URITemplate, based on a
+ * provided template type.
+ */
+public class UriTemplateFactory {
+    
+    // For coding convenience, each item in the enum is also available as a field
+    // in the enclosing class.
+    public final static UriTemplateType RESOURCE = UriTemplateType.RESOURCE;
+    public final static UriTemplateType ITEM = UriTemplateType.ITEM;
+    public final static UriTemplateType CONTACT = UriTemplateType.CONTACT;
+
+    public enum UriTemplateType {
+
+        RESOURCE, ITEM, CONTACT
+    };
+    
+    public final static String SERVICENAME_VAR = "servicename";
+    public final static String IDENTIFIER_VAR = "identifier";
+    public final static String ITEM_IDENTIFIER_VAR = "itemIdentifier";
+    public final static String CONTACT_IDENTIFIER_VAR = "contactIdentifier";
+    
+    public final static String AUTHORITY_ITEM_PATH_COMPONENT = AuthorityClient.ITEMS;
+    // FIXME: Get this currently hard-coded value from an external authoritative source.
+    // The only candidate so far identified is ContactClient.SERVICE_PATH_COMPONENT;
+    // is this appropriate?
+    public final static String CONTACT_PATH_COMPONENT = "contacts";
+
+    public final static String RESOURCE_PATH_PATTERN =
+            "/"
+            + "{" + SERVICENAME_VAR + "}"
+            + "/"
+            + "{" + IDENTIFIER_VAR + "}";
+    public final static String ITEM_PATH_PATTERN =
+            RESOURCE_PATH_PATTERN
+            + "/"
+            + AUTHORITY_ITEM_PATH_COMPONENT
+            + "/"
+            + "{" + ITEM_IDENTIFIER_VAR + "}";
+    public final static String CONTACT_PATH_PATTERN =
+            ITEM_PATH_PATTERN
+            + "/"
+            + CONTACT_PATH_COMPONENT
+            + "/"
+            + "{" + CONTACT_IDENTIFIER_VAR + "}";
+
+    public static StoredValuesUriTemplate getURITemplate(UriTemplateType type) {
+        return new StoredValuesUriTemplate(type, getUriPathPattern(type));
+    }
+    
+    public static StoredValuesUriTemplate getURITemplate(UriTemplateType type, Map<String,String> storedValuesMap) {
+        return new StoredValuesUriTemplate(type, getUriPathPattern(type), storedValuesMap);
+    }
+
+    private static String getUriPathPattern(UriTemplateType type) {
+        switch (type) {
+            case RESOURCE:
+                return RESOURCE_PATH_PATTERN;
+
+            case ITEM:
+                return ITEM_PATH_PATTERN;
+
+            case CONTACT:
+                return CONTACT_PATH_PATTERN;
+
+            default:
+                return RESOURCE_PATH_PATTERN;
+        }
+    }
+
 }
\ No newline at end of file
index 9d438b3c0bae64f5886e7819f9321898b4ccf007..ed2075959f7cc2c5280b527bc090498e4cff15ff 100644 (file)
@@ -1,64 +1,64 @@
-/**\r
- * This document is a part of the source code and related artifacts for\r
- * CollectionSpace, an open source collections management system for museums and\r
- * related institutions:\r
- *\r
- * http://www.collectionspace.org http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009-2012 University of California, Berkeley\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0. You may\r
- * not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- *\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-import java.util.Set;\r
-import org.collectionspace.services.common.UriTemplateRegistryKey;\r
-\r
-/**\r
- * UriTemplateRegistry.java\r
- *\r
- * Maps document types to templates for building URIs, per tenant.\r
- */\r
-public class UriTemplateRegistry extends HashMap<UriTemplateRegistryKey, StoredValuesUriTemplate> {\r
-\r
-    /**\r
-     * Dumps all registry settings for debugging purposes.\r
-     */\r
-    public void dump() {\r
-        System.out.println(this.toString());\r
-    }\r
-    \r
-    /**\r
-     * Dumps all registry settings for debugging purposes.\r
-     * @return a String representation of the URI Template Registry settings\r
-     */\r
-    @Override\r
-    public String toString() {\r
-        StringBuilder sb = new StringBuilder("");\r
-        for (Map.Entry<UriTemplateRegistryKey, StoredValuesUriTemplate> uriTemplateEntry : this.entrySet()) {\r
-            sb.append("Tenant : DocType = ");\r
-            sb.append(uriTemplateEntry.getKey().getTenantId());\r
-            sb.append(" : ");\r
-            sb.append(uriTemplateEntry.getKey().getDocType());\r
-            sb.append('\n');\r
-            sb.append(" Value of Template = ");\r
-            sb.append("  ");\r
-            sb.append(uriTemplateEntry.getValue().toString());\r
-            sb.append('\n');\r
-        }\r
-        return sb.toString();\r
-    }\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright © 2009-2012 University of California, Berkeley
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.collectionspace.services.common;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import org.collectionspace.services.common.UriTemplateRegistryKey;
+
+/**
+ * UriTemplateRegistry.java
+ *
+ * Maps document types to templates for building URIs, per tenant.
+ */
+public class UriTemplateRegistry extends HashMap<UriTemplateRegistryKey, StoredValuesUriTemplate> {
+
+    /**
+     * Dumps all registry settings for debugging purposes.
+     */
+    public void dump() {
+        System.out.println(this.toString());
+    }
+    
+    /**
+     * Dumps all registry settings for debugging purposes.
+     * @return a String representation of the URI Template Registry settings
+     */
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder("");
+        for (Map.Entry<UriTemplateRegistryKey, StoredValuesUriTemplate> uriTemplateEntry : this.entrySet()) {
+            sb.append("Tenant : DocType = ");
+            sb.append(uriTemplateEntry.getKey().getTenantId());
+            sb.append(" : ");
+            sb.append(uriTemplateEntry.getKey().getDocType());
+            sb.append('\n');
+            sb.append(" Value of Template = ");
+            sb.append("  ");
+            sb.append(uriTemplateEntry.getValue().toString());
+            sb.append('\n');
+        }
+        return sb.toString();
+    }
+}
index b7973c1cc2967d27c4c3f65a15509d76b2495d3a..c5a5a40e1d274039ce4d90aba2a929d3e7cad574 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2011 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.dom4j.Document;\r
-import org.dom4j.DocumentHelper;\r
-import org.dom4j.Element;\r
-import org.dom4j.io.HTMLWriter;\r
-import org.dom4j.io.OutputFormat;\r
-import org.xml.sax.Attributes;\r
-import org.xml.sax.ContentHandler;\r
-import org.xml.sax.ErrorHandler;\r
-import org.xml.sax.InputSource;\r
-import org.xml.sax.Locator;\r
-import org.xml.sax.SAXException;\r
-import org.xml.sax.SAXParseException;\r
-import org.xml.sax.XMLReader;\r
-import org.xml.sax.helpers.XMLReaderFactory;\r
-import org.xml.sax.ext.Locator2;\r
-import java.io.StringWriter;\r
-\r
-/** Use XmlSaxFragmenter to parse a large file or InputSource (stream)\r
- *   with SAX, and pass in an instance of IFragmentHandler to parse() so that you can\r
- *   get fragments back that you can parse with DOM or other processing.\r
- *\r
- *   You would typically instantiate and run this class like so:\r
- *\r
- *   IFragmentHandler callback = new MyFragmentHandlerImpl();  //define the interface somewhere.\r
- *   XmlSaxFragmenter.parse("C:\\tmp\\imports.xml", "/document/schema", callback);\r
- *\r
- *   Then, given an XML document like this:\r
- *       &lt;document repository="default" id="123">\r
- *         &lt;schema name="collectionobjects_naturalhistory">\r
- *           &lt;nh-int/>\r
- *           &lt;nh-note/>\r
- *         &lt;/schema>\r
- *         &lt;schema name="collectionobjects_common">\r
- *            &lt;distinguishingFeatures/>\r
- *         &lt;/schema>\r
- *       &lt;/document>\r
- *\r
- *    you'll get two onFragmentReady() events: the first will pass String fragment =\r
- *        &lt;schema name="collectionobjects_naturalhistory">            &lt;nh-int/>\r
- *        &lt;nh-note/>\r
- *    plus some context information, and the second will pass String fragment =\r
- *        &lt;distinguishingFeatures/>\r
- *\r
- *\r
- * @author Laramie Crocker\r
- */\r
-public class XmlSaxFragmenter implements ContentHandler, ErrorHandler {\r
-\r
-    //=============== ContentHandler ====================================================\r
-\r
-    public void setDocumentLocator(Locator locator) {\r
-        if (xmlDeclarationDone){\r
-            return;\r
-        }\r
-        if (locator instanceof Locator2){\r
-            Locator2 l2 = ((Locator2) locator);\r
-            String enc = l2.getEncoding();\r
-            String ver = l2.getXMLVersion();\r
-            append("<?xml version=\""+ver+"\" encoding=\""+enc+"\"?>\r\n");\r
-            xmlDeclarationDone = true;\r
-        } else {\r
-            //System.err.println("Locator2 not found.");\r
-            append("<?xml version=\"1.0\"?>\r\n");\r
-            xmlDeclarationDone = true;\r
-        }\r
-        //more info available from Locator if needed: locator.getPublicId(), locator.getSystemId();\r
-    }\r
-\r
-    public void startDocument() throws SAXException {\r
-        document = DocumentHelper.createDocument();\r
-    }\r
-\r
-    public void endDocument() throws SAXException {\r
-        if (fragmentHandler!=null) {\r
-            fragmentHandler.onEndDocument(document, fragmentIndex + 1);\r
-        }\r
-    }\r
-\r
-    public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {\r
-        String attsString = attsToStr(atts);\r
-        append("<" + name(qName, localName) + attsString + ">");\r
-        if (inFragment){\r
-            inFragmentDepth++;\r
-            return;\r
-        }\r
-        if (currentElement == null){\r
-            currentElement =  document.addElement(qName);\r
-        } else {\r
-            Element element = DocumentHelper.createElement(qName);\r
-            currentElement.add(element);\r
-            previousElement = currentElement;\r
-            currentElement = element;\r
-        }\r
-        addAttributes(currentElement, atts);\r
-        String currentPath = currentElement.getPath();\r
-        if (currentPath.equals(chopPath)){\r
-            buffer = new StringBuffer();\r
-            inFragment = true;\r
-            if (includeParent){\r
-                append("<" + name(qName, localName) + attsString + ">");\r
-            }\r
-        }\r
-    }\r
-\r
-    public void endElement(String uri, String localName, String qName) throws SAXException {\r
-        if (inFragment && (inFragmentDepth>0)){\r
-            append("</" + name(qName, localName) + '>');\r
-        } else if (inFragment && inFragmentDepth == 0 && includeParent){\r
-            append("</" + name(qName, localName) + '>');\r
-        }\r
-        if (inFragment && (inFragmentDepth==0)){\r
-            if (fragmentHandler!=null) {\r
-                fragmentIndex++;\r
-                fragmentHandler.onFragmentReady(document,\r
-                                                currentElement,\r
-                                                currentElement.getPath(),\r
-                                                fragmentIndex,\r
-                                                buffer.toString());\r
-            }\r
-            inFragment = false;\r
-            currentElement = previousElement;\r
-        }\r
-        if (inFragment){\r
-            inFragmentDepth--;\r
-        }\r
-    }\r
-\r
-    public void characters(char ch[], int start, int length) throws SAXException {\r
-        String chars = new String(ch, start, length);\r
-        append(chars);\r
-    }\r
-\r
-    public void startPrefixMapping(String prefix, String uri) throws SAXException {\r
-    }\r
-    public void endPrefixMapping(String prefix) throws SAXException {\r
-    }\r
-    public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {\r
-    }\r
-    public void processingInstruction(String target, String data) throws SAXException {\r
-    }\r
-    public void skippedEntity(String name) throws SAXException {\r
-    }\r
-\r
-    //=============== ErrorHandler ====================================================\r
-\r
-    public void error(SAXParseException exception){\r
-        System.err.println("ERROR:"+exception);\r
-    }\r
-    public void fatalError(SAXParseException exception){\r
-        System.err.println("FATAL_ERROR:"+exception);\r
-    }\r
-    public void warning(SAXParseException exception){\r
-        System.err.println("WARNING:"+exception);\r
-    }\r
-\r
-    //================ Helper Methods ===================================================\r
-\r
-    private Document document;\r
-    private Element currentElement;\r
-    private Element previousElement;\r
-    private StringBuffer buffer = new StringBuffer();\r
-\r
-    private boolean xmlDeclarationDone = false;\r
-    private boolean inFragment = false;\r
-    private int inFragmentDepth = 0;\r
-    private int fragmentIndex = -1;  //zero-based.  Used for informational purposes only, to report to the IFragmentHandler.\r
-\r
-    private String chopPath = "";\r
-    public String getChopPath() {\r
-        return chopPath;\r
-    }\r
-    /** You should not set the chopPath directly; instead you must set it in the call to parse(). */\r
-    protected void setChopPath(String chopPath) {\r
-        this.chopPath = chopPath;\r
-    }\r
-\r
-    private boolean includeParent = false;\r
-    public boolean isIncludeParent() {\r
-        return includeParent;\r
-    }\r
-    public void setIncludeParent(boolean includeParent) {\r
-        this.includeParent = includeParent;\r
-    }\r
-\r
-\r
-    private IFragmentHandler fragmentHandler;\r
-    public IFragmentHandler getFragmentHandler() {\r
-        return fragmentHandler;\r
-    }\r
-    /** You should not set the FragmentHandler directly; instead you must set it in the call to parse(). */\r
-    protected void setFragmentHandler(IFragmentHandler fragmentHandler) {\r
-        this.fragmentHandler = fragmentHandler;\r
-    }\r
-\r
-    protected void append(String str){\r
-        buffer.append(str);\r
-    }\r
-\r
-    protected String name(String qn, String ln){\r
-        if (Tools.isEmpty(qn)){\r
-            return ln;\r
-        }\r
-        if (qn.equals(ln)){\r
-            return ln;\r
-        }\r
-        return qn;\r
-    }\r
-\r
-    //NOTE: we don't deal with this here because we don't need to\r
-    // actually understand the namespace uri:\r
-    // a.getURI(i)\r
-    protected String attsToStr(Attributes a){\r
-        StringBuffer b = new StringBuffer();\r
-        String qn, ln;\r
-        int attsLen = a.getLength();\r
-        for (int i=0; i<attsLen; i++){\r
-            b.append(' ');\r
-            qn = a.getQName(i);\r
-            ln = a.getLocalName(i);\r
-            b.append(name(qn, ln)).append("=\"")\r
-             .append(a.getValue(i)).append('\"');\r
-        }\r
-        return b.toString();\r
-    }\r
-\r
-    protected void addAttributes(Element cur, Attributes a){\r
-        int attsLen = a.getLength();\r
-        for (int i=0; i<attsLen; i++){\r
-            cur.addAttribute(a.getQName(i), a.getValue(i));\r
-        }\r
-    }\r
-\r
-\r
-    /** This method takes a filename of a local file only; InputSource is not implemented yet.\r
-     *\r
-     * @param theFileName the filename of a local file, which should be valid XML.\r
-     * @param chopPath    the path from the root of the document to the parent element\r
-     *                    of the fragment you want.\r
-     * @param handler     An instance of IFragmentHandler that you define to get the onFragmentReady event\r
-     *                    which will give you the fragment and some context information.\r
-     * @param includeParent  If you set this to true, you will get the element described by chopPath included in the fragment, otherwise,\r
-     *                       it will not appear in the fragment; in either case, the element will be available in the Document context and the\r
-     *                       Element fragmentParent in the callback IFragmentHandler.onFragmentReady().\r
-     */\r
-    public static void parse(String theFileName,\r
-                             String chopPath,\r
-                             IFragmentHandler handler,\r
-                             boolean includeParent){\r
-        try{\r
-            XMLReader parser = setupParser(chopPath, handler, includeParent);\r
-            parser.parse(theFileName);\r
-        } catch(Exception e) {\r
-            e.printStackTrace();\r
-        }\r
-    }\r
-\r
-    public static void parse(InputSource inputSource,\r
-                             String chopPath,\r
-                             IFragmentHandler handler,\r
-                             boolean includeParent){\r
-        try{\r
-            XMLReader parser = setupParser(chopPath, handler, includeParent);\r
-            parser.parse(inputSource);\r
-        } catch(Exception e) {\r
-            e.printStackTrace();\r
-        }\r
-    }\r
-\r
-    protected static XMLReader setupParser(String chopPath,\r
-                                      IFragmentHandler handler,\r
-                                      boolean includeParent) throws Exception {\r
-            XMLReader parser = XMLReaderFactory.createXMLReader();\r
-            XmlSaxFragmenter fragmenter = new XmlSaxFragmenter();\r
-            fragmenter.setChopPath(chopPath);\r
-            fragmenter.setFragmentHandler(handler);\r
-            fragmenter.setIncludeParent(includeParent);\r
-            parser.setContentHandler(fragmenter);\r
-            parser.setErrorHandler(fragmenter);\r
-            parser.setFeature("http://xml.org/sax/features/namespace-prefixes", true);\r
-            return parser;\r
-    }\r
-\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2011 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common;
+
+import org.collectionspace.services.common.api.Tools;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.io.HTMLWriter;
+import org.dom4j.io.OutputFormat;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+import org.xml.sax.ext.Locator2;
+import java.io.StringWriter;
+
+/** Use XmlSaxFragmenter to parse a large file or InputSource (stream)
+ *   with SAX, and pass in an instance of IFragmentHandler to parse() so that you can
+ *   get fragments back that you can parse with DOM or other processing.
+ *
+ *   You would typically instantiate and run this class like so:
+ *
+ *   IFragmentHandler callback = new MyFragmentHandlerImpl();  //define the interface somewhere.
+ *   XmlSaxFragmenter.parse("C:\\tmp\\imports.xml", "/document/schema", callback);
+ *
+ *   Then, given an XML document like this:
+ *       &lt;document repository="default" id="123">
+ *         &lt;schema name="collectionobjects_naturalhistory">
+ *           &lt;nh-int/>
+ *           &lt;nh-note/>
+ *         &lt;/schema>
+ *         &lt;schema name="collectionobjects_common">
+ *            &lt;distinguishingFeatures/>
+ *         &lt;/schema>
+ *       &lt;/document>
+ *
+ *    you'll get two onFragmentReady() events: the first will pass String fragment =
+ *        &lt;schema name="collectionobjects_naturalhistory">            &lt;nh-int/>
+ *        &lt;nh-note/>
+ *    plus some context information, and the second will pass String fragment =
+ *        &lt;distinguishingFeatures/>
+ *
+ *
+ * @author Laramie Crocker
+ */
+public class XmlSaxFragmenter implements ContentHandler, ErrorHandler {
+
+    //=============== ContentHandler ====================================================
+
+    public void setDocumentLocator(Locator locator) {
+        if (xmlDeclarationDone){
+            return;
+        }
+        if (locator instanceof Locator2){
+            Locator2 l2 = ((Locator2) locator);
+            String enc = l2.getEncoding();
+            String ver = l2.getXMLVersion();
+            append("<?xml version=\""+ver+"\" encoding=\""+enc+"\"?>\r\n");
+            xmlDeclarationDone = true;
+        } else {
+            //System.err.println("Locator2 not found.");
+            append("<?xml version=\"1.0\"?>\r\n");
+            xmlDeclarationDone = true;
+        }
+        //more info available from Locator if needed: locator.getPublicId(), locator.getSystemId();
+    }
+
+    public void startDocument() throws SAXException {
+        document = DocumentHelper.createDocument();
+    }
+
+    public void endDocument() throws SAXException {
+        if (fragmentHandler!=null) {
+            fragmentHandler.onEndDocument(document, fragmentIndex + 1);
+        }
+    }
+
+    public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
+        String attsString = attsToStr(atts);
+        append("<" + name(qName, localName) + attsString + ">");
+        if (inFragment){
+            inFragmentDepth++;
+            return;
+        }
+        if (currentElement == null){
+            currentElement =  document.addElement(qName);
+        } else {
+            Element element = DocumentHelper.createElement(qName);
+            currentElement.add(element);
+            previousElement = currentElement;
+            currentElement = element;
+        }
+        addAttributes(currentElement, atts);
+        String currentPath = currentElement.getPath();
+        if (currentPath.equals(chopPath)){
+            buffer = new StringBuffer();
+            inFragment = true;
+            if (includeParent){
+                append("<" + name(qName, localName) + attsString + ">");
+            }
+        }
+    }
+
+    public void endElement(String uri, String localName, String qName) throws SAXException {
+        if (inFragment && (inFragmentDepth>0)){
+            append("</" + name(qName, localName) + '>');
+        } else if (inFragment && inFragmentDepth == 0 && includeParent){
+            append("</" + name(qName, localName) + '>');
+        }
+        if (inFragment && (inFragmentDepth==0)){
+            if (fragmentHandler!=null) {
+                fragmentIndex++;
+                fragmentHandler.onFragmentReady(document,
+                                                currentElement,
+                                                currentElement.getPath(),
+                                                fragmentIndex,
+                                                buffer.toString());
+            }
+            inFragment = false;
+            currentElement = previousElement;
+        }
+        if (inFragment){
+            inFragmentDepth--;
+        }
+    }
+
+    public void characters(char ch[], int start, int length) throws SAXException {
+        String chars = new String(ch, start, length);
+        append(chars);
+    }
+
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
+    }
+    public void endPrefixMapping(String prefix) throws SAXException {
+    }
+    public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {
+    }
+    public void processingInstruction(String target, String data) throws SAXException {
+    }
+    public void skippedEntity(String name) throws SAXException {
+    }
+
+    //=============== ErrorHandler ====================================================
+
+    public void error(SAXParseException exception){
+        System.err.println("ERROR:"+exception);
+    }
+    public void fatalError(SAXParseException exception){
+        System.err.println("FATAL_ERROR:"+exception);
+    }
+    public void warning(SAXParseException exception){
+        System.err.println("WARNING:"+exception);
+    }
+
+    //================ Helper Methods ===================================================
+
+    private Document document;
+    private Element currentElement;
+    private Element previousElement;
+    private StringBuffer buffer = new StringBuffer();
+
+    private boolean xmlDeclarationDone = false;
+    private boolean inFragment = false;
+    private int inFragmentDepth = 0;
+    private int fragmentIndex = -1;  //zero-based.  Used for informational purposes only, to report to the IFragmentHandler.
+
+    private String chopPath = "";
+    public String getChopPath() {
+        return chopPath;
+    }
+    /** You should not set the chopPath directly; instead you must set it in the call to parse(). */
+    protected void setChopPath(String chopPath) {
+        this.chopPath = chopPath;
+    }
+
+    private boolean includeParent = false;
+    public boolean isIncludeParent() {
+        return includeParent;
+    }
+    public void setIncludeParent(boolean includeParent) {
+        this.includeParent = includeParent;
+    }
+
+
+    private IFragmentHandler fragmentHandler;
+    public IFragmentHandler getFragmentHandler() {
+        return fragmentHandler;
+    }
+    /** You should not set the FragmentHandler directly; instead you must set it in the call to parse(). */
+    protected void setFragmentHandler(IFragmentHandler fragmentHandler) {
+        this.fragmentHandler = fragmentHandler;
+    }
+
+    protected void append(String str){
+        buffer.append(str);
+    }
+
+    protected String name(String qn, String ln){
+        if (Tools.isEmpty(qn)){
+            return ln;
+        }
+        if (qn.equals(ln)){
+            return ln;
+        }
+        return qn;
+    }
+
+    //NOTE: we don't deal with this here because we don't need to
+    // actually understand the namespace uri:
+    // a.getURI(i)
+    protected String attsToStr(Attributes a){
+        StringBuffer b = new StringBuffer();
+        String qn, ln;
+        int attsLen = a.getLength();
+        for (int i=0; i<attsLen; i++){
+            b.append(' ');
+            qn = a.getQName(i);
+            ln = a.getLocalName(i);
+            b.append(name(qn, ln)).append("=\"")
+             .append(a.getValue(i)).append('\"');
+        }
+        return b.toString();
+    }
+
+    protected void addAttributes(Element cur, Attributes a){
+        int attsLen = a.getLength();
+        for (int i=0; i<attsLen; i++){
+            cur.addAttribute(a.getQName(i), a.getValue(i));
+        }
+    }
+
+
+    /** This method takes a filename of a local file only; InputSource is not implemented yet.
+     *
+     * @param theFileName the filename of a local file, which should be valid XML.
+     * @param chopPath    the path from the root of the document to the parent element
+     *                    of the fragment you want.
+     * @param handler     An instance of IFragmentHandler that you define to get the onFragmentReady event
+     *                    which will give you the fragment and some context information.
+     * @param includeParent  If you set this to true, you will get the element described by chopPath included in the fragment, otherwise,
+     *                       it will not appear in the fragment; in either case, the element will be available in the Document context and the
+     *                       Element fragmentParent in the callback IFragmentHandler.onFragmentReady().
+     */
+    public static void parse(String theFileName,
+                             String chopPath,
+                             IFragmentHandler handler,
+                             boolean includeParent){
+        try{
+            XMLReader parser = setupParser(chopPath, handler, includeParent);
+            parser.parse(theFileName);
+        } catch(Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void parse(InputSource inputSource,
+                             String chopPath,
+                             IFragmentHandler handler,
+                             boolean includeParent){
+        try{
+            XMLReader parser = setupParser(chopPath, handler, includeParent);
+            parser.parse(inputSource);
+        } catch(Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    protected static XMLReader setupParser(String chopPath,
+                                      IFragmentHandler handler,
+                                      boolean includeParent) throws Exception {
+            XMLReader parser = XMLReaderFactory.createXMLReader();
+            XmlSaxFragmenter fragmenter = new XmlSaxFragmenter();
+            fragmenter.setChopPath(chopPath);
+            fragmenter.setFragmentHandler(handler);
+            fragmenter.setIncludeParent(includeParent);
+            parser.setContentHandler(fragmenter);
+            parser.setErrorHandler(fragmenter);
+            parser.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
+            return parser;
+    }
+
+}
index 14c562c1f0fcaeac25bc84b1132928cf8fd60aa5..e8c5b560e31b1cac7668529a95a11a32de749096 100644 (file)
-package org.collectionspace.services.common.authorization_mgt;\r
-\r
-import java.sql.Connection;\r
-import java.sql.PreparedStatement;\r
-import java.sql.ResultSet;\r
-import java.sql.SQLException;\r
-import java.sql.Statement;\r
-import java.util.ArrayList;\r
-import java.util.Date;\r
-import java.util.HashMap;\r
-import java.util.Hashtable;\r
-import java.util.List;\r
-import java.util.UUID;\r
-\r
-import javax.naming.NamingException;\r
-import javax.persistence.EntityManager;\r
-import javax.persistence.EntityManagerFactory;\r
-\r
-import org.collectionspace.authentication.AuthN;\r
-import org.collectionspace.services.authorization.AuthZ;\r
-import org.collectionspace.services.authorization.CSpaceAction;\r
-import org.collectionspace.services.authorization.PermissionException;\r
-import org.collectionspace.services.authorization.PermissionRole;\r
-import org.collectionspace.services.authorization.PermissionRoleRel;\r
-import org.collectionspace.services.authorization.PermissionValue;\r
-import org.collectionspace.services.authorization.Role;\r
-import org.collectionspace.services.authorization.RoleValue;\r
-import org.collectionspace.services.authorization.SubjectType;\r
-import org.collectionspace.services.authorization.URIResourceImpl;\r
-import org.collectionspace.services.authorization.perms.ActionType;\r
-import org.collectionspace.services.authorization.perms.EffectType;\r
-import org.collectionspace.services.authorization.perms.Permission;\r
-import org.collectionspace.services.authorization.perms.PermissionAction;\r
-\r
-import org.collectionspace.services.client.Profiler;\r
-import org.collectionspace.services.client.RoleClient;\r
-import org.collectionspace.services.client.workflow.WorkflowClient;\r
-import org.collectionspace.services.common.config.ServiceConfigUtils;\r
-import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;\r
-import org.collectionspace.services.common.context.ServiceBindingUtils;\r
-import org.collectionspace.services.common.document.DocumentHandler;\r
-import org.collectionspace.services.common.security.SecurityUtils;\r
-import org.collectionspace.services.common.storage.DatabaseProductType;\r
-import org.collectionspace.services.common.storage.JDBCTools;\r
-import org.collectionspace.services.common.storage.jpa.JpaStorageUtils;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-import org.collectionspace.services.config.tenant.TenantBindingType;\r
-\r
-import org.collectionspace.services.lifecycle.Lifecycle;\r
-import org.collectionspace.services.lifecycle.TransitionDef;\r
-import org.collectionspace.services.lifecycle.TransitionDefList;\r
-\r
-//import org.mortbay.log.Log;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import org.springframework.security.acls.model.AlreadyExistsException;\r
-\r
-\r
-public class AuthorizationCommon {\r
-       \r
-       final public static String REFRESH_AUTZ_PROP = "refreshAuthZOnStartup";\r
-    //\r
-    // ActionGroup labels/constants\r
-    //\r
-       \r
-       // for READ-WRITE\r
-    final public static String ACTIONGROUP_CRUDL_NAME = "CRUDL";\r
-    final public static ActionType[] ACTIONSET_CRUDL = {ActionType.CREATE, ActionType.READ, ActionType.UPDATE, ActionType.DELETE, ActionType.SEARCH};\r
-    // for READ-ONLY\r
-    final public static String ACTIONGROUP_RL_NAME = "RL";\r
-    final public static ActionType[] ACTIONSET_RL = {ActionType.READ, ActionType.SEARCH};\r
-\r
-    \r
-       /*\r
-        * Inner class to deal with predefined ADMIN and READER action groupds\r
-        */\r
-       public class ActionGroup {\r
-               String name;\r
-               ActionType[] actions;\r
-       }\r
-       \r
-       static ActionGroup ACTIONGROUP_CRUDL;\r
-       static ActionGroup ACTIONGROUP_RL;\r
-       \r
-       // A static block to initialize the predefined action groups\r
-       static {\r
-               AuthorizationCommon ac = new AuthorizationCommon();\r
-               // For admin\r
-               ACTIONGROUP_CRUDL = ac.new ActionGroup();\r
-               ACTIONGROUP_CRUDL.name = ACTIONGROUP_CRUDL_NAME;\r
-               ACTIONGROUP_CRUDL.actions = ACTIONSET_CRUDL;\r
-               // For reader\r
-               ACTIONGROUP_RL = ac.new ActionGroup();\r
-               ACTIONGROUP_RL.name = ACTIONGROUP_RL_NAME;\r
-               ACTIONGROUP_RL.actions = ACTIONSET_RL;\r
-\r
-       }\r
-       \r
-    final static Logger logger = LoggerFactory.getLogger(AuthorizationCommon.class);\r
-\r
-    //\r
-    // The "super" role has a predefined ID of "0" and a tenant ID of "0";\r
-    //\r
-    final public static String ROLE_ALL_TENANTS_MANAGER = "ALL_TENANTS_MANAGER";\r
-    final public static String ROLE_ALL_TENANTS_MANAGER_ID = "0";\r
-    final public static String ALL_TENANTS_MANAGER_TENANT_ID = "0";\r
-\r
-    final public static String ROLE_TENANT_ADMINISTRATOR = "TENANT_ADMINISTRATOR";\r
-    final public static String ROLE_TENANT_READER = "TENANT_READER";\r
-       \r
-    public static final String TENANT_MANAGER_USER = "tenantManager"; \r
-    public static final String TENANT_MANAGER_SCREEN_NAME = TENANT_MANAGER_USER; \r
-    public static final String DEFAULT_TENANT_MANAGER_PASSWORD = "manage"; \r
-    public static final String DEFAULT_TENANT_MANAGER_EMAIL = "tenantManager@collectionspace.org"; \r
-    \r
-    public static final String TENANT_ADMIN_ACCT_PREFIX = "admin@"; \r
-    public static final String TENANT_READER_ACCT_PREFIX = "reader@"; \r
-    public static final String ROLE_PREFIX = "ROLE_"; \r
-    public static final String SPRING_ADMIN_ROLE = "ROLE_SPRING_ADMIN"; \r
-    public static final String TENANT_ADMIN_ROLE_SUFFIX = "_TENANT_ADMINISTRATOR"; \r
-    public static final String TENANT_READER_ROLE_SUFFIX = "_TENANT_READER"; \r
-    public static final String DEFAULT_ADMIN_PASSWORD = "Administrator";\r
-    public static final String DEFAULT_READER_PASSWORD = "reader";\r
-\r
-    public static final String ROLE_SPRING_ADMIN_ID = "-1";\r
-    public static final String ROLE_SPRING_ADMIN_NAME = "ROLE_SPRING_ADMIN";\r
-    \r
-    // SQL for init tasks\r
-       final private static String INSERT_ACCOUNT_ROLE_SQL_MYSQL = \r
-                       "INSERT INTO accounts_roles(account_id, user_id, role_id, role_name, created_at)"\r
-                                       +" VALUES(?, ?, ?, ?, now())";\r
-       final private static String INSERT_ACCOUNT_ROLE_SQL_POSTGRES =\r
-                       "INSERT INTO accounts_roles(HJID, account_id, user_id, role_id, role_name, created_at)"\r
-                                       +" VALUES(nextval('hibernate_sequence'), ?, ?, ?, ?, now())";\r
-       final private static String QUERY_USERS_SQL = \r
-               "SELECT username FROM users WHERE username LIKE '"\r
-                       +TENANT_ADMIN_ACCT_PREFIX+"%' OR username LIKE '"+TENANT_READER_ACCT_PREFIX+"%'";\r
-       final private static String INSERT_USER_SQL = \r
-                       "INSERT INTO users (username,passwd, created_at) VALUES (?,?, now())";\r
-       final private static String INSERT_ACCOUNT_SQL = \r
-                       "INSERT INTO accounts_common "\r
-                                       + "(csid, email, userid, status, screen_name, metadata_protection, roles_protection, created_at) "\r
-                                       + "VALUES (?,?,?,'ACTIVE',?, 'immutable', 'immutable', now())";\r
-       \r
-       // TENANT MANAGER specific SQL\r
-       final private static String QUERY_TENANT_MGR_USER_SQL = \r
-               "SELECT username FROM users WHERE username = '"+TENANT_MANAGER_USER+"'";\r
-       final private static String GET_TENANT_MGR_ROLE_SQL =\r
-                       "SELECT csid from roles WHERE tenant_id='"+ALL_TENANTS_MANAGER_TENANT_ID+"' and rolename=?";\r
-\r
-    public static Role getRole(String tenantId, String displayName) {\r
-       Role role = null;\r
-       \r
-       String roleName = AuthorizationCommon.getQualifiedRoleName(tenantId, displayName);\r
-       role = AuthorizationStore.getRoleByName(roleName, tenantId);\r
-        \r
-        return role;\r
-    }\r
-    \r
-    public static Role getRole(EntityManager em, String tenantId, String displayName) {\r
-       Role role = null;\r
-       \r
-       String roleName = AuthorizationCommon.getQualifiedRoleName(tenantId, displayName);\r
-       role = AuthorizationStore.getRoleByName(em, roleName, tenantId);\r
-        \r
-        return role;\r
-    }\r
-    \r
-    \r
-    public static Role createRole(String tenantId, String name, String description) {\r
-       return createRole(tenantId, name, description, false /* mutable by default */);\r
-    }\r
-    \r
-    public static Role createRole(String tenantId, String name, String description, boolean immutable) {\r
-       Role role = new Role();\r
-       \r
-        role.setCreatedAtItem(new Date());\r
-        role.setDisplayName(name);\r
-       String roleName = AuthorizationCommon.getQualifiedRoleName(tenantId, name);     \r
-        role.setRoleName(roleName);\r
-        String id = UUID.randomUUID().toString(); //FIXME: The qualified role name should be unique enough to use as an ID/key\r
-        role.setCsid(id);\r
-               role.setDescription(description);\r
-        role.setTenantId(tenantId);\r
-        if (immutable == true) {\r
-               role.setMetadataProtection(RoleClient.IMMUTABLE);\r
-               role.setPermsProtection(RoleClient.IMMUTABLE);\r
-        }\r
-       \r
-       return role;\r
-    }\r
-    \r
-    /**\r
-     * Add permission to the Spring Security tables\r
-     * with assumption that resource is of type URI\r
-     * @param permission configuration\r
-     */\r
-    public static void addPermissionsForUri(Permission perm,\r
-            PermissionRole permRole) throws PermissionException {\r
-       //\r
-       // First check the integrity of the incoming arguments.\r
-       //\r
-        if (!perm.getCsid().equals(permRole.getPermission().get(0).getPermissionId())) {\r
-            throw new IllegalArgumentException("permission ids do not"\r
-                    + " match for role=" + permRole.getRole().get(0).getRoleName()\r
-                    + " with permissionId=" + permRole.getPermission().get(0).getPermissionId()\r
-                    + " for permission with csid=" + perm.getCsid());\r
-        }\r
-        \r
-        List<String> principals = new ArrayList<String>();        \r
-        for (RoleValue roleValue : permRole.getRole()) {\r
-            principals.add(roleValue.getRoleName());\r
-        }\r
-        List<PermissionAction> permActions = perm.getAction();\r
-        for (PermissionAction permAction : permActions) {\r
-               try {\r
-                   CSpaceAction action = URIResourceImpl.getAction(permAction.getName()); \r
-                   URIResourceImpl uriRes = new URIResourceImpl(perm.getTenantId(),\r
-                           perm.getResourceName(), action);\r
-                   boolean grant = perm.getEffect().equals(EffectType.PERMIT) ? true : false;\r
-                   AuthZ.get().addPermissions(uriRes, principals.toArray(new String[0]), grant);//CSPACE-4967\r
-               } catch (PermissionException e) {\r
-                       //\r
-                       // Only throw the exception if it is *not* an already-exists exception\r
-                       //\r
-                       if (e.getCause() instanceof AlreadyExistsException == false) {\r
-                               throw e;\r
-                       }\r
-               }\r
-        }\r
-    }\r
-    \r
-    private static Connection getConnection(String databaseName) throws NamingException, SQLException {\r
-        return JDBCTools.getConnection(JDBCTools.CSPACE_DATASOURCE_NAME,\r
-                       databaseName);\r
-    }\r
-    \r
-    /*\r
-     * Spring security seems to require that all of our role names start\r
-     * with the ROLE_PREFIX string.\r
-     */\r
-    public static String getQualifiedRoleName(String tenantId, String name) {\r
-       String result = name;\r
-       \r
-       String qualifiedName = ROLE_PREFIX + tenantId.toUpperCase() + "_" + name.toUpperCase();         \r
-       if (name.equals(qualifiedName) == false) {\r
-               result = qualifiedName;\r
-       }\r
-       \r
-       return result;\r
-    }\r
-        \r
-    private static ActionGroup getActionGroup(String actionGroupStr) {\r
-       ActionGroup result = null;\r
-       \r
-       if (actionGroupStr.equalsIgnoreCase(ACTIONGROUP_CRUDL_NAME)) {\r
-               result = ACTIONGROUP_CRUDL;\r
-       } else if (actionGroupStr.equalsIgnoreCase(ACTIONGROUP_RL_NAME)) {\r
-               result = ACTIONGROUP_RL;\r
-       }\r
-       \r
-       return result;\r
-    }\r
-    \r
-    public static Permission createPermission(String tenantId,\r
-               String resourceName,\r
-               String description,\r
-               String actionGroupStr) {\r
-       Permission result = null;\r
-       \r
-       ActionGroup actionGroup = getActionGroup(actionGroupStr);\r
-       result = createPermission(tenantId, resourceName, description, actionGroup);\r
-       \r
-       return result;\r
-    }\r
-    \r
-    private static Permission createPermission(String tenantId,\r
-               String resourceName,\r
-               String description,\r
-               ActionGroup actionGroup) {\r
-        String id = tenantId\r
-                       + "-" + resourceName.replace('/', '_') // Remove the slashes so the ID can be used in a URI/URL\r
-                       + "-" + actionGroup.name;\r
-        Permission perm = new Permission();\r
-        perm.setCsid(id);\r
-        perm.setDescription(description);\r
-        perm.setCreatedAtItem(new Date());\r
-        perm.setResourceName(resourceName.toLowerCase().trim());\r
-        perm.setEffect(EffectType.PERMIT);\r
-        perm.setTenantId(tenantId);\r
-        \r
-        perm.setActionGroup(actionGroup.name);\r
-        ArrayList<PermissionAction> pas = new ArrayList<PermissionAction>();\r
-        perm.setAction(pas);\r
-        for (ActionType actionType : actionGroup.actions) {\r
-               PermissionAction permAction = createPermissionAction(perm, actionType);\r
-               pas.add(permAction);\r
-        }\r
-        \r
-        return perm;\r
-    }\r
-    \r
-    private static Permission createWorkflowPermission(TenantBindingType tenantBinding,\r
-               ServiceBindingType serviceBinding,\r
-               TransitionDef transitionDef,\r
-               ActionGroup actionGroup)\r
-    {\r
-       Permission result = null;\r
-       String workFlowServiceSuffix;\r
-       String transitionName;\r
-       if (transitionDef != null) {\r
-               transitionName = transitionDef.getName();\r
-               workFlowServiceSuffix = WorkflowClient.SERVICE_AUTHZ_SUFFIX;\r
-       } else {\r
-               transitionName = ""; //since the transitionDef was null, we're assuming that this is the base workflow permission to be created                 \r
-               workFlowServiceSuffix = WorkflowClient.SERVICE_PATH;\r
-       }\r
-       \r
-       String tenantId = tenantBinding.getId();\r
-       String resourceName = "/"\r
-                       + serviceBinding.getName().toLowerCase().trim()\r
-                       + workFlowServiceSuffix\r
-                       + transitionName;\r
-       String description = "A generated workflow permission for actiongroup " + actionGroup.name;\r
-       result = createPermission(tenantId, resourceName, description, actionGroup);\r
-       \r
-       if (logger.isDebugEnabled() == true) {\r
-               logger.debug("Generated a workflow permission: "\r
-                               + result.getResourceName()\r
-                               + ":" + transitionName\r
-                               + ":" + "tenant id=" + result.getTenantId()\r
-                               + ":" + actionGroup.name);\r
-       }\r
-       \r
-       return result;\r
-    }\r
-    \r
-    private static PermissionRole createPermissionRole(EntityManager em,\r
-               Permission permission,\r
-               Role role,\r
-               boolean enforceTenancy) throws Exception\r
-    {\r
-       PermissionRole permRole = new PermissionRole();\r
-       // Check to see if the tenant ID of the permission and the tenant ID of the role match\r
-       boolean tenantIdsMatch = role.getTenantId().equalsIgnoreCase(permission.getTenantId());\r
-       if (tenantIdsMatch == false && enforceTenancy == false) {\r
-               tenantIdsMatch = true; // If we don't need to enforce tenancy then we'll just consider them matched.\r
-       }\r
-                       \r
-               if (tenantIdsMatch == true) {\r
-               permRole.setSubject(SubjectType.ROLE);\r
-               //\r
-               // Set of the permission value list of the permrole\r
-               //\r
-               List<PermissionValue> permValues = new ArrayList<PermissionValue>();\r
-               PermissionValue permValue = new PermissionValue();\r
-               permValue.setPermissionId(permission.getCsid());\r
-               permValue.setResourceName(permission.getResourceName().toLowerCase());\r
-               permValue.setActionGroup(permission.getActionGroup());\r
-               permValues.add(permValue);\r
-               permRole.setPermission(permValues);\r
-               //\r
-               // Set of the role value list of the permrole\r
-               //\r
-               List<RoleValue> roleValues = new ArrayList<RoleValue>();\r
-               RoleValue rv = new RoleValue();\r
-            // This needs to use the qualified name, not the display name\r
-            rv.setRoleName(role.getRoleName());\r
-            rv.setRoleId(role.getCsid());\r
-            roleValues.add(rv);\r
-            permRole.setRole(roleValues);\r
-               } else {\r
-               String errMsg = "The tenant ID of the role: " + role.getTenantId()\r
-                               + " did not match the tenant ID of the permission: " + permission.getTenantId();\r
-               throw new Exception(errMsg);\r
-               }\r
-       \r
-       return permRole;\r
-    }\r
-    \r
-    private static Hashtable<String, String> getTenantNamesFromConfig(TenantBindingConfigReaderImpl tenantBindingConfigReader) {\r
-\r
-       // Note that this only handles tenants not marked as "createDisabled"\r
-       Hashtable<String, TenantBindingType> tenantBindings =\r
-                       tenantBindingConfigReader.getTenantBindings();\r
-       Hashtable<String, String> tenantInfo = new Hashtable<String, String>();\r
-       for (TenantBindingType tenantBinding : tenantBindings.values()) {\r
-               String tId = tenantBinding.getId();\r
-               String tName = tenantBinding.getName();\r
-               tenantInfo.put(tId, tName);\r
-               if (logger.isDebugEnabled()) {\r
-                       logger.debug("getTenantNamesFromConfig found configured tenant id: "+tId+" name: "+tName);\r
-               }\r
-       }\r
-       return tenantInfo;\r
-    }\r
-    \r
-    private static ArrayList<String> compileExistingTenants(Connection conn, Hashtable<String, String> tenantInfo)\r
-       throws SQLException, Exception {\r
-       Statement stmt = null;\r
-       ArrayList<String> existingTenants = new ArrayList<String>();\r
-       // First find or create the tenants\r
-       final String queryTenantSQL = "SELECT id,name FROM tenants";\r
-       try {\r
-               stmt = conn.createStatement();\r
-               ResultSet rs = stmt.executeQuery(queryTenantSQL);\r
-               while (rs.next()) {\r
-                       String tId = rs.getString("id");\r
-                       String tName = rs.getString("name");\r
-                       if(tenantInfo.containsKey(tId)) {\r
-                               existingTenants.add(tId);\r
-                               if(!tenantInfo.get(tId).equalsIgnoreCase(tName)) {\r
-                                       logger.warn("Configured name for tenant: "\r
-                                                       +tId+" in repository: "+tName\r
-                                                       +" does not match config'd name: "+ tenantInfo.get(tId));\r
-                               }\r
-                       }\r
-               }\r
-               rs.close();\r
-       } catch(Exception e) {\r
-               throw e;\r
-       } finally {\r
-               if(stmt!=null)\r
-                       stmt.close();\r
-       }\r
-\r
-       return existingTenants;\r
-    }\r
-    \r
-    private static void createMissingTenants(Connection conn, Hashtable<String, String> tenantInfo,\r
-               ArrayList<String> existingTenants) throws SQLException, Exception {\r
-               // Need to define and look for a createDisabled attribute in tenant config\r
-       final String insertTenantSQL = \r
-               "INSERT INTO tenants (id,name,disabled,created_at) VALUES (?,?,FALSE,now())";\r
-        PreparedStatement pstmt = null;\r
-       try {\r
-               pstmt = conn.prepareStatement(insertTenantSQL); // create a statement\r
-               for(String tId : tenantInfo.keySet()) {\r
-                       if(existingTenants.contains(tId)) {\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createMissingTenants: tenant exists (skipping): "\r
-                                                       +tenantInfo.get(tId));\r
-                               }\r
-                               continue;\r
-                       }\r
-                       pstmt.setString(1, tId);                                        // set id param\r
-                       pstmt.setString(2, tenantInfo.get(tId));        // set name param\r
-                       if (logger.isDebugEnabled()) {\r
-                               logger.debug("createMissingTenants adding entry for tenant: "+tId);\r
-                       }\r
-                       pstmt.executeUpdate();\r
-               }\r
-               pstmt.close();\r
-       } catch(Exception e) {\r
-               throw e;\r
-       } finally {\r
-               if(pstmt!=null)\r
-                       pstmt.close();\r
-       }\r
-    }\r
-    \r
-    private static ArrayList<String> findOrCreateDefaultUsers(Connection conn, Hashtable<String, String> tenantInfo) \r
-               throws SQLException, Exception {\r
-       // Second find or create the users\r
-       Statement stmt = null;\r
-        PreparedStatement pstmt = null;\r
-       ArrayList<String> usersInRepo = new ArrayList<String>();\r
-        try {\r
-               stmt = conn.createStatement();\r
-               ResultSet rs = stmt.executeQuery(QUERY_USERS_SQL);\r
-               while (rs.next()) {\r
-                       String uName = rs.getString("username");\r
-                       usersInRepo.add(uName);\r
-               }\r
-               rs.close();\r
-               pstmt = conn.prepareStatement(INSERT_USER_SQL); // create a statement\r
-               for(String tName : tenantInfo.values()) {\r
-                       String adminAcctName = getDefaultAdminUserID(tName);\r
-                       if(!usersInRepo.contains(adminAcctName)) {\r
-                               String secEncPasswd = SecurityUtils.createPasswordHash(\r
-                                               adminAcctName, DEFAULT_ADMIN_PASSWORD);\r
-                               pstmt.setString(1, adminAcctName);      // set username param\r
-                               pstmt.setString(2, secEncPasswd);       // set passwd param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createDefaultUsersAndAccounts adding user: "\r
-                                                       +adminAcctName+" for tenant: "+tName);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                       } else if (logger.isDebugEnabled()) {\r
-                               logger.debug("createDefaultUsersAndAccounts: user: "+adminAcctName\r
-                                               +" already exists - skipping.");\r
-                       }\r
-\r
-\r
-                       String readerAcctName =  getDefaultReaderUserID(tName);\r
-                       if(!usersInRepo.contains(readerAcctName)) {\r
-                               String secEncPasswd = SecurityUtils.createPasswordHash(\r
-                                               readerAcctName, DEFAULT_READER_PASSWORD);\r
-                               pstmt.setString(1, readerAcctName);     // set username param\r
-                               pstmt.setString(2, secEncPasswd);       // set passwd param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createDefaultUsersAndAccounts adding user: "\r
-                                                       +readerAcctName+" for tenant: "+tName);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                       } else if (logger.isDebugEnabled()) {\r
-                               logger.debug("createDefaultUsersAndAccounts: user: "+readerAcctName\r
-                                               +" already exists - skipping.");\r
-                       }\r
-               }\r
-               pstmt.close();\r
-        } catch(Exception e) {\r
-               throw e;\r
-        } finally {\r
-               if(stmt!=null)\r
-                       stmt.close();\r
-               if(pstmt!=null)\r
-                       pstmt.close();\r
-        }\r
-        return usersInRepo;\r
-    }\r
-    \r
-    private static void findOrCreateDefaultAccounts(Connection conn, Hashtable<String, String> tenantInfo,\r
-               ArrayList<String> usersInRepo,\r
-               Hashtable<String, String> tenantAdminAcctCSIDs, Hashtable<String, String> tenantReaderAcctCSIDs) \r
-                       throws SQLException, Exception {\r
-       // Third, create the accounts. Assume that if the users were already there,\r
-       // then the accounts were as well\r
-       PreparedStatement pstmt = null;\r
-       try {\r
-               pstmt = conn.prepareStatement(INSERT_ACCOUNT_SQL); // create a statement\r
-               for(String tId : tenantInfo.keySet()) {\r
-                       String tName = tenantInfo.get(tId);\r
-                       String adminCSID = UUID.randomUUID().toString();\r
-                       tenantAdminAcctCSIDs.put(tId, adminCSID);\r
-                       String adminAcctName =  getDefaultAdminUserID(tName);\r
-                       if(!usersInRepo.contains(adminAcctName)) {\r
-                               pstmt.setString(1, adminCSID);                  // set csid param\r
-                               pstmt.setString(2, adminAcctName);      // set email param (bogus)\r
-                               pstmt.setString(3, adminAcctName);      // set userid param\r
-                               pstmt.setString(4, "Administrator");// set screen name param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createDefaultAccounts adding account: "\r
-                                                       +adminAcctName+" for tenant: "+tName);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                       } else if (logger.isDebugEnabled()) {\r
-                               logger.debug("createDefaultAccounts: user: "+adminAcctName\r
-                                               +" already exists - skipping account generation.");\r
-                       }\r
-\r
-                       String readerCSID = UUID.randomUUID().toString();       \r
-                       tenantReaderAcctCSIDs.put(tId, readerCSID);\r
-                       String readerAcctName =  getDefaultReaderUserID(tName);\r
-                       if(!usersInRepo.contains(readerAcctName)) {\r
-                               pstmt.setString(1, readerCSID);         // set csid param\r
-                               pstmt.setString(2, readerAcctName);     // set email param (bogus)\r
-                               pstmt.setString(3, readerAcctName);     // set userid param\r
-                               pstmt.setString(4, "Reader");           // set screen name param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createDefaultAccounts adding account: "\r
-                                                       +readerAcctName+" for tenant: "+tName);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                       } else if (logger.isDebugEnabled()) {\r
-                               logger.debug("createDefaultAccounts: user: "+readerAcctName\r
-                                               +" already exists - skipping account creation.");\r
-                       }\r
-               }\r
-               pstmt.close();\r
-       } catch(Exception e) {\r
-               throw e;\r
-       } finally {\r
-               if(pstmt!=null)\r
-                       pstmt.close();\r
-       }\r
-    }\r
-    \r
-    private static boolean findOrCreateTenantManagerUserAndAccount(Connection conn) \r
-                       throws SQLException, Exception {\r
-       // Find or create the special tenant manager account.\r
-       // Later can make the user name for tenant manager be configurable, settable.\r
-       Statement stmt = null;\r
-        PreparedStatement pstmt = null;\r
-        boolean created = false;\r
-        try {\r
-               boolean foundTMgrUser = false;\r
-               stmt = conn.createStatement();\r
-               ResultSet rs = stmt.executeQuery(QUERY_TENANT_MGR_USER_SQL);\r
-               // Should only find one - only consider it\r
-               if(rs.next()) {\r
-                       String uName = rs.getString("username");\r
-                       foundTMgrUser = uName.equals(TENANT_MANAGER_USER);\r
-               }\r
-               rs.close();\r
-               if(!foundTMgrUser) {\r
-                       pstmt = conn.prepareStatement(INSERT_USER_SQL); // create a statement\r
-                       String secEncPasswd = SecurityUtils.createPasswordHash(\r
-                                       TENANT_MANAGER_USER, DEFAULT_TENANT_MANAGER_PASSWORD);\r
-                       pstmt.setString(1, TENANT_MANAGER_USER);        // set username param\r
-                       pstmt.setString(2, secEncPasswd);       // set passwd param\r
-                       if (logger.isDebugEnabled()) {\r
-                               logger.debug("findOrCreateTenantManagerUserAndAccount adding tenant manager user: "\r
-                                               +TENANT_MANAGER_USER);\r
-                       }\r
-                       pstmt.executeUpdate();\r
-               pstmt.close();\r
-               // Now create the account to match\r
-                       pstmt = conn.prepareStatement(INSERT_ACCOUNT_SQL); // create a statement\r
-                               pstmt.setString(1, AuthN.TENANT_MANAGER_ACCT_ID);                // set csid param\r
-                               pstmt.setString(2, DEFAULT_TENANT_MANAGER_EMAIL);       // set email param (bogus)\r
-                               pstmt.setString(3, TENANT_MANAGER_USER);        // set userid param\r
-                               pstmt.setString(4, TENANT_MANAGER_SCREEN_NAME);// set screen name param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("findOrCreateTenantManagerUserAndAccount adding tenant manager account: "\r
-                                                       +TENANT_MANAGER_USER);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                       pstmt.close();\r
-                       created = true;\r
-               } else if (logger.isDebugEnabled()) {\r
-                       logger.debug("findOrCreateTenantManagerUserAndAccount: tenant manager: "+TENANT_MANAGER_USER\r
-                                       +" already exists.");\r
-               }\r
-       } catch(Exception e) {\r
-               throw e;\r
-       } finally {\r
-               if(stmt!=null)\r
-                       stmt.close();\r
-               if(pstmt!=null)\r
-                       pstmt.close();\r
-       }\r
-        return created;\r
-    }\r
-    \r
-    private static void bindDefaultAccountsToTenants(Connection conn, DatabaseProductType databaseProductType,\r
-               Hashtable<String, String> tenantInfo, ArrayList<String> usersInRepo,\r
-               Hashtable<String, String> tenantAdminAcctCSIDs, Hashtable<String, String> tenantReaderAcctCSIDs) \r
-                       throws SQLException, Exception {\r
-       // Fourth, bind accounts to tenants. Assume that if the users were already there,\r
-       // then the accounts were bound to tenants correctly\r
-       PreparedStatement pstmt = null;\r
-       try {\r
-               String insertAccountTenantSQL;\r
-               if (databaseProductType == DatabaseProductType.MYSQL) {\r
-                       insertAccountTenantSQL =\r
-                                       "INSERT INTO accounts_tenants (TENANTS_ACCOUNTSCOMMON_CSID,tenant_id) "\r
-                                                       + " VALUES(?, ?)";\r
-               } else if (databaseProductType == DatabaseProductType.POSTGRESQL) {\r
-                       insertAccountTenantSQL =\r
-                                       "INSERT INTO accounts_tenants (HJID, TENANTS_ACCOUNTSCOMMON_CSID,tenant_id) "\r
-                                                       + " VALUES(nextval('hibernate_sequence'), ?, ?)";\r
-               } else {\r
-                       throw new Exception("Unrecognized database system.");\r
-               }\r
-               pstmt = conn.prepareStatement(insertAccountTenantSQL); // create a statement\r
-               for(String tId : tenantInfo.keySet()) {\r
-                       String tName = tenantInfo.get(tId);\r
-                       if(!usersInRepo.contains(getDefaultAdminUserID(tName))) {\r
-                               String adminAcct = tenantAdminAcctCSIDs.get(tId);\r
-                               pstmt.setString(1, adminAcct);          // set acct CSID param\r
-                               pstmt.setString(2, tId);                        // set tenant_id param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createDefaultAccounts binding account id: "\r
-                                                       +adminAcct+" to tenant id: "+tId);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                       }\r
-                       if(!usersInRepo.contains(getDefaultReaderUserID(tName))) {\r
-                               String readerAcct = tenantReaderAcctCSIDs.get(tId);\r
-                               pstmt.setString(1, readerAcct);         // set acct CSID param\r
-                               pstmt.setString(2, tId);                        // set tenant_id param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createDefaultAccounts binding account id: "\r
-                                                       +readerAcct+" to tenant id: "+tId);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                       }\r
-               }\r
-               pstmt.close();\r
-       } catch(Exception e) {\r
-               throw e;\r
-       } finally {\r
-               if(pstmt!=null)\r
-                       pstmt.close();\r
-       }\r
-    }\r
-    \r
-    \r
-    private static String findOrCreateDefaultRoles(Connection conn, Hashtable<String, String> tenantInfo,\r
-               Hashtable<String, String> tenantAdminRoleCSIDs, Hashtable<String, String> tenantReaderRoleCSIDs) \r
-                       throws SQLException, Exception {\r
-       // Fifth, fetch and save the default roles\r
-               String springAdminRoleCSID = null;\r
-       Statement stmt = null;\r
-       PreparedStatement pstmt = null;\r
-       try {\r
-               final String querySpringRole = \r
-                               "SELECT csid from roles WHERE rolename='"+SPRING_ADMIN_ROLE+"'";\r
-               stmt = conn.createStatement();\r
-               ResultSet rs = stmt.executeQuery(querySpringRole);\r
-               if(rs.next()) {\r
-                       springAdminRoleCSID = rs.getString(1);\r
-                       if (logger.isDebugEnabled()) {\r
-                               logger.debug("createDefaultAccounts found Spring Admin role: "\r
-                                               +springAdminRoleCSID);\r
-                       }\r
-               } else {\r
-                       final String insertSpringAdminRoleSQL =\r
-                                       "INSERT INTO roles (csid, rolename, displayName, rolegroup, created_at, tenant_id) "\r
-                                                       + "VALUES ('-1', 'ROLE_SPRING_ADMIN', 'SPRING_ADMIN', 'Spring Security Administrator', now(), '0')";\r
-                       stmt.executeUpdate(insertSpringAdminRoleSQL);\r
-                       springAdminRoleCSID = "-1";\r
-                       if (logger.isDebugEnabled()) {\r
-                               logger.debug("createDefaultAccounts CREATED Spring Admin role: "\r
-                                               +springAdminRoleCSID);\r
-                       }\r
-               }\r
-               rs.close();\r
-               final String getRoleCSIDSql =\r
-                               "SELECT csid from roles WHERE tenant_id=? and rolename=?";\r
-               pstmt = conn.prepareStatement(getRoleCSIDSql); // create a statement\r
-               rs = null;\r
-               for(String tId : tenantInfo.keySet()) {\r
-                       pstmt.setString(1, tId);                                                // set tenant_id param\r
-                       pstmt.setString(2, getDefaultAdminRole(tId));   // set rolename param\r
-                       rs = pstmt.executeQuery();\r
-                       // extract data from the ResultSet\r
-                       if(!rs.next()) {\r
-                               throw new RuntimeException("Cannot find role: "+getDefaultAdminRole(tId)\r
-                                               +" for tenant id: "+tId+" in roles!");\r
-                       }\r
-                       String tenantAdminRoleCSID = rs.getString(1);\r
-                       if (logger.isDebugEnabled()) {\r
-                               logger.debug("createDefaultAccounts found role: "\r
-                                               +getDefaultAdminRole(tId)+"("+tenantAdminRoleCSID\r
-                                               +") for tenant id: "+tId);\r
-                       }\r
-                       tenantAdminRoleCSIDs.put(tId, tenantAdminRoleCSID);\r
-                       pstmt.setString(1, tId);                                                // set tenant_id param\r
-                       pstmt.setString(2, getDefaultReaderRole(tId));  // set rolename param\r
-                       rs.close();\r
-                       rs = pstmt.executeQuery();\r
-                       // extract data from the ResultSet\r
-                       if(!rs.next()) {\r
-                               throw new RuntimeException("Cannot find role: "+getDefaultReaderRole(tId)\r
-                                               +" for tenant id: "+tId+" in roles!");\r
-                       }\r
-                       String tenantReaderRoleCSID = rs.getString(1);\r
-                       if (logger.isDebugEnabled()) {\r
-                               logger.debug("createDefaultAccounts found role: "\r
-                                               +getDefaultReaderRole(tId)+"("+tenantReaderRoleCSID\r
-                                               +") for tenant id: "+tId);\r
-                       }\r
-                       tenantReaderRoleCSIDs.put(tId, tenantReaderRoleCSID);\r
-                       rs.close();\r
-               }\r
-               pstmt.close();\r
-       } catch(Exception e) {\r
-               throw e;\r
-       } finally {\r
-               if(stmt!=null)\r
-                       stmt.close();\r
-               if(pstmt!=null)\r
-                       pstmt.close();\r
-       }\r
-       return springAdminRoleCSID;\r
-    }\r
-\r
-    private static String findTenantManagerRole(Connection conn ) \r
-                       throws SQLException, RuntimeException, Exception {\r
-               String tenantMgrRoleCSID = null;\r
-       PreparedStatement pstmt = null;\r
-       try {\r
-               String rolename = getQualifiedRoleName(ALL_TENANTS_MANAGER_TENANT_ID, \r
-                                                                                               ROLE_ALL_TENANTS_MANAGER);              \r
-               pstmt = conn.prepareStatement(GET_TENANT_MGR_ROLE_SQL); // create a statement\r
-               ResultSet rs = null;\r
-               pstmt.setString(1, rolename);   // set rolename param\r
-               rs = pstmt.executeQuery();\r
-               if(rs.next()) {\r
-                       tenantMgrRoleCSID = rs.getString(1);\r
-                       if (logger.isDebugEnabled()) {\r
-                               logger.debug("findTenantManagerRole found Tenant Mgr role: "\r
-                                               +tenantMgrRoleCSID);\r
-                       }\r
-               }\r
-               rs.close();\r
-       } catch(Exception e) {\r
-               throw e;\r
-       } finally {\r
-               if(pstmt!=null)\r
-                       pstmt.close();\r
-       }\r
-       if(tenantMgrRoleCSID==null)\r
-               throw new RuntimeException("findTenantManagerRole: Cound not find tenant Manager Role!");\r
-       return tenantMgrRoleCSID;\r
-    }\r
-\r
-    private static void bindAccountsToRoles(Connection conn,  DatabaseProductType databaseProductType,\r
-               Hashtable<String, String> tenantInfo, ArrayList<String> usersInRepo,\r
-               String springAdminRoleCSID,\r
-               Hashtable<String, String> tenantAdminRoleCSIDs, Hashtable<String, String> tenantReaderRoleCSIDs,\r
-               Hashtable<String, String> tenantAdminAcctCSIDs, Hashtable<String, String> tenantReaderAcctCSIDs) \r
-                       throws SQLException, Exception {\r
-       // Sixth, bind the accounts to roles. If the users already existed,\r
-       // we'll assume they were set up correctly.\r
-       PreparedStatement pstmt = null;\r
-       try {\r
-               String insertAccountRoleSQL;\r
-               if (databaseProductType == DatabaseProductType.MYSQL) {\r
-                       insertAccountRoleSQL = INSERT_ACCOUNT_ROLE_SQL_MYSQL;\r
-               } else if (databaseProductType == DatabaseProductType.POSTGRESQL) {\r
-                       insertAccountRoleSQL = INSERT_ACCOUNT_ROLE_SQL_POSTGRES;\r
-               } else {\r
-                       throw new Exception("Unrecognized database system.");\r
-               }\r
-               if (logger.isDebugEnabled()) {\r
-                       logger.debug("createDefaultAccounts binding accounts to roles with SQL:\n"\r
-                                       +insertAccountRoleSQL);\r
-               }\r
-               pstmt = conn.prepareStatement(insertAccountRoleSQL); // create a statement\r
-               for(String tId : tenantInfo.keySet()) {\r
-                       String adminUserId =  getDefaultAdminUserID(tenantInfo.get(tId));\r
-                       if(!usersInRepo.contains(adminUserId)) {\r
-                               String adminAcct = tenantAdminAcctCSIDs.get(tId);\r
-                               String adminRoleId = tenantAdminRoleCSIDs.get(tId);\r
-                               pstmt.setString(1, adminAcct);          // set acct CSID param\r
-                               pstmt.setString(2, adminUserId);        // set user_id param\r
-                               pstmt.setString(3, adminRoleId);        // set role_id param\r
-                               pstmt.setString(4, getDefaultAdminRole(tId));   // set rolename param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createDefaultAccounts binding account: "\r
-                                                       +adminUserId+" to Admin role("+adminRoleId\r
-                                                       +") for tenant id: "+tId);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                               // Now add the Spring Admin Role to the admin accounts\r
-                               pstmt.setString(3, springAdminRoleCSID);        // set role_id param\r
-                               pstmt.setString(4, SPRING_ADMIN_ROLE);          // set rolename param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createDefaultAccounts binding account: "\r
-                                                       +adminUserId+" to Spring Admin role: "+springAdminRoleCSID);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                       }\r
-                       String readerUserId = getDefaultReaderUserID(tenantInfo.get(tId));\r
-                       if(!usersInRepo.contains(readerUserId)) {\r
-                               String readerAcct = tenantReaderAcctCSIDs.get(tId);\r
-                               String readerRoleId = tenantReaderRoleCSIDs.get(tId);\r
-                               pstmt.setString(1, readerAcct);         // set acct CSID param\r
-                               pstmt.setString(2, readerUserId);       // set user_id param\r
-                               pstmt.setString(3, readerRoleId);       // set role_id param\r
-                               pstmt.setString(4, getDefaultReaderRole(tId));  // set rolename param\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("createDefaultAccounts binding account: "\r
-                                                       +readerUserId+" to Reader role("+readerRoleId\r
-                                                       +") for tenant id: "+tId);\r
-                               }\r
-                               pstmt.executeUpdate();\r
-                       }\r
-               }\r
-               pstmt.close();\r
-       } catch(Exception e) {\r
-               throw e;\r
-       } finally {\r
-               if(pstmt!=null)\r
-                       pstmt.close();\r
-       }\r
-    }\r
-    \r
-    private static void bindTenantManagerAccountRole(Connection conn,  DatabaseProductType databaseProductType,\r
-               String tenantManagerUserID, String tenantManagerAccountID, String tenantManagerRoleID, String tenantManagerRoleName ) \r
-                       throws SQLException, Exception {\r
-       PreparedStatement pstmt = null;\r
-       try {\r
-               String insertAccountRoleSQL;\r
-               if (databaseProductType == DatabaseProductType.MYSQL) {\r
-                       insertAccountRoleSQL = INSERT_ACCOUNT_ROLE_SQL_MYSQL;\r
-               } else if (databaseProductType == DatabaseProductType.POSTGRESQL) {\r
-                       insertAccountRoleSQL = INSERT_ACCOUNT_ROLE_SQL_POSTGRES;\r
-               } else {\r
-                       throw new Exception("Unrecognized database system.");\r
-               }\r
-               if (logger.isDebugEnabled()) {\r
-                       logger.debug("bindTenantManagerAccountRole binding account to role with SQL:\n"\r
-                                       +insertAccountRoleSQL);\r
-               }\r
-               pstmt = conn.prepareStatement(insertAccountRoleSQL); // create a statement\r
-               pstmt.setString(1, tenantManagerAccountID);             // set acct CSID param\r
-               pstmt.setString(2, tenantManagerUserID);        // set user_id param\r
-               pstmt.setString(3, tenantManagerRoleID);        // set role_id param\r
-               pstmt.setString(4, tenantManagerRoleName);      // set rolename param\r
-               if (logger.isDebugEnabled()) {\r
-                       logger.debug("bindTenantManagerAccountRole binding user: "\r
-                                       +tenantManagerUserID+" to Admin role("+tenantManagerRoleName+")");\r
-               }\r
-               pstmt.executeUpdate();\r
-               /* At this point, tenant manager should not need the Spring Admin Role\r
-               pstmt.setString(3, springAdminRoleCSID);        // set role_id param\r
-               pstmt.setString(4, SPRING_ADMIN_ROLE);          // set rolename param\r
-               if (logger.isDebugEnabled()) {\r
-                       logger.debug("createDefaultAccounts binding account: "\r
-                                       +adminUserId+" to Spring Admin role: "+springAdminRoleCSID);\r
-               }\r
-               pstmt.executeUpdate();\r
-               */\r
-               pstmt.close();\r
-       } catch(Exception e) {\r
-               throw e;\r
-       } finally {\r
-               if(pstmt!=null)\r
-                       pstmt.close();\r
-       }\r
-    }\r
-    \r
-    public static void createDefaultAccounts(\r
-               TenantBindingConfigReaderImpl tenantBindingConfigReader,\r
-               DatabaseProductType databaseProductType,\r
-               String cspaceDatabaseName) throws Exception {\r
-\r
-       logger.debug("ServiceMain.createDefaultAccounts starting...");\r
-       \r
-        Hashtable<String, String> tenantInfo = getTenantNamesFromConfig(tenantBindingConfigReader);\r
-        Connection conn = null;\r
-        // TODO - need to put in tests for existence first.\r
-        // We could just look for the accounts per tenant up front, and assume that\r
-        // the rest is there if the accounts are.\r
-        // Could add a sql script to remove these if need be - Spring only does roles, \r
-        // and we're not touching that, so we could safely toss the \r
-        // accounts, users, account-tenants, account-roles, and start over.\r
-        try {\r
-               conn = getConnection(cspaceDatabaseName);\r
-               ArrayList<String> existingTenants = compileExistingTenants(conn, tenantInfo);\r
-               \r
-               // Note that this only creates tenants not marked as "createDisabled"\r
-               createMissingTenants(conn, tenantInfo, existingTenants);\r
-               \r
-               ArrayList<String> usersInRepo = findOrCreateDefaultUsers(conn, tenantInfo);\r
-               \r
-               Hashtable<String, String> tenantAdminAcctCSIDs = new Hashtable<String, String>();\r
-               Hashtable<String, String> tenantReaderAcctCSIDs = new Hashtable<String, String>();\r
-               findOrCreateDefaultAccounts(conn, tenantInfo, usersInRepo,\r
-                               tenantAdminAcctCSIDs, tenantReaderAcctCSIDs);\r
-\r
-               bindDefaultAccountsToTenants(conn, databaseProductType, tenantInfo, usersInRepo,\r
-                               tenantAdminAcctCSIDs, tenantReaderAcctCSIDs);\r
-               \r
-               Hashtable<String, String> tenantAdminRoleCSIDs = new Hashtable<String, String>();\r
-               Hashtable<String, String> tenantReaderRoleCSIDs = new Hashtable<String, String>();\r
-               String springAdminRoleCSID = findOrCreateDefaultRoles(conn, tenantInfo,\r
-                               tenantAdminRoleCSIDs, tenantReaderRoleCSIDs);\r
-               \r
-               bindAccountsToRoles(conn,  databaseProductType,\r
-                               tenantInfo, usersInRepo, springAdminRoleCSID,\r
-                               tenantAdminRoleCSIDs, tenantReaderRoleCSIDs,\r
-                               tenantAdminAcctCSIDs, tenantReaderAcctCSIDs);\r
-               \r
-               boolean createdTenantMgrAccount = findOrCreateTenantManagerUserAndAccount(conn);\r
-               if(createdTenantMgrAccount) {\r
-                       // If we created the account, we need to create the bindings. Otherwise, assume they\r
-                       // are all set (from previous initialization).\r
-                       String tenantManagerRoleCSID = findTenantManagerRole(conn);\r
-                       bindTenantManagerAccountRole(conn, databaseProductType, \r
-                                       TENANT_MANAGER_USER, AuthN.TENANT_MANAGER_ACCT_ID, \r
-                                       tenantManagerRoleCSID, ROLE_ALL_TENANTS_MANAGER);\r
-               }\r
-        } catch (Exception e) {\r
-                       logger.debug("Exception in createDefaultAccounts: " + e.getLocalizedMessage());\r
-               throw e;\r
-               } finally {\r
-                       try {\r
-                               if (conn != null)\r
-                                       conn.close();\r
-                       } catch (SQLException sqle) {\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("SQL Exception closing statement/connection: " + sqle.getLocalizedMessage());\r
-                               }\r
-                       }\r
-               }       \r
-    }\r
-    \r
-    private static String getDefaultAdminRole(String tenantId) {\r
-       return ROLE_PREFIX+tenantId+TENANT_ADMIN_ROLE_SUFFIX;\r
-    }\r
-    \r
-    private static String getDefaultReaderRole(String tenantId) {\r
-       return ROLE_PREFIX+tenantId+TENANT_READER_ROLE_SUFFIX;\r
-    }\r
-    \r
-    private static String getDefaultAdminUserID(String tenantName) {\r
-       return TENANT_ADMIN_ACCT_PREFIX+tenantName;\r
-    }\r
-    \r
-    private static String getDefaultReaderUserID(String tenantName) {\r
-       return TENANT_READER_ACCT_PREFIX+tenantName;\r
-    }\r
-    \r
-       static public PermissionAction createPermissionAction(Permission perm,\r
-                       ActionType actionType) {\r
-        PermissionAction pa = new PermissionAction();\r
-\r
-           CSpaceAction action = URIResourceImpl.getAction(actionType);\r
-           URIResourceImpl uriRes = new URIResourceImpl(perm.getTenantId(),\r
-                   perm.getResourceName(), action);\r
-           pa.setName(actionType);\r
-           pa.setObjectIdentity(uriRes.getHashedId().toString());\r
-           pa.setObjectIdentityResource(uriRes.getId());\r
-           \r
-           return pa;\r
-       }\r
-\r
-       static public PermissionAction update(Permission perm, PermissionAction permAction) {\r
-        PermissionAction pa = new PermissionAction();\r
-\r
-           CSpaceAction action = URIResourceImpl.getAction(permAction.getName());\r
-           URIResourceImpl uriRes = new URIResourceImpl(perm.getTenantId(),\r
-                   perm.getResourceName(), action);\r
-           pa.setObjectIdentity(uriRes.getHashedId().toString());\r
-           pa.setObjectIdentityResource(uriRes.getId());\r
-           \r
-           return pa;\r
-       }\r
-       \r
-       private static TransitionDefList getTransitionDefList(TenantBindingType tenantBinding, ServiceBindingType serviceBinding) {\r
-               TransitionDefList result = null;\r
-               try {\r
-                       String serviceObjectName = serviceBinding.getObject().getName();\r
-               DocumentHandler docHandler = ServiceConfigUtils.createDocumentHandlerInstance(\r
-                               tenantBinding, serviceBinding);\r
-               Lifecycle lifecycle = docHandler.getLifecycle(serviceObjectName);\r
-               if (lifecycle != null) {\r
-                       result = lifecycle.getTransitionDefList();\r
-               }\r
-               } catch (Exception e) {\r
-                       // Ignore this exception and return an empty non-null TransitionDefList\r
-               }\r
-               \r
-               if (result == null) {\r
-                       if (serviceBinding.getType().equalsIgnoreCase(ServiceBindingUtils.SERVICE_TYPE_SECURITY) == false) {\r
-                               logger.warn("Could not retrieve a lifecycle transition definition list from: "\r
-                                               + serviceBinding.getName()\r
-                                               + " with tenant ID = "\r
-                                               + tenantBinding.getId());\r
-                       }\r
-                       // return an empty list                 \r
-                       result = new TransitionDefList();\r
-               } else {\r
-                       logger.debug("Successfully retrieved a lifecycle transition definition list from: "\r
-                                       + serviceBinding.getName()\r
-                                       + " with tenant ID = "\r
-                                       + tenantBinding.getId());\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-    public static void createDefaultWorkflowPermissions(TenantBindingConfigReaderImpl tenantBindingConfigReader) throws Exception //FIXME: REM - 4/11/2012 - Rename to createWorkflowPermissions\r
-    {\r
-       AuthZ.get().login(); //login to Spring Security manager\r
-       \r
-        EntityManagerFactory emf = JpaStorageUtils.getEntityManagerFactory(JpaStorageUtils.CS_PERSISTENCE_UNIT);\r
-        EntityManager em = null;\r
-\r
-        try {\r
-            em = emf.createEntityManager();\r
-\r
-               Hashtable<String, TenantBindingType> tenantBindings =\r
-                       tenantBindingConfigReader.getTenantBindings();\r
-               for (String tenantId : tenantBindings.keySet()) {\r
-                       TenantBindingType tenantBinding = tenantBindings.get(tenantId);\r
-                       Role adminRole = AuthorizationCommon.getRole(em, tenantBinding.getId(), ROLE_TENANT_ADMINISTRATOR);\r
-                       Role readonlyRole = AuthorizationCommon.getRole(em, tenantBinding.getId(), ROLE_TENANT_READER);\r
-                       for (ServiceBindingType serviceBinding : tenantBinding.getServiceBindings()) {\r
-                               String prop = ServiceBindingUtils.getPropertyValue(serviceBinding, REFRESH_AUTZ_PROP);\r
-                               if (prop == null ? true : Boolean.parseBoolean(prop)) {\r
-                                               try {\r
-                                               em.getTransaction().begin();\r
-                                               TransitionDefList transitionDefList = getTransitionDefList(tenantBinding, serviceBinding);\r
-                                               for (TransitionDef transitionDef : transitionDefList.getTransitionDef()) {\r
-                                                       //\r
-                                                       // Create the permission for the admin role\r
-                                                       Permission adminPerm = createWorkflowPermission(tenantBinding, serviceBinding, transitionDef, ACTIONGROUP_CRUDL);\r
-                                                       persist(em, adminPerm, adminRole, true);\r
-                                                       //\r
-                                                       // Create the permission for the read-only role\r
-                                                       Permission readonlyPerm = createWorkflowPermission(tenantBinding, serviceBinding, transitionDef, ACTIONGROUP_RL);\r
-                                                       \r
-                                                       Profiler profiler = new Profiler(AuthorizationCommon.class, 1);\r
-                                                       profiler.start("createDefaultPermissions started:" + readonlyPerm.getCsid());\r
-                                                       persist(em, readonlyPerm, readonlyRole, true); // Persist/store the permission and permrole records and related Spring Security info\r
-                                                       profiler.stop();\r
-                                                       logger.debug("Finished full perm generation for "\r
-                                                                       + ":" + tenantBinding.getId()\r
-                                                                       + ":" + serviceBinding.getName()\r
-                                                                       + ":" + transitionDef.getName()\r
-                                                                       + ":" + ACTIONGROUP_RL\r
-                                                                       + ":" + profiler.getCumulativeTime());                                          \r
-                                               }\r
-                                               em.getTransaction().commit();\r
-                                       } catch (IllegalStateException e) {\r
-                                               logger.debug(e.getLocalizedMessage(), e); //We end up here if there is no document handler for the service -this is ok for some of the services.\r
-                                       }\r
-                               } else {\r
-                                       logger.warn("AuthZ refresh service binding property is set to FALSE so default permissions will NOT be refreshed for: "\r
-                                                       + serviceBinding.getName());\r
-                               }\r
-                       }\r
-               }\r
-            em.close();\r
-       } catch (Exception e) {\r
-            if (em != null && em.getTransaction().isActive()) {\r
-                em.getTransaction().rollback();\r
-            }\r
-            if (logger.isDebugEnabled()) {\r
-                logger.debug("Caught exception and rolling back permission creation: ", e);\r
-            }\r
-            throw e;\r
-        } finally {\r
-            if (em != null) {\r
-                JpaStorageUtils.releaseEntityManagerFactory(emf);\r
-            }\r
-        }\r
-    }\r
-    \r
-    private static PermissionRoleRel findPermRoleRel(EntityManager em, String permissionId, String RoleId) {\r
-       PermissionRoleRel result = null;\r
-       \r
-       try {\r
-               String whereClause = "where permissionId = :id and roleId = :roleId";\r
-               HashMap<String, Object> params = new HashMap<String, Object>();\r
-               params.put("id", permissionId);\r
-               params.put("roleId", RoleId);        \r
-       \r
-               result = (PermissionRoleRel) JpaStorageUtils.getEntity(em,\r
-                               PermissionRoleRel.class.getCanonicalName(), whereClause, params);\r
-       } catch (Exception e) {\r
-               //Do nothing. Will return null;\r
-       }\r
-               \r
-       return result;\r
-    }\r
-    \r
-    /*\r
-     * Persists the Permission, PermissionRoleRel, and Spring Security table entries all in one transaction\r
-     */\r
-    private static void persist(EntityManager em, Permission permission, Role role, boolean enforceTenancy) throws Exception {\r
-               AuthorizationStore authzStore = new AuthorizationStore();\r
-               // First persist the Permission record\r
-               authzStore.store(em, permission);\r
-               \r
-               // If the PermRoleRel doesn't already exists then relate the permission and the role in a new PermissionRole (the service payload)\r
-               // Create a PermissionRoleRel (the database relation table for the permission and role)\r
-               PermissionRoleRel permRoleRel = findPermRoleRel(em, permission.getCsid(), role.getCsid());\r
-               if (permRoleRel == null) {\r
-                       PermissionRole permRole = createPermissionRole(em, permission, role, enforceTenancy);\r
-               List<PermissionRoleRel> permRoleRels = new ArrayList<PermissionRoleRel>();\r
-               PermissionRoleUtil.buildPermissionRoleRel(em, permRole, SubjectType.ROLE, permRoleRels, false /*not for delete*/);\r
-               for (PermissionRoleRel prr : permRoleRels) {\r
-                   authzStore.store(em, prr);\r
-               }\r
-                       Profiler profiler = new Profiler(AuthorizationCommon.class, 2);\r
-                       profiler.start();\r
-                       // Add a corresponding entry in the Spring Security Tables\r
-                       addPermissionsForUri(permission, permRole);\r
-                       profiler.stop();\r
-                       logger.debug("Finished full perm generation for "\r
-                                       + ":" + permission.getTenantId()\r
-                                       + ":" + permission.getResourceName()\r
-                                       + ":" + ACTIONGROUP_RL\r
-                                       + ":" + profiler.getCumulativeTime());\r
-               }\r
-        \r
-    }\r
-\r
-}\r
+package org.collectionspace.services.common.authorization_mgt;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.UUID;
+
+import javax.naming.NamingException;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+
+import org.collectionspace.authentication.AuthN;
+import org.collectionspace.services.authorization.AuthZ;
+import org.collectionspace.services.authorization.CSpaceAction;
+import org.collectionspace.services.authorization.PermissionException;
+import org.collectionspace.services.authorization.PermissionRole;
+import org.collectionspace.services.authorization.PermissionRoleRel;
+import org.collectionspace.services.authorization.PermissionValue;
+import org.collectionspace.services.authorization.Role;
+import org.collectionspace.services.authorization.RoleValue;
+import org.collectionspace.services.authorization.SubjectType;
+import org.collectionspace.services.authorization.URIResourceImpl;
+import org.collectionspace.services.authorization.perms.ActionType;
+import org.collectionspace.services.authorization.perms.EffectType;
+import org.collectionspace.services.authorization.perms.Permission;
+import org.collectionspace.services.authorization.perms.PermissionAction;
+
+import org.collectionspace.services.client.Profiler;
+import org.collectionspace.services.client.RoleClient;
+import org.collectionspace.services.client.workflow.WorkflowClient;
+import org.collectionspace.services.common.config.ServiceConfigUtils;
+import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
+import org.collectionspace.services.common.context.ServiceBindingUtils;
+import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.security.SecurityUtils;
+import org.collectionspace.services.common.storage.DatabaseProductType;
+import org.collectionspace.services.common.storage.JDBCTools;
+import org.collectionspace.services.common.storage.jpa.JpaStorageUtils;
+import org.collectionspace.services.config.service.ServiceBindingType;
+import org.collectionspace.services.config.tenant.TenantBindingType;
+
+import org.collectionspace.services.lifecycle.Lifecycle;
+import org.collectionspace.services.lifecycle.TransitionDef;
+import org.collectionspace.services.lifecycle.TransitionDefList;
+
+//import org.mortbay.log.Log;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.springframework.security.acls.model.AlreadyExistsException;
+
+
+public class AuthorizationCommon {
+       
+       final public static String REFRESH_AUTZ_PROP = "refreshAuthZOnStartup";
+    //
+    // ActionGroup labels/constants
+    //
+       
+       // for READ-WRITE
+    final public static String ACTIONGROUP_CRUDL_NAME = "CRUDL";
+    final public static ActionType[] ACTIONSET_CRUDL = {ActionType.CREATE, ActionType.READ, ActionType.UPDATE, ActionType.DELETE, ActionType.SEARCH};
+    // for READ-ONLY
+    final public static String ACTIONGROUP_RL_NAME = "RL";
+    final public static ActionType[] ACTIONSET_RL = {ActionType.READ, ActionType.SEARCH};
+
+    
+       /*
+        * Inner class to deal with predefined ADMIN and READER action groupds
+        */
+       public class ActionGroup {
+               String name;
+               ActionType[] actions;
+       }
+       
+       static ActionGroup ACTIONGROUP_CRUDL;
+       static ActionGroup ACTIONGROUP_RL;
+       
+       // A static block to initialize the predefined action groups
+       static {
+               AuthorizationCommon ac = new AuthorizationCommon();
+               // For admin
+               ACTIONGROUP_CRUDL = ac.new ActionGroup();
+               ACTIONGROUP_CRUDL.name = ACTIONGROUP_CRUDL_NAME;
+               ACTIONGROUP_CRUDL.actions = ACTIONSET_CRUDL;
+               // For reader
+               ACTIONGROUP_RL = ac.new ActionGroup();
+               ACTIONGROUP_RL.name = ACTIONGROUP_RL_NAME;
+               ACTIONGROUP_RL.actions = ACTIONSET_RL;
+
+       }
+       
+    final static Logger logger = LoggerFactory.getLogger(AuthorizationCommon.class);
+
+    //
+    // The "super" role has a predefined ID of "0" and a tenant ID of "0";
+    //
+    final public static String ROLE_ALL_TENANTS_MANAGER = "ALL_TENANTS_MANAGER";
+    final public static String ROLE_ALL_TENANTS_MANAGER_ID = "0";
+    final public static String ALL_TENANTS_MANAGER_TENANT_ID = "0";
+
+    final public static String ROLE_TENANT_ADMINISTRATOR = "TENANT_ADMINISTRATOR";
+    final public static String ROLE_TENANT_READER = "TENANT_READER";
+       
+    public static final String TENANT_MANAGER_USER = "tenantManager"; 
+    public static final String TENANT_MANAGER_SCREEN_NAME = TENANT_MANAGER_USER; 
+    public static final String DEFAULT_TENANT_MANAGER_PASSWORD = "manage"; 
+    public static final String DEFAULT_TENANT_MANAGER_EMAIL = "tenantManager@collectionspace.org"; 
+    
+    public static final String TENANT_ADMIN_ACCT_PREFIX = "admin@"; 
+    public static final String TENANT_READER_ACCT_PREFIX = "reader@"; 
+    public static final String ROLE_PREFIX = "ROLE_"; 
+    public static final String SPRING_ADMIN_ROLE = "ROLE_SPRING_ADMIN"; 
+    public static final String TENANT_ADMIN_ROLE_SUFFIX = "_TENANT_ADMINISTRATOR"; 
+    public static final String TENANT_READER_ROLE_SUFFIX = "_TENANT_READER"; 
+    public static final String DEFAULT_ADMIN_PASSWORD = "Administrator";
+    public static final String DEFAULT_READER_PASSWORD = "reader";
+
+    public static final String ROLE_SPRING_ADMIN_ID = "-1";
+    public static final String ROLE_SPRING_ADMIN_NAME = "ROLE_SPRING_ADMIN";
+    
+    // SQL for init tasks
+       final private static String INSERT_ACCOUNT_ROLE_SQL_MYSQL = 
+                       "INSERT INTO accounts_roles(account_id, user_id, role_id, role_name, created_at)"
+                                       +" VALUES(?, ?, ?, ?, now())";
+       final private static String INSERT_ACCOUNT_ROLE_SQL_POSTGRES =
+                       "INSERT INTO accounts_roles(HJID, account_id, user_id, role_id, role_name, created_at)"
+                                       +" VALUES(nextval('hibernate_sequence'), ?, ?, ?, ?, now())";
+       final private static String QUERY_USERS_SQL = 
+               "SELECT username FROM users WHERE username LIKE '"
+                       +TENANT_ADMIN_ACCT_PREFIX+"%' OR username LIKE '"+TENANT_READER_ACCT_PREFIX+"%'";
+       final private static String INSERT_USER_SQL = 
+                       "INSERT INTO users (username,passwd, created_at) VALUES (?,?, now())";
+       final private static String INSERT_ACCOUNT_SQL = 
+                       "INSERT INTO accounts_common "
+                                       + "(csid, email, userid, status, screen_name, metadata_protection, roles_protection, created_at) "
+                                       + "VALUES (?,?,?,'ACTIVE',?, 'immutable', 'immutable', now())";
+       
+       // TENANT MANAGER specific SQL
+       final private static String QUERY_TENANT_MGR_USER_SQL = 
+               "SELECT username FROM users WHERE username = '"+TENANT_MANAGER_USER+"'";
+       final private static String GET_TENANT_MGR_ROLE_SQL =
+                       "SELECT csid from roles WHERE tenant_id='"+ALL_TENANTS_MANAGER_TENANT_ID+"' and rolename=?";
+
+    public static Role getRole(String tenantId, String displayName) {
+       Role role = null;
+       
+       String roleName = AuthorizationCommon.getQualifiedRoleName(tenantId, displayName);
+       role = AuthorizationStore.getRoleByName(roleName, tenantId);
+        
+        return role;
+    }
+    
+    public static Role getRole(EntityManager em, String tenantId, String displayName) {
+       Role role = null;
+       
+       String roleName = AuthorizationCommon.getQualifiedRoleName(tenantId, displayName);
+       role = AuthorizationStore.getRoleByName(em, roleName, tenantId);
+        
+        return role;
+    }
+    
+    
+    public static Role createRole(String tenantId, String name, String description) {
+       return createRole(tenantId, name, description, false /* mutable by default */);
+    }
+    
+    public static Role createRole(String tenantId, String name, String description, boolean immutable) {
+       Role role = new Role();
+       
+        role.setCreatedAtItem(new Date());
+        role.setDisplayName(name);
+       String roleName = AuthorizationCommon.getQualifiedRoleName(tenantId, name);     
+        role.setRoleName(roleName);
+        String id = UUID.randomUUID().toString(); //FIXME: The qualified role name should be unique enough to use as an ID/key
+        role.setCsid(id);
+               role.setDescription(description);
+        role.setTenantId(tenantId);
+        if (immutable == true) {
+               role.setMetadataProtection(RoleClient.IMMUTABLE);
+               role.setPermsProtection(RoleClient.IMMUTABLE);
+        }
+       
+       return role;
+    }
+    
+    /**
+     * Add permission to the Spring Security tables
+     * with assumption that resource is of type URI
+     * @param permission configuration
+     */
+    public static void addPermissionsForUri(Permission perm,
+            PermissionRole permRole) throws PermissionException {
+       //
+       // First check the integrity of the incoming arguments.
+       //
+        if (!perm.getCsid().equals(permRole.getPermission().get(0).getPermissionId())) {
+            throw new IllegalArgumentException("permission ids do not"
+                    + " match for role=" + permRole.getRole().get(0).getRoleName()
+                    + " with permissionId=" + permRole.getPermission().get(0).getPermissionId()
+                    + " for permission with csid=" + perm.getCsid());
+        }
+        
+        List<String> principals = new ArrayList<String>();        
+        for (RoleValue roleValue : permRole.getRole()) {
+            principals.add(roleValue.getRoleName());
+        }
+        List<PermissionAction> permActions = perm.getAction();
+        for (PermissionAction permAction : permActions) {
+               try {
+                   CSpaceAction action = URIResourceImpl.getAction(permAction.getName()); 
+                   URIResourceImpl uriRes = new URIResourceImpl(perm.getTenantId(),
+                           perm.getResourceName(), action);
+                   boolean grant = perm.getEffect().equals(EffectType.PERMIT) ? true : false;
+                   AuthZ.get().addPermissions(uriRes, principals.toArray(new String[0]), grant);//CSPACE-4967
+               } catch (PermissionException e) {
+                       //
+                       // Only throw the exception if it is *not* an already-exists exception
+                       //
+                       if (e.getCause() instanceof AlreadyExistsException == false) {
+                               throw e;
+                       }
+               }
+        }
+    }
+    
+    private static Connection getConnection(String databaseName) throws NamingException, SQLException {
+        return JDBCTools.getConnection(JDBCTools.CSPACE_DATASOURCE_NAME,
+                       databaseName);
+    }
+    
+    /*
+     * Spring security seems to require that all of our role names start
+     * with the ROLE_PREFIX string.
+     */
+    public static String getQualifiedRoleName(String tenantId, String name) {
+       String result = name;
+       
+       String qualifiedName = ROLE_PREFIX + tenantId.toUpperCase() + "_" + name.toUpperCase();         
+       if (name.equals(qualifiedName) == false) {
+               result = qualifiedName;
+       }
+       
+       return result;
+    }
+        
+    private static ActionGroup getActionGroup(String actionGroupStr) {
+       ActionGroup result = null;
+       
+       if (actionGroupStr.equalsIgnoreCase(ACTIONGROUP_CRUDL_NAME)) {
+               result = ACTIONGROUP_CRUDL;
+       } else if (actionGroupStr.equalsIgnoreCase(ACTIONGROUP_RL_NAME)) {
+               result = ACTIONGROUP_RL;
+       }
+       
+       return result;
+    }
+    
+    public static Permission createPermission(String tenantId,
+               String resourceName,
+               String description,
+               String actionGroupStr) {
+       Permission result = null;
+       
+       ActionGroup actionGroup = getActionGroup(actionGroupStr);
+       result = createPermission(tenantId, resourceName, description, actionGroup);
+       
+       return result;
+    }
+    
+    private static Permission createPermission(String tenantId,
+               String resourceName,
+               String description,
+               ActionGroup actionGroup) {
+        String id = tenantId
+                       + "-" + resourceName.replace('/', '_') // Remove the slashes so the ID can be used in a URI/URL
+                       + "-" + actionGroup.name;
+        Permission perm = new Permission();
+        perm.setCsid(id);
+        perm.setDescription(description);
+        perm.setCreatedAtItem(new Date());
+        perm.setResourceName(resourceName.toLowerCase().trim());
+        perm.setEffect(EffectType.PERMIT);
+        perm.setTenantId(tenantId);
+        
+        perm.setActionGroup(actionGroup.name);
+        ArrayList<PermissionAction> pas = new ArrayList<PermissionAction>();
+        perm.setAction(pas);
+        for (ActionType actionType : actionGroup.actions) {
+               PermissionAction permAction = createPermissionAction(perm, actionType);
+               pas.add(permAction);
+        }
+        
+        return perm;
+    }
+    
+    private static Permission createWorkflowPermission(TenantBindingType tenantBinding,
+               ServiceBindingType serviceBinding,
+               TransitionDef transitionDef,
+               ActionGroup actionGroup)
+    {
+       Permission result = null;
+       String workFlowServiceSuffix;
+       String transitionName;
+       if (transitionDef != null) {
+               transitionName = transitionDef.getName();
+               workFlowServiceSuffix = WorkflowClient.SERVICE_AUTHZ_SUFFIX;
+       } else {
+               transitionName = ""; //since the transitionDef was null, we're assuming that this is the base workflow permission to be created                 
+               workFlowServiceSuffix = WorkflowClient.SERVICE_PATH;
+       }
+       
+       String tenantId = tenantBinding.getId();
+       String resourceName = "/"
+                       + serviceBinding.getName().toLowerCase().trim()
+                       + workFlowServiceSuffix
+                       + transitionName;
+       String description = "A generated workflow permission for actiongroup " + actionGroup.name;
+       result = createPermission(tenantId, resourceName, description, actionGroup);
+       
+       if (logger.isDebugEnabled() == true) {
+               logger.debug("Generated a workflow permission: "
+                               + result.getResourceName()
+                               + ":" + transitionName
+                               + ":" + "tenant id=" + result.getTenantId()
+                               + ":" + actionGroup.name);
+       }
+       
+       return result;
+    }
+    
+    private static PermissionRole createPermissionRole(EntityManager em,
+               Permission permission,
+               Role role,
+               boolean enforceTenancy) throws Exception
+    {
+       PermissionRole permRole = new PermissionRole();
+       // Check to see if the tenant ID of the permission and the tenant ID of the role match
+       boolean tenantIdsMatch = role.getTenantId().equalsIgnoreCase(permission.getTenantId());
+       if (tenantIdsMatch == false && enforceTenancy == false) {
+               tenantIdsMatch = true; // If we don't need to enforce tenancy then we'll just consider them matched.
+       }
+                       
+               if (tenantIdsMatch == true) {
+               permRole.setSubject(SubjectType.ROLE);
+               //
+               // Set of the permission value list of the permrole
+               //
+               List<PermissionValue> permValues = new ArrayList<PermissionValue>();
+               PermissionValue permValue = new PermissionValue();
+               permValue.setPermissionId(permission.getCsid());
+               permValue.setResourceName(permission.getResourceName().toLowerCase());
+               permValue.setActionGroup(permission.getActionGroup());
+               permValues.add(permValue);
+               permRole.setPermission(permValues);
+               //
+               // Set of the role value list of the permrole
+               //
+               List<RoleValue> roleValues = new ArrayList<RoleValue>();
+               RoleValue rv = new RoleValue();
+            // This needs to use the qualified name, not the display name
+            rv.setRoleName(role.getRoleName());
+            rv.setRoleId(role.getCsid());
+            roleValues.add(rv);
+            permRole.setRole(roleValues);
+               } else {
+               String errMsg = "The tenant ID of the role: " + role.getTenantId()
+                               + " did not match the tenant ID of the permission: " + permission.getTenantId();
+               throw new Exception(errMsg);
+               }
+       
+       return permRole;
+    }
+    
+    private static Hashtable<String, String> getTenantNamesFromConfig(TenantBindingConfigReaderImpl tenantBindingConfigReader) {
+
+       // Note that this only handles tenants not marked as "createDisabled"
+       Hashtable<String, TenantBindingType> tenantBindings =
+                       tenantBindingConfigReader.getTenantBindings();
+       Hashtable<String, String> tenantInfo = new Hashtable<String, String>();
+       for (TenantBindingType tenantBinding : tenantBindings.values()) {
+               String tId = tenantBinding.getId();
+               String tName = tenantBinding.getName();
+               tenantInfo.put(tId, tName);
+               if (logger.isDebugEnabled()) {
+                       logger.debug("getTenantNamesFromConfig found configured tenant id: "+tId+" name: "+tName);
+               }
+       }
+       return tenantInfo;
+    }
+    
+    private static ArrayList<String> compileExistingTenants(Connection conn, Hashtable<String, String> tenantInfo)
+       throws SQLException, Exception {
+       Statement stmt = null;
+       ArrayList<String> existingTenants = new ArrayList<String>();
+       // First find or create the tenants
+       final String queryTenantSQL = "SELECT id,name FROM tenants";
+       try {
+               stmt = conn.createStatement();
+               ResultSet rs = stmt.executeQuery(queryTenantSQL);
+               while (rs.next()) {
+                       String tId = rs.getString("id");
+                       String tName = rs.getString("name");
+                       if(tenantInfo.containsKey(tId)) {
+                               existingTenants.add(tId);
+                               if(!tenantInfo.get(tId).equalsIgnoreCase(tName)) {
+                                       logger.warn("Configured name for tenant: "
+                                                       +tId+" in repository: "+tName
+                                                       +" does not match config'd name: "+ tenantInfo.get(tId));
+                               }
+                       }
+               }
+               rs.close();
+       } catch(Exception e) {
+               throw e;
+       } finally {
+               if(stmt!=null)
+                       stmt.close();
+       }
+
+       return existingTenants;
+    }
+    
+    private static void createMissingTenants(Connection conn, Hashtable<String, String> tenantInfo,
+               ArrayList<String> existingTenants) throws SQLException, Exception {
+               // Need to define and look for a createDisabled attribute in tenant config
+       final String insertTenantSQL = 
+               "INSERT INTO tenants (id,name,disabled,created_at) VALUES (?,?,FALSE,now())";
+        PreparedStatement pstmt = null;
+       try {
+               pstmt = conn.prepareStatement(insertTenantSQL); // create a statement
+               for(String tId : tenantInfo.keySet()) {
+                       if(existingTenants.contains(tId)) {
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createMissingTenants: tenant exists (skipping): "
+                                                       +tenantInfo.get(tId));
+                               }
+                               continue;
+                       }
+                       pstmt.setString(1, tId);                                        // set id param
+                       pstmt.setString(2, tenantInfo.get(tId));        // set name param
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("createMissingTenants adding entry for tenant: "+tId);
+                       }
+                       pstmt.executeUpdate();
+               }
+               pstmt.close();
+       } catch(Exception e) {
+               throw e;
+       } finally {
+               if(pstmt!=null)
+                       pstmt.close();
+       }
+    }
+    
+    private static ArrayList<String> findOrCreateDefaultUsers(Connection conn, Hashtable<String, String> tenantInfo) 
+               throws SQLException, Exception {
+       // Second find or create the users
+       Statement stmt = null;
+        PreparedStatement pstmt = null;
+       ArrayList<String> usersInRepo = new ArrayList<String>();
+        try {
+               stmt = conn.createStatement();
+               ResultSet rs = stmt.executeQuery(QUERY_USERS_SQL);
+               while (rs.next()) {
+                       String uName = rs.getString("username");
+                       usersInRepo.add(uName);
+               }
+               rs.close();
+               pstmt = conn.prepareStatement(INSERT_USER_SQL); // create a statement
+               for(String tName : tenantInfo.values()) {
+                       String adminAcctName = getDefaultAdminUserID(tName);
+                       if(!usersInRepo.contains(adminAcctName)) {
+                               String secEncPasswd = SecurityUtils.createPasswordHash(
+                                               adminAcctName, DEFAULT_ADMIN_PASSWORD);
+                               pstmt.setString(1, adminAcctName);      // set username param
+                               pstmt.setString(2, secEncPasswd);       // set passwd param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createDefaultUsersAndAccounts adding user: "
+                                                       +adminAcctName+" for tenant: "+tName);
+                               }
+                               pstmt.executeUpdate();
+                       } else if (logger.isDebugEnabled()) {
+                               logger.debug("createDefaultUsersAndAccounts: user: "+adminAcctName
+                                               +" already exists - skipping.");
+                       }
+
+
+                       String readerAcctName =  getDefaultReaderUserID(tName);
+                       if(!usersInRepo.contains(readerAcctName)) {
+                               String secEncPasswd = SecurityUtils.createPasswordHash(
+                                               readerAcctName, DEFAULT_READER_PASSWORD);
+                               pstmt.setString(1, readerAcctName);     // set username param
+                               pstmt.setString(2, secEncPasswd);       // set passwd param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createDefaultUsersAndAccounts adding user: "
+                                                       +readerAcctName+" for tenant: "+tName);
+                               }
+                               pstmt.executeUpdate();
+                       } else if (logger.isDebugEnabled()) {
+                               logger.debug("createDefaultUsersAndAccounts: user: "+readerAcctName
+                                               +" already exists - skipping.");
+                       }
+               }
+               pstmt.close();
+        } catch(Exception e) {
+               throw e;
+        } finally {
+               if(stmt!=null)
+                       stmt.close();
+               if(pstmt!=null)
+                       pstmt.close();
+        }
+        return usersInRepo;
+    }
+    
+    private static void findOrCreateDefaultAccounts(Connection conn, Hashtable<String, String> tenantInfo,
+               ArrayList<String> usersInRepo,
+               Hashtable<String, String> tenantAdminAcctCSIDs, Hashtable<String, String> tenantReaderAcctCSIDs) 
+                       throws SQLException, Exception {
+       // Third, create the accounts. Assume that if the users were already there,
+       // then the accounts were as well
+       PreparedStatement pstmt = null;
+       try {
+               pstmt = conn.prepareStatement(INSERT_ACCOUNT_SQL); // create a statement
+               for(String tId : tenantInfo.keySet()) {
+                       String tName = tenantInfo.get(tId);
+                       String adminCSID = UUID.randomUUID().toString();
+                       tenantAdminAcctCSIDs.put(tId, adminCSID);
+                       String adminAcctName =  getDefaultAdminUserID(tName);
+                       if(!usersInRepo.contains(adminAcctName)) {
+                               pstmt.setString(1, adminCSID);                  // set csid param
+                               pstmt.setString(2, adminAcctName);      // set email param (bogus)
+                               pstmt.setString(3, adminAcctName);      // set userid param
+                               pstmt.setString(4, "Administrator");// set screen name param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createDefaultAccounts adding account: "
+                                                       +adminAcctName+" for tenant: "+tName);
+                               }
+                               pstmt.executeUpdate();
+                       } else if (logger.isDebugEnabled()) {
+                               logger.debug("createDefaultAccounts: user: "+adminAcctName
+                                               +" already exists - skipping account generation.");
+                       }
+
+                       String readerCSID = UUID.randomUUID().toString();       
+                       tenantReaderAcctCSIDs.put(tId, readerCSID);
+                       String readerAcctName =  getDefaultReaderUserID(tName);
+                       if(!usersInRepo.contains(readerAcctName)) {
+                               pstmt.setString(1, readerCSID);         // set csid param
+                               pstmt.setString(2, readerAcctName);     // set email param (bogus)
+                               pstmt.setString(3, readerAcctName);     // set userid param
+                               pstmt.setString(4, "Reader");           // set screen name param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createDefaultAccounts adding account: "
+                                                       +readerAcctName+" for tenant: "+tName);
+                               }
+                               pstmt.executeUpdate();
+                       } else if (logger.isDebugEnabled()) {
+                               logger.debug("createDefaultAccounts: user: "+readerAcctName
+                                               +" already exists - skipping account creation.");
+                       }
+               }
+               pstmt.close();
+       } catch(Exception e) {
+               throw e;
+       } finally {
+               if(pstmt!=null)
+                       pstmt.close();
+       }
+    }
+    
+    private static boolean findOrCreateTenantManagerUserAndAccount(Connection conn) 
+                       throws SQLException, Exception {
+       // Find or create the special tenant manager account.
+       // Later can make the user name for tenant manager be configurable, settable.
+       Statement stmt = null;
+        PreparedStatement pstmt = null;
+        boolean created = false;
+        try {
+               boolean foundTMgrUser = false;
+               stmt = conn.createStatement();
+               ResultSet rs = stmt.executeQuery(QUERY_TENANT_MGR_USER_SQL);
+               // Should only find one - only consider it
+               if(rs.next()) {
+                       String uName = rs.getString("username");
+                       foundTMgrUser = uName.equals(TENANT_MANAGER_USER);
+               }
+               rs.close();
+               if(!foundTMgrUser) {
+                       pstmt = conn.prepareStatement(INSERT_USER_SQL); // create a statement
+                       String secEncPasswd = SecurityUtils.createPasswordHash(
+                                       TENANT_MANAGER_USER, DEFAULT_TENANT_MANAGER_PASSWORD);
+                       pstmt.setString(1, TENANT_MANAGER_USER);        // set username param
+                       pstmt.setString(2, secEncPasswd);       // set passwd param
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("findOrCreateTenantManagerUserAndAccount adding tenant manager user: "
+                                               +TENANT_MANAGER_USER);
+                       }
+                       pstmt.executeUpdate();
+               pstmt.close();
+               // Now create the account to match
+                       pstmt = conn.prepareStatement(INSERT_ACCOUNT_SQL); // create a statement
+                               pstmt.setString(1, AuthN.TENANT_MANAGER_ACCT_ID);                // set csid param
+                               pstmt.setString(2, DEFAULT_TENANT_MANAGER_EMAIL);       // set email param (bogus)
+                               pstmt.setString(3, TENANT_MANAGER_USER);        // set userid param
+                               pstmt.setString(4, TENANT_MANAGER_SCREEN_NAME);// set screen name param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("findOrCreateTenantManagerUserAndAccount adding tenant manager account: "
+                                                       +TENANT_MANAGER_USER);
+                               }
+                               pstmt.executeUpdate();
+                       pstmt.close();
+                       created = true;
+               } else if (logger.isDebugEnabled()) {
+                       logger.debug("findOrCreateTenantManagerUserAndAccount: tenant manager: "+TENANT_MANAGER_USER
+                                       +" already exists.");
+               }
+       } catch(Exception e) {
+               throw e;
+       } finally {
+               if(stmt!=null)
+                       stmt.close();
+               if(pstmt!=null)
+                       pstmt.close();
+       }
+        return created;
+    }
+    
+    private static void bindDefaultAccountsToTenants(Connection conn, DatabaseProductType databaseProductType,
+               Hashtable<String, String> tenantInfo, ArrayList<String> usersInRepo,
+               Hashtable<String, String> tenantAdminAcctCSIDs, Hashtable<String, String> tenantReaderAcctCSIDs) 
+                       throws SQLException, Exception {
+       // Fourth, bind accounts to tenants. Assume that if the users were already there,
+       // then the accounts were bound to tenants correctly
+       PreparedStatement pstmt = null;
+       try {
+               String insertAccountTenantSQL;
+               if (databaseProductType == DatabaseProductType.MYSQL) {
+                       insertAccountTenantSQL =
+                                       "INSERT INTO accounts_tenants (TENANTS_ACCOUNTSCOMMON_CSID,tenant_id) "
+                                                       + " VALUES(?, ?)";
+               } else if (databaseProductType == DatabaseProductType.POSTGRESQL) {
+                       insertAccountTenantSQL =
+                                       "INSERT INTO accounts_tenants (HJID, TENANTS_ACCOUNTSCOMMON_CSID,tenant_id) "
+                                                       + " VALUES(nextval('hibernate_sequence'), ?, ?)";
+               } else {
+                       throw new Exception("Unrecognized database system.");
+               }
+               pstmt = conn.prepareStatement(insertAccountTenantSQL); // create a statement
+               for(String tId : tenantInfo.keySet()) {
+                       String tName = tenantInfo.get(tId);
+                       if(!usersInRepo.contains(getDefaultAdminUserID(tName))) {
+                               String adminAcct = tenantAdminAcctCSIDs.get(tId);
+                               pstmt.setString(1, adminAcct);          // set acct CSID param
+                               pstmt.setString(2, tId);                        // set tenant_id param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createDefaultAccounts binding account id: "
+                                                       +adminAcct+" to tenant id: "+tId);
+                               }
+                               pstmt.executeUpdate();
+                       }
+                       if(!usersInRepo.contains(getDefaultReaderUserID(tName))) {
+                               String readerAcct = tenantReaderAcctCSIDs.get(tId);
+                               pstmt.setString(1, readerAcct);         // set acct CSID param
+                               pstmt.setString(2, tId);                        // set tenant_id param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createDefaultAccounts binding account id: "
+                                                       +readerAcct+" to tenant id: "+tId);
+                               }
+                               pstmt.executeUpdate();
+                       }
+               }
+               pstmt.close();
+       } catch(Exception e) {
+               throw e;
+       } finally {
+               if(pstmt!=null)
+                       pstmt.close();
+       }
+    }
+    
+    
+    private static String findOrCreateDefaultRoles(Connection conn, Hashtable<String, String> tenantInfo,
+               Hashtable<String, String> tenantAdminRoleCSIDs, Hashtable<String, String> tenantReaderRoleCSIDs) 
+                       throws SQLException, Exception {
+       // Fifth, fetch and save the default roles
+               String springAdminRoleCSID = null;
+       Statement stmt = null;
+       PreparedStatement pstmt = null;
+       try {
+               final String querySpringRole = 
+                               "SELECT csid from roles WHERE rolename='"+SPRING_ADMIN_ROLE+"'";
+               stmt = conn.createStatement();
+               ResultSet rs = stmt.executeQuery(querySpringRole);
+               if(rs.next()) {
+                       springAdminRoleCSID = rs.getString(1);
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("createDefaultAccounts found Spring Admin role: "
+                                               +springAdminRoleCSID);
+                       }
+               } else {
+                       final String insertSpringAdminRoleSQL =
+                                       "INSERT INTO roles (csid, rolename, displayName, rolegroup, created_at, tenant_id) "
+                                                       + "VALUES ('-1', 'ROLE_SPRING_ADMIN', 'SPRING_ADMIN', 'Spring Security Administrator', now(), '0')";
+                       stmt.executeUpdate(insertSpringAdminRoleSQL);
+                       springAdminRoleCSID = "-1";
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("createDefaultAccounts CREATED Spring Admin role: "
+                                               +springAdminRoleCSID);
+                       }
+               }
+               rs.close();
+               final String getRoleCSIDSql =
+                               "SELECT csid from roles WHERE tenant_id=? and rolename=?";
+               pstmt = conn.prepareStatement(getRoleCSIDSql); // create a statement
+               rs = null;
+               for(String tId : tenantInfo.keySet()) {
+                       pstmt.setString(1, tId);                                                // set tenant_id param
+                       pstmt.setString(2, getDefaultAdminRole(tId));   // set rolename param
+                       rs = pstmt.executeQuery();
+                       // extract data from the ResultSet
+                       if(!rs.next()) {
+                               throw new RuntimeException("Cannot find role: "+getDefaultAdminRole(tId)
+                                               +" for tenant id: "+tId+" in roles!");
+                       }
+                       String tenantAdminRoleCSID = rs.getString(1);
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("createDefaultAccounts found role: "
+                                               +getDefaultAdminRole(tId)+"("+tenantAdminRoleCSID
+                                               +") for tenant id: "+tId);
+                       }
+                       tenantAdminRoleCSIDs.put(tId, tenantAdminRoleCSID);
+                       pstmt.setString(1, tId);                                                // set tenant_id param
+                       pstmt.setString(2, getDefaultReaderRole(tId));  // set rolename param
+                       rs.close();
+                       rs = pstmt.executeQuery();
+                       // extract data from the ResultSet
+                       if(!rs.next()) {
+                               throw new RuntimeException("Cannot find role: "+getDefaultReaderRole(tId)
+                                               +" for tenant id: "+tId+" in roles!");
+                       }
+                       String tenantReaderRoleCSID = rs.getString(1);
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("createDefaultAccounts found role: "
+                                               +getDefaultReaderRole(tId)+"("+tenantReaderRoleCSID
+                                               +") for tenant id: "+tId);
+                       }
+                       tenantReaderRoleCSIDs.put(tId, tenantReaderRoleCSID);
+                       rs.close();
+               }
+               pstmt.close();
+       } catch(Exception e) {
+               throw e;
+       } finally {
+               if(stmt!=null)
+                       stmt.close();
+               if(pstmt!=null)
+                       pstmt.close();
+       }
+       return springAdminRoleCSID;
+    }
+
+    private static String findTenantManagerRole(Connection conn ) 
+                       throws SQLException, RuntimeException, Exception {
+               String tenantMgrRoleCSID = null;
+       PreparedStatement pstmt = null;
+       try {
+               String rolename = getQualifiedRoleName(ALL_TENANTS_MANAGER_TENANT_ID, 
+                                                                                               ROLE_ALL_TENANTS_MANAGER);              
+               pstmt = conn.prepareStatement(GET_TENANT_MGR_ROLE_SQL); // create a statement
+               ResultSet rs = null;
+               pstmt.setString(1, rolename);   // set rolename param
+               rs = pstmt.executeQuery();
+               if(rs.next()) {
+                       tenantMgrRoleCSID = rs.getString(1);
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("findTenantManagerRole found Tenant Mgr role: "
+                                               +tenantMgrRoleCSID);
+                       }
+               }
+               rs.close();
+       } catch(Exception e) {
+               throw e;
+       } finally {
+               if(pstmt!=null)
+                       pstmt.close();
+       }
+       if(tenantMgrRoleCSID==null)
+               throw new RuntimeException("findTenantManagerRole: Cound not find tenant Manager Role!");
+       return tenantMgrRoleCSID;
+    }
+
+    private static void bindAccountsToRoles(Connection conn,  DatabaseProductType databaseProductType,
+               Hashtable<String, String> tenantInfo, ArrayList<String> usersInRepo,
+               String springAdminRoleCSID,
+               Hashtable<String, String> tenantAdminRoleCSIDs, Hashtable<String, String> tenantReaderRoleCSIDs,
+               Hashtable<String, String> tenantAdminAcctCSIDs, Hashtable<String, String> tenantReaderAcctCSIDs) 
+                       throws SQLException, Exception {
+       // Sixth, bind the accounts to roles. If the users already existed,
+       // we'll assume they were set up correctly.
+       PreparedStatement pstmt = null;
+       try {
+               String insertAccountRoleSQL;
+               if (databaseProductType == DatabaseProductType.MYSQL) {
+                       insertAccountRoleSQL = INSERT_ACCOUNT_ROLE_SQL_MYSQL;
+               } else if (databaseProductType == DatabaseProductType.POSTGRESQL) {
+                       insertAccountRoleSQL = INSERT_ACCOUNT_ROLE_SQL_POSTGRES;
+               } else {
+                       throw new Exception("Unrecognized database system.");
+               }
+               if (logger.isDebugEnabled()) {
+                       logger.debug("createDefaultAccounts binding accounts to roles with SQL:\n"
+                                       +insertAccountRoleSQL);
+               }
+               pstmt = conn.prepareStatement(insertAccountRoleSQL); // create a statement
+               for(String tId : tenantInfo.keySet()) {
+                       String adminUserId =  getDefaultAdminUserID(tenantInfo.get(tId));
+                       if(!usersInRepo.contains(adminUserId)) {
+                               String adminAcct = tenantAdminAcctCSIDs.get(tId);
+                               String adminRoleId = tenantAdminRoleCSIDs.get(tId);
+                               pstmt.setString(1, adminAcct);          // set acct CSID param
+                               pstmt.setString(2, adminUserId);        // set user_id param
+                               pstmt.setString(3, adminRoleId);        // set role_id param
+                               pstmt.setString(4, getDefaultAdminRole(tId));   // set rolename param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createDefaultAccounts binding account: "
+                                                       +adminUserId+" to Admin role("+adminRoleId
+                                                       +") for tenant id: "+tId);
+                               }
+                               pstmt.executeUpdate();
+                               // Now add the Spring Admin Role to the admin accounts
+                               pstmt.setString(3, springAdminRoleCSID);        // set role_id param
+                               pstmt.setString(4, SPRING_ADMIN_ROLE);          // set rolename param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createDefaultAccounts binding account: "
+                                                       +adminUserId+" to Spring Admin role: "+springAdminRoleCSID);
+                               }
+                               pstmt.executeUpdate();
+                       }
+                       String readerUserId = getDefaultReaderUserID(tenantInfo.get(tId));
+                       if(!usersInRepo.contains(readerUserId)) {
+                               String readerAcct = tenantReaderAcctCSIDs.get(tId);
+                               String readerRoleId = tenantReaderRoleCSIDs.get(tId);
+                               pstmt.setString(1, readerAcct);         // set acct CSID param
+                               pstmt.setString(2, readerUserId);       // set user_id param
+                               pstmt.setString(3, readerRoleId);       // set role_id param
+                               pstmt.setString(4, getDefaultReaderRole(tId));  // set rolename param
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("createDefaultAccounts binding account: "
+                                                       +readerUserId+" to Reader role("+readerRoleId
+                                                       +") for tenant id: "+tId);
+                               }
+                               pstmt.executeUpdate();
+                       }
+               }
+               pstmt.close();
+       } catch(Exception e) {
+               throw e;
+       } finally {
+               if(pstmt!=null)
+                       pstmt.close();
+       }
+    }
+    
+    private static void bindTenantManagerAccountRole(Connection conn,  DatabaseProductType databaseProductType,
+               String tenantManagerUserID, String tenantManagerAccountID, String tenantManagerRoleID, String tenantManagerRoleName ) 
+                       throws SQLException, Exception {
+       PreparedStatement pstmt = null;
+       try {
+               String insertAccountRoleSQL;
+               if (databaseProductType == DatabaseProductType.MYSQL) {
+                       insertAccountRoleSQL = INSERT_ACCOUNT_ROLE_SQL_MYSQL;
+               } else if (databaseProductType == DatabaseProductType.POSTGRESQL) {
+                       insertAccountRoleSQL = INSERT_ACCOUNT_ROLE_SQL_POSTGRES;
+               } else {
+                       throw new Exception("Unrecognized database system.");
+               }
+               if (logger.isDebugEnabled()) {
+                       logger.debug("bindTenantManagerAccountRole binding account to role with SQL:\n"
+                                       +insertAccountRoleSQL);
+               }
+               pstmt = conn.prepareStatement(insertAccountRoleSQL); // create a statement
+               pstmt.setString(1, tenantManagerAccountID);             // set acct CSID param
+               pstmt.setString(2, tenantManagerUserID);        // set user_id param
+               pstmt.setString(3, tenantManagerRoleID);        // set role_id param
+               pstmt.setString(4, tenantManagerRoleName);      // set rolename param
+               if (logger.isDebugEnabled()) {
+                       logger.debug("bindTenantManagerAccountRole binding user: "
+                                       +tenantManagerUserID+" to Admin role("+tenantManagerRoleName+")");
+               }
+               pstmt.executeUpdate();
+               /* At this point, tenant manager should not need the Spring Admin Role
+               pstmt.setString(3, springAdminRoleCSID);        // set role_id param
+               pstmt.setString(4, SPRING_ADMIN_ROLE);          // set rolename param
+               if (logger.isDebugEnabled()) {
+                       logger.debug("createDefaultAccounts binding account: "
+                                       +adminUserId+" to Spring Admin role: "+springAdminRoleCSID);
+               }
+               pstmt.executeUpdate();
+               */
+               pstmt.close();
+       } catch(Exception e) {
+               throw e;
+       } finally {
+               if(pstmt!=null)
+                       pstmt.close();
+       }
+    }
+    
+    public static void createDefaultAccounts(
+               TenantBindingConfigReaderImpl tenantBindingConfigReader,
+               DatabaseProductType databaseProductType,
+               String cspaceDatabaseName) throws Exception {
+
+       logger.debug("ServiceMain.createDefaultAccounts starting...");
+       
+        Hashtable<String, String> tenantInfo = getTenantNamesFromConfig(tenantBindingConfigReader);
+        Connection conn = null;
+        // TODO - need to put in tests for existence first.
+        // We could just look for the accounts per tenant up front, and assume that
+        // the rest is there if the accounts are.
+        // Could add a sql script to remove these if need be - Spring only does roles, 
+        // and we're not touching that, so we could safely toss the 
+        // accounts, users, account-tenants, account-roles, and start over.
+        try {
+               conn = getConnection(cspaceDatabaseName);
+               ArrayList<String> existingTenants = compileExistingTenants(conn, tenantInfo);
+               
+               // Note that this only creates tenants not marked as "createDisabled"
+               createMissingTenants(conn, tenantInfo, existingTenants);
+               
+               ArrayList<String> usersInRepo = findOrCreateDefaultUsers(conn, tenantInfo);
+               
+               Hashtable<String, String> tenantAdminAcctCSIDs = new Hashtable<String, String>();
+               Hashtable<String, String> tenantReaderAcctCSIDs = new Hashtable<String, String>();
+               findOrCreateDefaultAccounts(conn, tenantInfo, usersInRepo,
+                               tenantAdminAcctCSIDs, tenantReaderAcctCSIDs);
+
+               bindDefaultAccountsToTenants(conn, databaseProductType, tenantInfo, usersInRepo,
+                               tenantAdminAcctCSIDs, tenantReaderAcctCSIDs);
+               
+               Hashtable<String, String> tenantAdminRoleCSIDs = new Hashtable<String, String>();
+               Hashtable<String, String> tenantReaderRoleCSIDs = new Hashtable<String, String>();
+               String springAdminRoleCSID = findOrCreateDefaultRoles(conn, tenantInfo,
+                               tenantAdminRoleCSIDs, tenantReaderRoleCSIDs);
+               
+               bindAccountsToRoles(conn,  databaseProductType,
+                               tenantInfo, usersInRepo, springAdminRoleCSID,
+                               tenantAdminRoleCSIDs, tenantReaderRoleCSIDs,
+                               tenantAdminAcctCSIDs, tenantReaderAcctCSIDs);
+               
+               boolean createdTenantMgrAccount = findOrCreateTenantManagerUserAndAccount(conn);
+               if(createdTenantMgrAccount) {
+                       // If we created the account, we need to create the bindings. Otherwise, assume they
+                       // are all set (from previous initialization).
+                       String tenantManagerRoleCSID = findTenantManagerRole(conn);
+                       bindTenantManagerAccountRole(conn, databaseProductType, 
+                                       TENANT_MANAGER_USER, AuthN.TENANT_MANAGER_ACCT_ID, 
+                                       tenantManagerRoleCSID, ROLE_ALL_TENANTS_MANAGER);
+               }
+        } catch (Exception e) {
+                       logger.debug("Exception in createDefaultAccounts: " + e.getLocalizedMessage());
+               throw e;
+               } finally {
+                       try {
+                               if (conn != null)
+                                       conn.close();
+                       } catch (SQLException sqle) {
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("SQL Exception closing statement/connection: " + sqle.getLocalizedMessage());
+                               }
+                       }
+               }       
+    }
+    
+    private static String getDefaultAdminRole(String tenantId) {
+       return ROLE_PREFIX+tenantId+TENANT_ADMIN_ROLE_SUFFIX;
+    }
+    
+    private static String getDefaultReaderRole(String tenantId) {
+       return ROLE_PREFIX+tenantId+TENANT_READER_ROLE_SUFFIX;
+    }
+    
+    private static String getDefaultAdminUserID(String tenantName) {
+       return TENANT_ADMIN_ACCT_PREFIX+tenantName;
+    }
+    
+    private static String getDefaultReaderUserID(String tenantName) {
+       return TENANT_READER_ACCT_PREFIX+tenantName;
+    }
+    
+       static public PermissionAction createPermissionAction(Permission perm,
+                       ActionType actionType) {
+        PermissionAction pa = new PermissionAction();
+
+           CSpaceAction action = URIResourceImpl.getAction(actionType);
+           URIResourceImpl uriRes = new URIResourceImpl(perm.getTenantId(),
+                   perm.getResourceName(), action);
+           pa.setName(actionType);
+           pa.setObjectIdentity(uriRes.getHashedId().toString());
+           pa.setObjectIdentityResource(uriRes.getId());
+           
+           return pa;
+       }
+
+       static public PermissionAction update(Permission perm, PermissionAction permAction) {
+        PermissionAction pa = new PermissionAction();
+
+           CSpaceAction action = URIResourceImpl.getAction(permAction.getName());
+           URIResourceImpl uriRes = new URIResourceImpl(perm.getTenantId(),
+                   perm.getResourceName(), action);
+           pa.setObjectIdentity(uriRes.getHashedId().toString());
+           pa.setObjectIdentityResource(uriRes.getId());
+           
+           return pa;
+       }
+       
+       private static TransitionDefList getTransitionDefList(TenantBindingType tenantBinding, ServiceBindingType serviceBinding) {
+               TransitionDefList result = null;
+               try {
+                       String serviceObjectName = serviceBinding.getObject().getName();
+               DocumentHandler docHandler = ServiceConfigUtils.createDocumentHandlerInstance(
+                               tenantBinding, serviceBinding);
+               Lifecycle lifecycle = docHandler.getLifecycle(serviceObjectName);
+               if (lifecycle != null) {
+                       result = lifecycle.getTransitionDefList();
+               }
+               } catch (Exception e) {
+                       // Ignore this exception and return an empty non-null TransitionDefList
+               }
+               
+               if (result == null) {
+                       if (serviceBinding.getType().equalsIgnoreCase(ServiceBindingUtils.SERVICE_TYPE_SECURITY) == false) {
+                               logger.warn("Could not retrieve a lifecycle transition definition list from: "
+                                               + serviceBinding.getName()
+                                               + " with tenant ID = "
+                                               + tenantBinding.getId());
+                       }
+                       // return an empty list                 
+                       result = new TransitionDefList();
+               } else {
+                       logger.debug("Successfully retrieved a lifecycle transition definition list from: "
+                                       + serviceBinding.getName()
+                                       + " with tenant ID = "
+                                       + tenantBinding.getId());
+               }
+               
+               return result;
+       }
+       
+    public static void createDefaultWorkflowPermissions(TenantBindingConfigReaderImpl tenantBindingConfigReader) throws Exception //FIXME: REM - 4/11/2012 - Rename to createWorkflowPermissions
+    {
+       AuthZ.get().login(); //login to Spring Security manager
+       
+        EntityManagerFactory emf = JpaStorageUtils.getEntityManagerFactory(JpaStorageUtils.CS_PERSISTENCE_UNIT);
+        EntityManager em = null;
+
+        try {
+            em = emf.createEntityManager();
+
+               Hashtable<String, TenantBindingType> tenantBindings =
+                       tenantBindingConfigReader.getTenantBindings();
+               for (String tenantId : tenantBindings.keySet()) {
+                       TenantBindingType tenantBinding = tenantBindings.get(tenantId);
+                       Role adminRole = AuthorizationCommon.getRole(em, tenantBinding.getId(), ROLE_TENANT_ADMINISTRATOR);
+                       Role readonlyRole = AuthorizationCommon.getRole(em, tenantBinding.getId(), ROLE_TENANT_READER);
+                       for (ServiceBindingType serviceBinding : tenantBinding.getServiceBindings()) {
+                               String prop = ServiceBindingUtils.getPropertyValue(serviceBinding, REFRESH_AUTZ_PROP);
+                               if (prop == null ? true : Boolean.parseBoolean(prop)) {
+                                               try {
+                                               em.getTransaction().begin();
+                                               TransitionDefList transitionDefList = getTransitionDefList(tenantBinding, serviceBinding);
+                                               for (TransitionDef transitionDef : transitionDefList.getTransitionDef()) {
+                                                       //
+                                                       // Create the permission for the admin role
+                                                       Permission adminPerm = createWorkflowPermission(tenantBinding, serviceBinding, transitionDef, ACTIONGROUP_CRUDL);
+                                                       persist(em, adminPerm, adminRole, true);
+                                                       //
+                                                       // Create the permission for the read-only role
+                                                       Permission readonlyPerm = createWorkflowPermission(tenantBinding, serviceBinding, transitionDef, ACTIONGROUP_RL);
+                                                       
+                                                       Profiler profiler = new Profiler(AuthorizationCommon.class, 1);
+                                                       profiler.start("createDefaultPermissions started:" + readonlyPerm.getCsid());
+                                                       persist(em, readonlyPerm, readonlyRole, true); // Persist/store the permission and permrole records and related Spring Security info
+                                                       profiler.stop();
+                                                       logger.debug("Finished full perm generation for "
+                                                                       + ":" + tenantBinding.getId()
+                                                                       + ":" + serviceBinding.getName()
+                                                                       + ":" + transitionDef.getName()
+                                                                       + ":" + ACTIONGROUP_RL
+                                                                       + ":" + profiler.getCumulativeTime());                                          
+                                               }
+                                               em.getTransaction().commit();
+                                       } catch (IllegalStateException e) {
+                                               logger.debug(e.getLocalizedMessage(), e); //We end up here if there is no document handler for the service -this is ok for some of the services.
+                                       }
+                               } else {
+                                       logger.warn("AuthZ refresh service binding property is set to FALSE so default permissions will NOT be refreshed for: "
+                                                       + serviceBinding.getName());
+                               }
+                       }
+               }
+            em.close();
+       } catch (Exception e) {
+            if (em != null && em.getTransaction().isActive()) {
+                em.getTransaction().rollback();
+            }
+            if (logger.isDebugEnabled()) {
+                logger.debug("Caught exception and rolling back permission creation: ", e);
+            }
+            throw e;
+        } finally {
+            if (em != null) {
+                JpaStorageUtils.releaseEntityManagerFactory(emf);
+            }
+        }
+    }
+    
+    private static PermissionRoleRel findPermRoleRel(EntityManager em, String permissionId, String RoleId) {
+       PermissionRoleRel result = null;
+       
+       try {
+               String whereClause = "where permissionId = :id and roleId = :roleId";
+               HashMap<String, Object> params = new HashMap<String, Object>();
+               params.put("id", permissionId);
+               params.put("roleId", RoleId);        
+       
+               result = (PermissionRoleRel) JpaStorageUtils.getEntity(em,
+                               PermissionRoleRel.class.getCanonicalName(), whereClause, params);
+       } catch (Exception e) {
+               //Do nothing. Will return null;
+       }
+               
+       return result;
+    }
+    
+    /*
+     * Persists the Permission, PermissionRoleRel, and Spring Security table entries all in one transaction
+     */
+    private static void persist(EntityManager em, Permission permission, Role role, boolean enforceTenancy) throws Exception {
+               AuthorizationStore authzStore = new AuthorizationStore();
+               // First persist the Permission record
+               authzStore.store(em, permission);
+               
+               // If the PermRoleRel doesn't already exists then relate the permission and the role in a new PermissionRole (the service payload)
+               // Create a PermissionRoleRel (the database relation table for the permission and role)
+               PermissionRoleRel permRoleRel = findPermRoleRel(em, permission.getCsid(), role.getCsid());
+               if (permRoleRel == null) {
+                       PermissionRole permRole = createPermissionRole(em, permission, role, enforceTenancy);
+               List<PermissionRoleRel> permRoleRels = new ArrayList<PermissionRoleRel>();
+               PermissionRoleUtil.buildPermissionRoleRel(em, permRole, SubjectType.ROLE, permRoleRels, false /*not for delete*/);
+               for (PermissionRoleRel prr : permRoleRels) {
+                   authzStore.store(em, prr);
+               }
+                       Profiler profiler = new Profiler(AuthorizationCommon.class, 2);
+                       profiler.start();
+                       // Add a corresponding entry in the Spring Security Tables
+                       addPermissionsForUri(permission, permRole);
+                       profiler.stop();
+                       logger.debug("Finished full perm generation for "
+                                       + ":" + permission.getTenantId()
+                                       + ":" + permission.getResourceName()
+                                       + ":" + ACTIONGROUP_RL
+                                       + ":" + profiler.getCumulativeTime());
+               }
+        
+    }
+
+}
index b2828e93650cacfde899030609695db09c5b0da2..c61560505cafa71f79f20b233ecc09d6dba6df63 100644 (file)
@@ -1,71 +1,71 @@
-package org.collectionspace.services.common.authorization_mgt;\r
-\r
-import org.collectionspace.services.authorization.AccountValue;\r
-import org.collectionspace.services.authorization.PermissionRoleRel;\r
-import org.collectionspace.services.authorization.AccountRoleRel;\r
-import org.collectionspace.services.authorization.PermissionValue;\r
-import org.collectionspace.services.authorization.RoleValue;\r
-\r
-public class AuthorizationRoleRel {\r
-\r
-    /**\r
-     * Builds the account value.\r
-     *\r
-     * @param arr the arr\r
-     * @return the account value\r
-     */\r
-    static public AccountValue buildAccountValue(AccountRoleRel arr) {\r
-        AccountValue av = new AccountValue();\r
-        av.setAccountId(arr.getAccountId());\r
-        av.setUserId(arr.getUserId());\r
-        av.setScreenName(arr.getScreenName());\r
-        return av;\r
-    }\r
-       \r
-    /**\r
-     * Builds the role value.\r
-     *\r
-     * @param arr the arr\r
-     * @return the role account value\r
-     */\r
-    static public RoleValue buildRoleValue(AccountRoleRel arr) {\r
-       RoleValue rv = null;\r
-       if (arr.getRoleId().equals(AuthorizationCommon.ROLE_SPRING_ADMIN_ID) == false) {\r
-               rv = new RoleValue();\r
-               rv.setRoleId(arr.getRoleId());\r
-               rv.setRoleName(arr.getRoleName());\r
-               rv.setRoleRelationshipId(arr.getHjid().toString());\r
-       }\r
-        return rv;\r
-    }\r
-    \r
-    /**\r
-     * Builds the permission value.\r
-     *\r
-     * @param prr the prr\r
-     * @return the permission value\r
-     */\r
-    static public PermissionValue buildPermissionValue(PermissionRoleRel prr) {\r
-        PermissionValue pv = new PermissionValue();\r
-        pv.setPermissionId(prr.getPermissionId());\r
-        pv.setResourceName(prr.getPermissionResource());\r
-        pv.setActionGroup(prr.getActionGroup());\r
-        pv.setPermRelationshipId(prr.getHjid().toString());\r
-        return pv;\r
-    }\r
-    \r
-    /**\r
-     * Builds the role value.\r
-     *\r
-     * @param prr the prr\r
-     * @return the role value\r
-     */\r
-    static public RoleValue buildRoleValue(PermissionRoleRel prr) {\r
-        RoleValue rv = new RoleValue();\r
-        rv.setRoleId(prr.getRoleId());\r
-        rv.setRoleName(prr.getRoleName());\r
-        rv.setRoleRelationshipId(prr.getHjid().toString());\r
-        return rv;\r
-    }\r
-    \r
-}\r
+package org.collectionspace.services.common.authorization_mgt;
+
+import org.collectionspace.services.authorization.AccountValue;
+import org.collectionspace.services.authorization.PermissionRoleRel;
+import org.collectionspace.services.authorization.AccountRoleRel;
+import org.collectionspace.services.authorization.PermissionValue;
+import org.collectionspace.services.authorization.RoleValue;
+
+public class AuthorizationRoleRel {
+
+    /**
+     * Builds the account value.
+     *
+     * @param arr the arr
+     * @return the account value
+     */
+    static public AccountValue buildAccountValue(AccountRoleRel arr) {
+        AccountValue av = new AccountValue();
+        av.setAccountId(arr.getAccountId());
+        av.setUserId(arr.getUserId());
+        av.setScreenName(arr.getScreenName());
+        return av;
+    }
+       
+    /**
+     * Builds the role value.
+     *
+     * @param arr the arr
+     * @return the role account value
+     */
+    static public RoleValue buildRoleValue(AccountRoleRel arr) {
+       RoleValue rv = null;
+       if (arr.getRoleId().equals(AuthorizationCommon.ROLE_SPRING_ADMIN_ID) == false) {
+               rv = new RoleValue();
+               rv.setRoleId(arr.getRoleId());
+               rv.setRoleName(arr.getRoleName());
+               rv.setRoleRelationshipId(arr.getHjid().toString());
+       }
+        return rv;
+    }
+    
+    /**
+     * Builds the permission value.
+     *
+     * @param prr the prr
+     * @return the permission value
+     */
+    static public PermissionValue buildPermissionValue(PermissionRoleRel prr) {
+        PermissionValue pv = new PermissionValue();
+        pv.setPermissionId(prr.getPermissionId());
+        pv.setResourceName(prr.getPermissionResource());
+        pv.setActionGroup(prr.getActionGroup());
+        pv.setPermRelationshipId(prr.getHjid().toString());
+        return pv;
+    }
+    
+    /**
+     * Builds the role value.
+     *
+     * @param prr the prr
+     * @return the role value
+     */
+    static public RoleValue buildRoleValue(PermissionRoleRel prr) {
+        RoleValue rv = new RoleValue();
+        rv.setRoleId(prr.getRoleId());
+        rv.setRoleName(prr.getRoleName());
+        rv.setRoleRelationshipId(prr.getHjid().toString());
+        return rv;
+    }
+    
+}
index 8cd38fb8e4b6b18cc352d547d94440e7c0bda890..5bc9eea7b7a1574abe3f1ee3a0ffaaf7c09af4b6 100644 (file)
-package org.collectionspace.services.common.blob;\r
-\r
-import java.io.File;\r
-import java.io.InputStream;\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import javax.servlet.http.HttpServletRequest;\r
-\r
-import org.collectionspace.services.nuxeo.client.java.CommonList;\r
-import org.collectionspace.services.common.Download;\r
-import org.collectionspace.services.common.document.DocumentException;\r
-import org.collectionspace.services.common.imaging.nuxeo.NuxeoBlobUtils;\r
-\r
-import org.apache.commons.io.FileUtils;\r
-\r
-public class BlobInput {\r
-       private final Logger logger = LoggerFactory.getLogger(BlobInput.class);\r
-       private final static String FILE_ACCESS_ERROR = "The following file is either missing or cannot be read: ";\r
-       private final static String URL_DOWNLOAD_FAILED = "Could not download file from the following URL: ";\r
-       \r
-       private String blobCsid = null;\r
-       private File blobFile = null;\r
-       private String blobUri = null;\r
-       private String blobMimeType = null;\r
-       private String originalFileName = null;\r
-       \r
-       private String derivativeTerm;\r
-       private boolean derivativeListRequested = false;\r
-       private CommonList derivativeList;\r
-       \r
-       private boolean contentRequested = false;\r
-       private InputStream contentStream;\r
-       \r
-       private boolean schemaRequested = false;\r
-       \r
-       public static final String URI_CONTENT_PATH = "content";\r
-       public static final String URI_DERIVATIVES_PATH = "derivatives";\r
-\r
-       /*\r
-        * Constructors\r
-        */\r
-       public BlobInput() {\r
-               /* Empty constructor */\r
-       }\r
-               \r
-       public BlobInput(File blobFile, String blobUri) {\r
-               this.blobFile = blobFile;\r
-               this.blobUri = blobUri;\r
-       }\r
-       \r
-       /*\r
-        * Save the original file name in case we rename it because of illegal Nuxeo file name characters\r
-        */\r
-       private void setBlobFileName(String fileName) throws Exception {\r
-               String sanitizedResult = NuxeoBlobUtils.getSanizitedFilename(fileName);\r
-               if (fileName.equals(sanitizedResult) == true) {\r
-                       originalFileName = null; //\r
-               } else {\r
-                       originalFileName = fileName;\r
-               }\r
-       }\r
-       \r
-       public String getBlobFilename() throws Exception {\r
-               String result = null;\r
-               \r
-               if (originalFileName != null && originalFileName.trim().isEmpty() == false) {\r
-                       result = originalFileName;\r
-               } else {\r
-                       File theBlobFile = this.getBlobFile();\r
-                       if (theBlobFile != null) {\r
-                               result = theBlobFile.getName();\r
-                       }\r
-               }\r
-               \r
-               //\r
-               // Add a log warning if the blob file name fails Nuxeo's file name restrictions.\r
-               //\r
-               String sanitizedResult = NuxeoBlobUtils.getSanizitedFilename(result);\r
-               if (result.equals(sanitizedResult) == false) {\r
-                       logger.warn(String.format("The file name '%s' contains characters that Nuxeo deems illegal.",\r
-                                       result));\r
-               }               \r
-               \r
-               return result;\r
-       }\r
-       \r
-       /*\r
-        * Getters and Setters\r
-        */\r
-       public boolean isSchemaRequested() {\r
-               return schemaRequested;\r
-       }\r
-\r
-       public void setSchemaRequested(boolean schemaRequested) {\r
-               this.schemaRequested = schemaRequested;\r
-       }\r
-\r
-       public String getBlobCsid() {\r
-               return blobCsid;\r
-       }\r
-\r
-       public void setBlobCsid(String blobCsid) {\r
-               this.blobCsid = blobCsid;\r
-       }\r
-\r
-       public File getBlobFile() {\r
-               return blobFile;\r
-       }\r
-\r
-       public void setBlobFile(File blobFile) throws Exception {\r
-               this.blobFile = blobFile;\r
-               if (blobFile != null) {\r
-                       String fileName = blobFile.getName();\r
-                       setBlobFileName(fileName);\r
-               }\r
-       }\r
-\r
-       public String getBlobUri() {\r
-               return blobUri;\r
-       }\r
-\r
-       public void setBlobUri(String blobUri) {\r
-               this.blobUri = blobUri;\r
-       }\r
-\r
-       public String getDerivativeTerm() {\r
-               return derivativeTerm;\r
-       }\r
-\r
-       public void setDerivativeTerm(String derivativeTerm) {\r
-               this.derivativeTerm = derivativeTerm;\r
-       }\r
-\r
-       public boolean isDerivativeListRequested() {\r
-               return derivativeListRequested;\r
-       }\r
-\r
-       public void setDerivativeListRequested(boolean derivativesRequested) {\r
-               this.derivativeListRequested = derivativesRequested;\r
-       }\r
-\r
-       public CommonList getDerivativeList() {\r
-               return derivativeList;\r
-       }\r
-\r
-       public void setDerivativeList(CommonList derivativeList) {\r
-               this.derivativeList = derivativeList;\r
-       }\r
-\r
-       public InputStream getContentStream() {\r
-               return contentStream;\r
-       }\r
-\r
-       public void setContentStream(InputStream contentStream) {\r
-               this.contentStream = contentStream;\r
-       }\r
-\r
-       public boolean isContentRequested() {\r
-               return contentRequested;\r
-       }\r
-\r
-       public void setContentRequested(boolean contentRequested) {\r
-               this.contentRequested = contentRequested;\r
-       }       \r
-       /*\r
-        * End of setters and getters\r
-        */\r
-       \r
-       //\r
-       // FIXME: REM - The callers of this method are sending us a multipart form-data post, so why\r
-       // are we also receiving the blobUri?\r
-       //\r
-       public void createBlobFile(HttpServletRequest req, String blobUri) throws Exception {\r
-       File tmpFile = org.collectionspace.services.common.FileUtils.createTmpFile(req);\r
-       this.setBlobFile(tmpFile);\r
-       this.setBlobUri(blobUri);\r
-       }\r
-       \r
-       public void createBlobFile(String theBlobUri) throws MalformedURLException, Exception {\r
-               URL blobUrl = new URL(theBlobUri);\r
-       File theBlobFile = null;\r
-\r
-               if (blobUrl.getProtocol().equalsIgnoreCase("http")) { //REM: Add support for https as well\r
-                       Download fetchedFile = new Download(blobUrl);\r
-                       if (logger.isDebugEnabled() == true) {\r
-                               logger.debug("Starting blob download into temp file:" + fetchedFile.getFilePath());\r
-                       }\r
-                       while (fetchedFile.getStatus() == Download.DOWNLOADING) {\r
-                               // Do nothing while we wait for the file to download\r
-                       }\r
-                       if (logger.isDebugEnabled() == true) {\r
-                               logger.debug("Finished blob download into temp file: " + fetchedFile.getFilePath());\r
-                       }\r
-                       \r
-                       int status = fetchedFile.getStatus();\r
-                       if (status == Download.COMPLETE) {\r
-                               theBlobFile = fetchedFile.getFile();\r
-                       } else {\r
-                               String msg = URL_DOWNLOAD_FAILED + theBlobUri;\r
-                               logger.error(msg);\r
-                               throw new DocumentException(msg);\r
-                       }\r
-               } else if (blobUrl.getProtocol().equalsIgnoreCase("file")) {\r
-                       theBlobFile = FileUtils.toFile(blobUrl);\r
-                       if (theBlobFile.exists() == false || theBlobFile.canRead() == false) {\r
-                               String msg = FILE_ACCESS_ERROR + theBlobFile.getAbsolutePath();\r
-                               logger.error(msg);\r
-                               throw new DocumentException(msg);\r
-                       }\r
-               } else {\r
-                       throw new MalformedURLException("Could not create a blob file from: " + blobUrl);\r
-               }\r
-       this.setBlobFile(theBlobFile);\r
-       this.setBlobUri(blobUri);\r
-       }\r
-\r
-       public String getMimeType() {\r
-               return blobMimeType;\r
-       }\r
-\r
-       public void setMimeType(String mimeType) {\r
-               this.blobMimeType = mimeType;\r
-       }       \r
-       \r
-}\r
-\r
+package org.collectionspace.services.common.blob;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.collectionspace.services.nuxeo.client.java.CommonList;
+import org.collectionspace.services.common.Download;
+import org.collectionspace.services.common.document.DocumentException;
+import org.collectionspace.services.common.imaging.nuxeo.NuxeoBlobUtils;
+
+import org.apache.commons.io.FileUtils;
+
+public class BlobInput {
+       private final Logger logger = LoggerFactory.getLogger(BlobInput.class);
+       private final static String FILE_ACCESS_ERROR = "The following file is either missing or cannot be read: ";
+       private final static String URL_DOWNLOAD_FAILED = "Could not download file from the following URL: ";
+       
+       private String blobCsid = null;
+       private File blobFile = null;
+       private String blobUri = null;
+       private String blobMimeType = null;
+       private String originalFileName = null;
+       
+       private String derivativeTerm;
+       private boolean derivativeListRequested = false;
+       private CommonList derivativeList;
+       
+       private boolean contentRequested = false;
+       private InputStream contentStream;
+       
+       private boolean schemaRequested = false;
+       
+       public static final String URI_CONTENT_PATH = "content";
+       public static final String URI_DERIVATIVES_PATH = "derivatives";
+
+       /*
+        * Constructors
+        */
+       public BlobInput() {
+               /* Empty constructor */
+       }
+               
+       public BlobInput(File blobFile, String blobUri) {
+               this.blobFile = blobFile;
+               this.blobUri = blobUri;
+       }
+       
+       /*
+        * Save the original file name in case we rename it because of illegal Nuxeo file name characters
+        */
+       private void setBlobFileName(String fileName) throws Exception {
+               String sanitizedResult = NuxeoBlobUtils.getSanizitedFilename(fileName);
+               if (fileName.equals(sanitizedResult) == true) {
+                       originalFileName = null; //
+               } else {
+                       originalFileName = fileName;
+               }
+       }
+       
+       public String getBlobFilename() throws Exception {
+               String result = null;
+               
+               if (originalFileName != null && originalFileName.trim().isEmpty() == false) {
+                       result = originalFileName;
+               } else {
+                       File theBlobFile = this.getBlobFile();
+                       if (theBlobFile != null) {
+                               result = theBlobFile.getName();
+                       }
+               }
+               
+               //
+               // Add a log warning if the blob file name fails Nuxeo's file name restrictions.
+               //
+               String sanitizedResult = NuxeoBlobUtils.getSanizitedFilename(result);
+               if (result.equals(sanitizedResult) == false) {
+                       logger.warn(String.format("The file name '%s' contains characters that Nuxeo deems illegal.",
+                                       result));
+               }               
+               
+               return result;
+       }
+       
+       /*
+        * Getters and Setters
+        */
+       public boolean isSchemaRequested() {
+               return schemaRequested;
+       }
+
+       public void setSchemaRequested(boolean schemaRequested) {
+               this.schemaRequested = schemaRequested;
+       }
+
+       public String getBlobCsid() {
+               return blobCsid;
+       }
+
+       public void setBlobCsid(String blobCsid) {
+               this.blobCsid = blobCsid;
+       }
+
+       public File getBlobFile() {
+               return blobFile;
+       }
+
+       public void setBlobFile(File blobFile) throws Exception {
+               this.blobFile = blobFile;
+               if (blobFile != null) {
+                       String fileName = blobFile.getName();
+                       setBlobFileName(fileName);
+               }
+       }
+
+       public String getBlobUri() {
+               return blobUri;
+       }
+
+       public void setBlobUri(String blobUri) {
+               this.blobUri = blobUri;
+       }
+
+       public String getDerivativeTerm() {
+               return derivativeTerm;
+       }
+
+       public void setDerivativeTerm(String derivativeTerm) {
+               this.derivativeTerm = derivativeTerm;
+       }
+
+       public boolean isDerivativeListRequested() {
+               return derivativeListRequested;
+       }
+
+       public void setDerivativeListRequested(boolean derivativesRequested) {
+               this.derivativeListRequested = derivativesRequested;
+       }
+
+       public CommonList getDerivativeList() {
+               return derivativeList;
+       }
+
+       public void setDerivativeList(CommonList derivativeList) {
+               this.derivativeList = derivativeList;
+       }
+
+       public InputStream getContentStream() {
+               return contentStream;
+       }
+
+       public void setContentStream(InputStream contentStream) {
+               this.contentStream = contentStream;
+       }
+
+       public boolean isContentRequested() {
+               return contentRequested;
+       }
+
+       public void setContentRequested(boolean contentRequested) {
+               this.contentRequested = contentRequested;
+       }       
+       /*
+        * End of setters and getters
+        */
+       
+       //
+       // FIXME: REM - The callers of this method are sending us a multipart form-data post, so why
+       // are we also receiving the blobUri?
+       //
+       public void createBlobFile(HttpServletRequest req, String blobUri) throws Exception {
+       File tmpFile = org.collectionspace.services.common.FileUtils.createTmpFile(req);
+       this.setBlobFile(tmpFile);
+       this.setBlobUri(blobUri);
+       }
+       
+       public void createBlobFile(String theBlobUri) throws MalformedURLException, Exception {
+               URL blobUrl = new URL(theBlobUri);
+       File theBlobFile = null;
+
+               if (blobUrl.getProtocol().equalsIgnoreCase("http")) { //REM: Add support for https as well
+                       Download fetchedFile = new Download(blobUrl);
+                       if (logger.isDebugEnabled() == true) {
+                               logger.debug("Starting blob download into temp file:" + fetchedFile.getFilePath());
+                       }
+                       while (fetchedFile.getStatus() == Download.DOWNLOADING) {
+                               // Do nothing while we wait for the file to download
+                       }
+                       if (logger.isDebugEnabled() == true) {
+                               logger.debug("Finished blob download into temp file: " + fetchedFile.getFilePath());
+                       }
+                       
+                       int status = fetchedFile.getStatus();
+                       if (status == Download.COMPLETE) {
+                               theBlobFile = fetchedFile.getFile();
+                       } else {
+                               String msg = URL_DOWNLOAD_FAILED + theBlobUri;
+                               logger.error(msg);
+                               throw new DocumentException(msg);
+                       }
+               } else if (blobUrl.getProtocol().equalsIgnoreCase("file")) {
+                       theBlobFile = FileUtils.toFile(blobUrl);
+                       if (theBlobFile.exists() == false || theBlobFile.canRead() == false) {
+                               String msg = FILE_ACCESS_ERROR + theBlobFile.getAbsolutePath();
+                               logger.error(msg);
+                               throw new DocumentException(msg);
+                       }
+               } else {
+                       throw new MalformedURLException("Could not create a blob file from: " + blobUrl);
+               }
+       this.setBlobFile(theBlobFile);
+       this.setBlobUri(blobUri);
+       }
+
+       public String getMimeType() {
+               return blobMimeType;
+       }
+
+       public void setMimeType(String mimeType) {
+               this.blobMimeType = mimeType;
+       }       
+       
+}
+
index a9325d853c0a87566f2bfa10336823683447703e..6acb2a3275578b936e16100f32a9055cd4cf24ea 100644 (file)
@@ -1,29 +1,29 @@
-package org.collectionspace.services.common.blob;\r
-\r
-import java.io.InputStream;\r
-import org.collectionspace.services.blob.BlobsCommon;\r
-\r
-public class BlobOutput {\r
-       private String mimeType;\r
-       private BlobsCommon blobsCommon;\r
-       private InputStream blobInputStream;\r
-\r
-       public BlobsCommon getBlobsCommon() {\r
-               return blobsCommon;\r
-       }\r
-       public void setBlobsCommon(BlobsCommon blobsCommon) {\r
-               this.blobsCommon = blobsCommon;\r
-       }\r
-       public InputStream getBlobInputStream() {\r
-               return blobInputStream;\r
-       }\r
-       public void setBlobInputStream(InputStream blobInputStream) {\r
-               this.blobInputStream = blobInputStream;\r
-       }\r
-       public String getMimeType() {\r
-               return mimeType;\r
-       }\r
-       public void setMimeType(String mimeType) {\r
-               this.mimeType = mimeType;\r
-       }\r
-}\r
+package org.collectionspace.services.common.blob;
+
+import java.io.InputStream;
+import org.collectionspace.services.blob.BlobsCommon;
+
+public class BlobOutput {
+       private String mimeType;
+       private BlobsCommon blobsCommon;
+       private InputStream blobInputStream;
+
+       public BlobsCommon getBlobsCommon() {
+               return blobsCommon;
+       }
+       public void setBlobsCommon(BlobsCommon blobsCommon) {
+               this.blobsCommon = blobsCommon;
+       }
+       public InputStream getBlobInputStream() {
+               return blobInputStream;
+       }
+       public void setBlobInputStream(InputStream blobInputStream) {
+               this.blobInputStream = blobInputStream;
+       }
+       public String getMimeType() {
+               return mimeType;
+       }
+       public void setMimeType(String mimeType) {
+               this.mimeType = mimeType;
+       }
+}
index bd45a77845c905b4f5dfaa26f201382a981ff12f..39d271206e4603efefb325aef724feb15c240add 100644 (file)
@@ -1,36 +1,36 @@
-package org.collectionspace.services.common.blob;\r
-\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class BlobUtil {\r
-       //\r
-       //\r
-       private static final Logger logger = LoggerFactory.getLogger(BlobUtil.class);\r
-       \r
-    public static BlobInput getBlobInput(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {\r
-       BlobInput result = (BlobInput)ctx.getProperty(BlobInput.class.getName());\r
-       if (result == null) {\r
-               result = new BlobInput();\r
-               setBlobInput(ctx, result);\r
-       }\r
-       return result;\r
-       }\r
-    \r
-    public static BlobInput resetBlobInput(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {\r
-       BlobInput blobInput = new BlobInput();\r
-       setBlobInput(ctx, blobInput);\r
-       return blobInput;\r
-    }\r
-    \r
-    public static void setBlobInput(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-               BlobInput blobInput) {\r
-       ctx.setProperty(BlobInput.class.getName(), blobInput);                  \r
-       }       \r
-    \r
-}\r
+package org.collectionspace.services.common.blob;
+
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.context.ServiceContext;
+//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
+//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BlobUtil {
+       //
+       //
+       private static final Logger logger = LoggerFactory.getLogger(BlobUtil.class);
+       
+    public static BlobInput getBlobInput(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {
+       BlobInput result = (BlobInput)ctx.getProperty(BlobInput.class.getName());
+       if (result == null) {
+               result = new BlobInput();
+               setBlobInput(ctx, result);
+       }
+       return result;
+       }
+    
+    public static BlobInput resetBlobInput(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {
+       BlobInput blobInput = new BlobInput();
+       setBlobInput(ctx, blobInput);
+       return blobInput;
+    }
+    
+    public static void setBlobInput(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+               BlobInput blobInput) {
+       ctx.setProperty(BlobInput.class.getName(), blobInput);                  
+       }       
+    
+}
index e79d3dc80fad1fd5e69b682311ab28ac701559da..53f57b46805561e333451a6d232ed30038a3022c 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.common.config;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.DocumentException;\r
-import org.collectionspace.services.common.document.DocumentHandler;\r
-import org.collectionspace.services.config.RepositoryClientConfigType;\r
-import org.collectionspace.services.config.ServiceConfig;\r
-import org.collectionspace.services.config.service.DocHandlerParams;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-import org.collectionspace.services.config.tenant.TenantBindingType;\r
-import org.collectionspace.services.config.types.PropertyItemType;\r
-import org.collectionspace.services.config.types.PropertyType;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * @author pschmitz\r
- *\r
- */\r
-public class ServiceConfigUtils {\r
-\r
-    final static Logger logger = LoggerFactory.getLogger(ServiceConfigUtils.class);\r
-\r
-    /*\r
-     * Returns the document handler parameters that were loaded at startup from the\r
-     * tenant bindings config file.\r
-     */\r
-       public static DocHandlerParams.Params getDocHandlerParams(ServiceContext ctx) throws DocumentException {\r
-               ServiceBindingType sb = ctx.getServiceBinding();\r
-               DocHandlerParams dhb = sb.getDocHandlerParams();\r
-               if (dhb != null && dhb.getParams() != null) {\r
-                       return dhb.getParams();\r
-               }\r
-               throw new DocumentException("No DocHandlerParams configured for: "\r
-                               + sb.getName());\r
-       }\r
-       \r
-    /**\r
-     * Creates the document handler instance.\r
-     * \r
-     * @return the document handler\r
-     * \r
-     * @throws Exception the exception\r
-     */\r
-    public static DocumentHandler createDocumentHandlerInstance(TenantBindingType tenantBinding,\r
-               ServiceBindingType serviceBinding) throws Exception {\r
-       DocumentHandler docHandler = null;\r
-       \r
-        ClassLoader tccl = Thread.currentThread().getContextClassLoader();\r
-        Class<?> c = tccl.loadClass(getDocumentHandlerClass(tenantBinding, serviceBinding));\r
-        if (DocumentHandler.class.isAssignableFrom(c)) {\r
-            docHandler = (DocumentHandler) c.newInstance();\r
-            if (logger.isDebugEnabled()) {\r
-               logger.debug("Created an instance of the DocumentHandler for: " + getDocumentHandlerClass(tenantBinding, serviceBinding));\r
-            }\r
-        } else {\r
-            throw new IllegalArgumentException("Not of type "\r
-                    + DocumentHandler.class.getCanonicalName());\r
-        }\r
-\r
-        return docHandler;\r
-    }\r
-\r
-    /**\r
-     * Gets the document handler class.\r
-     * \r
-     * @return the document handler class\r
-     */\r
-    private static String getDocumentHandlerClass(TenantBindingType tenantBinding,\r
-               ServiceBindingType serviceBinding) {\r
-        if (serviceBinding.getDocumentHandler() == null\r
-                || serviceBinding.getDocumentHandler().isEmpty()) {\r
-            String msg = "Missing documentHandler in service binding for service name \""\r
-                    + serviceBinding.getName() + "\" for tenant id=" + tenantBinding.getId()\r
-                    + " name=" + tenantBinding.getName();\r
-            logger.warn(msg);\r
-            throw new IllegalStateException(msg);\r
-        }\r
-        return serviceBinding.getDocumentHandler().trim();\r
-    }\r
-\r
-    /**\r
-     * Gets the values of a configured property for a service.\r
-     *\r
-     * @param serviceConfiga tenant binding\r
-     * @param propName the property to fetch (can return multiple values for this property).\r
-     * @return a list of values for the supplied property.\r
-     */\r
-    public static List<String> getPropertyValues(ServiceConfig serviceConfig,\r
-               String propName) {\r
-       List<String> propValues = null;\r
-       if(propName==null) {\r
-               throw new IllegalArgumentException("ServiceConfilUtils.getPropertyValues: null property name!");\r
-       }\r
-       RepositoryClientConfigType repoClient = serviceConfig.getRepositoryClient();\r
-       if(repoClient==null) {\r
-               throw new RuntimeException("ServiceConfilUtils.getPropertyValues: serviceConfig has NULL repoClient!");\r
-       }\r
-       List<PropertyType> propList = repoClient.getProperties();\r
-       if(propList!=null && propList.size()>0) {\r
-               List<PropertyItemType> propItems = propList.get(0).getItem();\r
-               for(PropertyItemType propItem:propItems) {\r
-                       if(propName.equals(propItem.getKey())) {\r
-                               String value = propItem.getValue();\r
-                               if(value!=null) {\r
-                                       if(propValues==null) {\r
-                                               propValues = new ArrayList<String>(); \r
-                                       }\r
-                                       propValues.add(value);\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-       return propValues;\r
-    }\r
-    \r
-\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.common.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.DocumentException;
+import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.config.RepositoryClientConfigType;
+import org.collectionspace.services.config.ServiceConfig;
+import org.collectionspace.services.config.service.DocHandlerParams;
+import org.collectionspace.services.config.service.ServiceBindingType;
+import org.collectionspace.services.config.tenant.TenantBindingType;
+import org.collectionspace.services.config.types.PropertyItemType;
+import org.collectionspace.services.config.types.PropertyType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author pschmitz
+ *
+ */
+public class ServiceConfigUtils {
+
+    final static Logger logger = LoggerFactory.getLogger(ServiceConfigUtils.class);
+
+    /*
+     * Returns the document handler parameters that were loaded at startup from the
+     * tenant bindings config file.
+     */
+       public static DocHandlerParams.Params getDocHandlerParams(ServiceContext ctx) throws DocumentException {
+               ServiceBindingType sb = ctx.getServiceBinding();
+               DocHandlerParams dhb = sb.getDocHandlerParams();
+               if (dhb != null && dhb.getParams() != null) {
+                       return dhb.getParams();
+               }
+               throw new DocumentException("No DocHandlerParams configured for: "
+                               + sb.getName());
+       }
+       
+    /**
+     * Creates the document handler instance.
+     * 
+     * @return the document handler
+     * 
+     * @throws Exception the exception
+     */
+    public static DocumentHandler createDocumentHandlerInstance(TenantBindingType tenantBinding,
+               ServiceBindingType serviceBinding) throws Exception {
+       DocumentHandler docHandler = null;
+       
+        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+        Class<?> c = tccl.loadClass(getDocumentHandlerClass(tenantBinding, serviceBinding));
+        if (DocumentHandler.class.isAssignableFrom(c)) {
+            docHandler = (DocumentHandler) c.newInstance();
+            if (logger.isDebugEnabled()) {
+               logger.debug("Created an instance of the DocumentHandler for: " + getDocumentHandlerClass(tenantBinding, serviceBinding));
+            }
+        } else {
+            throw new IllegalArgumentException("Not of type "
+                    + DocumentHandler.class.getCanonicalName());
+        }
+
+        return docHandler;
+    }
+
+    /**
+     * Gets the document handler class.
+     * 
+     * @return the document handler class
+     */
+    private static String getDocumentHandlerClass(TenantBindingType tenantBinding,
+               ServiceBindingType serviceBinding) {
+        if (serviceBinding.getDocumentHandler() == null
+                || serviceBinding.getDocumentHandler().isEmpty()) {
+            String msg = "Missing documentHandler in service binding for service name \""
+                    + serviceBinding.getName() + "\" for tenant id=" + tenantBinding.getId()
+                    + " name=" + tenantBinding.getName();
+            logger.warn(msg);
+            throw new IllegalStateException(msg);
+        }
+        return serviceBinding.getDocumentHandler().trim();
+    }
+
+    /**
+     * Gets the values of a configured property for a service.
+     *
+     * @param serviceConfiga tenant binding
+     * @param propName the property to fetch (can return multiple values for this property).
+     * @return a list of values for the supplied property.
+     */
+    public static List<String> getPropertyValues(ServiceConfig serviceConfig,
+               String propName) {
+       List<String> propValues = null;
+       if(propName==null) {
+               throw new IllegalArgumentException("ServiceConfilUtils.getPropertyValues: null property name!");
+       }
+       RepositoryClientConfigType repoClient = serviceConfig.getRepositoryClient();
+       if(repoClient==null) {
+               throw new RuntimeException("ServiceConfilUtils.getPropertyValues: serviceConfig has NULL repoClient!");
+       }
+       List<PropertyType> propList = repoClient.getProperties();
+       if(propList!=null && propList.size()>0) {
+               List<PropertyItemType> propItems = propList.get(0).getItem();
+               for(PropertyItemType propItem:propItems) {
+                       if(propName.equals(propItem.getKey())) {
+                               String value = propItem.getValue();
+                               if(value!=null) {
+                                       if(propValues==null) {
+                                               propValues = new ArrayList<String>(); 
+                                       }
+                                       propValues.add(value);
+                               }
+                       }
+               }
+       }
+       return propValues;
+    }
+    
+
+}
index 142c4ba646957bc4c1a91297105a3c9e061bf931..48718a6e5c203b9c8f77a0e366bf5904a9589afb 100644 (file)
-package org.collectionspace.services.common.config;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import org.collectionspace.services.common.context.ServiceBindingUtils;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-import org.collectionspace.services.config.tenant.TenantBindingType;\r
-import org.collectionspace.services.config.types.PropertyItemType;\r
-import org.collectionspace.services.config.types.PropertyType;\r
-\r
-\r
-public class TenantBindingUtils {\r
-\r
-    public static final boolean SET_PROP_IF_MISSING = true;\r
-    public static final boolean SET_PROP_ALWAYS = false;\r
-\r
-    /**\r
-     * @param tenantBinding\r
-     * @param propName the property to fetch\r
-     * @return the String value of the named property\r
-     */\r
-    public static String getPropertyValue(TenantBindingType tenantBinding,\r
-            String propName) {\r
-        if (propName == null) {\r
-            throw new IllegalArgumentException("TenantBindingUtils.getPropertyValue: null property name!");\r
-        }\r
-        List<PropertyType> tenantPropList = tenantBinding.getProperties();\r
-        return PropertyItemUtils.getPropertyValueByNameFromNodeList(tenantPropList, propName);\r
-    }\r
-\r
-    /**\r
-     * Gets the values of a configured property for a tenant.\r
-     *\r
-     * @param tenantBinding a tenant binding\r
-     * @param propName the property to fetch (can return multiple values for this property).\r
-     * @return a list of values for the supplied property.\r
-     */\r
-    public static List<String> getPropertyValues(TenantBindingType tenantBinding,\r
-            String propName) {\r
-        List<String> propValues = null;\r
-        List<PropertyType> propList = tenantBinding.getProperties();\r
-        if (propList != null && propList.size() > 0) {\r
-            List<PropertyItemType> propItems = propList.get(0).getItem();\r
-            for (PropertyItemType propItem : propItems) {\r
-                if (propName.equals(propItem.getKey())) {\r
-                    String value = propItem.getValue();\r
-                    if (value != null) {\r
-                        if (propValues == null) {\r
-                            propValues = new ArrayList<String>();\r
-                        }\r
-                        propValues.add(value);\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        return propValues;\r
-    }\r
-\r
-    /**\r
-     * @param service\r
-     * @param propName the property to fetch\r
-     * @param value the new value to set\r
-     * @param onlyIfNotSet if true, will not override an existing value\r
-     * @return true if set, false if an existing value was left as is.\r
-     */\r
-    public static boolean setPropertyValue(TenantBindingType tenantBinding,\r
-            PropertyItemType prop, boolean onlyIfNotSet) {\r
-        if (prop == null) {\r
-            throw new IllegalArgumentException(\r
-                    "TenantBindingUtils.setPropertyValue: null property!");\r
-        }\r
-        return setPropertyValue(tenantBinding, prop.getKey(), prop.getValue(),\r
-                onlyIfNotSet);\r
-    }\r
-\r
-    /**\r
-     * @param tenantBinding\r
-     * @param propName the property to fetch\r
-     * @param value the new value to set\r
-     * @param onlyIfNotSet if true, will not override an existing value\r
-     * @return true if set, false if an existing value was left as is.\r
-     */\r
-    public static boolean setPropertyValue(TenantBindingType tenantBinding,\r
-            String propName, String value,\r
-            boolean onlyIfNotSet) {\r
-        boolean valueFound = false;\r
-        boolean valueSet = false;\r
-        if (propName == null) {\r
-            throw new IllegalArgumentException("TenantBindingUtils.setPropertyValue: null property name!");\r
-        }\r
-        List<PropertyType> tenantPropertiesNode = tenantBinding.getProperties();\r
-        return PropertyItemUtils.setPropertyValueInNodeList(tenantPropertiesNode,\r
-                propName, value, onlyIfNotSet);\r
-    }\r
-\r
-    /**\r
-     * @param tenantBinding\r
-     * @param propName the property to fetch\r
-     * @param value the new value to set\r
-     * @param onlyIfNotSet if true, will not override an existing value\r
-     * @return true if set, false if an existing value was left as is.\r
-     */\r
-    public static void propagatePropertiesToServices(\r
-            TenantBindingType tenantBinding, boolean onlyIfNotSet) {\r
-        List<PropertyItemType> tenantPropList =\r
-                tenantBinding.getProperties().get(0).getItem();\r
-        for (PropertyItemType tenantPropItem : tenantPropList) {\r
-            for (ServiceBindingType service : tenantBinding.getServiceBindings()) {\r
-                ServiceBindingUtils.setPropertyValue(service,\r
-                        tenantPropItem, onlyIfNotSet);\r
-            }\r
-        }\r
-    }\r
-}\r
+package org.collectionspace.services.common.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.collectionspace.services.common.context.ServiceBindingUtils;
+import org.collectionspace.services.config.service.ServiceBindingType;
+import org.collectionspace.services.config.tenant.TenantBindingType;
+import org.collectionspace.services.config.types.PropertyItemType;
+import org.collectionspace.services.config.types.PropertyType;
+
+
+public class TenantBindingUtils {
+
+    public static final boolean SET_PROP_IF_MISSING = true;
+    public static final boolean SET_PROP_ALWAYS = false;
+
+    /**
+     * @param tenantBinding
+     * @param propName the property to fetch
+     * @return the String value of the named property
+     */
+    public static String getPropertyValue(TenantBindingType tenantBinding,
+            String propName) {
+        if (propName == null) {
+            throw new IllegalArgumentException("TenantBindingUtils.getPropertyValue: null property name!");
+        }
+        List<PropertyType> tenantPropList = tenantBinding.getProperties();
+        return PropertyItemUtils.getPropertyValueByNameFromNodeList(tenantPropList, propName);
+    }
+
+    /**
+     * Gets the values of a configured property for a tenant.
+     *
+     * @param tenantBinding a tenant binding
+     * @param propName the property to fetch (can return multiple values for this property).
+     * @return a list of values for the supplied property.
+     */
+    public static List<String> getPropertyValues(TenantBindingType tenantBinding,
+            String propName) {
+        List<String> propValues = null;
+        List<PropertyType> propList = tenantBinding.getProperties();
+        if (propList != null && propList.size() > 0) {
+            List<PropertyItemType> propItems = propList.get(0).getItem();
+            for (PropertyItemType propItem : propItems) {
+                if (propName.equals(propItem.getKey())) {
+                    String value = propItem.getValue();
+                    if (value != null) {
+                        if (propValues == null) {
+                            propValues = new ArrayList<String>();
+                        }
+                        propValues.add(value);
+                    }
+                }
+            }
+        }
+        return propValues;
+    }
+
+    /**
+     * @param service
+     * @param propName the property to fetch
+     * @param value the new value to set
+     * @param onlyIfNotSet if true, will not override an existing value
+     * @return true if set, false if an existing value was left as is.
+     */
+    public static boolean setPropertyValue(TenantBindingType tenantBinding,
+            PropertyItemType prop, boolean onlyIfNotSet) {
+        if (prop == null) {
+            throw new IllegalArgumentException(
+                    "TenantBindingUtils.setPropertyValue: null property!");
+        }
+        return setPropertyValue(tenantBinding, prop.getKey(), prop.getValue(),
+                onlyIfNotSet);
+    }
+
+    /**
+     * @param tenantBinding
+     * @param propName the property to fetch
+     * @param value the new value to set
+     * @param onlyIfNotSet if true, will not override an existing value
+     * @return true if set, false if an existing value was left as is.
+     */
+    public static boolean setPropertyValue(TenantBindingType tenantBinding,
+            String propName, String value,
+            boolean onlyIfNotSet) {
+        boolean valueFound = false;
+        boolean valueSet = false;
+        if (propName == null) {
+            throw new IllegalArgumentException("TenantBindingUtils.setPropertyValue: null property name!");
+        }
+        List<PropertyType> tenantPropertiesNode = tenantBinding.getProperties();
+        return PropertyItemUtils.setPropertyValueInNodeList(tenantPropertiesNode,
+                propName, value, onlyIfNotSet);
+    }
+
+    /**
+     * @param tenantBinding
+     * @param propName the property to fetch
+     * @param value the new value to set
+     * @param onlyIfNotSet if true, will not override an existing value
+     * @return true if set, false if an existing value was left as is.
+     */
+    public static void propagatePropertiesToServices(
+            TenantBindingType tenantBinding, boolean onlyIfNotSet) {
+        List<PropertyItemType> tenantPropList =
+                tenantBinding.getProperties().get(0).getItem();
+        for (PropertyItemType tenantPropItem : tenantPropList) {
+            for (ServiceBindingType service : tenantBinding.getServiceBindings()) {
+                ServiceBindingUtils.setPropertyValue(service,
+                        tenantPropItem, onlyIfNotSet);
+            }
+        }
+    }
+}
index af105c11216df52c53cc412e4cd8c013f0eb75e7..4ff8c5c227db0dc0c8abe1f3079c421fb0de6471 100644 (file)
@@ -1,22 +1,22 @@
-package org.collectionspace.services.common.context;\r
-\r
-import javax.ws.rs.core.Request;\r
-import javax.ws.rs.core.UriInfo;\r
-\r
-public class JaxRsContext {\r
-       private Request request;\r
-       private UriInfo uriInfo;\r
-       \r
-       public JaxRsContext(Request theRequest, UriInfo theUriInfo) {\r
-               this.request = theRequest;\r
-               this.uriInfo = theUriInfo;\r
-       }\r
-\r
-       public Request getRequest() {\r
-               return request;\r
-       }\r
-\r
-       public UriInfo getUriInfo() {\r
-               return uriInfo;\r
-       }\r
-}\r
+package org.collectionspace.services.common.context;
+
+import javax.ws.rs.core.Request;
+import javax.ws.rs.core.UriInfo;
+
+public class JaxRsContext {
+       private Request request;
+       private UriInfo uriInfo;
+       
+       public JaxRsContext(Request theRequest, UriInfo theUriInfo) {
+               this.request = theRequest;
+               this.uriInfo = theUriInfo;
+       }
+
+       public Request getRequest() {
+               return request;
+       }
+
+       public UriInfo getUriInfo() {
+               return uriInfo;
+       }
+}
index 2f23e54e6ab57aad68d30611cf5fb0608a00cc6c..f312ad72986d5763e01ac3c81ac2b8555da47673 100644 (file)
-/**    \r
- * RemoteServiceContextFactory.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.context;\r
-\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.UriInfo;\r
-\r
-import org.collectionspace.services.common.ResourceMap;\r
-\r
-\r
-/**\r
- * A factory for creating RemoteServiceContext objects.\r
- */\r
-public class RemoteServiceContextFactory<IT, OT>\r
-       implements ServiceContextFactory<IT, OT>{\r
-       \r
-       // create a Factory singleton\r
-       /** The Constant self. */\r
-       final private static RemoteServiceContextFactory self = new RemoteServiceContextFactory();\r
-       \r
-       /**\r
-        * Instantiates a new remote service context factory.\r
-        */\r
-       private RemoteServiceContextFactory() {} // private constructor\r
-    \r
-    /**\r
-     * Gets the.\r
-     * \r
-     * @return the remote service context factory\r
-     */\r
-    public static RemoteServiceContextFactory get() {\r
-        return self;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String)\r
-     */\r
-    @Override\r
-    public ServiceContext<IT, OT> createServiceContext(String serviceName, UriInfo uriInfo) throws Exception {\r
-       RemoteServiceContext<IT, OT> ctx = new RemoteServiceContextImpl<IT, OT>(serviceName, uriInfo);\r
-       return ctx;\r
-    }\r
-    \r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String, java.lang.Object)\r
-     */\r
-    @Override\r
-    public ServiceContext<IT, OT> createServiceContext(String serviceName,\r
-               IT theInput, UriInfo uriInfo) throws Exception {\r
-       RemoteServiceContext<IT, OT> ctx = new RemoteServiceContextImpl<IT, OT>(serviceName, theInput, uriInfo);\r
-        return ctx;\r
-    }\r
-    \r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String, java.lang.Object, javax.ws.rs.core.MultivaluedMap)\r
-     */\r
-    @Override\r
-    public ServiceContext<IT, OT> createServiceContext(\r
-               String serviceName,\r
-               IT theInput,\r
-               ResourceMap resourceMap,\r
-               UriInfo uriInfo) throws Exception {\r
-       ServiceContext<IT, OT> ctx = new RemoteServiceContextImpl<IT, OT>(serviceName,\r
-                       theInput,\r
-                       resourceMap,\r
-                       uriInfo);\r
-       \r
-        return ctx;\r
-    }\r
-\r
-    @Override\r
-    public ServiceContext<IT, OT> createServiceContext(String serviceName,\r
-               IT input,\r
-               ResourceMap resourceMap,\r
-               UriInfo uriInfo,\r
-               String documentType,\r
-               String entityName) throws Exception {\r
-       ServiceContext<IT, OT> ctx = createServiceContext(\r
-                       serviceName,\r
-                       input,\r
-                       resourceMap,\r
-                       uriInfo);\r
-        ctx.setDocumentType(documentType); //persistence unit\r
-        ctx.setProperty(ServiceContextProperties.ENTITY_NAME, entityName);\r
-        return ctx;\r
-    }\r
-    \r
-}\r
+/**    
+ * RemoteServiceContextFactory.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.context;
+
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.UriInfo;
+
+import org.collectionspace.services.common.ResourceMap;
+
+
+/**
+ * A factory for creating RemoteServiceContext objects.
+ */
+public class RemoteServiceContextFactory<IT, OT>
+       implements ServiceContextFactory<IT, OT>{
+       
+       // create a Factory singleton
+       /** The Constant self. */
+       final private static RemoteServiceContextFactory self = new RemoteServiceContextFactory();
+       
+       /**
+        * Instantiates a new remote service context factory.
+        */
+       private RemoteServiceContextFactory() {} // private constructor
+    
+    /**
+     * Gets the.
+     * 
+     * @return the remote service context factory
+     */
+    public static RemoteServiceContextFactory get() {
+        return self;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String)
+     */
+    @Override
+    public ServiceContext<IT, OT> createServiceContext(String serviceName, UriInfo uriInfo) throws Exception {
+       RemoteServiceContext<IT, OT> ctx = new RemoteServiceContextImpl<IT, OT>(serviceName, uriInfo);
+       return ctx;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String, java.lang.Object)
+     */
+    @Override
+    public ServiceContext<IT, OT> createServiceContext(String serviceName,
+               IT theInput, UriInfo uriInfo) throws Exception {
+       RemoteServiceContext<IT, OT> ctx = new RemoteServiceContextImpl<IT, OT>(serviceName, theInput, uriInfo);
+        return ctx;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.context.ServiceContextFactory#createServiceContext(java.lang.String, java.lang.Object, javax.ws.rs.core.MultivaluedMap)
+     */
+    @Override
+    public ServiceContext<IT, OT> createServiceContext(
+               String serviceName,
+               IT theInput,
+               ResourceMap resourceMap,
+               UriInfo uriInfo) throws Exception {
+       ServiceContext<IT, OT> ctx = new RemoteServiceContextImpl<IT, OT>(serviceName,
+                       theInput,
+                       resourceMap,
+                       uriInfo);
+       
+        return ctx;
+    }
+
+    @Override
+    public ServiceContext<IT, OT> createServiceContext(String serviceName,
+               IT input,
+               ResourceMap resourceMap,
+               UriInfo uriInfo,
+               String documentType,
+               String entityName) throws Exception {
+       ServiceContext<IT, OT> ctx = createServiceContext(
+                       serviceName,
+                       input,
+                       resourceMap,
+                       uriInfo);
+        ctx.setDocumentType(documentType); //persistence unit
+        ctx.setProperty(ServiceContextProperties.ENTITY_NAME, entityName);
+        return ctx;
+    }
+    
+}
index 6ab6e4975481da441bec3edf7f9da50e8e44b153..9c5be602b6050244773743a888d4a142c38112be 100644 (file)
-package org.collectionspace.services.common.context;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.regex.Matcher;\r
-import java.util.regex.Pattern;\r
-import java.util.regex.PatternSyntaxException;\r
-\r
-import org.collectionspace.services.common.config.PropertyItemUtils;\r
-import org.collectionspace.services.config.service.ObjectPartType;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-import org.collectionspace.services.config.service.ServiceObjectType;\r
-import org.collectionspace.services.config.types.PropertyItemType;\r
-import org.collectionspace.services.config.types.PropertyType;\r
-import org.collectionspace.services.nuxeo.util.NuxeoUtils;\r
-import org.nuxeo.ecm.core.api.ClientException;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import java.lang.IndexOutOfBoundsException;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.document.DocumentUtils;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-\r
-public class ServiceBindingUtils {\r
-       public static final boolean QUALIFIED_PROP_NAMES = true;\r
-       public static final boolean UNQUALIFIED_PROP_NAMES = false;\r
-       public static final String AUTH_REF_PROP = "authRef";\r
-       public static final String TERM_REF_PROP = "termRef";\r
-       public static final String OBJ_NUMBER_PROP = "objectNumberProperty";\r
-       public static final String OBJ_NAME_PROP = "objectNameProperty";\r
-       public static final String SERVICE_TYPE_PROP = "type";\r
-       public static final String SERVICE_TYPE_OBJECT = "object";\r
-       public static final String SERVICE_TYPE_PROCEDURE = "procedure";\r
-       public static final String SERVICE_TYPE_AUTHORITY = "authority";\r
-       public static final String SERVICE_TYPE_UTILITY = "utility";\r
-       public static final String SERVICE_TYPE_SECURITY = "security";\r
-       \r
-       private static final String TENANT_EXTENSION_PATTERN = "(.*)"+ServiceContext.TENANT_SUFFIX+"[\\d]+$";\r
-       private static final String TENANT_REPLACEMENT_PATTERN = "$1";\r
-       private static Pattern tenantSuffixPattern = null;\r
-\r
-       private static final Logger logger = LoggerFactory.getLogger(ServiceBindingUtils.class);\r
-       \r
-    public static String getTenantQualifiedDocType(String tenantId, String docType) {\r
-       String result = docType + ServiceContext.TENANT_SUFFIX + tenantId;\r
-       return result;\r
-    }\r
-       \r
-    public static String getUnqualifiedTenantDocType(String docType) {\r
-        try {\r
-            if(tenantSuffixPattern == null ) {\r
-               tenantSuffixPattern = Pattern.compile(TENANT_EXTENSION_PATTERN);\r
-            }\r
-            Matcher tenantSuffixMatcher = tenantSuffixPattern.matcher(docType);\r
-            return tenantSuffixMatcher.replaceFirst(TENANT_REPLACEMENT_PATTERN);\r
-        } catch (PatternSyntaxException pe) {\r
-            logger.warn("TENANT_EXTENSION_PATTERN regex pattern '" + TENANT_EXTENSION_PATTERN\r
-                    + "' could not be compiled: " + pe.getMessage());\r
-            // If reached, method will return a value of false.\r
-        }\r
-       return docType;\r
-    }\r
-       \r
-       // TODO consider building up a hashTable of the properties for each\r
-       // service binding. There will be generic properties, as well as\r
-       // properties on each part. Could build up a key from tenant id, \r
-       // servicename, (partname for those props), propName\r
-\r
-    public static void getPartsMetadata(ServiceBindingType serviceBinding, \r
-               Map<String, ObjectPartType> objectPartMap) {\r
-        ServiceObjectType objectType = serviceBinding.getObject();\r
-        List<ObjectPartType> objectPartTypes = objectType.getPart();\r
-        for (ObjectPartType objectPartType : objectPartTypes) {\r
-            objectPartMap.put(objectPartType.getLabel(), objectPartType);\r
-        }\r
-    }\r
-    \r
-    private static List<PropertyItemType> getPropertiesForPart(ServiceBindingType serviceBinding,\r
-               String partLabel) {\r
-        ServiceObjectType objectType = serviceBinding.getObject();\r
-        List<ObjectPartType> objectPartTypes = objectType.getPart();\r
-        for (ObjectPartType objectPartType : objectPartTypes) {\r
-            if(partLabel.equals(objectPartType.getLabel())) {\r
-               List<PropertyType> propNodeList = objectPartType.getProperties();\r
-               return propNodeList.isEmpty()?null:propNodeList.get(0).getItem();\r
-            }\r
-        }\r
-               throw new RuntimeException("No such part found: "+partLabel);\r
-    }\r
-\r
-    public static List<String> getPropertyValuesForPart(ServiceBindingType serviceBinding,\r
-               String partLabel, String propName, boolean qualify) {\r
-       List<PropertyItemType> partProps = getPropertiesForPart(serviceBinding, partLabel);\r
-       return PropertyItemUtils.getPropertyValuesByName(partProps, propName, \r
-                                                                                                       (qualify?(partLabel+":"):null));\r
-    }\r
-\r
-       /**\r
-        * @param serviceBinding the service to work from\r
-        * @param propName the name of the property of interest\r
-        * @param qualify if QUALIFIED_PROP_NAMES, will prefix all values with the part label\r
-        * @return a list of (qualified)\r
-        */\r
-       public static List<String> getAllPartsPropertyValues(ServiceBindingType serviceBinding,\r
-               String propName, boolean qualify) {\r
-       List<String> values = new ArrayList<String>();\r
-        ServiceObjectType objectType = serviceBinding.getObject();\r
-        List<ObjectPartType> objectPartTypes = objectType.getPart();\r
-        for (ObjectPartType objectPartType : objectPartTypes) {\r
-               List<PropertyType> propNodeList = objectPartType.getProperties();\r
-               PropertyItemUtils.getPropertyValuesByNameInNodeList(propNodeList, \r
-                               propName, (qualify?(objectPartType.getLabel()+":"):null), values);\r
-        }\r
-       return values;\r
-    }\r
-\r
-    /**\r
-     * @param service\r
-     * @param propName the property to fetch\r
-     * @return the String value of the named property\r
-     */\r
-    public static String getPropertyValue(ServiceBindingType service,\r
-               String propName) {\r
-       if(propName==null) {\r
-               throw new IllegalArgumentException("ServiceBindingUtils.getPropertyValues: null property name!");\r
-       }\r
-               List<PropertyType> servicePropList = service.getProperties();\r
-               return PropertyItemUtils.getPropertyValueByNameFromNodeList(servicePropList, propName );\r
-    }\r
-    \r
-    /**\r
-     * @param service\r
-     * @param propName the property to set\r
-     * @param value the new value to set\r
-     * @param onlyIfNotSet if true, will not override an existing value\r
-     * @return true if set, false if an existing value was left as is.\r
-     */\r
-    public static boolean setPropertyValue(ServiceBindingType service,\r
-               PropertyItemType prop, boolean onlyIfNotSet) {\r
-       if(prop==null) {\r
-               throw new IllegalArgumentException(\r
-                               "ServiceBindingUtils.setPropertyValue: null property!");\r
-       }\r
-       return setPropertyValue(service, prop.getKey(), prop.getValue(),\r
-                                                               onlyIfNotSet);\r
-    }\r
-    \r
-    /**\r
-     * @param service\r
-     * @param propName the property to set\r
-     * @param value the new value to set\r
-     * @param onlyIfNotSet if true, will not override an existing value\r
-     * @return true if set, false if an existing value was left as is.\r
-     */\r
-    public static boolean setPropertyValue(ServiceBindingType service,\r
-               String propName, String value,\r
-               boolean onlyIfNotSet) {\r
-       if(propName==null) {\r
-               throw new IllegalArgumentException("ServiceBindingUtils.setPropertyValue: null property name!");\r
-       }\r
-               List<PropertyType> servicePropertiesNode = service.getProperties();\r
-               return PropertyItemUtils.setPropertyValueInNodeList(servicePropertiesNode,\r
-                               propName, value, onlyIfNotSet);\r
-    }\r
-    \r
-    public static String getMappedFieldInDoc( ServiceBindingType sb,\r
-               String logicalFieldName, DocumentModel docModel ) {\r
-       // Now we have to get the number, which is configured as some field\r
-       // on each docType\r
-       /* If we go to qualified field names, we'll need this\r
-       String[] strings = qPropName.split(":");\r
-       if(strings.length!=2) {\r
-               throw new RuntimeException(\r
-                               "getMappedFieldInDoc: Bad configuration of "\r
-                               +logicalFieldName+" field for: "+docModel.getDocumentType().getName());\r
-       }\r
-       */\r
-       String propName = getPropertyValue(sb, logicalFieldName);\r
-       if(Tools.isBlank(propName)) {\r
-                logger.warn("Property name is empty for property " + logicalFieldName + " in service " + sb.getName());\r
-                logger.warn("This may be due to an improperly configured or missing "\r
-                        + "generic property (objectNameProperty, objectNumberProperty ...) in tenant bindings configuration");\r
-               return "";\r
-        }\r
-       try {\r
-            Object obj = docModel.getPropertyValue(propName);\r
-            return DocumentUtils.propertyValueAsString(obj, docModel, propName);\r
-       } catch(IndexOutOfBoundsException ioobe) {\r
-                               // Should not happen, but may with certain array forms\r
-                               if(logger.isTraceEnabled()) {\r
-                                       logger.trace("SBUtils.getMappedField caught OOB exc, for Prop: "+propName\r
-                                               + " in: " + docModel.getDocumentType().getName()\r
-                                               + " csid: " + NuxeoUtils.getCsid(docModel));\r
-                               }\r
-                               return null;\r
-       } catch(ClientException ce) {\r
-               throw new RuntimeException(\r
-                               "getMappedFieldInDoc: Problem fetching: "+propName+" logicalfieldName: "+logicalFieldName+" docModel: "+docModel, ce);\r
-       }\r
-    } \r
-    \r
-    private static ArrayList<String> commonProcedureServiceTypes = null;\r
-   \r
-    public static ArrayList<String> getCommonServiceTypes(boolean includeAuthorities) {\r
-        ArrayList<String> commonServiceTypes = new ArrayList<String>();\r
-               if (includeAuthorities == true) {\r
-                       commonServiceTypes.add(SERVICE_TYPE_AUTHORITY); // REM - CSPACE-5359: Added back authorities on demand to resolve this issue.\r
-               }\r
-               commonServiceTypes.add(SERVICE_TYPE_OBJECT);\r
-               commonServiceTypes.add(SERVICE_TYPE_PROCEDURE);\r
-               \r
-       return commonServiceTypes;\r
-    }\r
-    \r
-    // Temporary workaround for CSPACE-4983, to help reduce the\r
-    // number of service types searched for authority references\r
-    // in AuthorityResource.getReferencingObjects(), to in turn\r
-    // help reduce database query complexity.\r
-    //\r
-    // FIXME; this method is intended to be temporary.  It was added in part to\r
-    // make the effect of the workaround more explicit, and in part to avoid\r
-    // breaking the use of the getCommonServiceTypes method in ServiceGroups.\r
-    @Deprecated\r
-    public static ArrayList<String> getCommonProcedureServiceTypes() {\r
-        if(commonProcedureServiceTypes == null) {\r
-            commonProcedureServiceTypes = new ArrayList<String>();\r
-            commonProcedureServiceTypes.add(SERVICE_TYPE_PROCEDURE);\r
-        }\r
-       return commonProcedureServiceTypes;\r
-    }\r
-    \r
-\r
-\r
-}\r
+package org.collectionspace.services.common.context;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import org.collectionspace.services.common.config.PropertyItemUtils;
+import org.collectionspace.services.config.service.ObjectPartType;
+import org.collectionspace.services.config.service.ServiceBindingType;
+import org.collectionspace.services.config.service.ServiceObjectType;
+import org.collectionspace.services.config.types.PropertyItemType;
+import org.collectionspace.services.config.types.PropertyType;
+import org.collectionspace.services.nuxeo.util.NuxeoUtils;
+import org.nuxeo.ecm.core.api.ClientException;
+import org.nuxeo.ecm.core.api.DocumentModel;
+import java.lang.IndexOutOfBoundsException;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.document.DocumentUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class ServiceBindingUtils {
+       public static final boolean QUALIFIED_PROP_NAMES = true;
+       public static final boolean UNQUALIFIED_PROP_NAMES = false;
+       public static final String AUTH_REF_PROP = "authRef";
+       public static final String TERM_REF_PROP = "termRef";
+       public static final String OBJ_NUMBER_PROP = "objectNumberProperty";
+       public static final String OBJ_NAME_PROP = "objectNameProperty";
+       public static final String SERVICE_TYPE_PROP = "type";
+       public static final String SERVICE_TYPE_OBJECT = "object";
+       public static final String SERVICE_TYPE_PROCEDURE = "procedure";
+       public static final String SERVICE_TYPE_AUTHORITY = "authority";
+       public static final String SERVICE_TYPE_UTILITY = "utility";
+       public static final String SERVICE_TYPE_SECURITY = "security";
+       
+       private static final String TENANT_EXTENSION_PATTERN = "(.*)"+ServiceContext.TENANT_SUFFIX+"[\\d]+$";
+       private static final String TENANT_REPLACEMENT_PATTERN = "$1";
+       private static Pattern tenantSuffixPattern = null;
+
+       private static final Logger logger = LoggerFactory.getLogger(ServiceBindingUtils.class);
+       
+    public static String getTenantQualifiedDocType(String tenantId, String docType) {
+       String result = docType + ServiceContext.TENANT_SUFFIX + tenantId;
+       return result;
+    }
+       
+    public static String getUnqualifiedTenantDocType(String docType) {
+        try {
+            if(tenantSuffixPattern == null ) {
+               tenantSuffixPattern = Pattern.compile(TENANT_EXTENSION_PATTERN);
+            }
+            Matcher tenantSuffixMatcher = tenantSuffixPattern.matcher(docType);
+            return tenantSuffixMatcher.replaceFirst(TENANT_REPLACEMENT_PATTERN);
+        } catch (PatternSyntaxException pe) {
+            logger.warn("TENANT_EXTENSION_PATTERN regex pattern '" + TENANT_EXTENSION_PATTERN
+                    + "' could not be compiled: " + pe.getMessage());
+            // If reached, method will return a value of false.
+        }
+       return docType;
+    }
+       
+       // TODO consider building up a hashTable of the properties for each
+       // service binding. There will be generic properties, as well as
+       // properties on each part. Could build up a key from tenant id, 
+       // servicename, (partname for those props), propName
+
+    public static void getPartsMetadata(ServiceBindingType serviceBinding, 
+               Map<String, ObjectPartType> objectPartMap) {
+        ServiceObjectType objectType = serviceBinding.getObject();
+        List<ObjectPartType> objectPartTypes = objectType.getPart();
+        for (ObjectPartType objectPartType : objectPartTypes) {
+            objectPartMap.put(objectPartType.getLabel(), objectPartType);
+        }
+    }
+    
+    private static List<PropertyItemType> getPropertiesForPart(ServiceBindingType serviceBinding,
+               String partLabel) {
+        ServiceObjectType objectType = serviceBinding.getObject();
+        List<ObjectPartType> objectPartTypes = objectType.getPart();
+        for (ObjectPartType objectPartType : objectPartTypes) {
+            if(partLabel.equals(objectPartType.getLabel())) {
+               List<PropertyType> propNodeList = objectPartType.getProperties();
+               return propNodeList.isEmpty()?null:propNodeList.get(0).getItem();
+            }
+        }
+               throw new RuntimeException("No such part found: "+partLabel);
+    }
+
+    public static List<String> getPropertyValuesForPart(ServiceBindingType serviceBinding,
+               String partLabel, String propName, boolean qualify) {
+       List<PropertyItemType> partProps = getPropertiesForPart(serviceBinding, partLabel);
+       return PropertyItemUtils.getPropertyValuesByName(partProps, propName, 
+                                                                                                       (qualify?(partLabel+":"):null));
+    }
+
+       /**
+        * @param serviceBinding the service to work from
+        * @param propName the name of the property of interest
+        * @param qualify if QUALIFIED_PROP_NAMES, will prefix all values with the part label
+        * @return a list of (qualified)
+        */
+       public static List<String> getAllPartsPropertyValues(ServiceBindingType serviceBinding,
+               String propName, boolean qualify) {
+       List<String> values = new ArrayList<String>();
+        ServiceObjectType objectType = serviceBinding.getObject();
+        List<ObjectPartType> objectPartTypes = objectType.getPart();
+        for (ObjectPartType objectPartType : objectPartTypes) {
+               List<PropertyType> propNodeList = objectPartType.getProperties();
+               PropertyItemUtils.getPropertyValuesByNameInNodeList(propNodeList, 
+                               propName, (qualify?(objectPartType.getLabel()+":"):null), values);
+        }
+       return values;
+    }
+
+    /**
+     * @param service
+     * @param propName the property to fetch
+     * @return the String value of the named property
+     */
+    public static String getPropertyValue(ServiceBindingType service,
+               String propName) {
+       if(propName==null) {
+               throw new IllegalArgumentException("ServiceBindingUtils.getPropertyValues: null property name!");
+       }
+               List<PropertyType> servicePropList = service.getProperties();
+               return PropertyItemUtils.getPropertyValueByNameFromNodeList(servicePropList, propName );
+    }
+    
+    /**
+     * @param service
+     * @param propName the property to set
+     * @param value the new value to set
+     * @param onlyIfNotSet if true, will not override an existing value
+     * @return true if set, false if an existing value was left as is.
+     */
+    public static boolean setPropertyValue(ServiceBindingType service,
+               PropertyItemType prop, boolean onlyIfNotSet) {
+       if(prop==null) {
+               throw new IllegalArgumentException(
+                               "ServiceBindingUtils.setPropertyValue: null property!");
+       }
+       return setPropertyValue(service, prop.getKey(), prop.getValue(),
+                                                               onlyIfNotSet);
+    }
+    
+    /**
+     * @param service
+     * @param propName the property to set
+     * @param value the new value to set
+     * @param onlyIfNotSet if true, will not override an existing value
+     * @return true if set, false if an existing value was left as is.
+     */
+    public static boolean setPropertyValue(ServiceBindingType service,
+               String propName, String value,
+               boolean onlyIfNotSet) {
+       if(propName==null) {
+               throw new IllegalArgumentException("ServiceBindingUtils.setPropertyValue: null property name!");
+       }
+               List<PropertyType> servicePropertiesNode = service.getProperties();
+               return PropertyItemUtils.setPropertyValueInNodeList(servicePropertiesNode,
+                               propName, value, onlyIfNotSet);
+    }
+    
+    public static String getMappedFieldInDoc( ServiceBindingType sb,
+               String logicalFieldName, DocumentModel docModel ) {
+       // Now we have to get the number, which is configured as some field
+       // on each docType
+       /* If we go to qualified field names, we'll need this
+       String[] strings = qPropName.split(":");
+       if(strings.length!=2) {
+               throw new RuntimeException(
+                               "getMappedFieldInDoc: Bad configuration of "
+                               +logicalFieldName+" field for: "+docModel.getDocumentType().getName());
+       }
+       */
+       String propName = getPropertyValue(sb, logicalFieldName);
+       if(Tools.isBlank(propName)) {
+                logger.warn("Property name is empty for property " + logicalFieldName + " in service " + sb.getName());
+                logger.warn("This may be due to an improperly configured or missing "
+                        + "generic property (objectNameProperty, objectNumberProperty ...) in tenant bindings configuration");
+               return "";
+        }
+       try {
+            Object obj = docModel.getPropertyValue(propName);
+            return DocumentUtils.propertyValueAsString(obj, docModel, propName);
+       } catch(IndexOutOfBoundsException ioobe) {
+                               // Should not happen, but may with certain array forms
+                               if(logger.isTraceEnabled()) {
+                                       logger.trace("SBUtils.getMappedField caught OOB exc, for Prop: "+propName
+                                               + " in: " + docModel.getDocumentType().getName()
+                                               + " csid: " + NuxeoUtils.getCsid(docModel));
+                               }
+                               return null;
+       } catch(ClientException ce) {
+               throw new RuntimeException(
+                               "getMappedFieldInDoc: Problem fetching: "+propName+" logicalfieldName: "+logicalFieldName+" docModel: "+docModel, ce);
+       }
+    } 
+    
+    private static ArrayList<String> commonProcedureServiceTypes = null;
+   
+    public static ArrayList<String> getCommonServiceTypes(boolean includeAuthorities) {
+        ArrayList<String> commonServiceTypes = new ArrayList<String>();
+               if (includeAuthorities == true) {
+                       commonServiceTypes.add(SERVICE_TYPE_AUTHORITY); // REM - CSPACE-5359: Added back authorities on demand to resolve this issue.
+               }
+               commonServiceTypes.add(SERVICE_TYPE_OBJECT);
+               commonServiceTypes.add(SERVICE_TYPE_PROCEDURE);
+               
+       return commonServiceTypes;
+    }
+    
+    // Temporary workaround for CSPACE-4983, to help reduce the
+    // number of service types searched for authority references
+    // in AuthorityResource.getReferencingObjects(), to in turn
+    // help reduce database query complexity.
+    //
+    // FIXME; this method is intended to be temporary.  It was added in part to
+    // make the effect of the workaround more explicit, and in part to avoid
+    // breaking the use of the getCommonServiceTypes method in ServiceGroups.
+    @Deprecated
+    public static ArrayList<String> getCommonProcedureServiceTypes() {
+        if(commonProcedureServiceTypes == null) {
+            commonProcedureServiceTypes = new ArrayList<String>();
+            commonProcedureServiceTypes.add(SERVICE_TYPE_PROCEDURE);
+        }
+       return commonProcedureServiceTypes;
+    }
+    
+
+
+}
index df1c25704b4ce1e31f890792dfe3427428331cab..1168185d1ca0c6a7a51cbb492298cb67ba42b796 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.document;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import org.collectionspace.authentication.AuthN;\r
-import org.collectionspace.services.client.CollectionSpaceClient;\r
-import org.collectionspace.services.client.IClientQueryParams;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-\r
-/**\r
- * The Class DocumentFilter.\r
- */\r
-//FIXME: it would be nice to instantiate the doc filter with the service context\r
-//so tenant context and other things available from the service context\r
-//could be utilized while building the where clause.\r
-public class DocumentFilter {\r
-\r
-    /** The Constant DEFAULT_PAGE_SIZE_INIT. */\r
-    public static final int DEFAULT_PAGE_SIZE_INIT = 40;\r
-    /** The Constant PAGE_SIZE_DEFAULT_PROPERTY. */\r
-    public static final String PAGE_SIZE_DEFAULT_PROPERTY = "pageSizeDefault";\r
-    /** The default page size. */\r
-    public static int defaultPageSize = DEFAULT_PAGE_SIZE_INIT;\r
-    /** The where clause. */\r
-    protected String whereClause;      // Filtering clause. Omit the "WHERE".\r
-    /** The order by clause. */\r
-    protected String orderByClause;    // Filtering clause. Omit the "ORDER BY".\r
-    public static final String EMPTY_ORDER_BY_CLAUSE = "";\r
-    public static final String ORDER_BY_LAST_UPDATED = CollectionSpaceClient.CORE_UPDATED_AT + " DESC";\r
-    public static final String ORDER_BY_CREATED_AT = CollectionSpaceClient.CORE_CREATED_AT + " DESC";\r
-    /** The start page. */\r
-    protected int startPage;           // Pagination offset for list results\r
-    /** The page size. */\r
-    protected int pageSize;                    // Pagination limit for list results\r
-    //queryParams is not initialized as it would require a multi-valued map implementation\r
-    //unless it is used from opensource lib...this variable holds ref to\r
-    //implementation available in JBoss RESTeasy\r
-    /** The query params. */\r
-    private MultivaluedMap<String, String> queryParams = null;\r
-\r
-    /**\r
-     * The Class ParamBinding.\r
-     */\r
-    public static class ParamBinding {\r
-\r
-        /** The name. */\r
-        private String name;\r
-        /** The value. */\r
-        private Object value;\r
-\r
-        /**\r
-         * Instantiates a new param binding.\r
-         *\r
-         * @param theName the name\r
-         * @param theValue the value\r
-         */\r
-        public ParamBinding(String theName, Object theValue) {\r
-            this.name = theName;\r
-            this.value = theValue;\r
-        }\r
-\r
-        /**\r
-         * Gets the name.\r
-         *\r
-         * @return the name\r
-         */\r
-        public String getName() {\r
-            return name;\r
-        }\r
-\r
-        /**\r
-         * Sets the name.\r
-         *\r
-         * @param theName the new name\r
-         */\r
-        public void setName(String theName) {\r
-            this.name = theName;\r
-        }\r
-\r
-        /**\r
-         * Gets the value.\r
-         *\r
-         * @return the value\r
-         */\r
-        public Object getValue() {\r
-            return value;\r
-        }\r
-\r
-        /**\r
-         * Sets the value.\r
-         *\r
-         * @param theValue the new value\r
-         */\r
-        public void setValue(Object theValue) {\r
-            this.value = theValue;\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Instantiates a new document filter.\r
-     *\r
-     * @param ctx the ctx\r
-     */\r
-    public DocumentFilter(ServiceContext ctx) {\r
-       // Ignore errors - some contexts do not have proper service binding info\r
-       try {\r
-               String pageSizeString = ctx.getServiceBindingPropertyValue(\r
-                    DocumentFilter.PAGE_SIZE_DEFAULT_PROPERTY); \r
-               this.setPageSize(pageSizeString);\r
-       } catch(Exception e) {\r
-               this.setPageSize(defaultPageSize);\r
-       } \r
-    }\r
-\r
-    /**\r
-     * Instantiates a new document filter.\r
-     */\r
-    public DocumentFilter() {\r
-        this("", 0, defaultPageSize);                  // Use empty string for easy concatenation\r
-    }\r
-\r
-    /**\r
-     * Instantiates a new document filter.\r
-     *\r
-     * @param theWhereClause the where clause\r
-     * @param theStartPage the start page\r
-     * @param thePageSize the page size\r
-     */\r
-    public DocumentFilter(String theWhereClause, int theStartPage, int thePageSize) {\r
-        this(theWhereClause, EMPTY_ORDER_BY_CLAUSE, theStartPage, thePageSize);\r
-    }\r
-\r
-    /**\r
-     * Instantiates a new document filter.\r
-     *\r
-     * @param theWhereClause the where clause\r
-     * @param theOrderByClause the order by clause\r
-     * @param theStartPage the start page\r
-     * @param thePageSize the page size\r
-     */\r
-    public DocumentFilter(String theWhereClause, String theOrderByClause, int theStartPage, int thePageSize) {\r
-        this.whereClause = theWhereClause;\r
-        this.orderByClause = theOrderByClause;\r
-        this.startPage = (theStartPage > 0) ? theStartPage : 0;\r
-        this.pageSize = (thePageSize > 0) ? thePageSize : defaultPageSize;\r
-    }\r
-\r
-    /**\r
-     * Sets the pagination.\r
-     *\r
-     * @param theQueryParams the the query params\r
-     */\r
-    public void setPagination(MultivaluedMap<String, String> theQueryParams) {\r
-        //\r
-        // Bail if there are no params\r
-        //\r
-        if (theQueryParams == null) {\r
-            return;\r
-        }\r
-        //\r
-        // Set the page size\r
-        //\r
-        String pageSizeStr = null;\r
-        List<String> list = theQueryParams.get(IClientQueryParams.PAGE_SIZE_PARAM);\r
-        if (list != null) {\r
-            pageSizeStr = list.get(0);\r
-        }\r
-        setPageSize(pageSizeStr);\r
-        //\r
-        // Set the start page\r
-        //\r
-        String startPageStr = null;\r
-        list = theQueryParams.get(IClientQueryParams.START_PAGE_PARAM);\r
-        if (list != null) {\r
-            startPageStr = list.get(0);\r
-        }\r
-        setStartPage(startPageStr);\r
-    }\r
-\r
-    /**\r
-     * Gets the default page size.\r
-     *\r
-     * @return the default page size\r
-     */\r
-    public static int getDefaultPageSize() {\r
-        return defaultPageSize;\r
-    }\r
-\r
-    /**\r
-     * Sets the default page size.\r
-     *\r
-     * @param theDefaultPageSize the new default page size\r
-     */\r
-    public static void setDefaultPageSize(int theDefaultPageSize) {\r
-        DocumentFilter.defaultPageSize = theDefaultPageSize;\r
-    }\r
-\r
-    /**\r
-     * Gets the where clause.\r
-     *\r
-     * @return the where clause\r
-     */\r
-    public String getWhereClause() {\r
-        return whereClause;\r
-    }\r
-\r
-    /**\r
-     * Sets the where clause.\r
-     *\r
-     * @param theWhereClause the new where clause\r
-     */\r
-    public void setWhereClause(String theWhereClause) {\r
-        this.whereClause = theWhereClause;\r
-    }\r
-\r
-    /**\r
-     * Append where clause.\r
-     *\r
-     * @param theWhereClause the where clause\r
-     * @param conjunction the conjunction to insert between the current\r
-     *        where clause, if any, and the additional where clause to be appended\r
-     */\r
-    public void appendWhereClause(String theWhereClause, String conjunction) {\r
-        if (theWhereClause != null && ! theWhereClause.trim().isEmpty()) {\r
-            String currentClause = getWhereClause();\r
-            if (currentClause != null) {\r
-                String newClause = currentClause.concat(conjunction + theWhereClause);\r
-                this.setWhereClause(newClause);\r
-            } else {\r
-                this.setWhereClause(theWhereClause);\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Builds the where for search.\r
-     *\r
-     * @param queryStrBldr the query str bldr\r
-     * @return the list\r
-     */\r
-    public List<ParamBinding> buildWhereForSearch(StringBuilder queryStrBldr) {\r
-        return new ArrayList<ParamBinding>();\r
-    }\r
-\r
-    /**\r
-     * Builds the where.\r
-     *\r
-     * @param queryStrBldr the query str bldr\r
-     * @return the list\r
-     */\r
-    public List<ParamBinding> buildWhere(StringBuilder queryStrBldr) {\r
-        return new ArrayList<ParamBinding>();\r
-    }\r
-\r
-    /**\r
-     * Sets the sort ordering.\r
-     *\r
-     * @param theQueryParams the query params\r
-     */\r
-    public void setSortOrder(MultivaluedMap<String, String> theQueryParams) {\r
-        // Bail if there are no params\r
-        if (theQueryParams == null) {\r
-            return;\r
-        }\r
-        // Set the order by clause\r
-        String orderByStr = null;\r
-        List<String> list = theQueryParams.get(IClientQueryParams.ORDER_BY_PARAM);\r
-        if (list != null) {\r
-            orderByStr = list.get(0);\r
-        }\r
-\r
-        // FIXME: Verify the format of the value(s) in the 'sort by'\r
-        // query param.\r
-\r
-        setOrderByClause(orderByStr);\r
-    }\r
-\r
-    /**\r
-     * Gets the order by clause.\r
-     *\r
-     * @return the order by clause\r
-     */\r
-    public String getOrderByClause() {\r
-        return orderByClause;\r
-    }\r
-\r
-    /**\r
-     * Sets the order by clause.\r
-     *\r
-     * @param theOrderByClause the new order by clause\r
-     */\r
-    public void setOrderByClause(String theOrderByClause) {\r
-        this.orderByClause = theOrderByClause;\r
-    }\r
-\r
-    /**\r
-     * Gets the start page.\r
-     *\r
-     * @return the start page\r
-     */\r
-    public int getStartPage() {\r
-        return startPage;\r
-    }\r
-\r
-    /**\r
-     * Sets the start page.\r
-     *\r
-     * @param theStartPage the new start page\r
-     */\r
-    public void setStartPage(int theStartPage) {\r
-        this.startPage = theStartPage;\r
-    }\r
-\r
-    /**\r
-     * Gets the page size.\r
-     *\r
-     * @return the page size\r
-     */\r
-    public int getPageSize() {\r
-        return pageSize;\r
-    }\r
-\r
-    /**\r
-     * Gets the page size dirty.\r
-     *\r
-     * @return the page size dirty\r
-     */\r
-    public boolean getPageSizeDirty() {\r
-        return this.getPageSizeDirty();\r
-    }\r
-\r
-    /**\r
-     * Sets the page size.\r
-     *\r
-     * @param thePageSize the new page size\r
-     */\r
-    public void setPageSize(int thePageSize) {\r
-        this.pageSize = thePageSize;\r
-    }\r
-\r
-    /**\r
-     * Sets the page size.\r
-     *\r
-     * @param thePageSizeStr the new page size\r
-     */\r
-    public void setPageSize(String thePageSizeStr) {\r
-        int newPageSize = DocumentFilter.defaultPageSize;\r
-        if (thePageSizeStr != null) {\r
-            try {\r
-                newPageSize = Integer.valueOf(thePageSizeStr);\r
-            } catch (NumberFormatException e) {\r
-                //FIXME This should cause a warning in the log file and should result in the\r
-                //FIXME page size being set to the default.  We don't need to throw an exception here.\r
-                throw new NumberFormatException("Bad value for: "\r
-                        + IClientQueryParams.PAGE_SIZE_PARAM);\r
-            }\r
-        }\r
-\r
-        setPageSize(newPageSize);\r
-    }\r
-\r
-    /**\r
-     * Sets the start page.\r
-     *\r
-     * @param startPageStr the new start page\r
-     */\r
-    protected void setStartPage(String startPageStr) {\r
-        if (startPageStr != null) {\r
-            try {\r
-                startPage = Integer.valueOf(startPageStr);\r
-            } catch (NumberFormatException e) {\r
-                throw new NumberFormatException("Bad value for: "\r
-                        + IClientQueryParams.START_PAGE_PARAM);\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Gets the offset.\r
-     *\r
-     * @return the offset\r
-     */\r
-    public int getOffset() {\r
-        return pageSize * startPage;\r
-    }\r
-\r
-    /**\r
-     * Adds the query param.\r
-     *\r
-     * @param key the key\r
-     * @param value the value\r
-     */\r
-    public void addQueryParam(String key, String value) {\r
-        if (queryParams != null) {\r
-            queryParams.add(key, value);\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Gets the query param.\r
-     *\r
-     * @param key the key\r
-     * @return the query param\r
-     */\r
-    public List<String> getQueryParam(String key) {\r
-        if (queryParams != null) {\r
-            return queryParams.get(key);\r
-        } else {\r
-            return new ArrayList<String>();\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Gets the query params.\r
-     *\r
-     * @return the query params\r
-     */\r
-    public MultivaluedMap<String, String> getQueryParams() {\r
-        return queryParams;\r
-    }\r
-\r
-    /**\r
-     * Sets the query params.\r
-     *\r
-     * @param theQueryParams the the query params\r
-     */\r
-    public void setQueryParams(MultivaluedMap<String, String> theQueryParams) {\r
-        this.queryParams = theQueryParams;\r
-    }\r
-\r
-    /**\r
-     * getTenantId\r
-     * //FIXME: it would be nice to take tenantId from service context\r
-     * @return\r
-     */\r
-    protected String getTenantId() {\r
-        return AuthN.get().getCurrentTenantId();\r
-    }\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.document;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.ws.rs.core.MultivaluedMap;
+import org.collectionspace.authentication.AuthN;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.IClientQueryParams;
+import org.collectionspace.services.common.context.ServiceContext;
+
+/**
+ * The Class DocumentFilter.
+ */
+//FIXME: it would be nice to instantiate the doc filter with the service context
+//so tenant context and other things available from the service context
+//could be utilized while building the where clause.
+public class DocumentFilter {
+
+    /** The Constant DEFAULT_PAGE_SIZE_INIT. */
+    public static final int DEFAULT_PAGE_SIZE_INIT = 40;
+    /** The Constant PAGE_SIZE_DEFAULT_PROPERTY. */
+    public static final String PAGE_SIZE_DEFAULT_PROPERTY = "pageSizeDefault";
+    /** The default page size. */
+    public static int defaultPageSize = DEFAULT_PAGE_SIZE_INIT;
+    /** The where clause. */
+    protected String whereClause;      // Filtering clause. Omit the "WHERE".
+    /** The order by clause. */
+    protected String orderByClause;    // Filtering clause. Omit the "ORDER BY".
+    public static final String EMPTY_ORDER_BY_CLAUSE = "";
+    public static final String ORDER_BY_LAST_UPDATED = CollectionSpaceClient.CORE_UPDATED_AT + " DESC";
+    public static final String ORDER_BY_CREATED_AT = CollectionSpaceClient.CORE_CREATED_AT + " DESC";
+    /** The start page. */
+    protected int startPage;           // Pagination offset for list results
+    /** The page size. */
+    protected int pageSize;                    // Pagination limit for list results
+    //queryParams is not initialized as it would require a multi-valued map implementation
+    //unless it is used from opensource lib...this variable holds ref to
+    //implementation available in JBoss RESTeasy
+    /** The query params. */
+    private MultivaluedMap<String, String> queryParams = null;
+
+    /**
+     * The Class ParamBinding.
+     */
+    public static class ParamBinding {
+
+        /** The name. */
+        private String name;
+        /** The value. */
+        private Object value;
+
+        /**
+         * Instantiates a new param binding.
+         *
+         * @param theName the name
+         * @param theValue the value
+         */
+        public ParamBinding(String theName, Object theValue) {
+            this.name = theName;
+            this.value = theValue;
+        }
+
+        /**
+         * Gets the name.
+         *
+         * @return the name
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * Sets the name.
+         *
+         * @param theName the new name
+         */
+        public void setName(String theName) {
+            this.name = theName;
+        }
+
+        /**
+         * Gets the value.
+         *
+         * @return the value
+         */
+        public Object getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value.
+         *
+         * @param theValue the new value
+         */
+        public void setValue(Object theValue) {
+            this.value = theValue;
+        }
+    }
+
+    /**
+     * Instantiates a new document filter.
+     *
+     * @param ctx the ctx
+     */
+    public DocumentFilter(ServiceContext ctx) {
+       // Ignore errors - some contexts do not have proper service binding info
+       try {
+               String pageSizeString = ctx.getServiceBindingPropertyValue(
+                    DocumentFilter.PAGE_SIZE_DEFAULT_PROPERTY); 
+               this.setPageSize(pageSizeString);
+       } catch(Exception e) {
+               this.setPageSize(defaultPageSize);
+       } 
+    }
+
+    /**
+     * Instantiates a new document filter.
+     */
+    public DocumentFilter() {
+        this("", 0, defaultPageSize);                  // Use empty string for easy concatenation
+    }
+
+    /**
+     * Instantiates a new document filter.
+     *
+     * @param theWhereClause the where clause
+     * @param theStartPage the start page
+     * @param thePageSize the page size
+     */
+    public DocumentFilter(String theWhereClause, int theStartPage, int thePageSize) {
+        this(theWhereClause, EMPTY_ORDER_BY_CLAUSE, theStartPage, thePageSize);
+    }
+
+    /**
+     * Instantiates a new document filter.
+     *
+     * @param theWhereClause the where clause
+     * @param theOrderByClause the order by clause
+     * @param theStartPage the start page
+     * @param thePageSize the page size
+     */
+    public DocumentFilter(String theWhereClause, String theOrderByClause, int theStartPage, int thePageSize) {
+        this.whereClause = theWhereClause;
+        this.orderByClause = theOrderByClause;
+        this.startPage = (theStartPage > 0) ? theStartPage : 0;
+        this.pageSize = (thePageSize > 0) ? thePageSize : defaultPageSize;
+    }
+
+    /**
+     * Sets the pagination.
+     *
+     * @param theQueryParams the the query params
+     */
+    public void setPagination(MultivaluedMap<String, String> theQueryParams) {
+        //
+        // Bail if there are no params
+        //
+        if (theQueryParams == null) {
+            return;
+        }
+        //
+        // Set the page size
+        //
+        String pageSizeStr = null;
+        List<String> list = theQueryParams.get(IClientQueryParams.PAGE_SIZE_PARAM);
+        if (list != null) {
+            pageSizeStr = list.get(0);
+        }
+        setPageSize(pageSizeStr);
+        //
+        // Set the start page
+        //
+        String startPageStr = null;
+        list = theQueryParams.get(IClientQueryParams.START_PAGE_PARAM);
+        if (list != null) {
+            startPageStr = list.get(0);
+        }
+        setStartPage(startPageStr);
+    }
+
+    /**
+     * Gets the default page size.
+     *
+     * @return the default page size
+     */
+    public static int getDefaultPageSize() {
+        return defaultPageSize;
+    }
+
+    /**
+     * Sets the default page size.
+     *
+     * @param theDefaultPageSize the new default page size
+     */
+    public static void setDefaultPageSize(int theDefaultPageSize) {
+        DocumentFilter.defaultPageSize = theDefaultPageSize;
+    }
+
+    /**
+     * Gets the where clause.
+     *
+     * @return the where clause
+     */
+    public String getWhereClause() {
+        return whereClause;
+    }
+
+    /**
+     * Sets the where clause.
+     *
+     * @param theWhereClause the new where clause
+     */
+    public void setWhereClause(String theWhereClause) {
+        this.whereClause = theWhereClause;
+    }
+
+    /**
+     * Append where clause.
+     *
+     * @param theWhereClause the where clause
+     * @param conjunction the conjunction to insert between the current
+     *        where clause, if any, and the additional where clause to be appended
+     */
+    public void appendWhereClause(String theWhereClause, String conjunction) {
+        if (theWhereClause != null && ! theWhereClause.trim().isEmpty()) {
+            String currentClause = getWhereClause();
+            if (currentClause != null) {
+                String newClause = currentClause.concat(conjunction + theWhereClause);
+                this.setWhereClause(newClause);
+            } else {
+                this.setWhereClause(theWhereClause);
+            }
+        }
+    }
+
+    /**
+     * Builds the where for search.
+     *
+     * @param queryStrBldr the query str bldr
+     * @return the list
+     */
+    public List<ParamBinding> buildWhereForSearch(StringBuilder queryStrBldr) {
+        return new ArrayList<ParamBinding>();
+    }
+
+    /**
+     * Builds the where.
+     *
+     * @param queryStrBldr the query str bldr
+     * @return the list
+     */
+    public List<ParamBinding> buildWhere(StringBuilder queryStrBldr) {
+        return new ArrayList<ParamBinding>();
+    }
+
+    /**
+     * Sets the sort ordering.
+     *
+     * @param theQueryParams the query params
+     */
+    public void setSortOrder(MultivaluedMap<String, String> theQueryParams) {
+        // Bail if there are no params
+        if (theQueryParams == null) {
+            return;
+        }
+        // Set the order by clause
+        String orderByStr = null;
+        List<String> list = theQueryParams.get(IClientQueryParams.ORDER_BY_PARAM);
+        if (list != null) {
+            orderByStr = list.get(0);
+        }
+
+        // FIXME: Verify the format of the value(s) in the 'sort by'
+        // query param.
+
+        setOrderByClause(orderByStr);
+    }
+
+    /**
+     * Gets the order by clause.
+     *
+     * @return the order by clause
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * Sets the order by clause.
+     *
+     * @param theOrderByClause the new order by clause
+     */
+    public void setOrderByClause(String theOrderByClause) {
+        this.orderByClause = theOrderByClause;
+    }
+
+    /**
+     * Gets the start page.
+     *
+     * @return the start page
+     */
+    public int getStartPage() {
+        return startPage;
+    }
+
+    /**
+     * Sets the start page.
+     *
+     * @param theStartPage the new start page
+     */
+    public void setStartPage(int theStartPage) {
+        this.startPage = theStartPage;
+    }
+
+    /**
+     * Gets the page size.
+     *
+     * @return the page size
+     */
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    /**
+     * Gets the page size dirty.
+     *
+     * @return the page size dirty
+     */
+    public boolean getPageSizeDirty() {
+        return this.getPageSizeDirty();
+    }
+
+    /**
+     * Sets the page size.
+     *
+     * @param thePageSize the new page size
+     */
+    public void setPageSize(int thePageSize) {
+        this.pageSize = thePageSize;
+    }
+
+    /**
+     * Sets the page size.
+     *
+     * @param thePageSizeStr the new page size
+     */
+    public void setPageSize(String thePageSizeStr) {
+        int newPageSize = DocumentFilter.defaultPageSize;
+        if (thePageSizeStr != null) {
+            try {
+                newPageSize = Integer.valueOf(thePageSizeStr);
+            } catch (NumberFormatException e) {
+                //FIXME This should cause a warning in the log file and should result in the
+                //FIXME page size being set to the default.  We don't need to throw an exception here.
+                throw new NumberFormatException("Bad value for: "
+                        + IClientQueryParams.PAGE_SIZE_PARAM);
+            }
+        }
+
+        setPageSize(newPageSize);
+    }
+
+    /**
+     * Sets the start page.
+     *
+     * @param startPageStr the new start page
+     */
+    protected void setStartPage(String startPageStr) {
+        if (startPageStr != null) {
+            try {
+                startPage = Integer.valueOf(startPageStr);
+            } catch (NumberFormatException e) {
+                throw new NumberFormatException("Bad value for: "
+                        + IClientQueryParams.START_PAGE_PARAM);
+            }
+        }
+    }
+
+    /**
+     * Gets the offset.
+     *
+     * @return the offset
+     */
+    public int getOffset() {
+        return pageSize * startPage;
+    }
+
+    /**
+     * Adds the query param.
+     *
+     * @param key the key
+     * @param value the value
+     */
+    public void addQueryParam(String key, String value) {
+        if (queryParams != null) {
+            queryParams.add(key, value);
+        }
+    }
+
+    /**
+     * Gets the query param.
+     *
+     * @param key the key
+     * @return the query param
+     */
+    public List<String> getQueryParam(String key) {
+        if (queryParams != null) {
+            return queryParams.get(key);
+        } else {
+            return new ArrayList<String>();
+        }
+    }
+
+    /**
+     * Gets the query params.
+     *
+     * @return the query params
+     */
+    public MultivaluedMap<String, String> getQueryParams() {
+        return queryParams;
+    }
+
+    /**
+     * Sets the query params.
+     *
+     * @param theQueryParams the the query params
+     */
+    public void setQueryParams(MultivaluedMap<String, String> theQueryParams) {
+        this.queryParams = theQueryParams;
+    }
+
+    /**
+     * getTenantId
+     * //FIXME: it would be nice to take tenantId from service context
+     * @return
+     */
+    protected String getTenantId() {
+        return AuthN.get().getCurrentTenantId();
+    }
+}
index 44562af1773f99231b3197a2f531cba54d93d16e..2739df850159073dbcd36a757bca2cbca9a362d6 100644 (file)
@@ -1,40 +1,40 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.common.document;\r
-\r
-import java.util.List;\r
-/**\r
- *\r
- * DocumentWrapper wraps DocumentModel (java) or Representation (REST)\r
- *\r
- */\r
-public interface DocumentListWrapper {\r
-\r
-    /**\r
-     * getWrappedObject\r
-     * @return wrapped object\r
-     */\r
-    public List<?> getWrappedObject();\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.collectionspace.services.common.document;
+
+import java.util.List;
+/**
+ *
+ * DocumentWrapper wraps DocumentModel (java) or Representation (REST)
+ *
+ */
+public interface DocumentListWrapper {
+
+    /**
+     * getWrappedObject
+     * @return wrapped object
+     */
+    public List<?> getWrappedObject();
+}
index 0ab43ea43f4ef094a209a2d9159da3863ba5157b..32ba489709c20434cb6d051ff2d391af08568be0 100644 (file)
@@ -1,55 +1,55 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.common.document;\r
-\r
-import java.util.List;\r
-\r
-// TODO: Auto-generated Javadoc\r
-/**\r
- * The Class DocumentListWrapperImpl.\r
- *\r
- * @param <T> the generic type\r
- */\r
-public class DocumentListWrapperImpl<T> implements DocumentListWrapper {\r
-\r
-    /** The document list wrapper. */\r
-    private List<T> documentListWrapper;\r
-\r
-    /**\r
-     * Instantiates a new document list wrapper impl.\r
-     *\r
-     * @param theDocumentListWrapper the the document list wrapper\r
-     */\r
-    public DocumentListWrapperImpl(List<T> theDocumentListWrapper) {\r
-        documentListWrapper = theDocumentListWrapper;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.common.document.DocumentListWrapper#getWrappedObject()\r
-     */\r
-    public List<T> getWrappedObject() {\r
-        return documentListWrapper;\r
-    }\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.collectionspace.services.common.document;
+
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class DocumentListWrapperImpl.
+ *
+ * @param <T> the generic type
+ */
+public class DocumentListWrapperImpl<T> implements DocumentListWrapper {
+
+    /** The document list wrapper. */
+    private List<T> documentListWrapper;
+
+    /**
+     * Instantiates a new document list wrapper impl.
+     *
+     * @param theDocumentListWrapper the the document list wrapper
+     */
+    public DocumentListWrapperImpl(List<T> theDocumentListWrapper) {
+        documentListWrapper = theDocumentListWrapper;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.document.DocumentListWrapper#getWrappedObject()
+     */
+    public List<T> getWrappedObject() {
+        return documentListWrapper;
+    }
 }
\ No newline at end of file
index eff2255e585fbd58c436aedc0ab778df863bdfae..0239eee10b939cb084280c1fe026bd6f69f8c920 100644 (file)
-package org.collectionspace.services.common.document;\r
-\r
-import org.collectionspace.services.common.context.MultipartServiceContext;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.DocumentHandler.Action;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-// TODO: Auto-generated Javadoc\r
-/**\r
- * The Class ValidatorHandlerImpl.\r
- */\r
-public abstract class ValidatorHandlerImpl<IT, OT> implements ValidatorHandler<IT, OT> {\r
-\r
-    /**\r
-     * The logger.\r
-     */\r
-    private final Logger logger = LoggerFactory.getLogger(ValidatorHandlerImpl.class);\r
-    private ServiceContext<IT, OT> ctx;\r
-\r
-    protected ServiceContext<IT, OT> getServiceContext() {\r
-        return ctx;\r
-    }\r
-    // gets reset by calls to setServiceContext() method\r
-    protected boolean enforceAsserts = true;\r
-\r
-    public boolean getEnforceAsserts() {\r
-        return enforceAsserts;\r
-    }\r
-\r
-    public void setEnforceAsserts(ServiceContext<IT, OT> ctx) {\r
-        Boolean disableAssertsAttr = ctx.getServiceBinding().isDisableAsserts();\r
-        if (disableAssertsAttr == null) {\r
-            enforceAsserts = true;\r
-        } else {\r
-            enforceAsserts = !disableAssertsAttr.booleanValue();\r
-        }\r
-    }\r
-\r
-    protected void setServiceContext(ServiceContext<IT, OT> ctx) {\r
-        this.ctx = ctx;\r
-\r
-    }\r
-\r
-    protected void CS_ASSERT(boolean expression, String errorMsg) throws AssertionError {\r
-        if (expression != true) {\r
-            if (errorMsg == null) {\r
-                errorMsg = "Validation exception occurred in: "\r
-                        + this.getClass().getName();\r
-            }\r
-            throw new AssertionError(errorMsg);\r
-        }\r
-    }\r
-\r
-    protected void CS_ASSERT(boolean expression) throws AssertionError {\r
-        CS_ASSERT(expression, null);\r
-    }\r
-\r
-    private void init(ServiceContext<IT, OT> ctx) {\r
-        setEnforceAsserts(ctx);\r
-        setServiceContext(ctx);\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc) @see\r
-     * org.collectionspace.services.common.document.ValidatorHandler#validate(org.collectionspace.services.common.document.DocumentHandler.Action,\r
-     * org.collectionspace.services.common.context.ServiceContext)\r
-     */\r
-    @Override\r
-    public void validate(Action action, ServiceContext<IT, OT> ctx)\r
-            throws InvalidDocumentException {\r
-        init(ctx);\r
-\r
-        switch (action) {\r
-            case CREATE:\r
-                handleCreate();\r
-                break;\r
-            case GET:\r
-                handleGet();\r
-                break;\r
-            case GET_ALL:\r
-                handleGetAll();\r
-                break;\r
-            case UPDATE:\r
-                handleUpdate();\r
-                break;\r
-            case DELETE:\r
-                handleDelete();\r
-                break;\r
-            default:\r
-                throw new UnsupportedOperationException("ValidatorHandlerImpl: Unknown action = "\r
-                        + action);\r
-        }\r
-    }\r
-\r
-    protected boolean enforceAsserts() {\r
-        return !ctx.getServiceBinding().isDisableAsserts();\r
-    }\r
-\r
-    protected Object getCommonPart() {\r
-        Object result = null;\r
-\r
-        try {\r
-            MultipartServiceContext multiPartCtx = (MultipartServiceContext) getServiceContext();\r
-            result = multiPartCtx.getInputPart(ctx.getCommonPartLabel(),\r
-                    getCommonPartClass());\r
-        } catch (Exception e) {\r
-            if (logger.isDebugEnabled() == true) {\r
-                logger.debug("Could not extract common part from multipart input.", e);\r
-            }\r
-        }\r
-\r
-        return result;\r
-    }\r
-\r
-    abstract protected Class<?> getCommonPartClass();\r
-\r
-    /**\r
-     * Handle create.\r
-     *\r
-     * @param ctx the ctx\r
-     */\r
-    abstract protected void handleCreate() throws InvalidDocumentException;\r
-\r
-    /**\r
-     * Handle get.\r
-     *\r
-     * @param ctx the ctx\r
-     */\r
-    abstract protected void handleGet() throws InvalidDocumentException;\r
-\r
-    /**\r
-     * Handle get all.\r
-     *\r
-     * @param ctx the ctx\r
-     */\r
-    abstract protected void handleGetAll() throws InvalidDocumentException;\r
-\r
-    /**\r
-     * Handle update.\r
-     *\r
-     * @param ctx the ctx\r
-     */\r
-    abstract protected void handleUpdate() throws InvalidDocumentException;\r
-\r
-    /**\r
-     * Handle delete.\r
-     *\r
-     * @param ctx the ctx\r
-     */\r
-    abstract protected void handleDelete() throws InvalidDocumentException;\r
+package org.collectionspace.services.common.document;
+
+import org.collectionspace.services.common.context.MultipartServiceContext;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.DocumentHandler.Action;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ValidatorHandlerImpl.
+ */
+public abstract class ValidatorHandlerImpl<IT, OT> implements ValidatorHandler<IT, OT> {
+
+    /**
+     * The logger.
+     */
+    private final Logger logger = LoggerFactory.getLogger(ValidatorHandlerImpl.class);
+    private ServiceContext<IT, OT> ctx;
+
+    protected ServiceContext<IT, OT> getServiceContext() {
+        return ctx;
+    }
+    // gets reset by calls to setServiceContext() method
+    protected boolean enforceAsserts = true;
+
+    public boolean getEnforceAsserts() {
+        return enforceAsserts;
+    }
+
+    public void setEnforceAsserts(ServiceContext<IT, OT> ctx) {
+        Boolean disableAssertsAttr = ctx.getServiceBinding().isDisableAsserts();
+        if (disableAssertsAttr == null) {
+            enforceAsserts = true;
+        } else {
+            enforceAsserts = !disableAssertsAttr.booleanValue();
+        }
+    }
+
+    protected void setServiceContext(ServiceContext<IT, OT> ctx) {
+        this.ctx = ctx;
+
+    }
+
+    protected void CS_ASSERT(boolean expression, String errorMsg) throws AssertionError {
+        if (expression != true) {
+            if (errorMsg == null) {
+                errorMsg = "Validation exception occurred in: "
+                        + this.getClass().getName();
+            }
+            throw new AssertionError(errorMsg);
+        }
+    }
+
+    protected void CS_ASSERT(boolean expression) throws AssertionError {
+        CS_ASSERT(expression, null);
+    }
+
+    private void init(ServiceContext<IT, OT> ctx) {
+        setEnforceAsserts(ctx);
+        setServiceContext(ctx);
+    }
+
+    /*
+     * (non-Javadoc) @see
+     * org.collectionspace.services.common.document.ValidatorHandler#validate(org.collectionspace.services.common.document.DocumentHandler.Action,
+     * org.collectionspace.services.common.context.ServiceContext)
+     */
+    @Override
+    public void validate(Action action, ServiceContext<IT, OT> ctx)
+            throws InvalidDocumentException {
+        init(ctx);
+
+        switch (action) {
+            case CREATE:
+                handleCreate();
+                break;
+            case GET:
+                handleGet();
+                break;
+            case GET_ALL:
+                handleGetAll();
+                break;
+            case UPDATE:
+                handleUpdate();
+                break;
+            case DELETE:
+                handleDelete();
+                break;
+            default:
+                throw new UnsupportedOperationException("ValidatorHandlerImpl: Unknown action = "
+                        + action);
+        }
+    }
+
+    protected boolean enforceAsserts() {
+        return !ctx.getServiceBinding().isDisableAsserts();
+    }
+
+    protected Object getCommonPart() {
+        Object result = null;
+
+        try {
+            MultipartServiceContext multiPartCtx = (MultipartServiceContext) getServiceContext();
+            result = multiPartCtx.getInputPart(ctx.getCommonPartLabel(),
+                    getCommonPartClass());
+        } catch (Exception e) {
+            if (logger.isDebugEnabled() == true) {
+                logger.debug("Could not extract common part from multipart input.", e);
+            }
+        }
+
+        return result;
+    }
+
+    abstract protected Class<?> getCommonPartClass();
+
+    /**
+     * Handle create.
+     *
+     * @param ctx the ctx
+     */
+    abstract protected void handleCreate() throws InvalidDocumentException;
+
+    /**
+     * Handle get.
+     *
+     * @param ctx the ctx
+     */
+    abstract protected void handleGet() throws InvalidDocumentException;
+
+    /**
+     * Handle get all.
+     *
+     * @param ctx the ctx
+     */
+    abstract protected void handleGetAll() throws InvalidDocumentException;
+
+    /**
+     * Handle update.
+     *
+     * @param ctx the ctx
+     */
+    abstract protected void handleUpdate() throws InvalidDocumentException;
+
+    /**
+     * Handle delete.
+     *
+     * @param ctx the ctx
+     */
+    abstract protected void handleDelete() throws InvalidDocumentException;
 }
\ No newline at end of file
index a6e5143013705e02031162a668c18274fe0e3edd..4e2b69512db2d87c3915f32d204ad79a89bbe61e 100644 (file)
-/**    \r
- * NuxeoImageUtils.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}.\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.imaging.nuxeo;\r
-\r
-import java.io.ByteArrayInputStream;\r
-import java.io.File;\r
-import java.io.ByteArrayOutputStream;\r
-import java.io.FileNotFoundException;\r
-import java.io.InputStream;\r
-import java.io.BufferedInputStream;\r
-import java.io.IOException;\r
-import java.io.Serializable;\r
-import java.math.BigDecimal;\r
-import java.math.BigInteger;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.nuxeo.runtime.api.Framework;\r
-//import org.nuxeo.runtime.api.ServiceManager;\r
-//import org.nuxeo.runtime.api.ServiceDescriptor;\r
-\r
-//import org.nuxeo.common.utils.FileUtils;\r
-\r
-import org.nuxeo.ecm.platform.picture.api.ImageInfo;\r
-import org.nuxeo.ecm.platform.picture.api.ImagingDocumentConstants;\r
-import org.nuxeo.ecm.platform.picture.api.ImagingService;\r
-import org.nuxeo.ecm.platform.picture.api.PictureView;\r
-import org.nuxeo.ecm.platform.mimetype.MimetypeDetectionException;\r
-import org.nuxeo.ecm.platform.mimetype.interfaces.MimetypeRegistry;\r
-import org.nuxeo.ecm.platform.picture.api.adapters.PictureBlobHolder;\r
-import org.nuxeo.ecm.platform.filemanager.api.FileManager;\r
-import org.nuxeo.ecm.platform.filemanager.service.FileManagerService;\r
-import org.nuxeo.ecm.platform.filemanager.service.extension.FileImporter;\r
-import org.nuxeo.ecm.platform.filemanager.utils.FileManagerUtils;\r
-import org.nuxeo.ecm.platform.types.TypeManager;\r
-import org.nuxeo.ecm.core.repository.RepositoryDescriptor;\r
-import org.nuxeo.ecm.core.repository.RepositoryManager;\r
-import org.nuxeo.ecm.core.repository.RepositoryService;\r
-import org.nuxeo.ecm.core.storage.sql.BinaryManager;\r
-import org.nuxeo.ecm.core.storage.sql.DefaultBinaryManager;\r
-\r
-/*\r
- * Keep these commented out import statements as reminders of Nuxeo's blob management\r
-import org.nuxeo.runtime.model.ComponentManager;\r
-import org.nuxeo.runtime.model.impl.ComponentManagerImpl;\r
-import org.nuxeo.ecm.core.api.ejb.DocumentManagerBean;\r
-import org.nuxeo.ecm.core.storage.sql.RepositoryImpl;\r
-import org.nuxeo.ecm.core.storage.sql.Repository;\r
-import org.nuxeo.ecm.core.storage.sql.Binary;\r
-import org.nuxeo.ecm.core.storage.sql.RepositoryImpl;\r
-import org.nuxeo.ecm.core.storage.sql.RepositoryResolver;\r
-import org.nuxeo.ecm.core.storage.sql.coremodel.SQLBlob;\r
-import org.nuxeo.ecm.core.storage.sql.coremodel.SQLRepository;\r
-import org.nuxeo.ecm.core.storage.sql.RepositoryDescriptor;\r
-import org.nuxeo.ecm.core.api.DocumentResolver;\r
-*/\r
-\r
-import org.nuxeo.ecm.core.api.IdRef;\r
-import org.nuxeo.ecm.core.api.blobholder.BlobHolder;\r
-import org.nuxeo.ecm.core.api.blobholder.DocumentBlobHolder;\r
-import org.nuxeo.ecm.core.api.impl.blob.FileBlob;\r
-import org.nuxeo.ecm.core.api.impl.blob.InputStreamBlob;\r
-import org.nuxeo.ecm.core.api.impl.blob.StreamingBlob;\r
-import org.nuxeo.ecm.core.api.impl.blob.ByteArrayBlob;\r
-import org.nuxeo.ecm.core.api.repository.RepositoryInstance;\r
-import org.nuxeo.ecm.core.api.repository.Repository;\r
-import org.nuxeo.ecm.core.api.Blob;\r
-import org.nuxeo.ecm.core.api.ClientException;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import org.nuxeo.ecm.core.api.DocumentRef;\r
-import org.nuxeo.ecm.core.event.EventServiceAdmin;\r
-import org.nuxeo.ecm.core.schema.SchemaManager;\r
-import org.nuxeo.ecm.core.schema.types.Schema;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-//import org.nuxeo.ecm.core.repository.jcr.testing.RepositoryOSGITestCase;\r
-\r
-import org.apache.commons.io.IOUtils;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.common.FileUtils;\r
-import org.collectionspace.services.common.ServiceMain;\r
-import org.collectionspace.services.common.blob.BlobInput;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.TransactionException;\r
-import org.collectionspace.services.common.repository.RepositoryClient;\r
-import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;\r
-import org.collectionspace.services.common.blob.BlobOutput;\r
-import org.collectionspace.services.blob.BlobsCommon;\r
-import org.collectionspace.services.blob.DimensionSubGroup;\r
-import org.collectionspace.services.blob.DimensionSubGroupList;\r
-import org.collectionspace.services.blob.MeasuredPartGroup;\r
-import org.collectionspace.services.blob.MeasuredPartGroupList;\r
-import org.collectionspace.services.jaxb.BlobJAXBSchema;\r
-import org.collectionspace.services.nuxeo.client.java.CommonList;\r
-import org.collectionspace.services.nuxeo.client.java.RepositoryInstanceInterface;\r
-import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;\r
-import org.collectionspace.services.nuxeo.extension.thumbnail.ThumbnailConstants;\r
-import org.collectionspace.services.nuxeo.util.NuxeoUtils;\r
-import org.collectionspace.services.config.service.ListResultField;\r
-\r
-\r
-/**\r
- * The Class NuxeoBlobUtils.\r
- */\r
-public class NuxeoBlobUtils {\r
-               \r
-       /** The Constant logger. */\r
-       private static final Logger logger = LoggerFactory\r
-                       .getLogger(NuxeoBlobUtils.class);\r
-\r
-       //\r
-       // A maximum byte size for the byte array used to hold an image.  Images larger than this will\r
-       // be returned as FileInputStreams rather than ByteArrayInputStreams\r
-       //\r
-       private static final int MAX_IMAGE_BUFFER = 256 * 1024; // REM: 11/26/2013 - This should be set in a config/property file.\r
-       \r
-       //\r
-       // File name constants\r
-       //\r
-    private static final String NUXEO_FILENAME_BAD_CHARS = "[^a-zA-Z_0-9-.%:/\\ ]";\r
-    private static final String NUXEO_FILENAME_VALID_STRING = "[a-zA-Z_0-9-.%:/\\ ]+";\r
-\r
-       public static final String DOCUMENT_PLACEHOLDER_IMAGE = "documentImage.jpg";\r
-       public static final String DOCUMENT_MISSING_PLACEHOLDER_IMAGE = "documentImageMissing.jpg";\r
-       public static final String MIME_JPEG = "image/jpeg";\r
-       /*\r
-        * FIXME: REM - These constants should be coming from configuration and NOT\r
-        * hard coded.\r
-        */\r
-       public static final String DERIVATIVE_ORIGINAL = "Original";\r
-       public static final String DERIVATIVE_ORIGINAL_TAG = DERIVATIVE_ORIGINAL\r
-                       + "_";\r
-\r
-       public static final String DERIVATIVE_ORIGINAL_JPEG = "OriginalJpeg";\r
-       public static final String DERIVATIVE_ORIGINAL_JPEG_TAG = DERIVATIVE_ORIGINAL_JPEG\r
-                       + "_";\r
-\r
-       public static final String DERIVATIVE_MEDIUM = "Medium";\r
-       public static final String DERIVATIVE_MEDIUM_TAG = DERIVATIVE_MEDIUM + "_";\r
-\r
-       public static final String DERIVATIVE_THUMBNAIL = "Thumbnail";\r
-       public static final String DERIVATIVE_THUMBNAIL_TAG = DERIVATIVE_THUMBNAIL\r
-                       + "_";\r
-\r
-       public static final String DERIVATIVE_UNKNOWN = "_UNKNOWN_DERIVATIVE_NAME_";\r
-\r
-       //\r
-       // Image Dimension fields\r
-       //\r
-       public static final String PART_IMAGE = "digitalImage";\r
-       public static final String PART_SUMMARY = "The dimensions of a digital image -width, height, and pixel depth.";\r
-       public static final String WIDTH = "width";\r
-       public static final String HEIGHT = "height";\r
-       public static final String DEPTH = "depth";\r
-       public static final String UNIT_PIXELS = "pixels";\r
-       public static final String UNIT_BITS = "bits";\r
-       //\r
-       // Image Metadata schemas - These are Nuxeo defined schemas\r
-       //\r
-       public static final String SCHEMA_IPTC = "iptc";\r
-       public static final String SCHEMA_IMAGE_METADATA = "image_metadata";\r
-\r
-       private static final int THUMB_SIZE_HEIGHT = 100;\r
-       private static final int THUMB_SIZE_WIDTH = 75;\r
-\r
-       // static DefaultBinaryManager binaryManager = new DefaultBinaryManager();\r
-       // //can we get this from Nuxeo? i.e.,\r
-       // Framework.getService(BinaryManger.class)\r
-\r
-       // /** The temp file name. */\r
-       // static String tempFileName = "sunset.jpg";\r
-       //\r
-       // /** The file separator. */\r
-       // static String fileSeparator = System.getProperty("file.separator");\r
-       //\r
-       // /** The cur dir. */\r
-       // static String curDir = System.getProperty("user.dir");\r
-\r
-       /**\r
-        * Instantiates a new nuxeo image utils.\r
-        */\r
-       NuxeoBlobUtils() {\r
-               // empty constructor\r
-       }\r
-\r
-       /*\r
-        * Use this for debugging Nuxeo's PictureView class\r
-        */\r
-       private static String toStringPictureView(PictureView pictureView) {\r
-               StringBuffer strBuffer = new StringBuffer();\r
-               strBuffer.append("Description: " + pictureView.getDescription() + '\n');\r
-               strBuffer.append("FileName: " + pictureView.getFilename() + '\n');\r
-               strBuffer.append("Height: " + pictureView.getHeight() + '\n');\r
-               strBuffer.append("Width: " + pictureView.getWidth() + '\n');\r
-               strBuffer.append("Tag: " + pictureView.getTag() + '\n');\r
-               strBuffer.append("Title: " + pictureView.getTitle() + '\n');\r
-               return strBuffer.toString();\r
-       }\r
-\r
-       // FIXME: REM - This needs to be configuration-bases and NOT hard coded!\r
-       // FIXME: REM - Use MultiviewPicture adapter to get some of this information\r
-       static private String getDerivativeUri(String uri, String derivativeName) {\r
-               String result = DERIVATIVE_UNKNOWN;\r
-\r
-               if (derivativeName.startsWith(DERIVATIVE_ORIGINAL_TAG) == true) {\r
-                       result = DERIVATIVE_ORIGINAL;\r
-               } else if (derivativeName.startsWith(DERIVATIVE_ORIGINAL_JPEG_TAG) == true) {\r
-                       result = DERIVATIVE_ORIGINAL_JPEG;\r
-               } else if (derivativeName.startsWith(DERIVATIVE_MEDIUM_TAG) == true) {\r
-                       result = DERIVATIVE_MEDIUM;\r
-               } else if (derivativeName.startsWith(DERIVATIVE_THUMBNAIL_TAG) == true) {\r
-                       result = DERIVATIVE_THUMBNAIL;\r
-               }\r
-\r
-               return uri + result + "/" + BlobInput.URI_CONTENT_PATH;\r
-       }\r
-\r
-       static private HashMap<String, Object> createBlobListItem(Blob blob,\r
-                       String uri) {\r
-               HashMap<String, Object> item = new HashMap<String, Object>();\r
-\r
-               String value = blob.getEncoding();\r
-               if (value != null && !value.trim().isEmpty()) {\r
-                       item.put(BlobJAXBSchema.encoding, value);\r
-               }\r
-               value = Long.toString(blob.getLength());\r
-               if (value != null && !value.trim().isEmpty()) {\r
-                       item.put(BlobJAXBSchema.length, value);\r
-               }\r
-               value = blob.getMimeType();\r
-               if (value != null && !value.trim().isEmpty()) {\r
-                       item.put(BlobJAXBSchema.mimeType, value);\r
-               }\r
-               value = blob.getFilename();\r
-               if (value != null && !value.trim().isEmpty()) {\r
-                       item.put(BlobJAXBSchema.name, value);\r
-               }\r
-               value = getDerivativeUri(uri, blob.getFilename());\r
-               if (value != null && !value.trim().isEmpty()) {\r
-                       item.put(BlobJAXBSchema.uri, value);\r
-               }\r
-\r
-               return item;\r
-       }\r
-       \r
-       static public String getSanizitedFilename(File srcFile) throws Exception {\r
-               return getSanizitedFilename(srcFile.getName());\r
-       }\r
-       \r
-       /*\r
-        * Valid Nuxeo file names are a subset of *nix and Windows filenames, so we need to check.\r
-        */\r
-       static public String getSanizitedFilename(String fileName) throws Exception {\r
-               String result = fileName;\r
-               \r
-               if (fileName != null && fileName.matches(NUXEO_FILENAME_VALID_STRING) == false) {\r
-                       String fixedString = fileName.replaceAll(NUXEO_FILENAME_BAD_CHARS, "_");  // Replace "bad" chars with underscore character\r
-                       if (fixedString.matches(NUXEO_FILENAME_VALID_STRING) == true) {\r
-                               result = fixedString;\r
-                       } else {\r
-                               String errMsg = String.format("\tSorry, the sanizited string '%s' is still bad.", fixedString);\r
-                               throw new Exception(errMsg);\r
-                       }\r
-               }\r
-               \r
-               if (result != null && logger.isDebugEnabled() == true) {\r
-                       if (result.equals(fileName) == false) {\r
-                               logger.debug(String.format("The file name '%s' was sanizitized to '%s'.", fileName, result));\r
-                       }\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-       static public CommonList getBlobDerivatives(RepositoryInstanceInterface repoSession,\r
-                       String repositoryId, List<ListResultField> resultsFields, String uri)\r
-                       throws Exception {\r
-               CommonList commonList = new CommonList();\r
-               int nFields = resultsFields.size() + 2;\r
-               String fields[] = new String[nFields];// FIXME: REM - Patrick needs to fix this hack.  It is a "common list" issue\r
-               fields[0] = "csid";\r
-               fields[1] = "uri";\r
-               for (int i = 2; i < nFields; i++) {\r
-                       ListResultField field = resultsFields.get(i - 2);\r
-                       fields[i] = field.getElement();\r
-               }\r
-               commonList.setFieldsReturned(fields);\r
-\r
-               IdRef documentRef = new IdRef(repositoryId);\r
-               DocumentModel documentModel = repoSession.getDocument(documentRef);\r
-               DocumentBlobHolder docBlobHolder = (DocumentBlobHolder) documentModel\r
-                               .getAdapter(BlobHolder.class);\r
-               List<Blob> docBlobs = docBlobHolder.getBlobs();\r
-               // List<BlobListItem> blobListItems = result.getBlobListItem();\r
-               HashMap<String, Object> item = null;\r
-               for (Blob blob : docBlobs) {\r
-                       if (blob != null) {\r
-                               item = createBlobListItem(blob, uri);\r
-                               commonList.addItem(item);\r
-                       }\r
-               }\r
-\r
-               return commonList;\r
-       }\r
-\r
-       /*\r
-        * [dublincore, uid, picture, iptc, common, image_metadata]\r
-        */\r
-       static private Map<String, Object> getMetadata(Blob nuxeoBlob)\r
-                       throws Exception {\r
-               ImagingService service = Framework.getService(ImagingService.class);\r
-               Map<String, Object> metadataMap = service.getImageMetadata(nuxeoBlob);\r
-               return metadataMap;\r
-       }\r
-\r
-       private static String[] imageTypes = {"jpeg", "bmp", "gif", "png", "tiff", "octet-stream"};\r
-       static private boolean isImageMedia(Blob nuxeoBlob) {\r
-               boolean result = false;\r
-               \r
-               String mimeType = nuxeoBlob.getMimeType();\r
-               if (mimeType != null) {\r
-                       mimeType = mimeType.toLowerCase().trim();\r
-                       String[] parts = mimeType.split("/"); // split strings like "application/xml" into an array of two strings\r
-                       if (parts.length == 2) {\r
-                               for (String type : imageTypes) {\r
-                                       if (parts[1].equalsIgnoreCase(type)) {\r
-                                               result = true;\r
-                                               break;\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       static private MeasuredPartGroupList getDimensions(\r
-                       DocumentModel documentModel, Blob nuxeoBlob) {\r
-               MeasuredPartGroupList result = null;\r
-               \r
-               if (isImageMedia(nuxeoBlob) == true) try {\r
-                       ImagingService service = Framework.getService(ImagingService.class);\r
-                       ImageInfo imageInfo = service.getImageInfo(nuxeoBlob);\r
-                       Map<String, Object> metadataMap = getMetadata(nuxeoBlob);\r
-\r
-                       if (imageInfo != null) {\r
-                               //\r
-                               // Create a timestamp to add to all the image's dimensions\r
-                               //\r
-                               String valueDate = GregorianCalendarDateTimeUtils\r
-                                               .timestampUTC();\r
-                               \r
-                               result = new MeasuredPartGroupList();\r
-                               List<MeasuredPartGroup> measuredPartGroupList = \r
-                                               (result).getMeasuredPartGroup();\r
-                               //\r
-                               // Create a new measured part for the "image"\r
-                               //\r
-                               MeasuredPartGroup mpGroup = new MeasuredPartGroup();\r
-                               mpGroup.setMeasuredPart(PART_IMAGE);\r
-                               mpGroup.setDimensionSummary(PART_SUMMARY);\r
-                               mpGroup.setDimensionSubGroupList(new DimensionSubGroupList());\r
-                               List<DimensionSubGroup> dimensionSubGroupList = mpGroup.getDimensionSubGroupList()\r
-                                               .getDimensionSubGroup();\r
-\r
-                               //\r
-                               // Set the width\r
-                               //\r
-                               DimensionSubGroup widthDimension = new DimensionSubGroup();\r
-                               widthDimension.setDimension(WIDTH);\r
-                               widthDimension.setMeasurementUnit(UNIT_PIXELS);\r
-                               widthDimension.setValue(intToBigDecimal(imageInfo.getWidth()));\r
-                               widthDimension.setValueDate(valueDate);\r
-                               dimensionSubGroupList.add(widthDimension);\r
-                               //\r
-                               // Set the height\r
-                               //\r
-                               DimensionSubGroup heightDimension = new DimensionSubGroup();\r
-                               heightDimension.setDimension(HEIGHT);\r
-                               heightDimension.setMeasurementUnit(UNIT_PIXELS);\r
-                               heightDimension\r
-                                               .setValue(intToBigDecimal(imageInfo.getHeight()));\r
-                               heightDimension.setValueDate(valueDate);\r
-                               dimensionSubGroupList.add(heightDimension);\r
-                               //\r
-                               // Set the depth\r
-                               //\r
-                               DimensionSubGroup depthDimension = new DimensionSubGroup();\r
-                               depthDimension.setDimension(DEPTH);\r
-                               depthDimension.setMeasurementUnit(UNIT_BITS);\r
-                               depthDimension.setValue(intToBigDecimal(imageInfo.getDepth()));\r
-                               depthDimension.setValueDate(valueDate);\r
-                               dimensionSubGroupList.add(depthDimension);\r
-                               //\r
-                               // Now set out result\r
-                               //\r
-                               measuredPartGroupList.add(mpGroup);\r
-                       } else {\r
-                               if (logger.isWarnEnabled() == true) {\r
-                                       logger.warn("Could not synthesize a dimension list of the blob: "\r
-                                                       + documentModel.getName());\r
-                               }\r
-                       }\r
-               } catch (Exception e) {\r
-                       logger.warn("Could not extract image information for blob: "\r
-                                       + documentModel.getName(), e);\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-       // FIXME: Add error checking here, as none of these calls return an\r
-       // Exception\r
-       static private BigDecimal intToBigDecimal(int i) {\r
-               BigInteger bigint = BigInteger.valueOf(i);\r
-               BigDecimal bigdec = new BigDecimal(bigint);\r
-               return bigdec;\r
-       }\r
-\r
-       static private BlobsCommon createBlobsCommon(DocumentModel documentModel,\r
-                       Blob nuxeoBlob) {\r
-               return createBlobsCommon(documentModel, nuxeoBlob, false);\r
-       }\r
-       \r
-       static private BlobsCommon createBlobsCommon(DocumentModel documentModel,\r
-                       Blob nuxeoBlob, Boolean getContentFlag) {\r
-               BlobsCommon result = new BlobsCommon();\r
-\r
-               if (documentModel != null) {\r
-                       result.setMimeType(nuxeoBlob.getMimeType());\r
-                       result.setName(nuxeoBlob.getFilename());\r
-                       result.setLength(Long.toString(nuxeoBlob.getLength()));\r
-                       result.setRepositoryId(documentModel.getId());\r
-                       \r
-                       //\r
-                       // If getContentFlag is true then we're being asked for the blob's content, so we don't\r
-                       // need the measurement info.  Getting the measurement info requires a call to Nuxeo which in turn\r
-                       // calls ImageMagick.\r
-                       //\r
-                       if (getContentFlag.booleanValue() == false) {\r
-                               MeasuredPartGroupList measuredPartGroupList = getDimensions(\r
-                                               documentModel, nuxeoBlob);\r
-                               if (measuredPartGroupList != null) {\r
-                                       result.setMeasuredPartGroupList(measuredPartGroupList);\r
-                               }\r
-                       }\r
-                       \r
-                       // Check to see if a thumbnail preview was created by Nuxeo\r
-            if (documentModel.hasFacet(ThumbnailConstants.THUMBNAIL_FACET)) {\r
-                       String errorMsg = null;\r
-               String thumbnailName = null;\r
-                               try {\r
-                                       thumbnailName = (String)documentModel.getProperty(ThumbnailConstants.THUMBNAIL_SCHEMA_NAME,\r
-                                               ThumbnailConstants.THUMBNAIL_FILENAME_PROPERTY_NAME);\r
-                                       Blob thumbnailBlob = (Blob)documentModel.getProperty(ThumbnailConstants.THUMBNAIL_SCHEMA_NAME,\r
-                                               ThumbnailConstants.THUMBNAIL_PROPERTY_NAME);\r
-                               } catch (ClientException e) {\r
-                                       errorMsg = "Could not extract the name of the thumbnail preview image file.";\r
-                                       if (logger.isTraceEnabled()) {\r
-                                               logger.trace(errorMsg, e);\r
-                                       }\r
-                               }\r
-                               \r
-                               if (errorMsg == null) {\r
-                                       logger.info("A thumbnail preview was created for this document blob: " + thumbnailName);\r
-                               } else {\r
-                                       logger.warn(errorMsg);\r
-                               }\r
-            }\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-       /*\r
-        * This is a prototype method that is not currently used as of 1/1/2012.  However,\r
-        * it may be useful now that we've transitioned to using an embedded Nuxeo server.\r
-        */\r
-       static private File getBlobFile(RepositoryInstanceInterface ri,\r
-                       DocumentModel documentModel, Blob blob) {\r
-               DefaultBinaryManager binaryManager = null;\r
-               RepositoryDescriptor descriptor = null;\r
-               File file = null;\r
-\r
-               try {\r
-                       RepositoryService repositoryService1 = (RepositoryService) Framework\r
-                                       .getRuntime().getComponent(RepositoryService.NAME);\r
-\r
-                       String repositoryName = documentModel.getRepositoryName();\r
-                       RepositoryManager repositoryManager = repositoryService1\r
-                                       .getRepositoryManager();\r
-                       descriptor = repositoryManager.getDescriptor(repositoryName);\r
-\r
-// Keep this code around for future work/enhancements                  \r
-//                     binaryManager = new DefaultBinaryManager();\r
-//\r
-//                     File storageDir = binaryManager.getStorageDir();\r
-//                     // SQLBlob blob = (SQLBlob)\r
-//                     // doc.getPropertyValue("schema:blobField");\r
-//                     File file = binaryManager.getFileForDigest(blob.getDigest(), false);\r
-\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-\r
-// Keep this code around for future work/enhancements\r
-//             try {\r
-//                     binaryManager.initialize(SQLRepository.getDescriptor(descriptor));\r
-//             } catch (IOException e) {\r
-//                     // TODO Auto-generated catch block\r
-//                     e.printStackTrace();\r
-//             } catch (Exception e) {\r
-//                     // TODO Auto-generated catch block\r
-//                     e.printStackTrace();\r
-//             }\r
-\r
-// Keep this code around for future work/enhancements\r
-//             File storageDir = binaryManager.getStorageDir();\r
-//             SQLBlob blob = (SQLBlob)\r
-//             documentModel.getPropertyValue("schema:blobField");\r
-//             File file = binaryManager.getFileForDigest(blob.getDigest(), false);\r
-\r
-               return file;\r
-       }\r
-\r
-       /**\r
-        * Returns a schema, given the name of a schema.  Possibly usefule in the future\r
-        * \r
-        * @param schemaName\r
-        *            a schema name.\r
-        * @return a schema.\r
-        */\r
-       private static Schema getSchemaFromName(String schemaName) {\r
-               SchemaManager schemaManager = null;\r
-               try {\r
-                       schemaManager = Framework.getService(SchemaManager.class);\r
-               } catch (Exception e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-               return schemaManager != null ? schemaManager.getSchema(schemaName)\r
-                               : null;\r
-       }\r
-\r
-       /**\r
-        * Gets the blob.  Not in use now, but might be useful in the future.\r
-        * \r
-        * @param nuxeoSession\r
-        *            the nuxeo session\r
-        * @param id\r
-        *            the id\r
-        * @return the blob\r
-        */\r
-       static private Blob getBlob(RepositoryInstanceInterface repoSession, String id) {\r
-               Blob result = null;\r
-\r
-               try {\r
-                       Repository repository = repoSession.getRepositoryInstance().getRepository();\r
-                       // binaryManager.initialize(new RepositoryDescriptor());\r
-                       // binaryManager.getBinary("a4cac052ae0281979f2dcf5ab2e61a6c");\r
-                       // DocumentResolver.resolveReference(nuxeoSession, documentRef);\r
-                       // binaryManager = repository.getBinaryManager();\r
-                       // documentModel.getr\r
-               } catch (Exception x) {\r
-                       x.printStackTrace();\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-    static private Blob checkMimeType(Blob blob, String fullname)\r
-            throws ClientException {\r
-        final String mimeType = blob.getMimeType();\r
-        if (mimeType != null && !mimeType.equals("application/octet-stream")\r
-                && !mimeType.equals("application/octetstream")) {\r
-            return blob;\r
-        }\r
-        String filename = FileManagerUtils.fetchFileName(fullname);\r
-        try {\r
-            blob = getMimeService().updateMimetype(blob, filename);\r
-        } catch (MimetypeDetectionException e) {\r
-            throw new ClientException(e);\r
-        }\r
-        return blob;\r
-    }\r
-       \r
-       /**\r
-        * Gets the type service.  Not in use, but please keep for future reference\r
-        * \r
-        * @return the type service\r
-        * @throws ClientException\r
-        *             the client exception\r
-        */\r
-       private static TypeManager getTypeService() throws ClientException {\r
-               TypeManager typeService = null;\r
-               \r
-               try {\r
-                       typeService = Framework.getService(TypeManager.class);\r
-               } catch (Exception e) {\r
-                       throw new ClientException(e);\r
-               }\r
-               \r
-               return typeService;\r
-       }\r
-\r
-       /**\r
-        * Gets the bytes.\r
-        * \r
-        * @param fis\r
-        *            the fis\r
-        * @return the bytes\r
-        */\r
-       private static byte[] getBytes(InputStream fis) {\r
-               ByteArrayOutputStream bos = new ByteArrayOutputStream();\r
-               byte[] buf = new byte[128 * 1024];\r
-               try {\r
-                       for (int readNum; (readNum = fis.read(buf)) != -1;) {\r
-                               bos.write(buf, 0, readNum);\r
-                               // no doubt here is 0\r
-                               /*\r
-                                * Writes len bytes from the specified byte array starting at\r
-                                * offset off to this byte array output stream.\r
-                                */\r
-                               System.out.println("read " + readNum + " bytes,");\r
-                       }\r
-               } catch (IOException ex) {\r
-                       logger.error(ex.getMessage(), ex);\r
-               }\r
-               byte[] bytes = bos.toByteArray();\r
-               // bytes is the ByteArray we need\r
-               return bytes;\r
-       }\r
-\r
-       /**\r
-        * Creates the serializable blob.  We may need this code, do not remove.\r
-        * \r
-        * @param fileInputStream\r
-        *            the file input stream\r
-        * @param filename\r
-        *            the filename\r
-        * @param mimeType\r
-        *            the mime type\r
-        * @return the blob\r
-        */\r
-       private static Blob createSerializableBlob(InputStream fileInputStream,\r
-                       String filename, String mimeType) {\r
-               Blob blob = null;\r
-               try {\r
-                       // persisting the blob makes it possible to read the binary content\r
-                       // of the request stream several times (mimetype sniffing, digest\r
-                       // computation, core binary storage)\r
-                       byte[] bytes = getBytes(fileInputStream);\r
-                       blob = new ByteArrayBlob(bytes);\r
-                       // filename\r
-                       if (filename != null) {\r
-                               filename = getCleanFileName(filename);\r
-                       }\r
-                       blob.setFilename(filename);\r
-                       // mimetype detection\r
-                       MimetypeRegistry mimeService = Framework\r
-                                       .getService(MimetypeRegistry.class);\r
-                       String detectedMimeType = mimeService\r
-                                       .getMimetypeFromFilenameAndBlobWithDefault(filename, blob,\r
-                                                       null);\r
-                       if (detectedMimeType == null) {\r
-                               if (mimeType != null) {\r
-                                       detectedMimeType = mimeType;\r
-                               } else {\r
-                                       // default\r
-                                       detectedMimeType = "application/octet-stream";\r
-                               }\r
-                       }\r
-                       blob.setMimeType(detectedMimeType);\r
-               } catch (MimetypeDetectionException e) {\r
-                       logger.error(String.format("could not fetch mimetype for file %s",\r
-                                       filename), e);\r
-               } catch (Exception e) {\r
-                       logger.error("", e);\r
-               }\r
-               return blob;\r
-       }\r
-\r
-       /**\r
-        * Creates a serializable blob from a stream, with filename and mimetype\r
-        * detection.\r
-        * \r
-        * <p>\r
-        * Creates an in-memory blob if data is under 64K, otherwise constructs a\r
-        * serializable FileBlob which stores data in a temporary file on the hard\r
-        * disk.\r
-        * </p>\r
-        * \r
-        * @param file\r
-        *            the input stream holding data\r
-        * @param filename\r
-        *            the file name. Will be set on the blob and will used for\r
-        *            mimetype detection.\r
-        * @param mimeType\r
-        *            the detected mimetype at upload. Can be null. Will be verified\r
-        *            by the mimetype service.\r
-        * @return the blob\r
-        */\r
-       private static Blob createStreamingBlob(File file, String filename,\r
-                       String mimeType) {\r
-               Blob blob = null;\r
-               try {\r
-                       // persisting the blob makes it possible to read the binary content\r
-                       // of the request stream several times (mimetype sniffing, digest\r
-                       // computation, core binary storage)\r
-                       blob = StreamingBlob.createFromFile(file, mimeType).persist();\r
-                       // filename\r
-                       if (filename != null) {\r
-                               filename = getCleanFileName(filename);\r
-                       }\r
-                       blob.setFilename(filename);\r
-                       // mimetype detection\r
-                       MimetypeRegistry mimeService = Framework\r
-                                       .getService(MimetypeRegistry.class);\r
-                       String detectedMimeType = mimeService\r
-                                       .getMimetypeFromFilenameAndBlobWithDefault(filename, blob,\r
-                                                       null);\r
-                       if (detectedMimeType == null) {\r
-                               if (mimeType != null) {\r
-                                       detectedMimeType = mimeType;\r
-                               } else {\r
-                                       // default\r
-                                       detectedMimeType = "application/octet-stream";\r
-                               }\r
-                       }\r
-                       blob.setMimeType(detectedMimeType);\r
-               } catch (MimetypeDetectionException e) {\r
-                       logger.error(String.format("could not fetch mimetype for file %s",\r
-                                       filename), e);\r
-               } catch (IOException e) {\r
-                       logger.error("", e);\r
-               } catch (Exception e) {\r
-                       logger.error("", e);\r
-               }\r
-               return blob;\r
-       }\r
-\r
-       private static Blob createNuxeoFileBasedBlob(File file) throws Exception {\r
-               return new FileBlob(file);\r
-       }\r
-\r
-       /**\r
-        * Returns a clean filename, stripping upload path on client side.\r
-        * <p>\r
-        * Fixes NXP-544\r
-        * </p>\r
-        * \r
-        * @param filename\r
-        *            the filename\r
-        * @return the clean file name\r
-        */\r
-       private static String getCleanFileName(String filename) {\r
-               String res = null;\r
-               int lastWinSeparator = filename.lastIndexOf('\\');\r
-               int lastUnixSeparator = filename.lastIndexOf('/');\r
-               int lastSeparator = Math.max(lastWinSeparator, lastUnixSeparator);\r
-               if (lastSeparator != -1) {\r
-                       res = filename.substring(lastSeparator + 1, filename.length());\r
-               } else {\r
-                       res = filename;\r
-               }\r
-               return res;\r
-       }\r
-\r
-       /**\r
-        * Gets Nuxeo's file manager service.\r
-        * \r
-        * @return the file manager service\r
-        * @throws ClientException\r
-        *             the client exception\r
-        */\r
-       private static FileManager getFileManager() throws ClientException {\r
-               FileManager result = null;\r
-               \r
-               try {\r
-                       result = Framework.getService(FileManager.class);\r
-               } catch (Exception e) {\r
-                       String msg = "Unable to get Nuxeo's FileManager service.";\r
-                       logger.error(msg, e);\r
-                       throw new ClientException("msg", e);\r
-               }\r
-               \r
-               return result;\r
-       }\r
-               \r
-       /**\r
-        * Gets Nuxeo's file manager service.\r
-        * \r
-        * @return the file manager service\r
-        * @throws ClientException\r
-        *             the client exception\r
-        */\r
-       private static FileManagerService getFileManagerService() throws ClientException {\r
-               FileManagerService result = null;\r
-               \r
-               try {\r
-                       result = (FileManagerService)getFileManager();\r
-               } catch (Exception e) {\r
-                       String msg = "Unable to get Nuxeo's FileManager service.";\r
-                       logger.error(msg, e);\r
-                       throw new ClientException("msg", e);\r
-               }\r
-               \r
-               return result;\r
-       }       \r
-       \r
-       /**\r
-        * Gets Nuxeo's file manager service.\r
-        * \r
-        * @return the file manager service\r
-        * @throws ClientException\r
-        *             the client exception\r
-        */\r
-       private static FileManager getFileManagerServicex() throws ClientException {\r
-               FileManager result = null;\r
-               try {\r
-                       result = Framework.getService(FileManager.class);\r
-               } catch (Exception e) {\r
-                       String msg = "Unable to get Nuxeo's FileManager service.";\r
-                       logger.error(msg, e);\r
-                       throw new ClientException("msg", e);\r
-               }\r
-               return result;\r
-       }\r
-       \r
-       private static EventServiceAdmin getEventServiceAdmin() throws ClientException {\r
-               EventServiceAdmin result = null;\r
-               try {\r
-                       result = Framework.getService(EventServiceAdmin.class);\r
-               } catch (Exception e) {\r
-                       String msg = "Unable to get Nuxeo's EventServiceAdmin service.";\r
-                       logger.error(msg, e);\r
-                       throw new ClientException("msg", e);\r
-               }\r
-               return result;\r
-       }       \r
-       \r
-       private static BinaryManager getBinaryManagerService() throws ClientException {\r
-               BinaryManager result = null;\r
-               try {\r
-                       result = Framework.getService(BinaryManager.class);\r
-               } catch (Exception e) {\r
-                       String msg = "Unable to get Nuxeo's BinaryManager service.";\r
-                       logger.error(msg, e);\r
-                       throw new ClientException("msg", e);\r
-               }\r
-               return result;\r
-       }\r
-       \r
-       static private RepositoryInstanceInterface getRepositorySession(ServiceContext ctx, RepositoryClient repositoryClient) {\r
-               RepositoryInstanceInterface result = null;              \r
-               RepositoryJavaClientImpl nuxeoClient = (RepositoryJavaClientImpl)repositoryClient;\r
-               \r
-               try {\r
-                       result = nuxeoClient.getRepositorySession(ctx);\r
-               } catch (Exception e) {\r
-            logger.error("Could not get a repository session to the Nuxeo repository", e);\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       static private void releaseRepositorySession(ServiceContext ctx, RepositoryClient repositoryClient, RepositoryInstanceInterface repoSession) throws TransactionException {\r
-               RepositoryJavaClientImpl nuxeoClient = (RepositoryJavaClientImpl)repositoryClient;\r
-               nuxeoClient.releaseRepositorySession(ctx, repoSession);\r
-       }\r
-       \r
-    static private MimetypeRegistry getMimeService() throws ClientException {\r
-       MimetypeRegistry result = null;\r
-       \r
-        try {\r
-               result = Framework.getService(MimetypeRegistry.class);\r
-        } catch (Exception e) {\r
-            throw new ClientException(e);\r
-        }\r
-               \r
-        return result;\r
-    }\r
-       \r
-       private static DocumentModel createDocumentFromBlob(\r
-                       RepositoryInstanceInterface repoSession,\r
-            Blob inputStreamBlob, \r
-            String blobLocation, \r
-            boolean overwrite, \r
-            String blobName, \r
-            boolean useNuxeoAdaptors) throws Exception {\r
-               DocumentModel result = null;\r
-               \r
-               if (useNuxeoAdaptors == true) {\r
-                       //\r
-                       // Use Nuxeo's high-level create method which looks for plugin adapters that match the MIME type.  For example,\r
-                       // for image blobs, Nuxeo's file manager will pick a special image plugin that will automatically generate\r
-                       // image derivatives.\r
-                       //\r
-                       result = getFileManager().createDocumentFromBlob(\r
-                                       repoSession.getRepositoryInstance(), inputStreamBlob, blobLocation, true, blobName);\r
-               } else {\r
-                       //\r
-                       // User Nuxeo's default file importer/adapter explicitly.  This avoids specialized functionality from happening like\r
-                       // image derivative creation.\r
-                       //\r
-                       String digestAlgorithm = getFileManager()\r
-                       .getDigestAlgorithm(); // Only call this because we seem to need some way of initializing Nuxeo's FileManager with a call.\r
-                       \r
-                       FileManagerService fileManagerService = getFileManagerService();\r
-                       inputStreamBlob = checkMimeType(inputStreamBlob, blobName);\r
-\r
-                       FileImporter defaultFileImporter = fileManagerService.getPluginByName("DefaultFileImporter");\r
-                       result = defaultFileImporter.create(\r
-                                       repoSession.getRepositoryInstance(), inputStreamBlob, blobLocation, true, blobName, getTypeService());                  \r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       static public BlobsCommon createBlobInRepository(\r
-                       ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-                       RepositoryClient repositoryClient,\r
-                       InputStream inputStream,\r
-                       String blobName,\r
-                       boolean useNuxeoAdaptors) throws TransactionException {\r
-               BlobsCommon result = null;\r
-\r
-               boolean repoSessionCleanup = false;\r
-               RepositoryInstanceInterface repoSession = (RepositoryInstanceInterface)ctx.getCurrentRepositorySession();\r
-               if (repoSession == null) {\r
-                       repoSession = getRepositorySession(ctx, repositoryClient);\r
-                       repoSessionCleanup = true;\r
-               }\r
-                               \r
-               try {\r
-                       // We'll store the blob inside the workspace directory of the calling service\r
-                       String nuxeoWspaceId = ctx.getRepositoryWorkspaceId();\r
-                       DocumentRef nuxeoWspace = new IdRef(nuxeoWspaceId);\r
-                       DocumentModel blobLocation = repoSession.getDocument(nuxeoWspace);\r
-                       \r
-                       Blob inputStreamBlob = new InputStreamBlob(inputStream);\r
-                       DocumentModel documentModel = createDocumentFromBlob(\r
-                                       repoSession,\r
-                           inputStreamBlob, \r
-                           blobLocation.getPathAsString(), \r
-                           true, \r
-                           blobName,\r
-                           useNuxeoAdaptors);\r
-                       result = createBlobsCommon(documentModel, inputStreamBlob); // Now create the metadata about the Nuxeo blob document\r
-               } catch (Exception e) {\r
-                       result = null;\r
-                       logger.error("Could not create new Nuxeo blob document.", e); //FIXME: REM - This should probably be re-throwing the exception?\r
-               } finally {\r
-                       if (repoSessionCleanup == true) {\r
-                               releaseRepositorySession(ctx, repositoryClient, repoSession);\r
-                       }\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       /**\r
-        * Creates the picture.\r
-        * \r
-        * @param ctx\r
-        *            the ctx\r
-        * @param repoSession\r
-        *            the repo session\r
-        * @param filePath\r
-        *            the file path\r
-        * @return the string\r
-        * @throws Exception \r
-        */\r
-       public static BlobsCommon createBlobInRepository(\r
-                       ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-                       RepositoryInstanceInterface repoSession,\r
-                       BlobInput blobInput,\r
-                       boolean purgeOriginal,\r
-                       boolean useNuxeoAdaptors) throws Exception {\r
-               BlobsCommon result = null;\r
-\r
-               File originalFile = blobInput.getBlobFile();\r
-               File targetFile = originalFile;\r
-               try {\r
-                       // We'll store the blob inside the workspace directory of the calling service\r
-                       String nuxeoWspaceId = ctx.getRepositoryWorkspaceId();\r
-                       DocumentRef nuxeoWspace = new IdRef(nuxeoWspaceId);\r
-                       DocumentModel wspaceDoc = repoSession.getDocument(nuxeoWspace);\r
-                       //\r
-                       // If the original file's name contains "illegal" characters, then we create a copy of the file to give Nuxeo.\r
-                       //\r
-                       String sanitizedName = NuxeoBlobUtils.getSanizitedFilename(originalFile);\r
-                       if (sanitizedName.equals(originalFile.getName()) == false) {\r
-                               targetFile = FileUtils.createTmpFile(originalFile, sanitizedName);\r
-                               if (logger.isDebugEnabled() == true) {\r
-                                       logger.debug(String.format("The file '%s''s name has characters that Nuxeo can't deal with.  Rather than renaming the file, we created a new temp file at '%s'",\r
-                                                       originalFile.getName(), targetFile.getAbsolutePath()));\r
-                               }\r
-                       }                       \r
-                       \r
-                       result = createBlobInRepository(repoSession,\r
-                                       wspaceDoc,\r
-                                       purgeOriginal,\r
-                                       targetFile, \r
-                                       null, // MIME type\r
-                                       useNuxeoAdaptors);\r
-                       //\r
-                       // Make sure we're using the original file name in our BlobsCommon instance.  If the original file's name\r
-                       // contained illegal characters, then we created and handed a copy of the file to Nuxeo.  We don't want the\r
-                       // copy's file name stored in the BlobsCommon instance, we want the original file name instead.\r
-                       //\r
-                       if (targetFile.equals(originalFile) == false) {\r
-                               result.setName(originalFile.getName());\r
-                       }\r
-                       \r
-               } catch (Exception e) {\r
-                       logger.error("Could not create image blob.", e);\r
-                       throw e;\r
-               } finally {\r
-                       //\r
-                       // If we created a temp file then we should delete it.\r
-                       //\r
-                       if (targetFile.equals(originalFile) == false) {\r
-                               if (targetFile.delete() == false) {\r
-                                       logger.warn(String.format("Attempt to delete temporary file '%s' failed.", targetFile.getAbsolutePath()));\r
-                               }\r
-                       }\r
-               }\r
-\r
-               return result;\r
-       }\r
-       \r
-       /*\r
-        * Find out if this document's blob/file-contents are allowed to be purged.  For instance, we currently\r
-        * only want to allow the purging the contents of Nuxeo "Picture" documents. \r
-        */\r
-       static private boolean isPurgeAllowed(DocumentModel docModel) {\r
-               boolean result = false;\r
-               \r
-               if (docModel.hasFacet(ImagingDocumentConstants.PICTURE_FACET) == true) {\r
-                       result = true; // Yes, delete/purge the original content\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       /**\r
-        * Creates the image blob.\r
-        * \r
-        * @param nuxeoSession\r
-        *            the nuxeo session\r
-        * @param blobLocation\r
-        *            the blob location\r
-        * @param file\r
-        *            the file\r
-        * @param fileName\r
-        *            the file name\r
-        * @param mimeType\r
-        *            the mime type\r
-        * @return the string\r
-        */\r
-       static private BlobsCommon createBlobInRepository(RepositoryInstanceInterface nuxeoSession,\r
-                       DocumentModel blobLocation,\r
-                       boolean purgeOriginal,\r
-                       File file,\r
-                       String mimeType,\r
-                       boolean useNuxeoAdaptors) {\r
-               BlobsCommon result = null;\r
-\r
-               try {\r
-                       Blob fileBlob = createNuxeoFileBasedBlob(file);\r
-                       \r
-                       DocumentModel documentModel = createDocumentFromBlob(\r
-                                       nuxeoSession, fileBlob,\r
-                                       blobLocation.getPathAsString(),\r
-                                       true,\r
-                                       file.getName(),\r
-                                       useNuxeoAdaptors);\r
-\r
-                       result = createBlobsCommon(documentModel, fileBlob); // Now create our metadata resource document\r
-\r
-                       // If the sender wanted us to generate only derivatives, we need to purge/clear the original contents\r
-                       if (purgeOriginal == true && isPurgeAllowed(documentModel) == true) {\r
-                               // Empty the document model's "content" property -this does not delete the actual file/blob\r
-                               documentModel.setPropertyValue("file:content", (Serializable) null);\r
-                               \r
-                               if (documentModel.hasFacet(ImagingDocumentConstants.PICTURE_FACET)) {\r
-                                       // Now with no content, the derivative listener wants to update the derivatives. So to\r
-                                       // prevent the listener, we remove the "Picture" facet from the document\r
-                                       NuxeoUtils.removeFacet(documentModel, ImagingDocumentConstants.PICTURE_FACET); // Removing this facet ensures the original derivatives are unchanged.\r
-                                       nuxeoSession.saveDocument(documentModel);\r
-                                       // Now that we've emptied the document model's content field, we can add back the Picture facet\r
-                                       NuxeoUtils.addFacet(documentModel, ImagingDocumentConstants.PICTURE_FACET);\r
-                               }\r
-                               \r
-                               nuxeoSession.saveDocument(documentModel);\r
-                               // Next, we need to remove the actual file from Nuxeo's data directory\r
-                               DocumentBlobHolder docBlobHolder = (DocumentBlobHolder) documentModel\r
-                                               .getAdapter(BlobHolder.class);\r
-                               Blob blob = docBlobHolder.getBlob();\r
-                               if(blob == null) {\r
-                                       logger.error("Could not get blob for original image. Trying to delete original for: {}",\r
-                                                       file.getName());\r
-                               } else {\r
-                                       boolean deleteSuccess = NuxeoUtils.deleteFileOfBlob(docBlobHolder.getBlob());\r
-                               }\r
-                       }\r
-               } catch (Exception e) {\r
-                       result = null;\r
-                       logger.error("Could not create new Nuxeo blob document.", e); //FIXME: REM - This should probably be re-throwing the exception?\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-       // /*\r
-       // * This is an alternate approach to getting information about an image\r
-       // * and its corresponding derivatives.\r
-       // */\r
-       // // MultiviewPictureAdapter multiviewPictureAdapter =\r
-       // documentModel.getAdapter(MultiviewPictureAdapter.class);\r
-       // MultiviewPictureAdapterFactory multiviewPictureAdapterFactory = new\r
-       // MultiviewPictureAdapterFactory();\r
-       // MultiviewPictureAdapter multiviewPictureAdapter =\r
-       // (MultiviewPictureAdapter)multiviewPictureAdapterFactory.getAdapter(documentModel,\r
-       // null);\r
-       // if (multiviewPictureAdapter != null) {\r
-       // PictureView[] pictureViewArray = multiviewPictureAdapter.getViews();\r
-       // for (PictureView pictureView : pictureViewArray) {\r
-       // if (logger.isDebugEnabled() == true) {\r
-       // logger.debug("-------------------------------------");\r
-       // logger.debug(toStringPictureView(pictureView));\r
-       // }\r
-       // }\r
-       // }\r
-       \r
-       public static InputStream getResource(String resourceName) {\r
-               InputStream result = null;\r
-               \r
-               try {\r
-                       result = ServiceMain.getInstance().getResourceAsStream(resourceName);\r
-               } catch (FileNotFoundException e) {\r
-                       logger.error("Missing Services resource: " + resourceName, e);\r
-               }\r
-        \r
-               return result;\r
-       }\r
-\r
-       static public BlobOutput getBlobOutput(ServiceContext ctx,\r
-                       RepositoryClient repositoryClient,\r
-                       String repositoryId,\r
-                       StringBuffer outMimeType) throws TransactionException {\r
-               BlobOutput result = null;\r
-               \r
-               boolean repoSessionCleanup = false;\r
-               RepositoryInstanceInterface repoSession = (RepositoryInstanceInterface)ctx.getCurrentRepositorySession();\r
-               if (repoSession == null) {\r
-                       repoSession = getRepositorySession(ctx, repositoryClient);\r
-                       repoSessionCleanup = true;\r
-               }\r
-               \r
-               try {\r
-                       result = getBlobOutput(ctx, repoSession, repositoryId, null, true, outMimeType);\r
-                       if (outMimeType.length() == 0) {\r
-                               BlobsCommon blobsCommon = result.getBlobsCommon();\r
-                               String mimeType = blobsCommon.getMimeType();\r
-                               outMimeType.append(mimeType);\r
-                       }                       \r
-               } finally {\r
-                       if (repoSessionCleanup == true) {\r
-                               releaseRepositorySession(ctx, repositoryClient, repoSession);\r
-                       }\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       //\r
-       //  If the blob is not too big, we return a ByteArrayInputStream.  Otherwise, we return Nuxeo's InputStream\r
-       //  which is usually a FileInputStream.\r
-       //\r
-       static private InputStream getInputStream(BlobsCommon blobsCommon, Blob blob) {\r
-               InputStream result = null;\r
-               \r
-               try {\r
-                       InputStream blobStream = blob.getStream(); // By default, the result will be whatever stream Nuxeo returns to us.\r
-                       int blobSize = blobsCommon.getLength() != null ? Integer.parseInt(blobsCommon.getLength()) : 0;\r
-                       if (blobSize > 0 && blobSize < MAX_IMAGE_BUFFER) {\r
-                               byte[] bytes = IOUtils.toByteArray(blobStream);\r
-                               blobStream.close(); // Close the InputStream that we got from Nuxeo since it's usually a FileInputStream -we definitely want FileInputStreams closed.\r
-                               result = new ByteArrayInputStream(bytes);\r
-                       } else {\r
-                               result = blobStream; // The blob is too large to put into a ByteArrayStream.\r
-                       }\r
-               } catch (Exception e) {\r
-                       logger.error(String.format("Error getting the InputStream content for file %s.", blobsCommon.getName()), e);\r
-                       if (result != null) {\r
-                               try {\r
-                                       result.close();\r
-                                       result = null;\r
-                               } catch (Exception x) {\r
-                                       logger.debug(String.format("Exception encountered during InputStream cleanup of file %s", blobsCommon.getName()), x);\r
-                               }\r
-                       }                       \r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       /**\r
-        * Gets the image.\r
-        * \r
-        * @param repoSession\r
-        *            the repo session\r
-        * @param repositoryId\r
-        *            the repository id\r
-        * @param derivativeTerm\r
-        *            the derivative term\r
-        * @return the image\r
-        */\r
-       static public BlobOutput getBlobOutput(ServiceContext ctx,\r
-                       RepositoryInstanceInterface repoSession,\r
-                       String repositoryId,\r
-                       String derivativeTerm,\r
-                       Boolean getContentFlag,\r
-                       StringBuffer outMimeType) {\r
-               BlobOutput result = new BlobOutput();\r
-               boolean isNonImageDerivative = false;\r
-\r
-               if (repositoryId != null && repositoryId.isEmpty() == false)\r
-                       try {\r
-                               IdRef documentRef = new IdRef(repositoryId);\r
-                               DocumentModel documentModel = repoSession.getDocument(documentRef);\r
-\r
-                               Blob docBlob = null;\r
-                               DocumentBlobHolder docBlobHolder = (DocumentBlobHolder) documentModel\r
-                                               .getAdapter(BlobHolder.class);\r
-                               if (docBlobHolder instanceof PictureBlobHolder) {\r
-                                       // if it is a PictureDocument then it has these\r
-                                       // Nuxeo schemas: [dublincore, uid, picture, iptc, common, image_metadata]\r
-                                       //\r
-                                       // Need to add the "MultiviewPictureAdapter" support here to\r
-                                       // get the view data, see above.\r
-                                       //\r
-                                       PictureBlobHolder pictureBlobHolder = (PictureBlobHolder) docBlobHolder;\r
-                                       if (derivativeTerm != null) {\r
-                                               docBlob = pictureBlobHolder.getBlob(derivativeTerm);\r
-                                               // Nuxeo derivatives are all JPEG\r
-                                               outMimeType.append(MIME_JPEG); // All Nuxeo image derivatives are JPEG images.\r
-                                       } else {\r
-                                               docBlob = pictureBlobHolder.getBlob();\r
-                                       }\r
-                               } else {\r
-                                       docBlob = docBlobHolder.getBlob();\r
-                                       if (derivativeTerm != null) { // If its a derivative request on a non-image blob, then return just a document image thumnail\r
-                                               isNonImageDerivative = true;\r
-                                       }\r
-                               }\r
-\r
-                               //\r
-                               // Create the result instance that will contain the blob metadata\r
-                               // and an InputStream with the bits if the 'getContentFlag' is\r
-                               // set.\r
-                               //\r
-                               BlobsCommon blobsCommon = createBlobsCommon(documentModel, docBlob, getContentFlag);\r
-                               result.setBlobsCommon(blobsCommon);\r
-                               if (getContentFlag == true) {\r
-                                       InputStream remoteStream = null;\r
-                                       if (isNonImageDerivative == false) {\r
-                                               //remoteStream = docBlob.getStream();\r
-                                               remoteStream = getInputStream(blobsCommon, docBlob); // CSPACE-6110 - For small files, return a byte array instead of a file stream\r
-                                       } else {\r
-                                               remoteStream = getResource(DOCUMENT_PLACEHOLDER_IMAGE);\r
-                                               outMimeType.append(MIME_JPEG);\r
-                                       }\r
-//                                     BufferedInputStream bufferedInputStream = new BufferedInputStream(\r
-//                                                     remoteStream);  \r
-//                                     result.setBlobInputStream(bufferedInputStream);\r
-                                       result.setBlobInputStream(remoteStream);\r
-                               }\r
-                       } catch (Exception e) {\r
-                               if (logger.isErrorEnabled() == true) {\r
-                                       logger.error(e.getMessage(), e);\r
-                               }\r
-                               result = null;\r
-                       }\r
-\r
-               return result;\r
-       }\r
-       \r
-}\r
-\r
-/*\r
- * Notes and code snippets about Nuxeo's support for binaries and image\r
- * documents.\r
- */\r
-\r
-/*\r
- * \r
- * \r
- * MultiviewPictureAdapter org.nuxeo.ecm.platform.picture.api.adapters\r
- * PictureResourceAdapter pictureResourceAdapter = (PictureResourceAdapter)\r
- * documentModel.getAdapter(PictureResourceAdapter.class); String thumbnailPath\r
- * = pictureResourceAdapter.getViewXPath("Thumbnail");\r
- * \r
- * Map<String,Serializable> blobHolderProps = docBlobHolder.getProperties();\r
- * String filePath = docBlobHolder.getFilePath(); List<Blob> docBlobs =\r
- * docBlobHolder.getBlobs();\r
- * \r
- * stream = new FileInputStream(fileUploadHolder.getTempFile());\r
- * \r
- * public String addFile(InputStream fileUpload, String fileName) fileName =\r
- * FileUtils.getCleanFileName(fileName); DocumentModel currentDocument =\r
- * navigationContext.getCurrentDocument(); String path =\r
- * currentDocument.getPathAsString(); Blob blob =\r
- * FileUtils.createSerializableBlob(fileUpload, fileName, null);\r
- * \r
- * DocumentModel createdDoc = getFileManagerService().createDocumentFromBlob(\r
- * documentManager, blob, path, true, fileName);\r
- * eventManager.raiseEventsOnDocumentSelected(createdDoc);\r
- * \r
- * protected FileManager fileManager;\r
- * \r
- * protected FileManager getFileManagerService() throws ClientException { if\r
- * (fileManager == null) { try { fileManager =\r
- * Framework.getService(FileManager.class); } catch (Exception e) {\r
- * log.error("Unable to get FileManager service ", e); throw new\r
- * ClientException("Unable to get FileManager service ", e); } } return\r
- * fileManager; }\r
- */\r
-\r
-/*\r
- * RepositoryService repositoryService = (RepositoryService)\r
- * Framework.getRuntime().getComponent( RepositoryService.NAME);\r
- * RepositoryManager repositoryManager =\r
- * repositoryService.getRepositoryManager(); RepositoryDescriptor descriptor =\r
- * repositoryManager.getDescriptor(repositoryName); DefaultBinaryManager\r
- * binaryManager = new DefaultBinaryManager(\r
- * SQLRepository.getDescriptor(descriptor)));\r
- * \r
- * File storageDir = binaryManager.getStorageDir(); SQLBlob blob = (SQLBlob)\r
- * doc.getPropertyValue("schema:blobField"); File file =\r
- * binaryManager.getFileForDigest( blob.getBinary().getDigest(), false);\r
- */\r
-\r
-/*\r
- * RepositoryInstance.getStreamURI()\r
- * \r
- * String getStreamURI(String blobPropertyId) throws ClientException\r
- * \r
- * Returns an URI identifying the stream given the blob property id. This method\r
- * should be used by a client to download the data of a blob property.\r
- * \r
- * The blob is fetched from the repository and the blob stream is registered\r
- * against the streaming service so the stream will be available remotely\r
- * through stream service API.\r
- * \r
- * After the client has called this method, it will be able to download the\r
- * stream using streaming server API.\r
- * \r
- * Returns: an URI identifying the remote stream Throws: ClientException\r
- */\r
-\r
-/*\r
- * A blob contains usually large data.\r
- * \r
- * Document fields holding Blob data are by default fetched in a lazy manner.\r
- * \r
- * A Blob object hides the data source and it also describes data properties\r
- * like the encoding or mime-type.\r
- * \r
- * The encoding is used to decode Unicode text content that was stored in an\r
- * encoded form. If not encoding is specified, the default java encoding is\r
- * used. The encoding is ignored for binary content.\r
- * \r
- * When retrieving the content from a document, it will be returned as source\r
- * content instead of returning the content bytes.\r
- * \r
- * The same is true when setting the content for a document: you set a content\r
- * source and not directly the content bytes. Ex:\r
- * \r
- * File file = new File("/tmp/index.html"); FileBlob fb = new FileBlob(file);\r
- * fb.setMimeType("text/html"); fb.setEncoding("UTF-8"); // this specifies that\r
- * content bytes will be stored as UTF-8 document.setProperty("file", "content",\r
- * fb);\r
- * \r
- * \r
- * Then you may want to retrieve the content as follow:\r
- * \r
- * Blob blob = document.getProperty("file:content"); htmlDoc = blob.getString();\r
- * // the content is decoded from UTF-8 into a java string\r
- */\r
+/**    
+ * NuxeoImageUtils.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}.
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.imaging.nuxeo;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.nuxeo.runtime.api.Framework;
+//import org.nuxeo.runtime.api.ServiceManager;
+//import org.nuxeo.runtime.api.ServiceDescriptor;
+
+//import org.nuxeo.common.utils.FileUtils;
+
+import org.nuxeo.ecm.platform.picture.api.ImageInfo;
+import org.nuxeo.ecm.platform.picture.api.ImagingDocumentConstants;
+import org.nuxeo.ecm.platform.picture.api.ImagingService;
+import org.nuxeo.ecm.platform.picture.api.PictureView;
+import org.nuxeo.ecm.platform.mimetype.MimetypeDetectionException;
+import org.nuxeo.ecm.platform.mimetype.interfaces.MimetypeRegistry;
+import org.nuxeo.ecm.platform.picture.api.adapters.PictureBlobHolder;
+import org.nuxeo.ecm.platform.filemanager.api.FileManager;
+import org.nuxeo.ecm.platform.filemanager.service.FileManagerService;
+import org.nuxeo.ecm.platform.filemanager.service.extension.FileImporter;
+import org.nuxeo.ecm.platform.filemanager.utils.FileManagerUtils;
+import org.nuxeo.ecm.platform.types.TypeManager;
+import org.nuxeo.ecm.core.repository.RepositoryDescriptor;
+import org.nuxeo.ecm.core.repository.RepositoryManager;
+import org.nuxeo.ecm.core.repository.RepositoryService;
+import org.nuxeo.ecm.core.storage.sql.BinaryManager;
+import org.nuxeo.ecm.core.storage.sql.DefaultBinaryManager;
+
+/*
+ * Keep these commented out import statements as reminders of Nuxeo's blob management
+import org.nuxeo.runtime.model.ComponentManager;
+import org.nuxeo.runtime.model.impl.ComponentManagerImpl;
+import org.nuxeo.ecm.core.api.ejb.DocumentManagerBean;
+import org.nuxeo.ecm.core.storage.sql.RepositoryImpl;
+import org.nuxeo.ecm.core.storage.sql.Repository;
+import org.nuxeo.ecm.core.storage.sql.Binary;
+import org.nuxeo.ecm.core.storage.sql.RepositoryImpl;
+import org.nuxeo.ecm.core.storage.sql.RepositoryResolver;
+import org.nuxeo.ecm.core.storage.sql.coremodel.SQLBlob;
+import org.nuxeo.ecm.core.storage.sql.coremodel.SQLRepository;
+import org.nuxeo.ecm.core.storage.sql.RepositoryDescriptor;
+import org.nuxeo.ecm.core.api.DocumentResolver;
+*/
+
+import org.nuxeo.ecm.core.api.IdRef;
+import org.nuxeo.ecm.core.api.blobholder.BlobHolder;
+import org.nuxeo.ecm.core.api.blobholder.DocumentBlobHolder;
+import org.nuxeo.ecm.core.api.impl.blob.FileBlob;
+import org.nuxeo.ecm.core.api.impl.blob.InputStreamBlob;
+import org.nuxeo.ecm.core.api.impl.blob.StreamingBlob;
+import org.nuxeo.ecm.core.api.impl.blob.ByteArrayBlob;
+import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
+import org.nuxeo.ecm.core.api.repository.Repository;
+import org.nuxeo.ecm.core.api.Blob;
+import org.nuxeo.ecm.core.api.ClientException;
+import org.nuxeo.ecm.core.api.DocumentModel;
+import org.nuxeo.ecm.core.api.DocumentRef;
+import org.nuxeo.ecm.core.event.EventServiceAdmin;
+import org.nuxeo.ecm.core.schema.SchemaManager;
+import org.nuxeo.ecm.core.schema.types.Schema;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+//import org.nuxeo.ecm.core.repository.jcr.testing.RepositoryOSGITestCase;
+
+import org.apache.commons.io.IOUtils;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.FileUtils;
+import org.collectionspace.services.common.ServiceMain;
+import org.collectionspace.services.common.blob.BlobInput;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.TransactionException;
+import org.collectionspace.services.common.repository.RepositoryClient;
+import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
+import org.collectionspace.services.common.blob.BlobOutput;
+import org.collectionspace.services.blob.BlobsCommon;
+import org.collectionspace.services.blob.DimensionSubGroup;
+import org.collectionspace.services.blob.DimensionSubGroupList;
+import org.collectionspace.services.blob.MeasuredPartGroup;
+import org.collectionspace.services.blob.MeasuredPartGroupList;
+import org.collectionspace.services.jaxb.BlobJAXBSchema;
+import org.collectionspace.services.nuxeo.client.java.CommonList;
+import org.collectionspace.services.nuxeo.client.java.RepositoryInstanceInterface;
+import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;
+import org.collectionspace.services.nuxeo.extension.thumbnail.ThumbnailConstants;
+import org.collectionspace.services.nuxeo.util.NuxeoUtils;
+import org.collectionspace.services.config.service.ListResultField;
+
+
+/**
+ * The Class NuxeoBlobUtils.
+ */
+public class NuxeoBlobUtils {
+               
+       /** The Constant logger. */
+       private static final Logger logger = LoggerFactory
+                       .getLogger(NuxeoBlobUtils.class);
+
+       //
+       // A maximum byte size for the byte array used to hold an image.  Images larger than this will
+       // be returned as FileInputStreams rather than ByteArrayInputStreams
+       //
+       private static final int MAX_IMAGE_BUFFER = 256 * 1024; // REM: 11/26/2013 - This should be set in a config/property file.
+       
+       //
+       // File name constants
+       //
+    private static final String NUXEO_FILENAME_BAD_CHARS = "[^a-zA-Z_0-9-.%:/\\ ]";
+    private static final String NUXEO_FILENAME_VALID_STRING = "[a-zA-Z_0-9-.%:/\\ ]+";
+
+       public static final String DOCUMENT_PLACEHOLDER_IMAGE = "documentImage.jpg";
+       public static final String DOCUMENT_MISSING_PLACEHOLDER_IMAGE = "documentImageMissing.jpg";
+       public static final String MIME_JPEG = "image/jpeg";
+       /*
+        * FIXME: REM - These constants should be coming from configuration and NOT
+        * hard coded.
+        */
+       public static final String DERIVATIVE_ORIGINAL = "Original";
+       public static final String DERIVATIVE_ORIGINAL_TAG = DERIVATIVE_ORIGINAL
+                       + "_";
+
+       public static final String DERIVATIVE_ORIGINAL_JPEG = "OriginalJpeg";
+       public static final String DERIVATIVE_ORIGINAL_JPEG_TAG = DERIVATIVE_ORIGINAL_JPEG
+                       + "_";
+
+       public static final String DERIVATIVE_MEDIUM = "Medium";
+       public static final String DERIVATIVE_MEDIUM_TAG = DERIVATIVE_MEDIUM + "_";
+
+       public static final String DERIVATIVE_THUMBNAIL = "Thumbnail";
+       public static final String DERIVATIVE_THUMBNAIL_TAG = DERIVATIVE_THUMBNAIL
+                       + "_";
+
+       public static final String DERIVATIVE_UNKNOWN = "_UNKNOWN_DERIVATIVE_NAME_";
+
+       //
+       // Image Dimension fields
+       //
+       public static final String PART_IMAGE = "digitalImage";
+       public static final String PART_SUMMARY = "The dimensions of a digital image -width, height, and pixel depth.";
+       public static final String WIDTH = "width";
+       public static final String HEIGHT = "height";
+       public static final String DEPTH = "depth";
+       public static final String UNIT_PIXELS = "pixels";
+       public static final String UNIT_BITS = "bits";
+       //
+       // Image Metadata schemas - These are Nuxeo defined schemas
+       //
+       public static final String SCHEMA_IPTC = "iptc";
+       public static final String SCHEMA_IMAGE_METADATA = "image_metadata";
+
+       private static final int THUMB_SIZE_HEIGHT = 100;
+       private static final int THUMB_SIZE_WIDTH = 75;
+
+       // static DefaultBinaryManager binaryManager = new DefaultBinaryManager();
+       // //can we get this from Nuxeo? i.e.,
+       // Framework.getService(BinaryManger.class)
+
+       // /** The temp file name. */
+       // static String tempFileName = "sunset.jpg";
+       //
+       // /** The file separator. */
+       // static String fileSeparator = System.getProperty("file.separator");
+       //
+       // /** The cur dir. */
+       // static String curDir = System.getProperty("user.dir");
+
+       /**
+        * Instantiates a new nuxeo image utils.
+        */
+       NuxeoBlobUtils() {
+               // empty constructor
+       }
+
+       /*
+        * Use this for debugging Nuxeo's PictureView class
+        */
+       private static String toStringPictureView(PictureView pictureView) {
+               StringBuffer strBuffer = new StringBuffer();
+               strBuffer.append("Description: " + pictureView.getDescription() + '\n');
+               strBuffer.append("FileName: " + pictureView.getFilename() + '\n');
+               strBuffer.append("Height: " + pictureView.getHeight() + '\n');
+               strBuffer.append("Width: " + pictureView.getWidth() + '\n');
+               strBuffer.append("Tag: " + pictureView.getTag() + '\n');
+               strBuffer.append("Title: " + pictureView.getTitle() + '\n');
+               return strBuffer.toString();
+       }
+
+       // FIXME: REM - This needs to be configuration-bases and NOT hard coded!
+       // FIXME: REM - Use MultiviewPicture adapter to get some of this information
+       static private String getDerivativeUri(String uri, String derivativeName) {
+               String result = DERIVATIVE_UNKNOWN;
+
+               if (derivativeName.startsWith(DERIVATIVE_ORIGINAL_TAG) == true) {
+                       result = DERIVATIVE_ORIGINAL;
+               } else if (derivativeName.startsWith(DERIVATIVE_ORIGINAL_JPEG_TAG) == true) {
+                       result = DERIVATIVE_ORIGINAL_JPEG;
+               } else if (derivativeName.startsWith(DERIVATIVE_MEDIUM_TAG) == true) {
+                       result = DERIVATIVE_MEDIUM;
+               } else if (derivativeName.startsWith(DERIVATIVE_THUMBNAIL_TAG) == true) {
+                       result = DERIVATIVE_THUMBNAIL;
+               }
+
+               return uri + result + "/" + BlobInput.URI_CONTENT_PATH;
+       }
+
+       static private HashMap<String, Object> createBlobListItem(Blob blob,
+                       String uri) {
+               HashMap<String, Object> item = new HashMap<String, Object>();
+
+               String value = blob.getEncoding();
+               if (value != null && !value.trim().isEmpty()) {
+                       item.put(BlobJAXBSchema.encoding, value);
+               }
+               value = Long.toString(blob.getLength());
+               if (value != null && !value.trim().isEmpty()) {
+                       item.put(BlobJAXBSchema.length, value);
+               }
+               value = blob.getMimeType();
+               if (value != null && !value.trim().isEmpty()) {
+                       item.put(BlobJAXBSchema.mimeType, value);
+               }
+               value = blob.getFilename();
+               if (value != null && !value.trim().isEmpty()) {
+                       item.put(BlobJAXBSchema.name, value);
+               }
+               value = getDerivativeUri(uri, blob.getFilename());
+               if (value != null && !value.trim().isEmpty()) {
+                       item.put(BlobJAXBSchema.uri, value);
+               }
+
+               return item;
+       }
+       
+       static public String getSanizitedFilename(File srcFile) throws Exception {
+               return getSanizitedFilename(srcFile.getName());
+       }
+       
+       /*
+        * Valid Nuxeo file names are a subset of *nix and Windows filenames, so we need to check.
+        */
+       static public String getSanizitedFilename(String fileName) throws Exception {
+               String result = fileName;
+               
+               if (fileName != null && fileName.matches(NUXEO_FILENAME_VALID_STRING) == false) {
+                       String fixedString = fileName.replaceAll(NUXEO_FILENAME_BAD_CHARS, "_");  // Replace "bad" chars with underscore character
+                       if (fixedString.matches(NUXEO_FILENAME_VALID_STRING) == true) {
+                               result = fixedString;
+                       } else {
+                               String errMsg = String.format("\tSorry, the sanizited string '%s' is still bad.", fixedString);
+                               throw new Exception(errMsg);
+                       }
+               }
+               
+               if (result != null && logger.isDebugEnabled() == true) {
+                       if (result.equals(fileName) == false) {
+                               logger.debug(String.format("The file name '%s' was sanizitized to '%s'.", fileName, result));
+                       }
+               }
+
+               return result;
+       }
+
+       static public CommonList getBlobDerivatives(RepositoryInstanceInterface repoSession,
+                       String repositoryId, List<ListResultField> resultsFields, String uri)
+                       throws Exception {
+               CommonList commonList = new CommonList();
+               int nFields = resultsFields.size() + 2;
+               String fields[] = new String[nFields];// FIXME: REM - Patrick needs to fix this hack.  It is a "common list" issue
+               fields[0] = "csid";
+               fields[1] = "uri";
+               for (int i = 2; i < nFields; i++) {
+                       ListResultField field = resultsFields.get(i - 2);
+                       fields[i] = field.getElement();
+               }
+               commonList.setFieldsReturned(fields);
+
+               IdRef documentRef = new IdRef(repositoryId);
+               DocumentModel documentModel = repoSession.getDocument(documentRef);
+               DocumentBlobHolder docBlobHolder = (DocumentBlobHolder) documentModel
+                               .getAdapter(BlobHolder.class);
+               List<Blob> docBlobs = docBlobHolder.getBlobs();
+               // List<BlobListItem> blobListItems = result.getBlobListItem();
+               HashMap<String, Object> item = null;
+               for (Blob blob : docBlobs) {
+                       if (blob != null) {
+                               item = createBlobListItem(blob, uri);
+                               commonList.addItem(item);
+                       }
+               }
+
+               return commonList;
+       }
+
+       /*
+        * [dublincore, uid, picture, iptc, common, image_metadata]
+        */
+       static private Map<String, Object> getMetadata(Blob nuxeoBlob)
+                       throws Exception {
+               ImagingService service = Framework.getService(ImagingService.class);
+               Map<String, Object> metadataMap = service.getImageMetadata(nuxeoBlob);
+               return metadataMap;
+       }
+
+       private static String[] imageTypes = {"jpeg", "bmp", "gif", "png", "tiff", "octet-stream"};
+       static private boolean isImageMedia(Blob nuxeoBlob) {
+               boolean result = false;
+               
+               String mimeType = nuxeoBlob.getMimeType();
+               if (mimeType != null) {
+                       mimeType = mimeType.toLowerCase().trim();
+                       String[] parts = mimeType.split("/"); // split strings like "application/xml" into an array of two strings
+                       if (parts.length == 2) {
+                               for (String type : imageTypes) {
+                                       if (parts[1].equalsIgnoreCase(type)) {
+                                               result = true;
+                                               break;
+                                       }
+                               }
+                       }
+               }
+               
+               return result;
+       }
+       
+       static private MeasuredPartGroupList getDimensions(
+                       DocumentModel documentModel, Blob nuxeoBlob) {
+               MeasuredPartGroupList result = null;
+               
+               if (isImageMedia(nuxeoBlob) == true) try {
+                       ImagingService service = Framework.getService(ImagingService.class);
+                       ImageInfo imageInfo = service.getImageInfo(nuxeoBlob);
+                       Map<String, Object> metadataMap = getMetadata(nuxeoBlob);
+
+                       if (imageInfo != null) {
+                               //
+                               // Create a timestamp to add to all the image's dimensions
+                               //
+                               String valueDate = GregorianCalendarDateTimeUtils
+                                               .timestampUTC();
+                               
+                               result = new MeasuredPartGroupList();
+                               List<MeasuredPartGroup> measuredPartGroupList = 
+                                               (result).getMeasuredPartGroup();
+                               //
+                               // Create a new measured part for the "image"
+                               //
+                               MeasuredPartGroup mpGroup = new MeasuredPartGroup();
+                               mpGroup.setMeasuredPart(PART_IMAGE);
+                               mpGroup.setDimensionSummary(PART_SUMMARY);
+                               mpGroup.setDimensionSubGroupList(new DimensionSubGroupList());
+                               List<DimensionSubGroup> dimensionSubGroupList = mpGroup.getDimensionSubGroupList()
+                                               .getDimensionSubGroup();
+
+                               //
+                               // Set the width
+                               //
+                               DimensionSubGroup widthDimension = new DimensionSubGroup();
+                               widthDimension.setDimension(WIDTH);
+                               widthDimension.setMeasurementUnit(UNIT_PIXELS);
+                               widthDimension.setValue(intToBigDecimal(imageInfo.getWidth()));
+                               widthDimension.setValueDate(valueDate);
+                               dimensionSubGroupList.add(widthDimension);
+                               //
+                               // Set the height
+                               //
+                               DimensionSubGroup heightDimension = new DimensionSubGroup();
+                               heightDimension.setDimension(HEIGHT);
+                               heightDimension.setMeasurementUnit(UNIT_PIXELS);
+                               heightDimension
+                                               .setValue(intToBigDecimal(imageInfo.getHeight()));
+                               heightDimension.setValueDate(valueDate);
+                               dimensionSubGroupList.add(heightDimension);
+                               //
+                               // Set the depth
+                               //
+                               DimensionSubGroup depthDimension = new DimensionSubGroup();
+                               depthDimension.setDimension(DEPTH);
+                               depthDimension.setMeasurementUnit(UNIT_BITS);
+                               depthDimension.setValue(intToBigDecimal(imageInfo.getDepth()));
+                               depthDimension.setValueDate(valueDate);
+                               dimensionSubGroupList.add(depthDimension);
+                               //
+                               // Now set out result
+                               //
+                               measuredPartGroupList.add(mpGroup);
+                       } else {
+                               if (logger.isWarnEnabled() == true) {
+                                       logger.warn("Could not synthesize a dimension list of the blob: "
+                                                       + documentModel.getName());
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.warn("Could not extract image information for blob: "
+                                       + documentModel.getName(), e);
+               }
+
+               return result;
+       }
+
+       // FIXME: Add error checking here, as none of these calls return an
+       // Exception
+       static private BigDecimal intToBigDecimal(int i) {
+               BigInteger bigint = BigInteger.valueOf(i);
+               BigDecimal bigdec = new BigDecimal(bigint);
+               return bigdec;
+       }
+
+       static private BlobsCommon createBlobsCommon(DocumentModel documentModel,
+                       Blob nuxeoBlob) {
+               return createBlobsCommon(documentModel, nuxeoBlob, false);
+       }
+       
+       static private BlobsCommon createBlobsCommon(DocumentModel documentModel,
+                       Blob nuxeoBlob, Boolean getContentFlag) {
+               BlobsCommon result = new BlobsCommon();
+
+               if (documentModel != null) {
+                       result.setMimeType(nuxeoBlob.getMimeType());
+                       result.setName(nuxeoBlob.getFilename());
+                       result.setLength(Long.toString(nuxeoBlob.getLength()));
+                       result.setRepositoryId(documentModel.getId());
+                       
+                       //
+                       // If getContentFlag is true then we're being asked for the blob's content, so we don't
+                       // need the measurement info.  Getting the measurement info requires a call to Nuxeo which in turn
+                       // calls ImageMagick.
+                       //
+                       if (getContentFlag.booleanValue() == false) {
+                               MeasuredPartGroupList measuredPartGroupList = getDimensions(
+                                               documentModel, nuxeoBlob);
+                               if (measuredPartGroupList != null) {
+                                       result.setMeasuredPartGroupList(measuredPartGroupList);
+                               }
+                       }
+                       
+                       // Check to see if a thumbnail preview was created by Nuxeo
+            if (documentModel.hasFacet(ThumbnailConstants.THUMBNAIL_FACET)) {
+                       String errorMsg = null;
+               String thumbnailName = null;
+                               try {
+                                       thumbnailName = (String)documentModel.getProperty(ThumbnailConstants.THUMBNAIL_SCHEMA_NAME,
+                                               ThumbnailConstants.THUMBNAIL_FILENAME_PROPERTY_NAME);
+                                       Blob thumbnailBlob = (Blob)documentModel.getProperty(ThumbnailConstants.THUMBNAIL_SCHEMA_NAME,
+                                               ThumbnailConstants.THUMBNAIL_PROPERTY_NAME);
+                               } catch (ClientException e) {
+                                       errorMsg = "Could not extract the name of the thumbnail preview image file.";
+                                       if (logger.isTraceEnabled()) {
+                                               logger.trace(errorMsg, e);
+                                       }
+                               }
+                               
+                               if (errorMsg == null) {
+                                       logger.info("A thumbnail preview was created for this document blob: " + thumbnailName);
+                               } else {
+                                       logger.warn(errorMsg);
+                               }
+            }
+               }
+
+               return result;
+       }
+
+       /*
+        * This is a prototype method that is not currently used as of 1/1/2012.  However,
+        * it may be useful now that we've transitioned to using an embedded Nuxeo server.
+        */
+       static private File getBlobFile(RepositoryInstanceInterface ri,
+                       DocumentModel documentModel, Blob blob) {
+               DefaultBinaryManager binaryManager = null;
+               RepositoryDescriptor descriptor = null;
+               File file = null;
+
+               try {
+                       RepositoryService repositoryService1 = (RepositoryService) Framework
+                                       .getRuntime().getComponent(RepositoryService.NAME);
+
+                       String repositoryName = documentModel.getRepositoryName();
+                       RepositoryManager repositoryManager = repositoryService1
+                                       .getRepositoryManager();
+                       descriptor = repositoryManager.getDescriptor(repositoryName);
+
+// Keep this code around for future work/enhancements                  
+//                     binaryManager = new DefaultBinaryManager();
+//
+//                     File storageDir = binaryManager.getStorageDir();
+//                     // SQLBlob blob = (SQLBlob)
+//                     // doc.getPropertyValue("schema:blobField");
+//                     File file = binaryManager.getFileForDigest(blob.getDigest(), false);
+
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+
+// Keep this code around for future work/enhancements
+//             try {
+//                     binaryManager.initialize(SQLRepository.getDescriptor(descriptor));
+//             } catch (IOException e) {
+//                     // TODO Auto-generated catch block
+//                     e.printStackTrace();
+//             } catch (Exception e) {
+//                     // TODO Auto-generated catch block
+//                     e.printStackTrace();
+//             }
+
+// Keep this code around for future work/enhancements
+//             File storageDir = binaryManager.getStorageDir();
+//             SQLBlob blob = (SQLBlob)
+//             documentModel.getPropertyValue("schema:blobField");
+//             File file = binaryManager.getFileForDigest(blob.getDigest(), false);
+
+               return file;
+       }
+
+       /**
+        * Returns a schema, given the name of a schema.  Possibly usefule in the future
+        * 
+        * @param schemaName
+        *            a schema name.
+        * @return a schema.
+        */
+       private static Schema getSchemaFromName(String schemaName) {
+               SchemaManager schemaManager = null;
+               try {
+                       schemaManager = Framework.getService(SchemaManager.class);
+               } catch (Exception e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+               return schemaManager != null ? schemaManager.getSchema(schemaName)
+                               : null;
+       }
+
+       /**
+        * Gets the blob.  Not in use now, but might be useful in the future.
+        * 
+        * @param nuxeoSession
+        *            the nuxeo session
+        * @param id
+        *            the id
+        * @return the blob
+        */
+       static private Blob getBlob(RepositoryInstanceInterface repoSession, String id) {
+               Blob result = null;
+
+               try {
+                       Repository repository = repoSession.getRepositoryInstance().getRepository();
+                       // binaryManager.initialize(new RepositoryDescriptor());
+                       // binaryManager.getBinary("a4cac052ae0281979f2dcf5ab2e61a6c");
+                       // DocumentResolver.resolveReference(nuxeoSession, documentRef);
+                       // binaryManager = repository.getBinaryManager();
+                       // documentModel.getr
+               } catch (Exception x) {
+                       x.printStackTrace();
+               }
+
+               return result;
+       }
+
+    static private Blob checkMimeType(Blob blob, String fullname)
+            throws ClientException {
+        final String mimeType = blob.getMimeType();
+        if (mimeType != null && !mimeType.equals("application/octet-stream")
+                && !mimeType.equals("application/octetstream")) {
+            return blob;
+        }
+        String filename = FileManagerUtils.fetchFileName(fullname);
+        try {
+            blob = getMimeService().updateMimetype(blob, filename);
+        } catch (MimetypeDetectionException e) {
+            throw new ClientException(e);
+        }
+        return blob;
+    }
+       
+       /**
+        * Gets the type service.  Not in use, but please keep for future reference
+        * 
+        * @return the type service
+        * @throws ClientException
+        *             the client exception
+        */
+       private static TypeManager getTypeService() throws ClientException {
+               TypeManager typeService = null;
+               
+               try {
+                       typeService = Framework.getService(TypeManager.class);
+               } catch (Exception e) {
+                       throw new ClientException(e);
+               }
+               
+               return typeService;
+       }
+
+       /**
+        * Gets the bytes.
+        * 
+        * @param fis
+        *            the fis
+        * @return the bytes
+        */
+       private static byte[] getBytes(InputStream fis) {
+               ByteArrayOutputStream bos = new ByteArrayOutputStream();
+               byte[] buf = new byte[128 * 1024];
+               try {
+                       for (int readNum; (readNum = fis.read(buf)) != -1;) {
+                               bos.write(buf, 0, readNum);
+                               // no doubt here is 0
+                               /*
+                                * Writes len bytes from the specified byte array starting at
+                                * offset off to this byte array output stream.
+                                */
+                               System.out.println("read " + readNum + " bytes,");
+                       }
+               } catch (IOException ex) {
+                       logger.error(ex.getMessage(), ex);
+               }
+               byte[] bytes = bos.toByteArray();
+               // bytes is the ByteArray we need
+               return bytes;
+       }
+
+       /**
+        * Creates the serializable blob.  We may need this code, do not remove.
+        * 
+        * @param fileInputStream
+        *            the file input stream
+        * @param filename
+        *            the filename
+        * @param mimeType
+        *            the mime type
+        * @return the blob
+        */
+       private static Blob createSerializableBlob(InputStream fileInputStream,
+                       String filename, String mimeType) {
+               Blob blob = null;
+               try {
+                       // persisting the blob makes it possible to read the binary content
+                       // of the request stream several times (mimetype sniffing, digest
+                       // computation, core binary storage)
+                       byte[] bytes = getBytes(fileInputStream);
+                       blob = new ByteArrayBlob(bytes);
+                       // filename
+                       if (filename != null) {
+                               filename = getCleanFileName(filename);
+                       }
+                       blob.setFilename(filename);
+                       // mimetype detection
+                       MimetypeRegistry mimeService = Framework
+                                       .getService(MimetypeRegistry.class);
+                       String detectedMimeType = mimeService
+                                       .getMimetypeFromFilenameAndBlobWithDefault(filename, blob,
+                                                       null);
+                       if (detectedMimeType == null) {
+                               if (mimeType != null) {
+                                       detectedMimeType = mimeType;
+                               } else {
+                                       // default
+                                       detectedMimeType = "application/octet-stream";
+                               }
+                       }
+                       blob.setMimeType(detectedMimeType);
+               } catch (MimetypeDetectionException e) {
+                       logger.error(String.format("could not fetch mimetype for file %s",
+                                       filename), e);
+               } catch (Exception e) {
+                       logger.error("", e);
+               }
+               return blob;
+       }
+
+       /**
+        * Creates a serializable blob from a stream, with filename and mimetype
+        * detection.
+        * 
+        * <p>
+        * Creates an in-memory blob if data is under 64K, otherwise constructs a
+        * serializable FileBlob which stores data in a temporary file on the hard
+        * disk.
+        * </p>
+        * 
+        * @param file
+        *            the input stream holding data
+        * @param filename
+        *            the file name. Will be set on the blob and will used for
+        *            mimetype detection.
+        * @param mimeType
+        *            the detected mimetype at upload. Can be null. Will be verified
+        *            by the mimetype service.
+        * @return the blob
+        */
+       private static Blob createStreamingBlob(File file, String filename,
+                       String mimeType) {
+               Blob blob = null;
+               try {
+                       // persisting the blob makes it possible to read the binary content
+                       // of the request stream several times (mimetype sniffing, digest
+                       // computation, core binary storage)
+                       blob = StreamingBlob.createFromFile(file, mimeType).persist();
+                       // filename
+                       if (filename != null) {
+                               filename = getCleanFileName(filename);
+                       }
+                       blob.setFilename(filename);
+                       // mimetype detection
+                       MimetypeRegistry mimeService = Framework
+                                       .getService(MimetypeRegistry.class);
+                       String detectedMimeType = mimeService
+                                       .getMimetypeFromFilenameAndBlobWithDefault(filename, blob,
+                                                       null);
+                       if (detectedMimeType == null) {
+                               if (mimeType != null) {
+                                       detectedMimeType = mimeType;
+                               } else {
+                                       // default
+                                       detectedMimeType = "application/octet-stream";
+                               }
+                       }
+                       blob.setMimeType(detectedMimeType);
+               } catch (MimetypeDetectionException e) {
+                       logger.error(String.format("could not fetch mimetype for file %s",
+                                       filename), e);
+               } catch (IOException e) {
+                       logger.error("", e);
+               } catch (Exception e) {
+                       logger.error("", e);
+               }
+               return blob;
+       }
+
+       private static Blob createNuxeoFileBasedBlob(File file) throws Exception {
+               return new FileBlob(file);
+       }
+
+       /**
+        * Returns a clean filename, stripping upload path on client side.
+        * <p>
+        * Fixes NXP-544
+        * </p>
+        * 
+        * @param filename
+        *            the filename
+        * @return the clean file name
+        */
+       private static String getCleanFileName(String filename) {
+               String res = null;
+               int lastWinSeparator = filename.lastIndexOf('\\');
+               int lastUnixSeparator = filename.lastIndexOf('/');
+               int lastSeparator = Math.max(lastWinSeparator, lastUnixSeparator);
+               if (lastSeparator != -1) {
+                       res = filename.substring(lastSeparator + 1, filename.length());
+               } else {
+                       res = filename;
+               }
+               return res;
+       }
+
+       /**
+        * Gets Nuxeo's file manager service.
+        * 
+        * @return the file manager service
+        * @throws ClientException
+        *             the client exception
+        */
+       private static FileManager getFileManager() throws ClientException {
+               FileManager result = null;
+               
+               try {
+                       result = Framework.getService(FileManager.class);
+               } catch (Exception e) {
+                       String msg = "Unable to get Nuxeo's FileManager service.";
+                       logger.error(msg, e);
+                       throw new ClientException("msg", e);
+               }
+               
+               return result;
+       }
+               
+       /**
+        * Gets Nuxeo's file manager service.
+        * 
+        * @return the file manager service
+        * @throws ClientException
+        *             the client exception
+        */
+       private static FileManagerService getFileManagerService() throws ClientException {
+               FileManagerService result = null;
+               
+               try {
+                       result = (FileManagerService)getFileManager();
+               } catch (Exception e) {
+                       String msg = "Unable to get Nuxeo's FileManager service.";
+                       logger.error(msg, e);
+                       throw new ClientException("msg", e);
+               }
+               
+               return result;
+       }       
+       
+       /**
+        * Gets Nuxeo's file manager service.
+        * 
+        * @return the file manager service
+        * @throws ClientException
+        *             the client exception
+        */
+       private static FileManager getFileManagerServicex() throws ClientException {
+               FileManager result = null;
+               try {
+                       result = Framework.getService(FileManager.class);
+               } catch (Exception e) {
+                       String msg = "Unable to get Nuxeo's FileManager service.";
+                       logger.error(msg, e);
+                       throw new ClientException("msg", e);
+               }
+               return result;
+       }
+       
+       private static EventServiceAdmin getEventServiceAdmin() throws ClientException {
+               EventServiceAdmin result = null;
+               try {
+                       result = Framework.getService(EventServiceAdmin.class);
+               } catch (Exception e) {
+                       String msg = "Unable to get Nuxeo's EventServiceAdmin service.";
+                       logger.error(msg, e);
+                       throw new ClientException("msg", e);
+               }
+               return result;
+       }       
+       
+       private static BinaryManager getBinaryManagerService() throws ClientException {
+               BinaryManager result = null;
+               try {
+                       result = Framework.getService(BinaryManager.class);
+               } catch (Exception e) {
+                       String msg = "Unable to get Nuxeo's BinaryManager service.";
+                       logger.error(msg, e);
+                       throw new ClientException("msg", e);
+               }
+               return result;
+       }
+       
+       static private RepositoryInstanceInterface getRepositorySession(ServiceContext ctx, RepositoryClient repositoryClient) {
+               RepositoryInstanceInterface result = null;              
+               RepositoryJavaClientImpl nuxeoClient = (RepositoryJavaClientImpl)repositoryClient;
+               
+               try {
+                       result = nuxeoClient.getRepositorySession(ctx);
+               } catch (Exception e) {
+            logger.error("Could not get a repository session to the Nuxeo repository", e);
+               }
+               
+               return result;
+       }
+       
+       static private void releaseRepositorySession(ServiceContext ctx, RepositoryClient repositoryClient, RepositoryInstanceInterface repoSession) throws TransactionException {
+               RepositoryJavaClientImpl nuxeoClient = (RepositoryJavaClientImpl)repositoryClient;
+               nuxeoClient.releaseRepositorySession(ctx, repoSession);
+       }
+       
+    static private MimetypeRegistry getMimeService() throws ClientException {
+       MimetypeRegistry result = null;
+       
+        try {
+               result = Framework.getService(MimetypeRegistry.class);
+        } catch (Exception e) {
+            throw new ClientException(e);
+        }
+               
+        return result;
+    }
+       
+       private static DocumentModel createDocumentFromBlob(
+                       RepositoryInstanceInterface repoSession,
+            Blob inputStreamBlob, 
+            String blobLocation, 
+            boolean overwrite, 
+            String blobName, 
+            boolean useNuxeoAdaptors) throws Exception {
+               DocumentModel result = null;
+               
+               if (useNuxeoAdaptors == true) {
+                       //
+                       // Use Nuxeo's high-level create method which looks for plugin adapters that match the MIME type.  For example,
+                       // for image blobs, Nuxeo's file manager will pick a special image plugin that will automatically generate
+                       // image derivatives.
+                       //
+                       result = getFileManager().createDocumentFromBlob(
+                                       repoSession.getRepositoryInstance(), inputStreamBlob, blobLocation, true, blobName);
+               } else {
+                       //
+                       // User Nuxeo's default file importer/adapter explicitly.  This avoids specialized functionality from happening like
+                       // image derivative creation.
+                       //
+                       String digestAlgorithm = getFileManager()
+                       .getDigestAlgorithm(); // Only call this because we seem to need some way of initializing Nuxeo's FileManager with a call.
+                       
+                       FileManagerService fileManagerService = getFileManagerService();
+                       inputStreamBlob = checkMimeType(inputStreamBlob, blobName);
+
+                       FileImporter defaultFileImporter = fileManagerService.getPluginByName("DefaultFileImporter");
+                       result = defaultFileImporter.create(
+                                       repoSession.getRepositoryInstance(), inputStreamBlob, blobLocation, true, blobName, getTypeService());                  
+               }
+               
+               return result;
+       }
+       
+       static public BlobsCommon createBlobInRepository(
+                       ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+                       RepositoryClient repositoryClient,
+                       InputStream inputStream,
+                       String blobName,
+                       boolean useNuxeoAdaptors) throws TransactionException {
+               BlobsCommon result = null;
+
+               boolean repoSessionCleanup = false;
+               RepositoryInstanceInterface repoSession = (RepositoryInstanceInterface)ctx.getCurrentRepositorySession();
+               if (repoSession == null) {
+                       repoSession = getRepositorySession(ctx, repositoryClient);
+                       repoSessionCleanup = true;
+               }
+                               
+               try {
+                       // We'll store the blob inside the workspace directory of the calling service
+                       String nuxeoWspaceId = ctx.getRepositoryWorkspaceId();
+                       DocumentRef nuxeoWspace = new IdRef(nuxeoWspaceId);
+                       DocumentModel blobLocation = repoSession.getDocument(nuxeoWspace);
+                       
+                       Blob inputStreamBlob = new InputStreamBlob(inputStream);
+                       DocumentModel documentModel = createDocumentFromBlob(
+                                       repoSession,
+                           inputStreamBlob, 
+                           blobLocation.getPathAsString(), 
+                           true, 
+                           blobName,
+                           useNuxeoAdaptors);
+                       result = createBlobsCommon(documentModel, inputStreamBlob); // Now create the metadata about the Nuxeo blob document
+               } catch (Exception e) {
+                       result = null;
+                       logger.error("Could not create new Nuxeo blob document.", e); //FIXME: REM - This should probably be re-throwing the exception?
+               } finally {
+                       if (repoSessionCleanup == true) {
+                               releaseRepositorySession(ctx, repositoryClient, repoSession);
+                       }
+               }
+               
+               return result;
+       }
+       
+       /**
+        * Creates the picture.
+        * 
+        * @param ctx
+        *            the ctx
+        * @param repoSession
+        *            the repo session
+        * @param filePath
+        *            the file path
+        * @return the string
+        * @throws Exception 
+        */
+       public static BlobsCommon createBlobInRepository(
+                       ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+                       RepositoryInstanceInterface repoSession,
+                       BlobInput blobInput,
+                       boolean purgeOriginal,
+                       boolean useNuxeoAdaptors) throws Exception {
+               BlobsCommon result = null;
+
+               File originalFile = blobInput.getBlobFile();
+               File targetFile = originalFile;
+               try {
+                       // We'll store the blob inside the workspace directory of the calling service
+                       String nuxeoWspaceId = ctx.getRepositoryWorkspaceId();
+                       DocumentRef nuxeoWspace = new IdRef(nuxeoWspaceId);
+                       DocumentModel wspaceDoc = repoSession.getDocument(nuxeoWspace);
+                       //
+                       // If the original file's name contains "illegal" characters, then we create a copy of the file to give Nuxeo.
+                       //
+                       String sanitizedName = NuxeoBlobUtils.getSanizitedFilename(originalFile);
+                       if (sanitizedName.equals(originalFile.getName()) == false) {
+                               targetFile = FileUtils.createTmpFile(originalFile, sanitizedName);
+                               if (logger.isDebugEnabled() == true) {
+                                       logger.debug(String.format("The file '%s''s name has characters that Nuxeo can't deal with.  Rather than renaming the file, we created a new temp file at '%s'",
+                                                       originalFile.getName(), targetFile.getAbsolutePath()));
+                               }
+                       }                       
+                       
+                       result = createBlobInRepository(repoSession,
+                                       wspaceDoc,
+                                       purgeOriginal,
+                                       targetFile, 
+                                       null, // MIME type
+                                       useNuxeoAdaptors);
+                       //
+                       // Make sure we're using the original file name in our BlobsCommon instance.  If the original file's name
+                       // contained illegal characters, then we created and handed a copy of the file to Nuxeo.  We don't want the
+                       // copy's file name stored in the BlobsCommon instance, we want the original file name instead.
+                       //
+                       if (targetFile.equals(originalFile) == false) {
+                               result.setName(originalFile.getName());
+                       }
+                       
+               } catch (Exception e) {
+                       logger.error("Could not create image blob.", e);
+                       throw e;
+               } finally {
+                       //
+                       // If we created a temp file then we should delete it.
+                       //
+                       if (targetFile.equals(originalFile) == false) {
+                               if (targetFile.delete() == false) {
+                                       logger.warn(String.format("Attempt to delete temporary file '%s' failed.", targetFile.getAbsolutePath()));
+                               }
+                       }
+               }
+
+               return result;
+       }
+       
+       /*
+        * Find out if this document's blob/file-contents are allowed to be purged.  For instance, we currently
+        * only want to allow the purging the contents of Nuxeo "Picture" documents. 
+        */
+       static private boolean isPurgeAllowed(DocumentModel docModel) {
+               boolean result = false;
+               
+               if (docModel.hasFacet(ImagingDocumentConstants.PICTURE_FACET) == true) {
+                       result = true; // Yes, delete/purge the original content
+               }
+               
+               return result;
+       }
+       
+       /**
+        * Creates the image blob.
+        * 
+        * @param nuxeoSession
+        *            the nuxeo session
+        * @param blobLocation
+        *            the blob location
+        * @param file
+        *            the file
+        * @param fileName
+        *            the file name
+        * @param mimeType
+        *            the mime type
+        * @return the string
+        */
+       static private BlobsCommon createBlobInRepository(RepositoryInstanceInterface nuxeoSession,
+                       DocumentModel blobLocation,
+                       boolean purgeOriginal,
+                       File file,
+                       String mimeType,
+                       boolean useNuxeoAdaptors) {
+               BlobsCommon result = null;
+
+               try {
+                       Blob fileBlob = createNuxeoFileBasedBlob(file);
+                       
+                       DocumentModel documentModel = createDocumentFromBlob(
+                                       nuxeoSession, fileBlob,
+                                       blobLocation.getPathAsString(),
+                                       true,
+                                       file.getName(),
+                                       useNuxeoAdaptors);
+
+                       result = createBlobsCommon(documentModel, fileBlob); // Now create our metadata resource document
+
+                       // If the sender wanted us to generate only derivatives, we need to purge/clear the original contents
+                       if (purgeOriginal == true && isPurgeAllowed(documentModel) == true) {
+                               // Empty the document model's "content" property -this does not delete the actual file/blob
+                               documentModel.setPropertyValue("file:content", (Serializable) null);
+                               
+                               if (documentModel.hasFacet(ImagingDocumentConstants.PICTURE_FACET)) {
+                                       // Now with no content, the derivative listener wants to update the derivatives. So to
+                                       // prevent the listener, we remove the "Picture" facet from the document
+                                       NuxeoUtils.removeFacet(documentModel, ImagingDocumentConstants.PICTURE_FACET); // Removing this facet ensures the original derivatives are unchanged.
+                                       nuxeoSession.saveDocument(documentModel);
+                                       // Now that we've emptied the document model's content field, we can add back the Picture facet
+                                       NuxeoUtils.addFacet(documentModel, ImagingDocumentConstants.PICTURE_FACET);
+                               }
+                               
+                               nuxeoSession.saveDocument(documentModel);
+                               // Next, we need to remove the actual file from Nuxeo's data directory
+                               DocumentBlobHolder docBlobHolder = (DocumentBlobHolder) documentModel
+                                               .getAdapter(BlobHolder.class);
+                               Blob blob = docBlobHolder.getBlob();
+                               if(blob == null) {
+                                       logger.error("Could not get blob for original image. Trying to delete original for: {}",
+                                                       file.getName());
+                               } else {
+                                       boolean deleteSuccess = NuxeoUtils.deleteFileOfBlob(docBlobHolder.getBlob());
+                               }
+                       }
+               } catch (Exception e) {
+                       result = null;
+                       logger.error("Could not create new Nuxeo blob document.", e); //FIXME: REM - This should probably be re-throwing the exception?
+               }
+
+               return result;
+       }
+
+       // /*
+       // * This is an alternate approach to getting information about an image
+       // * and its corresponding derivatives.
+       // */
+       // // MultiviewPictureAdapter multiviewPictureAdapter =
+       // documentModel.getAdapter(MultiviewPictureAdapter.class);
+       // MultiviewPictureAdapterFactory multiviewPictureAdapterFactory = new
+       // MultiviewPictureAdapterFactory();
+       // MultiviewPictureAdapter multiviewPictureAdapter =
+       // (MultiviewPictureAdapter)multiviewPictureAdapterFactory.getAdapter(documentModel,
+       // null);
+       // if (multiviewPictureAdapter != null) {
+       // PictureView[] pictureViewArray = multiviewPictureAdapter.getViews();
+       // for (PictureView pictureView : pictureViewArray) {
+       // if (logger.isDebugEnabled() == true) {
+       // logger.debug("-------------------------------------");
+       // logger.debug(toStringPictureView(pictureView));
+       // }
+       // }
+       // }
+       
+       public static InputStream getResource(String resourceName) {
+               InputStream result = null;
+               
+               try {
+                       result = ServiceMain.getInstance().getResourceAsStream(resourceName);
+               } catch (FileNotFoundException e) {
+                       logger.error("Missing Services resource: " + resourceName, e);
+               }
+        
+               return result;
+       }
+
+       static public BlobOutput getBlobOutput(ServiceContext ctx,
+                       RepositoryClient repositoryClient,
+                       String repositoryId,
+                       StringBuffer outMimeType) throws TransactionException {
+               BlobOutput result = null;
+               
+               boolean repoSessionCleanup = false;
+               RepositoryInstanceInterface repoSession = (RepositoryInstanceInterface)ctx.getCurrentRepositorySession();
+               if (repoSession == null) {
+                       repoSession = getRepositorySession(ctx, repositoryClient);
+                       repoSessionCleanup = true;
+               }
+               
+               try {
+                       result = getBlobOutput(ctx, repoSession, repositoryId, null, true, outMimeType);
+                       if (outMimeType.length() == 0) {
+                               BlobsCommon blobsCommon = result.getBlobsCommon();
+                               String mimeType = blobsCommon.getMimeType();
+                               outMimeType.append(mimeType);
+                       }                       
+               } finally {
+                       if (repoSessionCleanup == true) {
+                               releaseRepositorySession(ctx, repositoryClient, repoSession);
+                       }
+               }
+               
+               return result;
+       }
+       
+       //
+       //  If the blob is not too big, we return a ByteArrayInputStream.  Otherwise, we return Nuxeo's InputStream
+       //  which is usually a FileInputStream.
+       //
+       static private InputStream getInputStream(BlobsCommon blobsCommon, Blob blob) {
+               InputStream result = null;
+               
+               try {
+                       InputStream blobStream = blob.getStream(); // By default, the result will be whatever stream Nuxeo returns to us.
+                       int blobSize = blobsCommon.getLength() != null ? Integer.parseInt(blobsCommon.getLength()) : 0;
+                       if (blobSize > 0 && blobSize < MAX_IMAGE_BUFFER) {
+                               byte[] bytes = IOUtils.toByteArray(blobStream);
+                               blobStream.close(); // Close the InputStream that we got from Nuxeo since it's usually a FileInputStream -we definitely want FileInputStreams closed.
+                               result = new ByteArrayInputStream(bytes);
+                       } else {
+                               result = blobStream; // The blob is too large to put into a ByteArrayStream.
+                       }
+               } catch (Exception e) {
+                       logger.error(String.format("Error getting the InputStream content for file %s.", blobsCommon.getName()), e);
+                       if (result != null) {
+                               try {
+                                       result.close();
+                                       result = null;
+                               } catch (Exception x) {
+                                       logger.debug(String.format("Exception encountered during InputStream cleanup of file %s", blobsCommon.getName()), x);
+                               }
+                       }                       
+               }
+               
+               return result;
+       }
+       
+       /**
+        * Gets the image.
+        * 
+        * @param repoSession
+        *            the repo session
+        * @param repositoryId
+        *            the repository id
+        * @param derivativeTerm
+        *            the derivative term
+        * @return the image
+        */
+       static public BlobOutput getBlobOutput(ServiceContext ctx,
+                       RepositoryInstanceInterface repoSession,
+                       String repositoryId,
+                       String derivativeTerm,
+                       Boolean getContentFlag,
+                       StringBuffer outMimeType) {
+               BlobOutput result = new BlobOutput();
+               boolean isNonImageDerivative = false;
+
+               if (repositoryId != null && repositoryId.isEmpty() == false)
+                       try {
+                               IdRef documentRef = new IdRef(repositoryId);
+                               DocumentModel documentModel = repoSession.getDocument(documentRef);
+
+                               Blob docBlob = null;
+                               DocumentBlobHolder docBlobHolder = (DocumentBlobHolder) documentModel
+                                               .getAdapter(BlobHolder.class);
+                               if (docBlobHolder instanceof PictureBlobHolder) {
+                                       // if it is a PictureDocument then it has these
+                                       // Nuxeo schemas: [dublincore, uid, picture, iptc, common, image_metadata]
+                                       //
+                                       // Need to add the "MultiviewPictureAdapter" support here to
+                                       // get the view data, see above.
+                                       //
+                                       PictureBlobHolder pictureBlobHolder = (PictureBlobHolder) docBlobHolder;
+                                       if (derivativeTerm != null) {
+                                               docBlob = pictureBlobHolder.getBlob(derivativeTerm);
+                                               // Nuxeo derivatives are all JPEG
+                                               outMimeType.append(MIME_JPEG); // All Nuxeo image derivatives are JPEG images.
+                                       } else {
+                                               docBlob = pictureBlobHolder.getBlob();
+                                       }
+                               } else {
+                                       docBlob = docBlobHolder.getBlob();
+                                       if (derivativeTerm != null) { // If its a derivative request on a non-image blob, then return just a document image thumnail
+                                               isNonImageDerivative = true;
+                                       }
+                               }
+
+                               //
+                               // Create the result instance that will contain the blob metadata
+                               // and an InputStream with the bits if the 'getContentFlag' is
+                               // set.
+                               //
+                               BlobsCommon blobsCommon = createBlobsCommon(documentModel, docBlob, getContentFlag);
+                               result.setBlobsCommon(blobsCommon);
+                               if (getContentFlag == true) {
+                                       InputStream remoteStream = null;
+                                       if (isNonImageDerivative == false) {
+                                               //remoteStream = docBlob.getStream();
+                                               remoteStream = getInputStream(blobsCommon, docBlob); // CSPACE-6110 - For small files, return a byte array instead of a file stream
+                                       } else {
+                                               remoteStream = getResource(DOCUMENT_PLACEHOLDER_IMAGE);
+                                               outMimeType.append(MIME_JPEG);
+                                       }
+//                                     BufferedInputStream bufferedInputStream = new BufferedInputStream(
+//                                                     remoteStream);  
+//                                     result.setBlobInputStream(bufferedInputStream);
+                                       result.setBlobInputStream(remoteStream);
+                               }
+                       } catch (Exception e) {
+                               if (logger.isErrorEnabled() == true) {
+                                       logger.error(e.getMessage(), e);
+                               }
+                               result = null;
+                       }
+
+               return result;
+       }
+       
+}
+
+/*
+ * Notes and code snippets about Nuxeo's support for binaries and image
+ * documents.
+ */
+
+/*
+ * 
+ * 
+ * MultiviewPictureAdapter org.nuxeo.ecm.platform.picture.api.adapters
+ * PictureResourceAdapter pictureResourceAdapter = (PictureResourceAdapter)
+ * documentModel.getAdapter(PictureResourceAdapter.class); String thumbnailPath
+ * = pictureResourceAdapter.getViewXPath("Thumbnail");
+ * 
+ * Map<String,Serializable> blobHolderProps = docBlobHolder.getProperties();
+ * String filePath = docBlobHolder.getFilePath(); List<Blob> docBlobs =
+ * docBlobHolder.getBlobs();
+ * 
+ * stream = new FileInputStream(fileUploadHolder.getTempFile());
+ * 
+ * public String addFile(InputStream fileUpload, String fileName) fileName =
+ * FileUtils.getCleanFileName(fileName); DocumentModel currentDocument =
+ * navigationContext.getCurrentDocument(); String path =
+ * currentDocument.getPathAsString(); Blob blob =
+ * FileUtils.createSerializableBlob(fileUpload, fileName, null);
+ * 
+ * DocumentModel createdDoc = getFileManagerService().createDocumentFromBlob(
+ * documentManager, blob, path, true, fileName);
+ * eventManager.raiseEventsOnDocumentSelected(createdDoc);
+ * 
+ * protected FileManager fileManager;
+ * 
+ * protected FileManager getFileManagerService() throws ClientException { if
+ * (fileManager == null) { try { fileManager =
+ * Framework.getService(FileManager.class); } catch (Exception e) {
+ * log.error("Unable to get FileManager service ", e); throw new
+ * ClientException("Unable to get FileManager service ", e); } } return
+ * fileManager; }
+ */
+
+/*
+ * RepositoryService repositoryService = (RepositoryService)
+ * Framework.getRuntime().getComponent( RepositoryService.NAME);
+ * RepositoryManager repositoryManager =
+ * repositoryService.getRepositoryManager(); RepositoryDescriptor descriptor =
+ * repositoryManager.getDescriptor(repositoryName); DefaultBinaryManager
+ * binaryManager = new DefaultBinaryManager(
+ * SQLRepository.getDescriptor(descriptor)));
+ * 
+ * File storageDir = binaryManager.getStorageDir(); SQLBlob blob = (SQLBlob)
+ * doc.getPropertyValue("schema:blobField"); File file =
+ * binaryManager.getFileForDigest( blob.getBinary().getDigest(), false);
+ */
+
+/*
+ * RepositoryInstance.getStreamURI()
+ * 
+ * String getStreamURI(String blobPropertyId) throws ClientException
+ * 
+ * Returns an URI identifying the stream given the blob property id. This method
+ * should be used by a client to download the data of a blob property.
+ * 
+ * The blob is fetched from the repository and the blob stream is registered
+ * against the streaming service so the stream will be available remotely
+ * through stream service API.
+ * 
+ * After the client has called this method, it will be able to download the
+ * stream using streaming server API.
+ * 
+ * Returns: an URI identifying the remote stream Throws: ClientException
+ */
+
+/*
+ * A blob contains usually large data.
+ * 
+ * Document fields holding Blob data are by default fetched in a lazy manner.
+ * 
+ * A Blob object hides the data source and it also describes data properties
+ * like the encoding or mime-type.
+ * 
+ * The encoding is used to decode Unicode text content that was stored in an
+ * encoded form. If not encoding is specified, the default java encoding is
+ * used. The encoding is ignored for binary content.
+ * 
+ * When retrieving the content from a document, it will be returned as source
+ * content instead of returning the content bytes.
+ * 
+ * The same is true when setting the content for a document: you set a content
+ * source and not directly the content bytes. Ex:
+ * 
+ * File file = new File("/tmp/index.html"); FileBlob fb = new FileBlob(file);
+ * fb.setMimeType("text/html"); fb.setEncoding("UTF-8"); // this specifies that
+ * content bytes will be stored as UTF-8 document.setProperty("file", "content",
+ * fb);
+ * 
+ * 
+ * Then you may want to retrieve the content as follow:
+ * 
+ * Blob blob = document.getProperty("file:content"); htmlDoc = blob.getString();
+ * // the content is decoded from UTF-8 into a java string
+ */
index 376d59bfcaf310f344c089a7c0a9570be9fa0708..2f18d305b502d52aa149b5f0c68ee4cbf901cc84 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.init;\r
-\r
-import java.sql.Connection;\r
-import java.sql.ResultSet;\r
-import java.sql.SQLException;\r
-import java.sql.Statement;\r
-import java.util.List;\r
-\r
-import javax.sql.DataSource;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.storage.DatabaseProductType;\r
-import org.collectionspace.services.common.storage.JDBCTools;\r
-import org.collectionspace.services.config.service.InitHandler.Params.Field;\r
-import org.collectionspace.services.config.service.InitHandler.Params.Property;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * AddIndices, post-init action to add indexes to the database.\r
- * \r
- * In the configuration file, you may have sets of table names and column names, or you may use params to send a \r
- * comma-separated list of column names and a table name.  That is, both of these are equivalent:\r
- * \r
- *   The single column per element version:\r
- *\r
- *\r
- *        &lt;s:initHandler xmlns:s='http://collectionspace.org/services/common/service'>\r
-                &lt;s:classname>org.collectionspace.services.common.init.AddIndices&lt;/s:classname>\r
-                &lt;s:params>\r
-                    &lt;s:field>\r
-                        &lt;s:table>nuxeo.organizations_common&lt;/s:table>\r
-                        &lt;s:col>inAuthority&lt;/s:col>\r
-                    &lt;/s:field>\r
-                    &lt;s:field>\r
-                        &lt;s:table>nuxeo.organizations_common&lt;/s:table>\r
-                        &lt;s:col>displayName&lt;/s:col>\r
-                    &lt;/s:field>\r
-                    &lt;s:field>\r
-                        &lt;s:table>nuxeo.organizations_common&lt;/s:table>\r
-                        &lt;s:col>shortIdentifier&lt;/s:col>\r
-                    &lt;/s:field>\r
-                &lt;/s:params>\r
-            &lt;/s:initHandler>\r
-\r
-     The csv version:\r
-\r
-            &lt;s:initHandler xmlns:s='http://collectionspace.org/services/common/service'>\r
-                &lt;s:classname>org.collectionspace.services.common.init.AddIndices&lt;/s:classname>\r
-                &lt;s:params>\r
-                    &lt;s:field>\r
-                        &lt;s:table>nuxeo.organizations_common&lt;/s:table>\r
-                        &lt;s:param>inAuthority,displayName,shortIdentifier&lt;/s:param>\r
-                    &lt;/s:field>\r
-                &lt;/s:params>\r
-            &lt;/s:initHandler>\r
- *\r
- * $LastChangedRevision$\r
- * $LastChangedDate$\r
- */\r
-public class AddIndices extends InitHandler implements IInitHandler {\r
-\r
-    final Logger logger = LoggerFactory.getLogger(AddIndices.class);\r
-    private final static String INDEX_SEP = "_";\r
-    private final static String INDEX_SUFFIX = INDEX_SEP + "idx";\r
-\r
-\r
-    /** See the class javadoc for this class: it shows the syntax supported in the configuration params.\r
-     */\r
-    @Override\r
-    public void onRepositoryInitialized(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId,\r
-               ServiceBindingType sbt, \r
-               List<Field> fields, \r
-               List<Property> properties) throws Exception {\r
-        //todo: all post-init tasks for services, or delegate to services that override.\r
-        int rows = 0;\r
-        String sql = "";\r
-        if (logger.isInfoEnabled() && sbt != null) {\r
-            logger.info("Creating indicies, as needed, for designated fields in " + sbt.getName()\r
-                    + " for repository domain " + sbt.getRepositoryDomain().trim() + "...");\r
-        }\r
-\r
-        for (Field field : fields) {\r
-            String tableName = field.getTable();\r
-            String fieldName = field.getCol();\r
-            String param = field.getParam();\r
-            if(Tools.notEmpty(param) && (param.indexOf(',')>-1)){\r
-                String[] fieldNames = param.split(",");\r
-                for (String fn: fieldNames){\r
-                    rows = addOneIndex(dataSourceName, repositoryName, cspaceInstanceId, tableName, fn);\r
-                }\r
-            } else {\r
-                rows = addOneIndex(dataSourceName, repositoryName, cspaceInstanceId, tableName, fieldName);\r
-            }\r
-        }\r
-    }\r
-\r
-    private int addOneIndex(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId,\r
-               String tableName, \r
-               String columnName) {\r
-        int rows = 0;\r
-        String sql = "";\r
-        String indexName = tableName + INDEX_SEP + columnName + INDEX_SUFFIX;\r
-        try {\r
-               DatabaseProductType databaseProductType = JDBCTools.getDatabaseProductType(dataSourceName, repositoryName);\r
-            if (indexExists(dataSourceName, repositoryName, cspaceInstanceId, databaseProductType,\r
-                       tableName, columnName, indexName)) {\r
-                logger.trace("Index already exists for column " + columnName\r
-                        + " in table " + tableName);\r
-                // FIXME: Can add the option to drop and re-create an index here.\r
-                // For example, see MySQL documentation on DROP INDEX.\r
-                return 0;\r
-            }\r
-            // TODO: Consider refactoring this 'if' statement to a general-purpose\r
-            // mechanism for retrieving and populating catalog/DDL-type SQL statements\r
-            // appropriate to a particular database product.\r
-            logger.info("Creating index for column " + columnName + " in table " + tableName);\r
-            if (databaseProductType == DatabaseProductType.MYSQL\r
-                       || databaseProductType == DatabaseProductType.POSTGRESQL) {\r
-                 sql = "CREATE INDEX " + indexName + " ON " \r
-                               + tableName + " (" + columnName + ")";\r
-            } else {\r
-                throw new Exception("Unrecognized database system " + databaseProductType);\r
-            }\r
-            if (sql != null && ! sql.trim().isEmpty()) {\r
-                // Assumes indicies will only be created at post-init time\r
-                // for the Nuxeo repository.\r
-                // \r
-                // To date, for the CSpace repository, indices have typically been\r
-                // created during the build process, via manual or generated\r
-                // DDL SQL scripts.\r
-                //\r
-                // If this assumption is no longer valid, we might instead\r
-                // identify the relevant repository from the table name here.\r
-                rows = JDBCTools.executeUpdate(dataSourceName, repositoryName, cspaceInstanceId, sql);\r
-                logger.trace("Index added to column ("+columnName+") on table ("+tableName+")");\r
-            }\r
-            return rows;\r
-        } catch (Throwable e) {\r
-            logger.debug("Index NOT added to column ("+columnName+") on table ("+tableName+") SQL: "+sql+" ERROR: "+e);\r
-            return -1;\r
-        }\r
-    }\r
-\r
-    private boolean indexExists(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId,\r
-               DatabaseProductType databaseProductType,\r
-            String tableName, \r
-            String colName, \r
-            String indexName) {\r
-        \r
-        // FIXME: May need to qualify table name by database/catalog,\r
-        // as table names likely will not be globally unique across same\r
-        // (although index names *may* be unique within scope).\r
-        //\r
-        // If we do need to do this, we might:\r
-        // - Pass in the database name as a parameter to this method, retrieved\r
-        //   via getDatabaseName(field) in onRepositoryInitialized, above.\r
-        // - Add 'IN databaseName' after tableName in MySQL variant, below.\r
-        //   (PostgreSQL variant, below, uses a view that doesn't include\r
-        //   a foreign key for associating a database/catalog to the index.)\r
-        \r
-        // FIXME: Consider instead substituting a database-agnostic\r
-        // JDBC mechanism for retrieving indexes; e.g.\r
-        // java.sql.DatabaseMetaData.getIndexInfo()\r
-        \r
-        boolean indexExists = false;\r
-        String sql = "";\r
-        Connection conn = null;\r
-        Statement stmt = null;\r
-        ResultSet rs = null;\r
-\r
-        if (databaseProductType == DatabaseProductType.MYSQL) {\r
-            sql = "SHOW INDEX FROM " + tableName + " WHERE key_name='" + indexName + "'";\r
-        } else if (databaseProductType == DatabaseProductType.POSTGRESQL) {\r
-               // We want to see if any index on that column exists, not just ours...\r
-            sql = "SELECT indexname FROM pg_catalog.pg_indexes "\r
-                    + "WHERE tablename = '" + tableName \r
-                    + "' AND indexdef ILIKE '%("+colName+")'";\r
-        }\r
-\r
-        try {\r
-            // Assumes indices will only be created at post-init time\r
-            // for the Nuxeo repository.\r
-            // \r
-            // To date, for the CSpace repository, indices have typically been\r
-            // created during the build process, via manual or generated\r
-            // DDL SQL scripts.\r
-            //\r
-            // If this assumption is no longer valid, we might instead\r
-            // identify the relevant repository from the table name here.\r
-            conn = JDBCTools.getConnection(dataSourceName, repositoryName, cspaceInstanceId);\r
-            stmt = conn.createStatement();\r
-            rs = stmt.executeQuery(sql);\r
-            if (rs.next()) {\r
-                indexExists = true;\r
-            }\r
-            rs.close();\r
-            stmt.close();\r
-            conn.close();\r
-        } catch (Exception e) {\r
-            logger.debug("Error when identifying whether index exists in table "\r
-                    + tableName + ":" + e.getMessage());\r
-        } finally {\r
-            try {\r
-                if (rs != null) {\r
-                    rs.close();\r
-                }\r
-                if (stmt != null) {\r
-                    stmt.close();\r
-                }\r
-                if (conn != null) {\r
-                    conn.close();\r
-                }\r
-            } catch (SQLException sqle) {\r
-                logger.debug("SQL Exception closing statement/connection in AddIndices: " + sqle.getLocalizedMessage());\r
-            }\r
-        }\r
-        return indexExists;\r
-    }\r
-\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.init;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.List;
+
+import javax.sql.DataSource;
+
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.storage.DatabaseProductType;
+import org.collectionspace.services.common.storage.JDBCTools;
+import org.collectionspace.services.config.service.InitHandler.Params.Field;
+import org.collectionspace.services.config.service.InitHandler.Params.Property;
+import org.collectionspace.services.config.service.ServiceBindingType;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * AddIndices, post-init action to add indexes to the database.
+ * 
+ * In the configuration file, you may have sets of table names and column names, or you may use params to send a 
+ * comma-separated list of column names and a table name.  That is, both of these are equivalent:
+ * 
+ *   The single column per element version:
+ *
+ *
+ *        &lt;s:initHandler xmlns:s='http://collectionspace.org/services/common/service'>
+                &lt;s:classname>org.collectionspace.services.common.init.AddIndices&lt;/s:classname>
+                &lt;s:params>
+                    &lt;s:field>
+                        &lt;s:table>nuxeo.organizations_common&lt;/s:table>
+                        &lt;s:col>inAuthority&lt;/s:col>
+                    &lt;/s:field>
+                    &lt;s:field>
+                        &lt;s:table>nuxeo.organizations_common&lt;/s:table>
+                        &lt;s:col>displayName&lt;/s:col>
+                    &lt;/s:field>
+                    &lt;s:field>
+                        &lt;s:table>nuxeo.organizations_common&lt;/s:table>
+                        &lt;s:col>shortIdentifier&lt;/s:col>
+                    &lt;/s:field>
+                &lt;/s:params>
+            &lt;/s:initHandler>
+
+     The csv version:
+
+            &lt;s:initHandler xmlns:s='http://collectionspace.org/services/common/service'>
+                &lt;s:classname>org.collectionspace.services.common.init.AddIndices&lt;/s:classname>
+                &lt;s:params>
+                    &lt;s:field>
+                        &lt;s:table>nuxeo.organizations_common&lt;/s:table>
+                        &lt;s:param>inAuthority,displayName,shortIdentifier&lt;/s:param>
+                    &lt;/s:field>
+                &lt;/s:params>
+            &lt;/s:initHandler>
+ *
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ */
+public class AddIndices extends InitHandler implements IInitHandler {
+
+    final Logger logger = LoggerFactory.getLogger(AddIndices.class);
+    private final static String INDEX_SEP = "_";
+    private final static String INDEX_SUFFIX = INDEX_SEP + "idx";
+
+
+    /** See the class javadoc for this class: it shows the syntax supported in the configuration params.
+     */
+    @Override
+    public void onRepositoryInitialized(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId,
+               ServiceBindingType sbt, 
+               List<Field> fields, 
+               List<Property> properties) throws Exception {
+        //todo: all post-init tasks for services, or delegate to services that override.
+        int rows = 0;
+        String sql = "";
+        if (logger.isInfoEnabled() && sbt != null) {
+            logger.info("Creating indicies, as needed, for designated fields in " + sbt.getName()
+                    + " for repository domain " + sbt.getRepositoryDomain().trim() + "...");
+        }
+
+        for (Field field : fields) {
+            String tableName = field.getTable();
+            String fieldName = field.getCol();
+            String param = field.getParam();
+            if(Tools.notEmpty(param) && (param.indexOf(',')>-1)){
+                String[] fieldNames = param.split(",");
+                for (String fn: fieldNames){
+                    rows = addOneIndex(dataSourceName, repositoryName, cspaceInstanceId, tableName, fn);
+                }
+            } else {
+                rows = addOneIndex(dataSourceName, repositoryName, cspaceInstanceId, tableName, fieldName);
+            }
+        }
+    }
+
+    private int addOneIndex(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId,
+               String tableName, 
+               String columnName) {
+        int rows = 0;
+        String sql = "";
+        String indexName = tableName + INDEX_SEP + columnName + INDEX_SUFFIX;
+        try {
+               DatabaseProductType databaseProductType = JDBCTools.getDatabaseProductType(dataSourceName, repositoryName);
+            if (indexExists(dataSourceName, repositoryName, cspaceInstanceId, databaseProductType,
+                       tableName, columnName, indexName)) {
+                logger.trace("Index already exists for column " + columnName
+                        + " in table " + tableName);
+                // FIXME: Can add the option to drop and re-create an index here.
+                // For example, see MySQL documentation on DROP INDEX.
+                return 0;
+            }
+            // TODO: Consider refactoring this 'if' statement to a general-purpose
+            // mechanism for retrieving and populating catalog/DDL-type SQL statements
+            // appropriate to a particular database product.
+            logger.info("Creating index for column " + columnName + " in table " + tableName);
+            if (databaseProductType == DatabaseProductType.MYSQL
+                       || databaseProductType == DatabaseProductType.POSTGRESQL) {
+                 sql = "CREATE INDEX " + indexName + " ON " 
+                               + tableName + " (" + columnName + ")";
+            } else {
+                throw new Exception("Unrecognized database system " + databaseProductType);
+            }
+            if (sql != null && ! sql.trim().isEmpty()) {
+                // Assumes indicies will only be created at post-init time
+                // for the Nuxeo repository.
+                // 
+                // To date, for the CSpace repository, indices have typically been
+                // created during the build process, via manual or generated
+                // DDL SQL scripts.
+                //
+                // If this assumption is no longer valid, we might instead
+                // identify the relevant repository from the table name here.
+                rows = JDBCTools.executeUpdate(dataSourceName, repositoryName, cspaceInstanceId, sql);
+                logger.trace("Index added to column ("+columnName+") on table ("+tableName+")");
+            }
+            return rows;
+        } catch (Throwable e) {
+            logger.debug("Index NOT added to column ("+columnName+") on table ("+tableName+") SQL: "+sql+" ERROR: "+e);
+            return -1;
+        }
+    }
+
+    private boolean indexExists(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId,
+               DatabaseProductType databaseProductType,
+            String tableName, 
+            String colName, 
+            String indexName) {
+        
+        // FIXME: May need to qualify table name by database/catalog,
+        // as table names likely will not be globally unique across same
+        // (although index names *may* be unique within scope).
+        //
+        // If we do need to do this, we might:
+        // - Pass in the database name as a parameter to this method, retrieved
+        //   via getDatabaseName(field) in onRepositoryInitialized, above.
+        // - Add 'IN databaseName' after tableName in MySQL variant, below.
+        //   (PostgreSQL variant, below, uses a view that doesn't include
+        //   a foreign key for associating a database/catalog to the index.)
+        
+        // FIXME: Consider instead substituting a database-agnostic
+        // JDBC mechanism for retrieving indexes; e.g.
+        // java.sql.DatabaseMetaData.getIndexInfo()
+        
+        boolean indexExists = false;
+        String sql = "";
+        Connection conn = null;
+        Statement stmt = null;
+        ResultSet rs = null;
+
+        if (databaseProductType == DatabaseProductType.MYSQL) {
+            sql = "SHOW INDEX FROM " + tableName + " WHERE key_name='" + indexName + "'";
+        } else if (databaseProductType == DatabaseProductType.POSTGRESQL) {
+               // We want to see if any index on that column exists, not just ours...
+            sql = "SELECT indexname FROM pg_catalog.pg_indexes "
+                    + "WHERE tablename = '" + tableName 
+                    + "' AND indexdef ILIKE '%("+colName+")'";
+        }
+
+        try {
+            // Assumes indices will only be created at post-init time
+            // for the Nuxeo repository.
+            // 
+            // To date, for the CSpace repository, indices have typically been
+            // created during the build process, via manual or generated
+            // DDL SQL scripts.
+            //
+            // If this assumption is no longer valid, we might instead
+            // identify the relevant repository from the table name here.
+            conn = JDBCTools.getConnection(dataSourceName, repositoryName, cspaceInstanceId);
+            stmt = conn.createStatement();
+            rs = stmt.executeQuery(sql);
+            if (rs.next()) {
+                indexExists = true;
+            }
+            rs.close();
+            stmt.close();
+            conn.close();
+        } catch (Exception e) {
+            logger.debug("Error when identifying whether index exists in table "
+                    + tableName + ":" + e.getMessage());
+        } finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+                if (stmt != null) {
+                    stmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException sqle) {
+                logger.debug("SQL Exception closing statement/connection in AddIndices: " + sqle.getLocalizedMessage());
+            }
+        }
+        return indexExists;
+    }
+
+}
index 27788d6ed2091211519d5d7533fe717523fced14..d227cd392ba1317757858cc9c17eb8c7bccbe87a 100644 (file)
@@ -1,22 +1,22 @@
-package org.collectionspace.services.common.init;\r
-\r
-import java.util.List;\r
-\r
-import org.collectionspace.services.config.service.InitHandler.Params.Field;\r
-import org.collectionspace.services.config.service.InitHandler.Params.Property;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision$\r
- * $LastChangedDate$\r
- */\r
-\r
-public interface IInitHandler {\r
-    public void onRepositoryInitialized(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId,\r
-               ServiceBindingType sbt, \r
-               List<Field> fields, \r
-               List<Property> property) throws Exception;\r
-}\r
+package org.collectionspace.services.common.init;
+
+import java.util.List;
+
+import org.collectionspace.services.config.service.InitHandler.Params.Field;
+import org.collectionspace.services.config.service.InitHandler.Params.Property;
+import org.collectionspace.services.config.service.ServiceBindingType;
+
+/**
+ * User: laramie
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ */
+
+public interface IInitHandler {
+    public void onRepositoryInitialized(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId,
+               ServiceBindingType sbt, 
+               List<Field> fields, 
+               List<Property> property) throws Exception;
+}
index e33c129f65c287ad676b136b639c8e61db0cbf52..56a6a4ba16fa7cb4ed41b11a6e3aa719f9875365 100644 (file)
@@ -1,79 +1,79 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.init;\r
-\r
-import org.collectionspace.services.config.service.InitHandler.Params.Field;\r
-import org.collectionspace.services.config.service.InitHandler.Params.Property;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import java.util.List;\r
-\r
-/** Concrete class which does nothing, but subclasses may override to do\r
- *  some action on the event onRepositoryInitialized(), such as sending JDBC\r
- *  calls to the repository to add indices, etc.\r
- * @author Laramie\r
- * $LastChangedRevision$\r
- * $LastChangedDate$\r
- */\r
-public class InitHandler implements IInitHandler {\r
-\r
-    final Logger logger = LoggerFactory.getLogger(InitHandler.class);\r
-\r
-    /**\r
-     * Callback procedure for performing post-initialization actions.\r
-     *\r
-     * See org.collectionspace.services.common.init.AddIndices for an implementation example.\r
-     *\r
-     * @param dataSourceName \r
-     * @param repositoryName \r
-     * @param sbt a service binding type.\r
-     * @param fields A list of fields and their attributes.\r
-     * @param properties A properties bag for additional properties.\r
-     * @throws Exception\r
-     */\r
-    @Override\r
-    public void onRepositoryInitialized(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId,\r
-               ServiceBindingType sbt,\r
-               List<Field> fields, \r
-               List<Property> properties) throws Exception {\r
-\r
-        // For debugging.\r
-        /*\r
-        for (Field field : fields) {\r
-            System.out.println("InitHandler.fields:"\r
-                    + "\r\n    col: " + field.getCol()\r
-                    + "   table: " + field.getTable()\r
-                    + "   type: " + field.getType()\r
-                    + "   param: " + field.getParam());\r
-        }\r
-        for (Property prop : properties) {\r
-            System.out.println("InitHandler.properties:"\r
-                    + "\r\n    key: " + prop.getKey()\r
-                    + "   value: " + prop.getValue());\r
-\r
-        }\r
-         *\r
-         */\r
-    }\r
-\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.init;
+
+import org.collectionspace.services.config.service.InitHandler.Params.Field;
+import org.collectionspace.services.config.service.InitHandler.Params.Property;
+import org.collectionspace.services.config.service.ServiceBindingType;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+/** Concrete class which does nothing, but subclasses may override to do
+ *  some action on the event onRepositoryInitialized(), such as sending JDBC
+ *  calls to the repository to add indices, etc.
+ * @author Laramie
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ */
+public class InitHandler implements IInitHandler {
+
+    final Logger logger = LoggerFactory.getLogger(InitHandler.class);
+
+    /**
+     * Callback procedure for performing post-initialization actions.
+     *
+     * See org.collectionspace.services.common.init.AddIndices for an implementation example.
+     *
+     * @param dataSourceName 
+     * @param repositoryName 
+     * @param sbt a service binding type.
+     * @param fields A list of fields and their attributes.
+     * @param properties A properties bag for additional properties.
+     * @throws Exception
+     */
+    @Override
+    public void onRepositoryInitialized(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId,
+               ServiceBindingType sbt,
+               List<Field> fields, 
+               List<Property> properties) throws Exception {
+
+        // For debugging.
+        /*
+        for (Field field : fields) {
+            System.out.println("InitHandler.fields:"
+                    + "\r\n    col: " + field.getCol()
+                    + "   table: " + field.getTable()
+                    + "   type: " + field.getType()
+                    + "   param: " + field.getParam());
+        }
+        for (Property prop : properties) {
+            System.out.println("InitHandler.properties:"
+                    + "\r\n    key: " + prop.getKey()
+                    + "   value: " + prop.getValue());
+
+        }
+         *
+         */
+    }
+
+}
index 3f8d96959e3cac85ad2735987d504b6be03ef4b5..8aebe1021ab13d6eebbb48f171dd7c964227abc7 100644 (file)
@@ -1,32 +1,32 @@
-package org.collectionspace.services.common.invocable;\r
-\r
-import org.collectionspace.services.jaxb.InvocableJAXBSchema;\r
-\r
-public class InvocableUtils {\r
-\r
-       /**\r
-        * Returns the standard property name for an invocable schema, given\r
-        * and invocation mode string.\r
-        * @param schema If not null, the returned property name will be qualified with\r
-        *                                      this schema name.\r
-        * @param invocationMode one of Invocable.INVOCATION_MODE_*\r
-        * @return\r
-        */\r
-       public static String getPropertyNameForInvocationMode(String schema, String invocationMode) {\r
-               String modeProperty = null;\r
-               if(Invocable.INVOCATION_MODE_SINGLE.equalsIgnoreCase(invocationMode)) {\r
-                       modeProperty = InvocableJAXBSchema.SUPPORTS_SINGLE_DOC;\r
-               } else if(Invocable.INVOCATION_MODE_LIST.equalsIgnoreCase(invocationMode)) {\r
-                       modeProperty = InvocableJAXBSchema.SUPPORTS_DOC_LIST;\r
-               } else if(Invocable.INVOCATION_MODE_GROUP.equalsIgnoreCase(invocationMode)) {\r
-                       modeProperty = InvocableJAXBSchema.SUPPORTS_GROUP;\r
-               } else if(Invocable.INVOCATION_MODE_NO_CONTEXT.equalsIgnoreCase(invocationMode)) {\r
-                       modeProperty = InvocableJAXBSchema.SUPPORTS_NO_CONTEXT;\r
-               } else {\r
-                       throw new IllegalArgumentException("QueryManagerNuxeoImpl: unknown Invocation Mode: "\r
-                               +invocationMode);\r
-               }\r
-               return (schema!=null)? (schema+":"+modeProperty):modeProperty;\r
-       }\r
-\r
-}\r
+package org.collectionspace.services.common.invocable;
+
+import org.collectionspace.services.jaxb.InvocableJAXBSchema;
+
+public class InvocableUtils {
+
+       /**
+        * Returns the standard property name for an invocable schema, given
+        * and invocation mode string.
+        * @param schema If not null, the returned property name will be qualified with
+        *                                      this schema name.
+        * @param invocationMode one of Invocable.INVOCATION_MODE_*
+        * @return
+        */
+       public static String getPropertyNameForInvocationMode(String schema, String invocationMode) {
+               String modeProperty = null;
+               if(Invocable.INVOCATION_MODE_SINGLE.equalsIgnoreCase(invocationMode)) {
+                       modeProperty = InvocableJAXBSchema.SUPPORTS_SINGLE_DOC;
+               } else if(Invocable.INVOCATION_MODE_LIST.equalsIgnoreCase(invocationMode)) {
+                       modeProperty = InvocableJAXBSchema.SUPPORTS_DOC_LIST;
+               } else if(Invocable.INVOCATION_MODE_GROUP.equalsIgnoreCase(invocationMode)) {
+                       modeProperty = InvocableJAXBSchema.SUPPORTS_GROUP;
+               } else if(Invocable.INVOCATION_MODE_NO_CONTEXT.equalsIgnoreCase(invocationMode)) {
+                       modeProperty = InvocableJAXBSchema.SUPPORTS_NO_CONTEXT;
+               } else {
+                       throw new IllegalArgumentException("QueryManagerNuxeoImpl: unknown Invocation Mode: "
+                               +invocationMode);
+               }
+               return (schema!=null)? (schema+":"+modeProperty):modeProperty;
+       }
+
+}
index 513a94b07dfdd45b697292be2f47f1205eff6f6a..4cf4585b0033413a47f6ffb2913229f43ef010f0 100644 (file)
@@ -1,28 +1,28 @@
-package org.collectionspace.services.common.profile;\r
-\r
-import javax.servlet.ServletInputStream;\r
-import java.io.ByteArrayInputStream;\r
-\r
-/* Subclass of ServletInputStream needed by the servlet engine.\r
-All inputStream methods are wrapped and are delegated to\r
-the ByteArrayInputStream (obtained as constructor parameter)!*/\r
-\r
-public class BufferedServletInputStream extends ServletInputStream {\r
-    ByteArrayInputStream bais;\r
-    public BufferedServletInputStream(ByteArrayInputStream bais) {\r
-        this.bais = bais;\r
-    }\r
-\r
-    public int available() {\r
-        return bais.available();\r
-    }\r
-\r
-    public int read() {\r
-        return bais.read();\r
-    }\r
-\r
-    public int read(byte[] buf, int off, int len) {\r
-        return bais.read(buf, off, len);\r
-    }\r
-}\r
-\r
+package org.collectionspace.services.common.profile;
+
+import javax.servlet.ServletInputStream;
+import java.io.ByteArrayInputStream;
+
+/* Subclass of ServletInputStream needed by the servlet engine.
+All inputStream methods are wrapped and are delegated to
+the ByteArrayInputStream (obtained as constructor parameter)!*/
+
+public class BufferedServletInputStream extends ServletInputStream {
+    ByteArrayInputStream bais;
+    public BufferedServletInputStream(ByteArrayInputStream bais) {
+        this.bais = bais;
+    }
+
+    public int available() {
+        return bais.available();
+    }
+
+    public int read() {
+        return bais.read();
+    }
+
+    public int read(byte[] buf, int off, int len) {
+        return bais.read(buf, off, len);
+    }
+}
+
index 35993b9fb62a4061033498c3604ddb99febaca68..9279de39e1ef9538a43db793b57c35aab2ab1d09 100644 (file)
@@ -1,39 +1,39 @@
-package org.collectionspace.services.common.profile;\r
-\r
-import java.io.*;\r
-import javax.servlet.*;\r
-\r
-public class BufferedServletOutputStream extends ServletOutputStream {\r
-    // the actual buffer\r
-    private ByteArrayOutputStream bos = new ByteArrayOutputStream( );\r
-\r
-    public String getAsString(){\r
-        byte[] buf = bos.toByteArray();\r
-        return new String(buf);\r
-    }\r
-\r
-    /**\r
-     * @return the contents of the buffer.\r
-     */\r
-    public byte[] getBuffer( ) {\r
-        return this.bos.toByteArray( );\r
-    }\r
-\r
-    /**\r
-     * This method must be defined for custom servlet output streams.\r
-     */\r
-    public void write(int data) {\r
-        this.bos.write(data);\r
-    }\r
-\r
-    // BufferedHttpResponseWrapper calls this method\r
-    public void reset( ) {\r
-        this.bos.reset( );\r
-    }\r
-\r
-    // BufferedHttpResponseWrapper calls this method\r
-    public void setBufferSize(int size) {\r
-        // no way to resize an existing ByteArrayOutputStream\r
-        this.bos = new ByteArrayOutputStream(size);\r
-    }\r
+package org.collectionspace.services.common.profile;
+
+import java.io.*;
+import javax.servlet.*;
+
+public class BufferedServletOutputStream extends ServletOutputStream {
+    // the actual buffer
+    private ByteArrayOutputStream bos = new ByteArrayOutputStream( );
+
+    public String getAsString(){
+        byte[] buf = bos.toByteArray();
+        return new String(buf);
+    }
+
+    /**
+     * @return the contents of the buffer.
+     */
+    public byte[] getBuffer( ) {
+        return this.bos.toByteArray( );
+    }
+
+    /**
+     * This method must be defined for custom servlet output streams.
+     */
+    public void write(int data) {
+        this.bos.write(data);
+    }
+
+    // BufferedHttpResponseWrapper calls this method
+    public void reset( ) {
+        this.bos.reset( );
+    }
+
+    // BufferedHttpResponseWrapper calls this method
+    public void setBufferSize(int size) {
+        // no way to resize an existing ByteArrayOutputStream
+        this.bos = new ByteArrayOutputStream(size);
+    }
 }
\ No newline at end of file
index fad825f920f2c284bfd3ff571c998e3a19bc4f5d..e2b2758694e8c84b1edd883e3d292943f0dc66e8 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.profile;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.Filter;\r
-import javax.servlet.FilterChain;\r
-import javax.servlet.FilterConfig;\r
-import javax.servlet.ServletException;\r
-import javax.servlet.ServletRequest;\r
-import javax.servlet.ServletResponse;\r
-import javax.servlet.http.HttpServletRequest;\r
-\r
-import org.collectionspace.services.client.Profiler;\r
-import org.collectionspace.services.common.ServletTools;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * CSpaceFilter.java\r
- *\r
- * A filter that performs specified actions at the time\r
- * each new request is received by the servlet container.\r
- *\r
- * This filter is currently used for recording performance\r
- * metrics for requests to the CollectionSpace services.\r
- *\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- */\r
-public class CSpaceFilter implements Filter {\r
-    final Logger logger = LoggerFactory.getLogger(CSpaceFilter.class);\r
-\r
-    /** The filter config. */\r
-    FilterConfig filterConfig = null;\r
-    private final String CLASS_NAME = this.getClass().getSimpleName();\r
-\r
-    /* (non-Javadoc)\r
-     * @see javax.servlet.Filter#destroy()\r
-     */\r
-    @Override\r
-    public void destroy() {\r
-        // Empty method.\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)\r
-     */\r
-    @Override\r
-    public void doFilter(ServletRequest request, ServletResponse response,\r
-            FilterChain chain) throws IOException, ServletException {\r
-        if (request != null) {\r
-            HttpServletRequest httpRequest = (HttpServletRequest) request;\r
-\r
-            // Instantiate the CollectionSpace services profiler.\r
-            StringBuffer uri = new StringBuffer(httpRequest.getRequestURI());\r
-            uri.append(':');\r
-            uri.append(httpRequest.getMethod());\r
-            Profiler profiler = new Profiler(uri.toString(), 0);\r
-            Profiler csvProfiler = new Profiler("org.collectionspace.perf.csv");\r
-\r
-            // Start timing.\r
-            profiler.start();\r
-\r
-            // Write a CSV-delimited message to the performance log,\r
-            // in a format intended to be interoperable with those\r
-            // generated by other system layers.\r
-            String csvMsg =\r
-                    profiler.getStartTime()\r
-                    + "," + profiler.getElapsedTime()\r
-                    + "," + "request"\r
-                    + "," + "app"\r
-                    + "," + "svc"\r
-                    + "," + httpRequest.getMethod()\r
-                    + "," + ServletTools.getURL(httpRequest)\r
-                    + "," + CLASS_NAME\r
-                    + "," + Thread.currentThread().getName();\r
-           final boolean FORMAT_LOG_MESSAGE = false;\r
-           profiler.log(csvMsg, FORMAT_LOG_MESSAGE);\r
-\r
-            // Process the request.\r
-            chain.doFilter(request, response);\r
-\r
-            // Stop timing and log performance-related metrics.\r
-            profiler.stop();\r
-\r
-            csvMsg =\r
-                    profiler.getStopTime()\r
-                    + "," + profiler.getElapsedTime()\r
-                    + "," + "response"\r
-                    + "," + "svc"\r
-                    + "," + "app"\r
-                    + "," + httpRequest.getMethod()\r
-                    + "," + ServletTools.getURL(httpRequest)\r
-                    + "," + CLASS_NAME\r
-                    + "," + Thread.currentThread().getName();\r
-            profiler.log(csvMsg, FORMAT_LOG_MESSAGE);\r
-\r
-            profiler.reset();\r
-        }\r
-    }\r
-    \r
-    /* (non-Javadoc)\r
-     * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)\r
-     */\r
-    @Override\r
-    public void init(FilterConfig theFilterConfig) throws ServletException {\r
-        filterConfig = theFilterConfig;\r
-        if (filterConfig != null) {\r
-            // We can initialize using the init-params here which we defined in\r
-            // web.xml)\r
-        }\r
-    }\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.profile;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+import org.collectionspace.services.client.Profiler;
+import org.collectionspace.services.common.ServletTools;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * CSpaceFilter.java
+ *
+ * A filter that performs specified actions at the time
+ * each new request is received by the servlet container.
+ *
+ * This filter is currently used for recording performance
+ * metrics for requests to the CollectionSpace services.
+ *
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ */
+public class CSpaceFilter implements Filter {
+    final Logger logger = LoggerFactory.getLogger(CSpaceFilter.class);
+
+    /** The filter config. */
+    FilterConfig filterConfig = null;
+    private final String CLASS_NAME = this.getClass().getSimpleName();
+
+    /* (non-Javadoc)
+     * @see javax.servlet.Filter#destroy()
+     */
+    @Override
+    public void destroy() {
+        // Empty method.
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
+     */
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response,
+            FilterChain chain) throws IOException, ServletException {
+        if (request != null) {
+            HttpServletRequest httpRequest = (HttpServletRequest) request;
+
+            // Instantiate the CollectionSpace services profiler.
+            StringBuffer uri = new StringBuffer(httpRequest.getRequestURI());
+            uri.append(':');
+            uri.append(httpRequest.getMethod());
+            Profiler profiler = new Profiler(uri.toString(), 0);
+            Profiler csvProfiler = new Profiler("org.collectionspace.perf.csv");
+
+            // Start timing.
+            profiler.start();
+
+            // Write a CSV-delimited message to the performance log,
+            // in a format intended to be interoperable with those
+            // generated by other system layers.
+            String csvMsg =
+                    profiler.getStartTime()
+                    + "," + profiler.getElapsedTime()
+                    + "," + "request"
+                    + "," + "app"
+                    + "," + "svc"
+                    + "," + httpRequest.getMethod()
+                    + "," + ServletTools.getURL(httpRequest)
+                    + "," + CLASS_NAME
+                    + "," + Thread.currentThread().getName();
+           final boolean FORMAT_LOG_MESSAGE = false;
+           profiler.log(csvMsg, FORMAT_LOG_MESSAGE);
+
+            // Process the request.
+            chain.doFilter(request, response);
+
+            // Stop timing and log performance-related metrics.
+            profiler.stop();
+
+            csvMsg =
+                    profiler.getStopTime()
+                    + "," + profiler.getElapsedTime()
+                    + "," + "response"
+                    + "," + "svc"
+                    + "," + "app"
+                    + "," + httpRequest.getMethod()
+                    + "," + ServletTools.getURL(httpRequest)
+                    + "," + CLASS_NAME
+                    + "," + Thread.currentThread().getName();
+            profiler.log(csvMsg, FORMAT_LOG_MESSAGE);
+
+            profiler.reset();
+        }
+    }
+    
+    /* (non-Javadoc)
+     * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
+     */
+    @Override
+    public void init(FilterConfig theFilterConfig) throws ServletException {
+        filterConfig = theFilterConfig;
+        if (filterConfig != null) {
+            // We can initialize using the init-params here which we defined in
+            // web.xml)
+        }
+    }
+}
index 1a8501c4b2a07e223d92ffefbc907fce2a29fc51..939f07152f165945c44e6bddbafbd7d1557634a7 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.profile;\r
-\r
-import java.io.IOException;\r
-import java.io.StringReader;\r
-import java.util.Enumeration;\r
-import java.util.Map;\r
-import javax.servlet.Filter;\r
-import javax.servlet.FilterChain;\r
-import javax.servlet.FilterConfig;\r
-import javax.servlet.ServletException;\r
-import javax.servlet.ServletRequest;\r
-import javax.servlet.ServletResponse;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-//import javax.servlet.ServletContext;\r
-\r
-import org.collectionspace.services.common.ServletTools;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- *  Install like this:\r
-    C:\src\trunk\services\JaxRsServiceProvider\src\main\webapp\WEB-INF\web.xml\r
- <filter>\r
-     <filter-name>PayloadFilter</filter-name>\r
-     <filter-class>org.collectionspace.services.common.profile.PayloadFilter</filter-class>\r
- </filter>\r
- <filter-mapping>\r
-     <filter-name>PayloadFilter</filter-name>\r
-     <url-pattern>/*</url-pattern>\r
- </filter-mapping>\r
- */\r
-public class PayloadFilter implements Filter {\r
-    FilterConfig filterConfig = null;\r
-\r
-    public String CRLF = "\r\n";\r
-\r
-    @Override\r
-    public void doFilter(ServletRequest request, ServletResponse response,\r
-            FilterChain chain) throws IOException, ServletException {\r
-        if (request != null) {\r
-            HttpServletRequest httpRequest = (HttpServletRequest) request;\r
-            //String uri = httpRequest.getRequestURI();\r
-            //String method = httpRequest.getMethod();\r
-            RequestWrapper requestWrapper = new RequestWrapper(httpRequest);\r
-            //ResponseWrapper responseWrapper = new ResponseWrapper((HttpServletResponse) response);\r
-\r
-            java.io.PrintWriter out = response.getWriter();\r
-            ResponseWrapper responseWrapper = new ResponseWrapper((HttpServletResponse) response);\r
-\r
-\r
-\r
-            // pass the wrappers on to the next entry\r
-            chain.doFilter(requestWrapper, responseWrapper);\r
-\r
-\r
-\r
-            //StringReader sr = new StringReader(new String(responseWrapper.getData()));\r
-            String rsp = responseWrapper.toString();\r
-            response.setContentLength(rsp.length());\r
-            out.write(rsp);\r
-\r
-            StringBuffer rqd = new StringBuffer();\r
-            StringBuffer rsd = new StringBuffer();\r
-\r
-            rqd.append(httpRequest.getMethod()+' '+ServletTools.getURL(httpRequest)+' '+httpRequest.getProtocol()+CRLF);\r
-            rqd.append(requestWrapper.getHeaderBlock());\r
-            rqd.append(CRLF);\r
-            rqd.append(requestWrapper.getRequestAsString());\r
-            System.out.println("request: =========="+CRLF+rqd.toString());\r
-\r
-            rsd.append(responseWrapper.getResponseLine()+CRLF);\r
-            rsd.append(responseWrapper.getHeaderBlock());\r
-            rsd.append("Content-Length: "+rsp.length());\r
-            rsd.append(CRLF);\r
-            rsd.append(rsp);\r
-            //responseWrapper.getContentType() + responseWrapper.getLocale() + responseWrapper.getResponse().)\r
-            System.out.println("response: =========="+CRLF+rsd.toString());\r
-        }\r
-    }\r
-\r
-    @Override\r
-    public void init(FilterConfig theFilterConfig) throws ServletException {\r
-        filterConfig = theFilterConfig;\r
-        if (filterConfig != null) {\r
-            // We can initialize using the init-params here which we defined in\r
-            // web.xml)\r
-        }\r
-    }\r
-    @Override\r
-\r
-    public void destroy() {\r
-        // Empty method.\r
-    }\r
-\r
-\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.profile;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.Enumeration;
+import java.util.Map;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+//import javax.servlet.ServletContext;
+
+import org.collectionspace.services.common.ServletTools;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *  Install like this:
+    C:\src\trunk\services\JaxRsServiceProvider\src\main\webapp\WEB-INF\web.xml
+ <filter>
+     <filter-name>PayloadFilter</filter-name>
+     <filter-class>org.collectionspace.services.common.profile.PayloadFilter</filter-class>
+ </filter>
+ <filter-mapping>
+     <filter-name>PayloadFilter</filter-name>
+     <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ */
+public class PayloadFilter implements Filter {
+    FilterConfig filterConfig = null;
+
+    public String CRLF = "\r\n";
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response,
+            FilterChain chain) throws IOException, ServletException {
+        if (request != null) {
+            HttpServletRequest httpRequest = (HttpServletRequest) request;
+            //String uri = httpRequest.getRequestURI();
+            //String method = httpRequest.getMethod();
+            RequestWrapper requestWrapper = new RequestWrapper(httpRequest);
+            //ResponseWrapper responseWrapper = new ResponseWrapper((HttpServletResponse) response);
+
+            java.io.PrintWriter out = response.getWriter();
+            ResponseWrapper responseWrapper = new ResponseWrapper((HttpServletResponse) response);
+
+
+
+            // pass the wrappers on to the next entry
+            chain.doFilter(requestWrapper, responseWrapper);
+
+
+
+            //StringReader sr = new StringReader(new String(responseWrapper.getData()));
+            String rsp = responseWrapper.toString();
+            response.setContentLength(rsp.length());
+            out.write(rsp);
+
+            StringBuffer rqd = new StringBuffer();
+            StringBuffer rsd = new StringBuffer();
+
+            rqd.append(httpRequest.getMethod()+' '+ServletTools.getURL(httpRequest)+' '+httpRequest.getProtocol()+CRLF);
+            rqd.append(requestWrapper.getHeaderBlock());
+            rqd.append(CRLF);
+            rqd.append(requestWrapper.getRequestAsString());
+            System.out.println("request: =========="+CRLF+rqd.toString());
+
+            rsd.append(responseWrapper.getResponseLine()+CRLF);
+            rsd.append(responseWrapper.getHeaderBlock());
+            rsd.append("Content-Length: "+rsp.length());
+            rsd.append(CRLF);
+            rsd.append(rsp);
+            //responseWrapper.getContentType() + responseWrapper.getLocale() + responseWrapper.getResponse().)
+            System.out.println("response: =========="+CRLF+rsd.toString());
+        }
+    }
+
+    @Override
+    public void init(FilterConfig theFilterConfig) throws ServletException {
+        filterConfig = theFilterConfig;
+        if (filterConfig != null) {
+            // We can initialize using the init-params here which we defined in
+            // web.xml)
+        }
+    }
+    @Override
+
+    public void destroy() {
+        // Empty method.
+    }
+
+
+
+}
index 0b0f4a9e0348865abd1f309302518e6be82893c3..0e1437738aad983a7302b0384b49cdfd034f6b06 100644 (file)
@@ -1,98 +1,98 @@
-package org.collectionspace.services.common.profile;\r
-\r
-import javax.servlet.*;\r
-import javax.servlet.http.HttpServletRequestWrapper;\r
-import javax.servlet.http.HttpServletRequest;\r
-import java.io.ByteArrayInputStream;\r
-import java.io.ByteArrayOutputStream;\r
-import java.io.IOException;\r
-import java.util.Enumeration;\r
-\r
-public class RequestWrapper extends HttpServletRequestWrapper {\r
-\r
-    ByteArrayInputStream bais;\r
-    ByteArrayOutputStream baos;\r
-    BufferedServletInputStream bufInputStream;\r
-    byte[] buffer;\r
-    HttpServletRequest originalRequest;\r
-\r
-    public RequestWrapper(HttpServletRequest req) throws IOException {\r
-        super(req);\r
-        this.originalRequest = req;\r
-        // Read InputStream and store its content in a buffer.\r
-        java.io.InputStream is = req.getInputStream();\r
-        baos = new ByteArrayOutputStream();\r
-        byte buf[] = new byte[1024];\r
-        int bytesRead;\r
-        while ((bytesRead = is.read(buf)) > 0) baos.write(buf, 0, bytesRead);\r
-        buffer = baos.toByteArray();\r
-    }\r
-\r
-    public ServletInputStream getInputStream() {\r
-        try {\r
-            // Generate a new InputStream by stored buffer\r
-            bais = new ByteArrayInputStream(buffer);\r
-            bufInputStream = new BufferedServletInputStream(bais); //BufferedServletInputStream is our custom class.\r
-        }\r
-        catch (Exception ex) {\r
-            ex.printStackTrace();\r
-        }\r
-        finally {\r
-            return bufInputStream;\r
-        }\r
-    }\r
-    public String getRequestAsString(){\r
-        return new String(buffer);\r
-    }\r
-\r
-    public String getHeaderBlock() {\r
-        StringBuffer b = new StringBuffer();\r
-        for (Enumeration headernames = originalRequest.getHeaderNames(); headernames.hasMoreElements();) {\r
-            String headername = (String) headernames.nextElement();\r
-            b.append(headername + ": " + originalRequest.getHeader(headername) + "\r\n");\r
-        }\r
-        return b.toString();\r
-    }\r
-\r
-}\r
-\r
-\r
- /*\r
-public class POSTFilter {\r
-public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {\r
-        try {\r
-            HttpServletRequest httpRequest = (HttpServletRequest) request;\r
-            RequestWrapper bufferedRequest = new RequestWrapper(httpRequest);\r
-\r
-//Here obtain InputStream to process POST data!\r
-\r
-            InputStream is = bufferedRequest.getInputStream();\r
-\r
-//... some kind of processing on "is"......\r
-\r
-//chain.doFilter using wrapped request!!!!\r
-\r
-            chain.doFilter(bufferedRequest, response);\r
-\r
-//When a chained servlet call request.getInputStream()\r
-\r
-//then the getInputStream() method of RequestWrapper will be invoked\r
-\r
-//and a new readable copy of the original inputStream will be returned!!!\r
-\r
-        }\r
-\r
-        catch (Exception ex) {\r
-\r
-            ex.printStackTrace();\r
-\r
-        }\r
-\r
-    }\r
-\r
-}  */\r
-\r
-\r
-\r
-\r
-\r
+package org.collectionspace.services.common.profile;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletRequest;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Enumeration;
+
+public class RequestWrapper extends HttpServletRequestWrapper {
+
+    ByteArrayInputStream bais;
+    ByteArrayOutputStream baos;
+    BufferedServletInputStream bufInputStream;
+    byte[] buffer;
+    HttpServletRequest originalRequest;
+
+    public RequestWrapper(HttpServletRequest req) throws IOException {
+        super(req);
+        this.originalRequest = req;
+        // Read InputStream and store its content in a buffer.
+        java.io.InputStream is = req.getInputStream();
+        baos = new ByteArrayOutputStream();
+        byte buf[] = new byte[1024];
+        int bytesRead;
+        while ((bytesRead = is.read(buf)) > 0) baos.write(buf, 0, bytesRead);
+        buffer = baos.toByteArray();
+    }
+
+    public ServletInputStream getInputStream() {
+        try {
+            // Generate a new InputStream by stored buffer
+            bais = new ByteArrayInputStream(buffer);
+            bufInputStream = new BufferedServletInputStream(bais); //BufferedServletInputStream is our custom class.
+        }
+        catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        finally {
+            return bufInputStream;
+        }
+    }
+    public String getRequestAsString(){
+        return new String(buffer);
+    }
+
+    public String getHeaderBlock() {
+        StringBuffer b = new StringBuffer();
+        for (Enumeration headernames = originalRequest.getHeaderNames(); headernames.hasMoreElements();) {
+            String headername = (String) headernames.nextElement();
+            b.append(headername + ": " + originalRequest.getHeader(headername) + "\r\n");
+        }
+        return b.toString();
+    }
+
+}
+
+
+ /*
+public class POSTFilter {
+public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
+        try {
+            HttpServletRequest httpRequest = (HttpServletRequest) request;
+            RequestWrapper bufferedRequest = new RequestWrapper(httpRequest);
+
+//Here obtain InputStream to process POST data!
+
+            InputStream is = bufferedRequest.getInputStream();
+
+//... some kind of processing on "is"......
+
+//chain.doFilter using wrapped request!!!!
+
+            chain.doFilter(bufferedRequest, response);
+
+//When a chained servlet call request.getInputStream()
+
+//then the getInputStream() method of RequestWrapper will be invoked
+
+//and a new readable copy of the original inputStream will be returned!!!
+
+        }
+
+        catch (Exception ex) {
+
+            ex.printStackTrace();
+
+        }
+
+    }
+
+}  */
+
+
+
+
+
index 53580f272430c4d761aa2a75bec188f4ac2c0f24..57f97939d841d5f188f8b8619c928ee93c49230a 100644 (file)
-package org.collectionspace.services.common.profile;\r
-\r
-import java.io.*;\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-import javax.servlet.*;\r
-import javax.servlet.http.*;\r
-\r
-public class ResponseWrapper extends HttpServletResponseWrapper {\r
-    private CharArrayWriter output;\r
-    private BufferedServletOutputStream os;\r
-    private boolean gotWriter = false;\r
-    private boolean gotStream = false;\r
-    private Map<String, String> headers = new HashMap<String,String>();\r
-    private int statusCode = 0;\r
-    private String statusMessage = "";\r
-\r
-    public String toString() {\r
-        if (gotWriter) return output.toString();\r
-        else {\r
-            String str = os.getAsString();\r
-            return str;\r
-        }\r
-    }\r
-\r
-    public ResponseWrapper(HttpServletResponse response) {\r
-        super(response);\r
-        output = new CharArrayWriter();\r
-        os = new BufferedServletOutputStream();\r
-    }\r
-\r
-    public PrintWriter getWriter() {\r
-        gotWriter = true;\r
-        return new PrintWriter(output);\r
-    }\r
-\r
-    public ServletOutputStream getOutputStream() {\r
-        gotStream = true;\r
-        return os;\r
-    }\r
-\r
-    public void setHeader(String header, String value){\r
-        System.out.println("###### setHeader ######################## header set: "+header+": "+value);\r
-        headers.put(header, value);\r
-        super.setHeader(header, value);\r
-    }\r
-    public void addHeader(java.lang.String name, java.lang.String value){\r
-        super.addHeader(name, value);\r
-        System.out.println("### addHeader  ########################### header set: "+name+": "+value);\r
-\r
-    }\r
-    public void setIntHeader(java.lang.String name, int value){\r
-        super.setIntHeader(name, value);\r
-        System.out.println("### setIntHeader  ########################### header set: "+name+": "+value);\r
-    }\r
-    public void addIntHeader(java.lang.String name, int value){\r
-        super.addIntHeader(name, value);\r
-        System.out.println("### addIntHeader  ########################### header set: "+name+": "+value);\r
-    }\r
-\r
-\r
-    public void setStatus(int sc, String sm){\r
-        super.setStatus(sc,sm);\r
-        this.statusCode = sc;\r
-        this.statusMessage = sm;\r
-    }\r
-    public void setStatus(int sc){\r
-        super.setStatus(sc);\r
-        this.statusCode = sc;\r
-    }\r
-    public void sendError(int sc) throws java.io.IOException {\r
-        super.sendError(sc);\r
-        this.statusCode = sc;\r
-    }\r
-    public void sendError(int sc, String msg) throws java.io.IOException{\r
-        super.sendError(sc, msg);\r
-        this.statusCode = sc;\r
-        this.statusMessage = msg;\r
-    }\r
-\r
-    public String getStatusMessage(){\r
-        return statusMessage;\r
-    }\r
-    public int getStatusCode(){\r
-        return statusCode;\r
-    }\r
-    public Map getHeaders(){\r
-        return headers;\r
-    }\r
-    public String getHeaderBlock(){\r
-        StringBuffer b = new StringBuffer();\r
-        for(Map.Entry<String, String> e : headers.entrySet()){\r
-            b.append(e.getKey()).append(": ").append(e.getValue()).append("\r\n");\r
-        }\r
-        return b.toString();\r
-    }\r
-    public String getResponseLine(){\r
-        return "HTTP/1.1 "+statusCode+' '+statusMessage;\r
-    }\r
-\r
-}\r
-\r
-/**\r
- * A custom response wrapper that captures all output in a buffer.\r
- */\r
-/*\r
-public class ResponseWrapper extends HttpServletResponseWrapper {\r
-    private BufferedServletOutputStream bufferedServletOut = new BufferedServletOutputStream( );\r
-    private PrintWriter printWriter = null;\r
-    private ServletOutputStream outputStream = null;\r
-\r
-    public ResponseWrapper(HttpServletResponse origResponse) {\r
-        super(origResponse);\r
-    }\r
-\r
-    public String getResponseAsString(){\r
-        return bufferedServletOut.getAsString();\r
-    }\r
-\r
-    public byte[] getBuffer( ) {\r
-        return this.bufferedServletOut.getBuffer( );\r
-    }\r
-\r
-    public PrintWriter getWriter( ) throws IOException {\r
-        if (this.outputStream != null) {\r
-            throw new IllegalStateException(\r
-                    "The Servlet API forbids calling getWriter( ) after"\r
-                    + " getOutputStream( ) has been called");\r
-        }\r
-\r
-        if (this.printWriter == null) {\r
-            this.printWriter = new PrintWriter(this.bufferedServletOut);\r
-        }\r
-        return this.printWriter;\r
-    }\r
-\r
-    public ServletOutputStream getOutputStream( ) throws IOException {\r
-        if (this.printWriter != null) {\r
-            throw new IllegalStateException(\r
-                "The Servlet API forbids calling getOutputStream( ) after"\r
-                + " getWriter( ) has been called");\r
-        }\r
-\r
-        if (this.outputStream == null) {\r
-            this.outputStream = this.bufferedServletOut;\r
-        }\r
-        return this.outputStream;\r
-    }\r
-\r
-    // override methods that deal with the response buffer\r
-\r
-    public void flushBuffer( ) throws IOException {\r
-        if (this.outputStream != null) {\r
-            this.outputStream.flush( );\r
-        } else if (this.printWriter != null) {\r
-            this.printWriter.flush( );\r
-        }\r
-    }\r
-\r
-    public int getBufferSize( ) {\r
-        return this.bufferedServletOut.getBuffer( ).length;\r
-    }\r
-\r
-    public void reset( ) {\r
-        this.bufferedServletOut.reset( );\r
-    }\r
-\r
-    public void resetBuffer( ) {\r
-        this.bufferedServletOut.reset( );\r
-    }\r
-\r
-    public void setBufferSize(int size) {\r
-        this.bufferedServletOut.setBufferSize(size);\r
-    }\r
-}\r
+package org.collectionspace.services.common.profile;
+
+import java.io.*;
+import java.util.HashMap;
+import java.util.Map;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+public class ResponseWrapper extends HttpServletResponseWrapper {
+    private CharArrayWriter output;
+    private BufferedServletOutputStream os;
+    private boolean gotWriter = false;
+    private boolean gotStream = false;
+    private Map<String, String> headers = new HashMap<String,String>();
+    private int statusCode = 0;
+    private String statusMessage = "";
+
+    public String toString() {
+        if (gotWriter) return output.toString();
+        else {
+            String str = os.getAsString();
+            return str;
+        }
+    }
+
+    public ResponseWrapper(HttpServletResponse response) {
+        super(response);
+        output = new CharArrayWriter();
+        os = new BufferedServletOutputStream();
+    }
+
+    public PrintWriter getWriter() {
+        gotWriter = true;
+        return new PrintWriter(output);
+    }
+
+    public ServletOutputStream getOutputStream() {
+        gotStream = true;
+        return os;
+    }
+
+    public void setHeader(String header, String value){
+        System.out.println("###### setHeader ######################## header set: "+header+": "+value);
+        headers.put(header, value);
+        super.setHeader(header, value);
+    }
+    public void addHeader(java.lang.String name, java.lang.String value){
+        super.addHeader(name, value);
+        System.out.println("### addHeader  ########################### header set: "+name+": "+value);
+
+    }
+    public void setIntHeader(java.lang.String name, int value){
+        super.setIntHeader(name, value);
+        System.out.println("### setIntHeader  ########################### header set: "+name+": "+value);
+    }
+    public void addIntHeader(java.lang.String name, int value){
+        super.addIntHeader(name, value);
+        System.out.println("### addIntHeader  ########################### header set: "+name+": "+value);
+    }
+
+
+    public void setStatus(int sc, String sm){
+        super.setStatus(sc,sm);
+        this.statusCode = sc;
+        this.statusMessage = sm;
+    }
+    public void setStatus(int sc){
+        super.setStatus(sc);
+        this.statusCode = sc;
+    }
+    public void sendError(int sc) throws java.io.IOException {
+        super.sendError(sc);
+        this.statusCode = sc;
+    }
+    public void sendError(int sc, String msg) throws java.io.IOException{
+        super.sendError(sc, msg);
+        this.statusCode = sc;
+        this.statusMessage = msg;
+    }
+
+    public String getStatusMessage(){
+        return statusMessage;
+    }
+    public int getStatusCode(){
+        return statusCode;
+    }
+    public Map getHeaders(){
+        return headers;
+    }
+    public String getHeaderBlock(){
+        StringBuffer b = new StringBuffer();
+        for(Map.Entry<String, String> e : headers.entrySet()){
+            b.append(e.getKey()).append(": ").append(e.getValue()).append("\r\n");
+        }
+        return b.toString();
+    }
+    public String getResponseLine(){
+        return "HTTP/1.1 "+statusCode+' '+statusMessage;
+    }
+
+}
+
+/**
+ * A custom response wrapper that captures all output in a buffer.
+ */
+/*
+public class ResponseWrapper extends HttpServletResponseWrapper {
+    private BufferedServletOutputStream bufferedServletOut = new BufferedServletOutputStream( );
+    private PrintWriter printWriter = null;
+    private ServletOutputStream outputStream = null;
+
+    public ResponseWrapper(HttpServletResponse origResponse) {
+        super(origResponse);
+    }
+
+    public String getResponseAsString(){
+        return bufferedServletOut.getAsString();
+    }
+
+    public byte[] getBuffer( ) {
+        return this.bufferedServletOut.getBuffer( );
+    }
+
+    public PrintWriter getWriter( ) throws IOException {
+        if (this.outputStream != null) {
+            throw new IllegalStateException(
+                    "The Servlet API forbids calling getWriter( ) after"
+                    + " getOutputStream( ) has been called");
+        }
+
+        if (this.printWriter == null) {
+            this.printWriter = new PrintWriter(this.bufferedServletOut);
+        }
+        return this.printWriter;
+    }
+
+    public ServletOutputStream getOutputStream( ) throws IOException {
+        if (this.printWriter != null) {
+            throw new IllegalStateException(
+                "The Servlet API forbids calling getOutputStream( ) after"
+                + " getWriter( ) has been called");
+        }
+
+        if (this.outputStream == null) {
+            this.outputStream = this.bufferedServletOut;
+        }
+        return this.outputStream;
+    }
+
+    // override methods that deal with the response buffer
+
+    public void flushBuffer( ) throws IOException {
+        if (this.outputStream != null) {
+            this.outputStream.flush( );
+        } else if (this.printWriter != null) {
+            this.printWriter.flush( );
+        }
+    }
+
+    public int getBufferSize( ) {
+        return this.bufferedServletOut.getBuffer( ).length;
+    }
+
+    public void reset( ) {
+        this.bufferedServletOut.reset( );
+    }
+
+    public void resetBuffer( ) {
+        this.bufferedServletOut.reset( );
+    }
+
+    public void setBufferSize(int size) {
+        this.bufferedServletOut.setBufferSize(size);
+    }
+}
 */
\ No newline at end of file
index b316d3c1bd1e6963e86e7d304496d3fa9b839c1a..1e99e9161c16db2ab2a9a5976f007cc2ec051dc0 100644 (file)
-package org.collectionspace.services.common.query;\r
-\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.DocumentException;\r
-import org.collectionspace.services.common.document.DocumentFilter;\r
-import org.collectionspace.services.common.document.DocumentHandler;\r
-import org.collectionspace.services.common.document.DocumentNotFoundException;\r
-\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;\r
-\r
-// TODO: Auto-generated Javadoc\r
-/**\r
- * The Class QueryContext.\r
- */\r
-public class QueryContext {\r
-\r
-    /** The doc type. */\r
-    String docType;\r
-    /** The doc filter. */\r
-    DocumentFilter docFilter;\r
-    /** The where clause. */\r
-    String whereClause;\r
-    /** The order by clause. */\r
-    String orderByClause;\r
-    /** The domain. */\r
-    String domain;\r
-    /** The tenant id. */\r
-    String tenantId;\r
-\r
-    static public final String getTenantQualifiedDoctype(QueryContext queryContext, String docType) {\r
-       return docType + ServiceContext.TENANT_SUFFIX + queryContext.getTenantId();\r
-    }\r
-    \r
-    /**\r
-     * Instantiates a new query context.\r
-     *\r
-     * @param ctx the ctx\r
-     * @throws DocumentNotFoundException the document not found exception\r
-     * @throws DocumentException the document exception\r
-     */\r
-    QueryContext(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws DocumentNotFoundException, DocumentException {\r
-        docType = ctx.getDocumentType();\r
-        if (docType == null) {\r
-            throw new DocumentNotFoundException(\r
-                    "Unable to find DocumentType for service " + ctx.getServiceName());\r
-        }\r
-        domain = ctx.getRepositoryDomainStorageName();\r
-        tenantId = ctx.getTenantId();\r
-        if (tenantId == null) {\r
-            throw new IllegalArgumentException(\r
-                    "Service context has no Tenant ID specified.");\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Instantiates a new query context.\r
-     *\r
-     * @param ctx the ctx\r
-     * @param theWhereClause the where clause\r
-     * @throws DocumentNotFoundException the document not found exception\r
-     * @throws DocumentException the document exception\r
-     */\r
-    public QueryContext(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            String theWhereClause) throws DocumentNotFoundException, DocumentException {\r
-        this(ctx);\r
-        whereClause = theWhereClause;\r
-    }\r
-    \r
-    /**\r
-     * Instantiates a new query context.\r
-     *\r
-     * @param ctx the ctx\r
-     * @param theWhereClause the where clause\r
-     * @param theOrderByClause the order by clause\r
-     * @throws DocumentNotFoundException the document not found exception\r
-     * @throws DocumentException the document exception\r
-     */\r
-    public QueryContext(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            String theWhereClause, String theOrderByClause) throws DocumentNotFoundException, DocumentException {\r
-        this(ctx);\r
-        whereClause = theWhereClause;\r
-        orderByClause = theOrderByClause;\r
-    }\r
-\r
-    /**\r
-     * Instantiates a new query context.\r
-     *\r
-     * @param ctx the ctx\r
-     * @param handler the handler\r
-     * @throws DocumentNotFoundException the document not found exception\r
-     * @throws DocumentException the document exception\r
-     */\r
-    public QueryContext(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            DocumentHandler handler) throws DocumentNotFoundException, DocumentException {\r
-        this(ctx);\r
-        if (handler == null) {\r
-            throw new IllegalArgumentException(\r
-                    "Document handler is missing.");\r
-        }\r
-        docFilter = handler.getDocumentFilter();\r
-        if (docFilter == null) {\r
-            throw new IllegalArgumentException(\r
-                    "Document handler has no Filter specified.");\r
-        }\r
-        whereClause = docFilter.getWhereClause();\r
-        orderByClause = docFilter.getOrderByClause();\r
-    }\r
-    \r
-    /**\r
-     * Gets the doc filter.\r
-     *\r
-     * @return the doc filter\r
-     */\r
-    public DocumentFilter getDocFilter() {\r
-       return docFilter;\r
-    }\r
-    \r
-    /**\r
-     * Gets the where clause.\r
-     *\r
-     * @return the where clause\r
-     */\r
-    public String getWhereClause() {\r
-       return whereClause;\r
-    }\r
-    \r
-    /**\r
-     * Gets the tenant id.\r
-     *\r
-     * @return the tenant id\r
-     */\r
-    public String getTenantId() {\r
-       return this.tenantId;\r
-    }\r
-    \r
-    /**\r
-     * Gets the order by clause.\r
-     *\r
-     * @return the order by clause\r
-     */\r
-    public String getOrderByClause() {\r
-       return this.orderByClause;\r
-    }\r
-    \r
-    /**\r
-     * Gets the doc type.\r
-     *\r
-     * @return the doc type\r
-     */\r
-    public String getDocType() {\r
-       return this.docType;\r
-    }\r
-    \r
-    public final String getTenantQualifiedDoctype() {\r
-       return QueryContext.getTenantQualifiedDoctype(this, docType);\r
-    }    \r
-\r
-    /**\r
-     * Gets the doc type.\r
-     *\r
-     * @return the doc type\r
-     */\r
-    public void setDocType(String theDocType) {\r
-       this.docType = theDocType;\r
-    }\r
-}\r
+package org.collectionspace.services.common.query;
+
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.DocumentException;
+import org.collectionspace.services.common.document.DocumentFilter;
+import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentNotFoundException;
+
+import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class QueryContext.
+ */
+public class QueryContext {
+
+    /** The doc type. */
+    String docType;
+    /** The doc filter. */
+    DocumentFilter docFilter;
+    /** The where clause. */
+    String whereClause;
+    /** The order by clause. */
+    String orderByClause;
+    /** The domain. */
+    String domain;
+    /** The tenant id. */
+    String tenantId;
+
+    static public final String getTenantQualifiedDoctype(QueryContext queryContext, String docType) {
+       return docType + ServiceContext.TENANT_SUFFIX + queryContext.getTenantId();
+    }
+    
+    /**
+     * Instantiates a new query context.
+     *
+     * @param ctx the ctx
+     * @throws DocumentNotFoundException the document not found exception
+     * @throws DocumentException the document exception
+     */
+    QueryContext(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws DocumentNotFoundException, DocumentException {
+        docType = ctx.getDocumentType();
+        if (docType == null) {
+            throw new DocumentNotFoundException(
+                    "Unable to find DocumentType for service " + ctx.getServiceName());
+        }
+        domain = ctx.getRepositoryDomainStorageName();
+        tenantId = ctx.getTenantId();
+        if (tenantId == null) {
+            throw new IllegalArgumentException(
+                    "Service context has no Tenant ID specified.");
+        }
+    }
+
+    /**
+     * Instantiates a new query context.
+     *
+     * @param ctx the ctx
+     * @param theWhereClause the where clause
+     * @throws DocumentNotFoundException the document not found exception
+     * @throws DocumentException the document exception
+     */
+    public QueryContext(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            String theWhereClause) throws DocumentNotFoundException, DocumentException {
+        this(ctx);
+        whereClause = theWhereClause;
+    }
+    
+    /**
+     * Instantiates a new query context.
+     *
+     * @param ctx the ctx
+     * @param theWhereClause the where clause
+     * @param theOrderByClause the order by clause
+     * @throws DocumentNotFoundException the document not found exception
+     * @throws DocumentException the document exception
+     */
+    public QueryContext(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            String theWhereClause, String theOrderByClause) throws DocumentNotFoundException, DocumentException {
+        this(ctx);
+        whereClause = theWhereClause;
+        orderByClause = theOrderByClause;
+    }
+
+    /**
+     * Instantiates a new query context.
+     *
+     * @param ctx the ctx
+     * @param handler the handler
+     * @throws DocumentNotFoundException the document not found exception
+     * @throws DocumentException the document exception
+     */
+    public QueryContext(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            DocumentHandler handler) throws DocumentNotFoundException, DocumentException {
+        this(ctx);
+        if (handler == null) {
+            throw new IllegalArgumentException(
+                    "Document handler is missing.");
+        }
+        docFilter = handler.getDocumentFilter();
+        if (docFilter == null) {
+            throw new IllegalArgumentException(
+                    "Document handler has no Filter specified.");
+        }
+        whereClause = docFilter.getWhereClause();
+        orderByClause = docFilter.getOrderByClause();
+    }
+    
+    /**
+     * Gets the doc filter.
+     *
+     * @return the doc filter
+     */
+    public DocumentFilter getDocFilter() {
+       return docFilter;
+    }
+    
+    /**
+     * Gets the where clause.
+     *
+     * @return the where clause
+     */
+    public String getWhereClause() {
+       return whereClause;
+    }
+    
+    /**
+     * Gets the tenant id.
+     *
+     * @return the tenant id
+     */
+    public String getTenantId() {
+       return this.tenantId;
+    }
+    
+    /**
+     * Gets the order by clause.
+     *
+     * @return the order by clause
+     */
+    public String getOrderByClause() {
+       return this.orderByClause;
+    }
+    
+    /**
+     * Gets the doc type.
+     *
+     * @return the doc type
+     */
+    public String getDocType() {
+       return this.docType;
+    }
+    
+    public final String getTenantQualifiedDoctype() {
+       return QueryContext.getTenantQualifiedDoctype(this, docType);
+    }    
+
+    /**
+     * Gets the doc type.
+     *
+     * @return the doc type
+     */
+    public void setDocType(String theDocType) {
+       this.docType = theDocType;
+    }
+}
index d59b4a2d8109c0b651ee2100c89bbe729fb33a65..fb46ff2ce4da79501a3268535bb68ac7fad17225 100644 (file)
-/**    \r
- * QueryManager.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.query;\r
-\r
-import org.collectionspace.services.client.IQueryManager;\r
-import org.collectionspace.services.common.ServiceMain;\r
-import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;\r
-import org.collectionspace.services.common.config.TenantBindingUtils;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.query.nuxeo.QueryManagerNuxeoImpl;\r
-import org.collectionspace.services.config.tenant.TenantBindingType;\r
-\r
-public class QueryManager {\r
-       static private final IQueryManager queryManager = new QueryManagerNuxeoImpl();\r
-       \r
-       /**\r
-        * Creates the where clause from keywords.\r
-        * \r
-        * @param keywords the keywords\r
-        * \r
-        * @return the string\r
-        */\r
-       static public String createWhereClauseFromKeywords(String keywords) {\r
-               return queryManager.createWhereClauseFromKeywords(keywords);\r
-       }\r
-       \r
-       static public String createWhereClauseFromAdvancedSearch(String keywords) {\r
-               return queryManager.createWhereClauseFromAdvancedSearch(keywords);\r
-       }\r
-       \r
-       /**\r
-        * Creates the where clause for partial term match.\r
-        * \r
-        * @param field the qualified field to match on\r
-        * @param partialTerm the term to match against\r
-        * \r
-        * @return the string\r
-        */\r
-       static public String createWhereClauseForPartialMatch(ServiceContext ctx,\r
-                       String field,\r
-                       String partialTerm) throws Exception {\r
-               String cspaceInstanceId = ServiceMain.getInstance().getCspaceInstanceId();\r
-               String repositoryName = ctx.getRepositoryName();\r
-        // Otherwise, generate that list and cache it for re-use.\r
-        TenantBindingConfigReaderImpl tReader =\r
-                ServiceMain.getInstance().getTenantBindingConfigReader();\r
-        TenantBindingType tenantBinding = tReader.getTenantBinding(ctx.getTenantId());\r
-        String ptStartingWildcardValue = TenantBindingUtils.getPropertyValue(tenantBinding,\r
-                       IQueryManager.TENANT_USES_STARTING_WILDCARD_FOR_PARTIAL_TERM);\r
-        boolean ptStartingWildcard = (ptStartingWildcardValue==null) \r
-                               || Boolean.parseBoolean(ptStartingWildcardValue);\r
-\r
-               return queryManager.createWhereClauseForPartialMatch(queryManager.getDatasourceName(),\r
-                               repositoryName, cspaceInstanceId, field, ptStartingWildcard, partialTerm);\r
-       }\r
-       \r
-       /**\r
-        * Creates a query to filter a qualified (string) field according to a list of string values. \r
-        * @param qualifiedField The schema-qualified field to filter on\r
-        * @param filterTerms the list of one or more strings to filter on\r
-        * @param fExclude If true, will require qualifiedField NOT match the filters strings.\r
-        *                                      If false, will require qualifiedField does match one of the filters strings.\r
-        * @return queryString\r
-        */\r
-       static public String createWhereClauseToFilterFromStringList(String qualifiedField, String[] filterTerms, boolean fExclude) {\r
-               return queryManager.createWhereClauseToFilterFromStringList(qualifiedField, filterTerms, fExclude);\r
-       }\r
-\r
-       \r
-       /**\r
-        * Creates a filtering where clause from docType, for invocables.\r
-        * \r
-        * @param schema the schema name for this invocable type\r
-        * @param docType the docType\r
-        * \r
-        * @return the string\r
-        */\r
-       static public String createWhereClauseForInvocableByDocType(String schema, String docType) {\r
-               return queryManager.createWhereClauseForInvocableByDocType(schema, docType);\r
-       }\r
-       \r
-       /**\r
-        * Creates a filtering where clause from invocation mode, for invocables.\r
-        * \r
-        * @param schema the schema name for this invocable type\r
-        * @param mode the mode\r
-        * \r
-        * @return the string\r
-        */\r
-       static public String createWhereClauseForInvocableByMode(String schema, String mode) {\r
-               return queryManager.createWhereClauseForInvocableByMode(schema, mode);\r
-       }\r
-       \r
-}\r
+/**    
+ * QueryManager.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.query;
+
+import org.collectionspace.services.client.IQueryManager;
+import org.collectionspace.services.common.ServiceMain;
+import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
+import org.collectionspace.services.common.config.TenantBindingUtils;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.query.nuxeo.QueryManagerNuxeoImpl;
+import org.collectionspace.services.config.tenant.TenantBindingType;
+
+public class QueryManager {
+       static private final IQueryManager queryManager = new QueryManagerNuxeoImpl();
+       
+       /**
+        * Creates the where clause from keywords.
+        * 
+        * @param keywords the keywords
+        * 
+        * @return the string
+        */
+       static public String createWhereClauseFromKeywords(String keywords) {
+               return queryManager.createWhereClauseFromKeywords(keywords);
+       }
+       
+       static public String createWhereClauseFromAdvancedSearch(String keywords) {
+               return queryManager.createWhereClauseFromAdvancedSearch(keywords);
+       }
+       
+       /**
+        * Creates the where clause for partial term match.
+        * 
+        * @param field the qualified field to match on
+        * @param partialTerm the term to match against
+        * 
+        * @return the string
+        */
+       static public String createWhereClauseForPartialMatch(ServiceContext ctx,
+                       String field,
+                       String partialTerm) throws Exception {
+               String cspaceInstanceId = ServiceMain.getInstance().getCspaceInstanceId();
+               String repositoryName = ctx.getRepositoryName();
+        // Otherwise, generate that list and cache it for re-use.
+        TenantBindingConfigReaderImpl tReader =
+                ServiceMain.getInstance().getTenantBindingConfigReader();
+        TenantBindingType tenantBinding = tReader.getTenantBinding(ctx.getTenantId());
+        String ptStartingWildcardValue = TenantBindingUtils.getPropertyValue(tenantBinding,
+                       IQueryManager.TENANT_USES_STARTING_WILDCARD_FOR_PARTIAL_TERM);
+        boolean ptStartingWildcard = (ptStartingWildcardValue==null) 
+                               || Boolean.parseBoolean(ptStartingWildcardValue);
+
+               return queryManager.createWhereClauseForPartialMatch(queryManager.getDatasourceName(),
+                               repositoryName, cspaceInstanceId, field, ptStartingWildcard, partialTerm);
+       }
+       
+       /**
+        * Creates a query to filter a qualified (string) field according to a list of string values. 
+        * @param qualifiedField The schema-qualified field to filter on
+        * @param filterTerms the list of one or more strings to filter on
+        * @param fExclude If true, will require qualifiedField NOT match the filters strings.
+        *                                      If false, will require qualifiedField does match one of the filters strings.
+        * @return queryString
+        */
+       static public String createWhereClauseToFilterFromStringList(String qualifiedField, String[] filterTerms, boolean fExclude) {
+               return queryManager.createWhereClauseToFilterFromStringList(qualifiedField, filterTerms, fExclude);
+       }
+
+       
+       /**
+        * Creates a filtering where clause from docType, for invocables.
+        * 
+        * @param schema the schema name for this invocable type
+        * @param docType the docType
+        * 
+        * @return the string
+        */
+       static public String createWhereClauseForInvocableByDocType(String schema, String docType) {
+               return queryManager.createWhereClauseForInvocableByDocType(schema, docType);
+       }
+       
+       /**
+        * Creates a filtering where clause from invocation mode, for invocables.
+        * 
+        * @param schema the schema name for this invocable type
+        * @param mode the mode
+        * 
+        * @return the string
+        */
+       static public String createWhereClauseForInvocableByMode(String schema, String mode) {
+               return queryManager.createWhereClauseForInvocableByMode(schema, mode);
+       }
+       
+}
index 43ba37ff42724c6f028b8de86b53a3fc5a254acb..2cbb156a5d46ae71f35e07fa64d4db94e512af2a 100644 (file)
@@ -1,54 +1,54 @@
-package org.collectionspace.services.common.query;\r
-\r
-import java.util.List;\r
-import org.collectionspace.services.common.document.DocumentListWrapper;\r
-\r
-// TODO: Auto-generated Javadoc\r
-/**\r
- * The Class QueryResultList.\r
- */\r
-public class QueryResultList<LISTTYPE> {\r
-       \r
-       private long totalSize = 0;\r
-       \r
-       /** The wrapper object list. */\r
-       private LISTTYPE wrapperObjectList;\r
-\r
-       /**\r
-        * Instantiates a new query result list.\r
-        */\r
-       private QueryResultList() {\r
-               //private constructor\r
-       }\r
-       \r
-       /**\r
-        * Instantiates a new query result list.\r
-        *\r
-        * @param theWrapperObjectList the the wrapper object list\r
-        */\r
-       public QueryResultList(LISTTYPE theWrapperObjectList) {\r
-               wrapperObjectList = theWrapperObjectList;\r
-       }\r
-       \r
-       /**\r
-        * Gets the wrapper object list.\r
-        *\r
-        * @return the wrapper object list\r
-        */\r
-       public LISTTYPE getWrapperObjectList() {\r
-               return this.wrapperObjectList;\r
-       }\r
-       \r
-       /**\r
-        * Sets the total size.  This is the total size of the non-paged result set.\r
-        *\r
-        * @param theTotalResultSize the new total size\r
-        */\r
-       public void setTotalSize(long theTotalSize) {\r
-               totalSize = theTotalSize;\r
-       }\r
-\r
-       public long getTotalSize() {\r
-               return totalSize;\r
-       }\r
-}\r
+package org.collectionspace.services.common.query;
+
+import java.util.List;
+import org.collectionspace.services.common.document.DocumentListWrapper;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class QueryResultList.
+ */
+public class QueryResultList<LISTTYPE> {
+       
+       private long totalSize = 0;
+       
+       /** The wrapper object list. */
+       private LISTTYPE wrapperObjectList;
+
+       /**
+        * Instantiates a new query result list.
+        */
+       private QueryResultList() {
+               //private constructor
+       }
+       
+       /**
+        * Instantiates a new query result list.
+        *
+        * @param theWrapperObjectList the the wrapper object list
+        */
+       public QueryResultList(LISTTYPE theWrapperObjectList) {
+               wrapperObjectList = theWrapperObjectList;
+       }
+       
+       /**
+        * Gets the wrapper object list.
+        *
+        * @return the wrapper object list
+        */
+       public LISTTYPE getWrapperObjectList() {
+               return this.wrapperObjectList;
+       }
+       
+       /**
+        * Sets the total size.  This is the total size of the non-paged result set.
+        *
+        * @param theTotalResultSize the new total size
+        */
+       public void setTotalSize(long theTotalSize) {
+               totalSize = theTotalSize;
+       }
+
+       public long getTotalSize() {
+               return totalSize;
+       }
+}
index e9e2f4cb2a98b3eea45343e5323b024c207b0012..604f2f28f0184fc038a66c1ce5dfd081a69ec899 100644 (file)
-/**    \r
- * QueryManagerNuxeoImpl.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.query.nuxeo;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import java.util.regex.Matcher;\r
-import java.util.regex.Pattern;\r
-\r
-//import org.nuxeo.ecm.core.client.NuxeoClient;\r
-\r
-import org.collectionspace.services.jaxb.InvocableJAXBSchema;\r
-//import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;\r
-//import org.collectionspace.services.nuxeo.client.java.NxConnect;\r
-\r
-import org.collectionspace.services.client.IQueryManager;\r
-import org.collectionspace.services.common.invocable.InvocableUtils;\r
-import org.collectionspace.services.common.storage.DatabaseProductType;\r
-import org.collectionspace.services.common.storage.JDBCTools;\r
-\r
-public class QueryManagerNuxeoImpl implements IQueryManager {\r
-\r
-       private static String ECM_FULLTEXT_LIKE = "ecm:fulltext"\r
-                       + SEARCH_TERM_SEPARATOR + IQueryManager.SEARCH_LIKE;\r
-       private static String SEARCH_LIKE_FORM = null;\r
-\r
-       private final Logger logger = LoggerFactory\r
-                       .getLogger(QueryManagerNuxeoImpl.class);\r
-\r
-       // Consider that letters, letter-markers, numbers, '_' and apostrophe are\r
-       // words\r
-       private static Pattern nonWordChars = Pattern\r
-                       .compile("[^\\p{L}\\p{M}\\p{N}_']");\r
-       private static Pattern kwdTokenizer = Pattern.compile("(?:(['\"])(.*?)(?<!\\\\)(?>\\\\\\\\)*\\1|([^ ]+))");\r
-       private static Pattern unescapedDblQuotes = Pattern.compile("(?<!\\\\)\"");\r
-       private static Pattern unescapedSingleQuote = Pattern.compile("(?<!\\\\)'");\r
-       //private static Pattern kwdSearchProblemChars = Pattern.compile("[\\:\\(\\)\\*\\%]");\r
-       // HACK to work around Nuxeo regression that tokenizes on '.'. \r
-       private static Pattern kwdSearchProblemChars = Pattern.compile("[\\:\\(\\)\\*\\%\\.]");\r
-       private static Pattern kwdSearchHyphen = Pattern.compile(" - ");\r
-       private static Pattern advSearchSqlWildcard = Pattern.compile(".*?[I]*LIKE\\s*\\\"\\%\\\".*?");\r
-\r
-\r
-       private static String getLikeForm(String dataSourceName, String repositoryName, String cspaceInstanceId) {\r
-               if (SEARCH_LIKE_FORM == null) {\r
-                       try {\r
-                               DatabaseProductType type = JDBCTools.getDatabaseProductType(dataSourceName, repositoryName, cspaceInstanceId);\r
-                               if (type == DatabaseProductType.MYSQL) {\r
-                                       SEARCH_LIKE_FORM = IQueryManager.SEARCH_LIKE;\r
-                               } else if (type == DatabaseProductType.POSTGRESQL) {\r
-                                       SEARCH_LIKE_FORM = IQueryManager.SEARCH_ILIKE;\r
-                               }\r
-                       } catch (Exception e) {\r
-                               SEARCH_LIKE_FORM = IQueryManager.SEARCH_LIKE;\r
-                       }\r
-               }\r
-               return SEARCH_LIKE_FORM;\r
-       }\r
-\r
-       @Override\r
-       public String getDatasourceName() {\r
-               return JDBCTools.NUXEO_DATASOURCE_NAME;\r
-       }\r
-       \r
-       // TODO: This is currently just an example fixed query. This should\r
-       // eventually be\r
-       // removed or replaced with a more generic method.\r
-       /*\r
-        * (non-Javadoc)\r
-        * \r
-        * @see\r
-        * org.collectionspace.services.common.query.IQueryManager#execQuery(java\r
-        * .lang.String)\r
-        */\r
-       @Override\r
-       @Deprecated\r
-       public void execQuery(String queryString) {\r
-               // Intentionally left blank\r
-       }\r
-\r
-       @Override\r
-       public String createWhereClauseFromAdvancedSearch(String advancedSearch) {\r
-               String result = null;\r
-               //\r
-               // Process search term.  FIXME: REM - Do we need to perform any string filtering here?\r
-               //\r
-               if (advancedSearch != null && !advancedSearch.isEmpty()) {\r
-                        // Filtering of advanced searches on a single '%' char, per CSPACE-5828\r
-                       Matcher regexMatcher = advSearchSqlWildcard.matcher(advancedSearch.trim());\r
-                        if (regexMatcher.matches()) {\r
-                            return "";\r
-                        }\r
-                       StringBuffer advancedSearchWhereClause = new StringBuffer(\r
-                                       advancedSearch);\r
-                       result = advancedSearchWhereClause.toString();\r
-               }\r
-               \r
-               return result;\r
-       }\r
-\r
-       /*\r
-        * (non-Javadoc)\r
-        * \r
-        * @see org.collectionspace.services.common.query.IQueryManager#\r
-        * createWhereClauseFromKeywords(java.lang.String)\r
-        */\r
-       // TODO handle keywords containing escaped punctuation chars, then we need\r
-       // to qualify the\r
-       // search by matching on the fulltext.simpletext field.\r
-       // TODO handle keywords containing unescaped double quotes by matching the\r
-       // phrase\r
-       // against the fulltext.simpletext field.\r
-       // Both these require using JDBC, since we cannot get to the fulltext table\r
-       // in NXQL\r
-       @Override\r
-       public String createWhereClauseFromKeywords(String keywords) {\r
-               String result = null;\r
-               StringBuffer fullTextWhereClause = new StringBuffer();\r
-               // Split on unescaped double quotes to handle phrases\r
-               Matcher regexMatcher = kwdTokenizer.matcher(keywords.trim());\r
-               boolean addNOT = false;\r
-               boolean newWordSet = true;\r
-               while (regexMatcher.find()) {\r
-                       String phrase = regexMatcher.group();\r
-                       // Not needed - already trimmed by split: \r
-                       // String trimmed = phrase.trim();\r
-                       // Ignore empty strings from match, or goofy input\r
-                       if (phrase.isEmpty())\r
-                               continue;\r
-                       // Note we let OR through as is\r
-                       if("AND".equalsIgnoreCase(phrase)) {\r
-                               continue;       // AND is default\r
-                       } else if("NOT".equalsIgnoreCase(phrase)) {\r
-                               addNOT = true;\r
-                               continue;\r
-                       }\r
-                       // Next comment block of questionable value...\r
-                       \r
-                       // ignore the special chars except single quote here - can't hurt\r
-                       // TODO this should become a special function that strips things the\r
-                       // fulltext will ignore, including non-word chars and too-short\r
-                       // words,\r
-                       // and escaping single quotes. Can return a boolean for anything\r
-                       // stripped,\r
-                       // which triggers the back-up search. We can think about whether\r
-                       // stripping\r
-                       // short words not in a quoted phrase should trigger the backup.\r
-                       String escapedAndTrimmed = unescapedSingleQuote.matcher(phrase).replaceAll("\\\\'");\r
-                       // If there are non-word chars in the phrase, we need to match the\r
-                       // phrase exactly against the fulltext table for this object\r
-                       // if(nonWordChars.matcher(trimmed).matches()) {\r
-                       // }\r
-                       // Replace problem chars with spaces. Patches CSPACE-4147,\r
-                       // CSPACE-4106\r
-                       escapedAndTrimmed = kwdSearchProblemChars.matcher(escapedAndTrimmed).replaceAll(" ").trim();\r
-                       escapedAndTrimmed = kwdSearchHyphen.matcher(escapedAndTrimmed).replaceAll(" ").trim();\r
-                       if(escapedAndTrimmed.isEmpty()) {\r
-                               if (logger.isDebugEnabled() == true) {\r
-                                       logger.debug("Phrase reduced to empty after replacements: " + phrase);\r
-                               }\r
-                               continue;\r
-                       }\r
-\r
-                       if (fullTextWhereClause.length()==0) {\r
-                               fullTextWhereClause.append(SEARCH_GROUP_OPEN);\r
-                       }\r
-                       if (newWordSet) {\r
-                               fullTextWhereClause.append(ECM_FULLTEXT_LIKE + "'");\r
-                               newWordSet = false;\r
-                       } else {\r
-                               fullTextWhereClause.append(SEARCH_TERM_SEPARATOR);\r
-                       }\r
-                       if(addNOT) {\r
-                               fullTextWhereClause.append("-");        // Negate the next term\r
-                               addNOT = false;\r
-                       }\r
-                       fullTextWhereClause.append(escapedAndTrimmed);\r
-                       \r
-                       if (logger.isTraceEnabled() == true) {\r
-                               logger.trace("Current built whereClause is: "\r
-                                               + fullTextWhereClause.toString());\r
-                       }\r
-               }\r
-               if (fullTextWhereClause.length()==0) {\r
-                       if (logger.isDebugEnabled() == true) {\r
-                               logger.debug("No usable keywords specified in string:[" + keywords + "]");\r
-                       }\r
-               } else {\r
-                       fullTextWhereClause.append("'" + SEARCH_GROUP_CLOSE);\r
-               }\r
-\r
-               result = fullTextWhereClause.toString();\r
-               if (logger.isDebugEnabled()) {\r
-                       logger.debug("Final built WHERE clause is: " + result);\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-       /*\r
-        * (non-Javadoc)\r
-        * \r
-        * @see org.collectionspace.services.common.query.IQueryManager#\r
-        * createWhereClauseFromKeywords(java.lang.String)\r
-        */\r
-       // TODO handle keywords containing escaped punctuation chars, then we need\r
-       // to qualify the\r
-       // search by matching on the fulltext.simpletext field.\r
-       // TODO handle keywords containing unescaped double quotes by matching the\r
-       // phrase\r
-       // against the fulltext.simpletext field.\r
-       // Both these require using JDBC, since we cannot get to the fulltext table\r
-       // in NXQL\r
-       @Override\r
-       public String createWhereClauseForPartialMatch(String dataSourceName,\r
-                       String repositoryName,\r
-                       String cspaceInstanceId,\r
-                       String field,\r
-                       boolean startingWildcard,\r
-                       String partialTerm) {\r
-               String trimmed = (partialTerm == null) ? "" : partialTerm.trim();\r
-               if (trimmed.isEmpty()) {\r
-                       throw new RuntimeException("No partialTerm specified.");\r
-               }\r
-               if(trimmed.charAt(0) == '*') {\r
-                       if(trimmed.length() == 1) { // only a star is not enough\r
-                               throw new RuntimeException("No partialTerm specified.");\r
-                       }\r
-                       trimmed = trimmed.substring(1);\r
-                       startingWildcard = true;                // force a starting wildcard match\r
-               }\r
-               if (field == null || field.isEmpty()) {\r
-                       throw new RuntimeException("No match field specified.");\r
-               }\r
-                       \r
-               StringBuilder ptClause = new StringBuilder(trimmed.length()+field.length()+20);\r
-               ptClause.append(field);\r
-               ptClause.append(getLikeForm(dataSourceName, repositoryName, cspaceInstanceId));\r
-               ptClause.append(startingWildcard?"'%":"'");\r
-               ptClause.append(unescapedSingleQuote.matcher(trimmed).replaceAll("\\\\'"));\r
-               ptClause.append("%'");\r
-               return ptClause.toString();\r
-       }\r
-\r
-       /**\r
-        * Creates a filtering where clause from docType, for invocables.\r
-        * \r
-        * @param docType\r
-        *            the docType\r
-        * \r
-        * @return the string\r
-        */\r
-       @Override\r
-       public String createWhereClauseForInvocableByDocType(String schema,\r
-                       String docType) {\r
-               String trimmed = (docType == null) ? "" : docType.trim();\r
-               if (trimmed.isEmpty()) {\r
-                       throw new RuntimeException("No docType specified.");\r
-               }\r
-               if (schema == null || schema.isEmpty()) {\r
-                       throw new RuntimeException("No match schema specified.");\r
-               }\r
-               String wClause = schema + ":" + InvocableJAXBSchema.FOR_DOC_TYPES\r
-                               + " = '" + trimmed + "'";\r
-               return wClause;\r
-       }\r
-\r
-       /**\r
-        * Creates a filtering where clause from invocation mode, for invocables.\r
-        * \r
-        * @param mode\r
-        *            the mode\r
-        * \r
-        * @return the string\r
-        */\r
-       @Override\r
-       public String createWhereClauseForInvocableByMode(String schema, String mode) {\r
-               String trimmed = (mode == null) ? "" : mode.trim();\r
-               if (trimmed.isEmpty()) {\r
-                       throw new RuntimeException("No docType specified.");\r
-               }\r
-               if (schema == null || schema.isEmpty()) {\r
-                       throw new RuntimeException("No match schema specified.");\r
-               }\r
-               String wClause = InvocableUtils.getPropertyNameForInvocationMode(\r
-                               schema, trimmed) + " != 0";\r
-               return wClause;\r
-       }\r
-\r
-       /**\r
-        * @param input\r
-        * @return true if there were any chars filtered, that will require a backup\r
-        *         qualifying search on the actual text.\r
-        */\r
-       private boolean filterForFullText(String input) {\r
-               boolean fFilteredChars = false;\r
-\r
-               return fFilteredChars;\r
-       }\r
-       \r
-       /**\r
-        * Creates a query to filter a qualified (string) field according to a list of string values. \r
-        * @param qualifiedField The schema-qualified field to filter on\r
-        * @param filterTerms the list of one or more strings to filter on\r
-        * @param fExclude If true, will require qualifiedField NOT match the filters strings.\r
-        *                                      If false, will require qualifiedField does match one of the filters strings.\r
-        * @return queryString\r
-        */\r
-       @Override\r
-       public String createWhereClauseToFilterFromStringList(String qualifiedField, String[] filterTerms, boolean fExclude) {\r
-       // Start with the qualified termStatus field\r
-       StringBuilder filterClause = new StringBuilder(qualifiedField);\r
-       if (filterTerms.length == 1) {\r
-               filterClause.append(fExclude?" <> '":" = '");\r
-               filterClause.append(filterTerms[0]);\r
-               filterClause.append('\'');  \r
-       } else {\r
-               filterClause.append(fExclude?" NOT IN (":" IN (");\r
-               for(int i=0; i<filterTerms.length; i++) {\r
-                       if(i>0) {\r
-                               filterClause.append(',');\r
-                       }\r
-                       filterClause.append('\'');  \r
-                       filterClause.append(filterTerms[i]);\r
-                       filterClause.append('\'');  \r
-               }\r
-               filterClause.append(')');  \r
-       }\r
-       return filterClause.toString();\r
-       }\r
-\r
-}\r
+/**    
+ * QueryManagerNuxeoImpl.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.query.nuxeo;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+//import org.nuxeo.ecm.core.client.NuxeoClient;
+
+import org.collectionspace.services.jaxb.InvocableJAXBSchema;
+//import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;
+//import org.collectionspace.services.nuxeo.client.java.NxConnect;
+
+import org.collectionspace.services.client.IQueryManager;
+import org.collectionspace.services.common.invocable.InvocableUtils;
+import org.collectionspace.services.common.storage.DatabaseProductType;
+import org.collectionspace.services.common.storage.JDBCTools;
+
+public class QueryManagerNuxeoImpl implements IQueryManager {
+
+       private static String ECM_FULLTEXT_LIKE = "ecm:fulltext"
+                       + SEARCH_TERM_SEPARATOR + IQueryManager.SEARCH_LIKE;
+       private static String SEARCH_LIKE_FORM = null;
+
+       private final Logger logger = LoggerFactory
+                       .getLogger(QueryManagerNuxeoImpl.class);
+
+       // Consider that letters, letter-markers, numbers, '_' and apostrophe are
+       // words
+       private static Pattern nonWordChars = Pattern
+                       .compile("[^\\p{L}\\p{M}\\p{N}_']");
+       private static Pattern kwdTokenizer = Pattern.compile("(?:(['\"])(.*?)(?<!\\\\)(?>\\\\\\\\)*\\1|([^ ]+))");
+       private static Pattern unescapedDblQuotes = Pattern.compile("(?<!\\\\)\"");
+       private static Pattern unescapedSingleQuote = Pattern.compile("(?<!\\\\)'");
+       //private static Pattern kwdSearchProblemChars = Pattern.compile("[\\:\\(\\)\\*\\%]");
+       // HACK to work around Nuxeo regression that tokenizes on '.'. 
+       private static Pattern kwdSearchProblemChars = Pattern.compile("[\\:\\(\\)\\*\\%\\.]");
+       private static Pattern kwdSearchHyphen = Pattern.compile(" - ");
+       private static Pattern advSearchSqlWildcard = Pattern.compile(".*?[I]*LIKE\\s*\\\"\\%\\\".*?");
+
+
+       private static String getLikeForm(String dataSourceName, String repositoryName, String cspaceInstanceId) {
+               if (SEARCH_LIKE_FORM == null) {
+                       try {
+                               DatabaseProductType type = JDBCTools.getDatabaseProductType(dataSourceName, repositoryName, cspaceInstanceId);
+                               if (type == DatabaseProductType.MYSQL) {
+                                       SEARCH_LIKE_FORM = IQueryManager.SEARCH_LIKE;
+                               } else if (type == DatabaseProductType.POSTGRESQL) {
+                                       SEARCH_LIKE_FORM = IQueryManager.SEARCH_ILIKE;
+                               }
+                       } catch (Exception e) {
+                               SEARCH_LIKE_FORM = IQueryManager.SEARCH_LIKE;
+                       }
+               }
+               return SEARCH_LIKE_FORM;
+       }
+
+       @Override
+       public String getDatasourceName() {
+               return JDBCTools.NUXEO_DATASOURCE_NAME;
+       }
+       
+       // TODO: This is currently just an example fixed query. This should
+       // eventually be
+       // removed or replaced with a more generic method.
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.collectionspace.services.common.query.IQueryManager#execQuery(java
+        * .lang.String)
+        */
+       @Override
+       @Deprecated
+       public void execQuery(String queryString) {
+               // Intentionally left blank
+       }
+
+       @Override
+       public String createWhereClauseFromAdvancedSearch(String advancedSearch) {
+               String result = null;
+               //
+               // Process search term.  FIXME: REM - Do we need to perform any string filtering here?
+               //
+               if (advancedSearch != null && !advancedSearch.isEmpty()) {
+                        // Filtering of advanced searches on a single '%' char, per CSPACE-5828
+                       Matcher regexMatcher = advSearchSqlWildcard.matcher(advancedSearch.trim());
+                        if (regexMatcher.matches()) {
+                            return "";
+                        }
+                       StringBuffer advancedSearchWhereClause = new StringBuffer(
+                                       advancedSearch);
+                       result = advancedSearchWhereClause.toString();
+               }
+               
+               return result;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.collectionspace.services.common.query.IQueryManager#
+        * createWhereClauseFromKeywords(java.lang.String)
+        */
+       // TODO handle keywords containing escaped punctuation chars, then we need
+       // to qualify the
+       // search by matching on the fulltext.simpletext field.
+       // TODO handle keywords containing unescaped double quotes by matching the
+       // phrase
+       // against the fulltext.simpletext field.
+       // Both these require using JDBC, since we cannot get to the fulltext table
+       // in NXQL
+       @Override
+       public String createWhereClauseFromKeywords(String keywords) {
+               String result = null;
+               StringBuffer fullTextWhereClause = new StringBuffer();
+               // Split on unescaped double quotes to handle phrases
+               Matcher regexMatcher = kwdTokenizer.matcher(keywords.trim());
+               boolean addNOT = false;
+               boolean newWordSet = true;
+               while (regexMatcher.find()) {
+                       String phrase = regexMatcher.group();
+                       // Not needed - already trimmed by split: 
+                       // String trimmed = phrase.trim();
+                       // Ignore empty strings from match, or goofy input
+                       if (phrase.isEmpty())
+                               continue;
+                       // Note we let OR through as is
+                       if("AND".equalsIgnoreCase(phrase)) {
+                               continue;       // AND is default
+                       } else if("NOT".equalsIgnoreCase(phrase)) {
+                               addNOT = true;
+                               continue;
+                       }
+                       // Next comment block of questionable value...
+                       
+                       // ignore the special chars except single quote here - can't hurt
+                       // TODO this should become a special function that strips things the
+                       // fulltext will ignore, including non-word chars and too-short
+                       // words,
+                       // and escaping single quotes. Can return a boolean for anything
+                       // stripped,
+                       // which triggers the back-up search. We can think about whether
+                       // stripping
+                       // short words not in a quoted phrase should trigger the backup.
+                       String escapedAndTrimmed = unescapedSingleQuote.matcher(phrase).replaceAll("\\\\'");
+                       // If there are non-word chars in the phrase, we need to match the
+                       // phrase exactly against the fulltext table for this object
+                       // if(nonWordChars.matcher(trimmed).matches()) {
+                       // }
+                       // Replace problem chars with spaces. Patches CSPACE-4147,
+                       // CSPACE-4106
+                       escapedAndTrimmed = kwdSearchProblemChars.matcher(escapedAndTrimmed).replaceAll(" ").trim();
+                       escapedAndTrimmed = kwdSearchHyphen.matcher(escapedAndTrimmed).replaceAll(" ").trim();
+                       if(escapedAndTrimmed.isEmpty()) {
+                               if (logger.isDebugEnabled() == true) {
+                                       logger.debug("Phrase reduced to empty after replacements: " + phrase);
+                               }
+                               continue;
+                       }
+
+                       if (fullTextWhereClause.length()==0) {
+                               fullTextWhereClause.append(SEARCH_GROUP_OPEN);
+                       }
+                       if (newWordSet) {
+                               fullTextWhereClause.append(ECM_FULLTEXT_LIKE + "'");
+                               newWordSet = false;
+                       } else {
+                               fullTextWhereClause.append(SEARCH_TERM_SEPARATOR);
+                       }
+                       if(addNOT) {
+                               fullTextWhereClause.append("-");        // Negate the next term
+                               addNOT = false;
+                       }
+                       fullTextWhereClause.append(escapedAndTrimmed);
+                       
+                       if (logger.isTraceEnabled() == true) {
+                               logger.trace("Current built whereClause is: "
+                                               + fullTextWhereClause.toString());
+                       }
+               }
+               if (fullTextWhereClause.length()==0) {
+                       if (logger.isDebugEnabled() == true) {
+                               logger.debug("No usable keywords specified in string:[" + keywords + "]");
+                       }
+               } else {
+                       fullTextWhereClause.append("'" + SEARCH_GROUP_CLOSE);
+               }
+
+               result = fullTextWhereClause.toString();
+               if (logger.isDebugEnabled()) {
+                       logger.debug("Final built WHERE clause is: " + result);
+               }
+
+               return result;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.collectionspace.services.common.query.IQueryManager#
+        * createWhereClauseFromKeywords(java.lang.String)
+        */
+       // TODO handle keywords containing escaped punctuation chars, then we need
+       // to qualify the
+       // search by matching on the fulltext.simpletext field.
+       // TODO handle keywords containing unescaped double quotes by matching the
+       // phrase
+       // against the fulltext.simpletext field.
+       // Both these require using JDBC, since we cannot get to the fulltext table
+       // in NXQL
+       @Override
+       public String createWhereClauseForPartialMatch(String dataSourceName,
+                       String repositoryName,
+                       String cspaceInstanceId,
+                       String field,
+                       boolean startingWildcard,
+                       String partialTerm) {
+               String trimmed = (partialTerm == null) ? "" : partialTerm.trim();
+               if (trimmed.isEmpty()) {
+                       throw new RuntimeException("No partialTerm specified.");
+               }
+               if(trimmed.charAt(0) == '*') {
+                       if(trimmed.length() == 1) { // only a star is not enough
+                               throw new RuntimeException("No partialTerm specified.");
+                       }
+                       trimmed = trimmed.substring(1);
+                       startingWildcard = true;                // force a starting wildcard match
+               }
+               if (field == null || field.isEmpty()) {
+                       throw new RuntimeException("No match field specified.");
+               }
+                       
+               StringBuilder ptClause = new StringBuilder(trimmed.length()+field.length()+20);
+               ptClause.append(field);
+               ptClause.append(getLikeForm(dataSourceName, repositoryName, cspaceInstanceId));
+               ptClause.append(startingWildcard?"'%":"'");
+               ptClause.append(unescapedSingleQuote.matcher(trimmed).replaceAll("\\\\'"));
+               ptClause.append("%'");
+               return ptClause.toString();
+       }
+
+       /**
+        * Creates a filtering where clause from docType, for invocables.
+        * 
+        * @param docType
+        *            the docType
+        * 
+        * @return the string
+        */
+       @Override
+       public String createWhereClauseForInvocableByDocType(String schema,
+                       String docType) {
+               String trimmed = (docType == null) ? "" : docType.trim();
+               if (trimmed.isEmpty()) {
+                       throw new RuntimeException("No docType specified.");
+               }
+               if (schema == null || schema.isEmpty()) {
+                       throw new RuntimeException("No match schema specified.");
+               }
+               String wClause = schema + ":" + InvocableJAXBSchema.FOR_DOC_TYPES
+                               + " = '" + trimmed + "'";
+               return wClause;
+       }
+
+       /**
+        * Creates a filtering where clause from invocation mode, for invocables.
+        * 
+        * @param mode
+        *            the mode
+        * 
+        * @return the string
+        */
+       @Override
+       public String createWhereClauseForInvocableByMode(String schema, String mode) {
+               String trimmed = (mode == null) ? "" : mode.trim();
+               if (trimmed.isEmpty()) {
+                       throw new RuntimeException("No docType specified.");
+               }
+               if (schema == null || schema.isEmpty()) {
+                       throw new RuntimeException("No match schema specified.");
+               }
+               String wClause = InvocableUtils.getPropertyNameForInvocationMode(
+                               schema, trimmed) + " != 0";
+               return wClause;
+       }
+
+       /**
+        * @param input
+        * @return true if there were any chars filtered, that will require a backup
+        *         qualifying search on the actual text.
+        */
+       private boolean filterForFullText(String input) {
+               boolean fFilteredChars = false;
+
+               return fFilteredChars;
+       }
+       
+       /**
+        * Creates a query to filter a qualified (string) field according to a list of string values. 
+        * @param qualifiedField The schema-qualified field to filter on
+        * @param filterTerms the list of one or more strings to filter on
+        * @param fExclude If true, will require qualifiedField NOT match the filters strings.
+        *                                      If false, will require qualifiedField does match one of the filters strings.
+        * @return queryString
+        */
+       @Override
+       public String createWhereClauseToFilterFromStringList(String qualifiedField, String[] filterTerms, boolean fExclude) {
+       // Start with the qualified termStatus field
+       StringBuilder filterClause = new StringBuilder(qualifiedField);
+       if (filterTerms.length == 1) {
+               filterClause.append(fExclude?" <> '":" = '");
+               filterClause.append(filterTerms[0]);
+               filterClause.append('\'');  
+       } else {
+               filterClause.append(fExclude?" NOT IN (":" IN (");
+               for(int i=0; i<filterTerms.length; i++) {
+                       if(i>0) {
+                               filterClause.append(',');
+                       }
+                       filterClause.append('\'');  
+                       filterClause.append(filterTerms[i]);
+                       filterClause.append('\'');  
+               }
+               filterClause.append(')');  
+       }
+       return filterClause.toString();
+       }
+
+}
index 3d4d01fa3f81a1000de5fb619c4ec552dadf6ab2..b125cc06912e117e556553cade2e5535c2fca001 100644 (file)
@@ -1,64 +1,64 @@
-/**    \r
- * RelationJAXBSchema.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.relation;\r
-\r
-import org.collectionspace.services.client.IRelationsManager;\r
-\r
-/**\r
- * The Interface RelationJAXBSchema.\r
- */\r
-public interface RelationJAXBSchema {\r
-       \r
-       // The Nuxeo root element name for the relation entity.\r
-       /** The Constant REL_ROOT_ELEM_NAME. */\r
-       final static String REL_ROOT_ELEM_NAME = "relationtype";\r
-       // Need to fix conflict between the Nuxeo XSD and the JAX-B XSD for the "relation" entity\r
-       \r
-       /** The Constant CSID. */\r
-       final static String CSID = "csid";\r
-       \r
-       /** The Constant RELATIONSHIP_TYPE. */\r
-       final static String RELATIONSHIP_TYPE = "relationshipType";\r
-       \r
-       /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */\r
-       final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName";\r
-        \r
-        final static String RELATIONSHIP_META_TYPE = "relationshipMetaType";\r
-\r
-    final static String SUBJECT_URI =          "subjectUri";\r
-    final static String SUBJECT_CSID =         IRelationsManager.SUBJECT;\r
-    final static String SUBJECT_REFNAME =      IRelationsManager.SUBJECT_REFNAME;\r
-    final static String SUBJECT_DOCTYPE =      "subjectDocumentType";\r
-\r
-    final static String OBJECT_URI =           "objectUri";\r
-    final static String OBJECT_CSID =          IRelationsManager.OBJECT;\r
-    final static String OBJECT_REFNAME =       IRelationsManager.OBJECT_REFNAME;\r
-    final static String OBJECT_DOCTYPE =       "objectDocumentType";\r
-\r
-}\r
-\r
-\r
+/**    
+ * RelationJAXBSchema.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.relation;
+
+import org.collectionspace.services.client.IRelationsManager;
+
+/**
+ * The Interface RelationJAXBSchema.
+ */
+public interface RelationJAXBSchema {
+       
+       // The Nuxeo root element name for the relation entity.
+       /** The Constant REL_ROOT_ELEM_NAME. */
+       final static String REL_ROOT_ELEM_NAME = "relationtype";
+       // Need to fix conflict between the Nuxeo XSD and the JAX-B XSD for the "relation" entity
+       
+       /** The Constant CSID. */
+       final static String CSID = "csid";
+       
+       /** The Constant RELATIONSHIP_TYPE. */
+       final static String RELATIONSHIP_TYPE = "relationshipType";
+       
+       /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */
+       final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName";
+        
+        final static String RELATIONSHIP_META_TYPE = "relationshipMetaType";
+
+    final static String SUBJECT_URI =          "subjectUri";
+    final static String SUBJECT_CSID =         IRelationsManager.SUBJECT;
+    final static String SUBJECT_REFNAME =      IRelationsManager.SUBJECT_REFNAME;
+    final static String SUBJECT_DOCTYPE =      "subjectDocumentType";
+
+    final static String OBJECT_URI =           "objectUri";
+    final static String OBJECT_CSID =          IRelationsManager.OBJECT;
+    final static String OBJECT_REFNAME =       IRelationsManager.OBJECT_REFNAME;
+    final static String OBJECT_DOCTYPE =       "objectDocumentType";
+
+}
+
+
index b044aa5cafe9d62b7b0108cc435b8bc7fab66009..8eb6e01a728b9e5255746ad28ab27b747eaed0f6 100644 (file)
@@ -1,49 +1,49 @@
-/**    \r
- * RelationListItemJAXBSchema.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.relation;\r
-\r
-/**\r
- * The Interface RelationListItemJAXBSchema.\r
- */\r
-public interface RelationListItemJAXBSchema {\r
-       \r
-       /** The Constant REL_ROOT_ELEM_NAME. */\r
-       final static String REL_ROOT_ELEM_NAME = "relation-list";\r
-       \r
-       /** The Constant CSID. */\r
-       final static String CSID = "csid";\r
-       \r
-       final static String SUBJECT_CSID = "subjectCsid";\r
-       final static String RELATIONSHIP_TYPE = "relationshipType";\r
-       final static String OBJECT_CSID = "objectCsid";\r
-       \r
-       /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */\r
-       final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName";\r
-\r
-       /** The Constant URI. */\r
-       final static String URI = "url";\r
-}\r
+/**    
+ * RelationListItemJAXBSchema.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.relation;
+
+/**
+ * The Interface RelationListItemJAXBSchema.
+ */
+public interface RelationListItemJAXBSchema {
+       
+       /** The Constant REL_ROOT_ELEM_NAME. */
+       final static String REL_ROOT_ELEM_NAME = "relation-list";
+       
+       /** The Constant CSID. */
+       final static String CSID = "csid";
+       
+       final static String SUBJECT_CSID = "subjectCsid";
+       final static String RELATIONSHIP_TYPE = "relationshipType";
+       final static String OBJECT_CSID = "objectCsid";
+       
+       /** The Constant RELATIONSHIP_TYPE_DISPLAYNAME. */
+       final static String RELATIONSHIP_TYPE_DISPLAYNAME = "predicateDisplayName";
+
+       /** The Constant URI. */
+       final static String URI = "url";
+}
index a647b07571e1b4c09988e7cef5008dd0d7e92c41..68045aed71dc0457e6e164b86ffdf100071836c3 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.common.storage;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.config.ConfigUtils;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import javax.naming.Context;\r
-import javax.naming.InitialContext;\r
-import javax.naming.NamingException;\r
-import javax.sql.DataSource;\r
-\r
-import java.sql.DatabaseMetaData;\r
-import java.sql.Connection;\r
-import java.sql.DriverManager;\r
-import java.sql.PreparedStatement;\r
-import java.sql.ResultSet;\r
-import java.sql.ResultSetMetaData;\r
-import java.sql.SQLException;\r
-import java.sql.Statement;\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-\r
-import javax.sql.rowset.CachedRowSet;\r
-import javax.sql.rowset.RowSetFactory;\r
-import javax.sql.rowset.RowSetProvider;\r
-\r
-import org.apache.tomcat.dbcp.dbcp.BasicDataSource;\r
-import org.collectionspace.services.common.ServiceMain;\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class JDBCTools {\r
-    public static HashMap<String, DataSource> cachedDataSources = new HashMap<String, DataSource>();\r
-    public static String CSPACE_DATASOURCE_NAME = "CspaceDS";\r
-    public static String NUXEO_DATASOURCE_NAME = "NuxeoDS";\r
-    // Default database names\r
-    // public static String DEFAULT_CSPACE_DATABASE_NAME = ConfigUtils.DEFAULT_CSPACE_DATABASE_NAME;\r
-    public static String DEFAULT_NUXEO_REPOSITORY_NAME = ConfigUtils.DEFAULT_NUXEO_REPOSITORY_NAME;\r
-    public static String DEFAULT_NUXEO_DATABASE_NAME = ConfigUtils.DEFAULT_NUXEO_DATABASE_NAME;\r
-    public static String CSADMIN_DATASOURCE_NAME = "CsadminDS";\r
-    public static String NUXEO_READER_DATASOURCE_NAME = "NuxeoReaderDS";\r
-    public static String NUXEO_USER_NAME = "nuxeo";\r
-    public static String SQL_WILDCARD = "%";\r
-    public static String DATABASE_SELECT_PRIVILEGE_NAME = "SELECT";\r
-\r
-    \r
-    //\r
-    // Private constants\r
-    //\r
-    private static String DBProductName = null;\r
-\r
-    //todo: make sure this will get instantiated in the right order\r
-    final static Logger logger = LoggerFactory.getLogger(JDBCTools.class);\r
-       private static final CharSequence URL_DATABASE_NAME = "${DatabaseName}";\r
-    private static String JDBC_URL_DATABASE_SEPARATOR = "\\/";\r
-        \r
-       //\r
-       // As a side-effect of calling JDBCTools.getDataSource(...), the DataSource instance will be\r
-       // cached in a static hash map of the JDBCTools class.  This will speed up lookups as well as protect our\r
-       // code from JNDI lookup problems -for example, if the JNDI context gets stepped on or corrupted.\r
-       //    \r
-    public static DataSource getDataSource(String dataSourceName) throws NamingException {\r
-       DataSource result = null;\r
-       \r
-       //\r
-       // First, see if we already have this DataSource instance cached\r
-       //\r
-       result = cachedDataSources.get(dataSourceName);\r
-       if (result == null) {           \r
-               InitialContext ctx = new InitialContext();\r
-               Context envCtx = null;\r
-\r
-               if (logger.isDebugEnabled() == true) {\r
-                       logger.debug("Looking up DataSource instance in JNDI with name: " + dataSourceName);\r
-               }\r
-                       \r
-               try {\r
-                       envCtx = (Context) ctx.lookup("java:comp/env");\r
-                       DataSource ds = (DataSource) envCtx.lookup("jdbc/" + dataSourceName);\r
-                       if (ds == null) {\r
-                           throw new IllegalArgumentException("DataSource instance not found: " + dataSourceName);\r
-                       } else {\r
-                               result = ds;\r
-                               // now cache this DataSource instance for future references\r
-                               cachedDataSources.put(dataSourceName, result);\r
-                       }\r
-               } finally {\r
-                   if (ctx != null) {\r
-                       try {\r
-                           ctx.close();\r
-                       } catch (Exception e) {\r
-                               logger.error("Error getting DataSource for: " + dataSourceName, e);\r
-                       }\r
-                   }\r
-                   if (envCtx != null) {\r
-                       try {\r
-                               envCtx.close();\r
-                       } catch (Exception e) {\r
-                               logger.error("Error getting DataSource for: " + dataSourceName, e);\r
-                       }\r
-                   }\r
-               }\r
-       }\r
-       \r
-       if (result != null) {\r
-//             DataSource resultClone = result.\r
-       }\r
-       \r
-       return result;\r
-    }\r
-    \r
-    //\r
-    // Use this version of the getConnection() method when you don't want to qualify the database name\r
-    // with a CollectionSpace instance ID.\r
-    //\r
-    public static Connection getConnection(String dataSourceName,\r
-               String databaseName) throws NamingException, SQLException {\r
-       return getConnection(dataSourceName, databaseName, null);\r
-    }\r
-    \r
-    public static Connection getConnection(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId) throws NamingException, SQLException {\r
-       Connection result = null;\r
-       \r
-       if (Tools.isEmpty(dataSourceName) || Tools.isEmpty(repositoryName)) {\r
-               String errMsg = String.format(\r
-                               "The getConnection() method was called with an empty or null repository name = '%s' and/or data source name = '%s'.", \r
-                               dataSourceName, repositoryName);\r
-            logger.error(errMsg);\r
-            throw new NamingException(errMsg);\r
-        }\r
-               \r
-       /*\r
-        * We synch this block as a workaround to not have separate DataSource instances for\r
-        * each Nuxeo repo/DB.  Ideally, we should replace the need for this synch block by\r
-        * registering a separate DataSource for each repo/db at init/start-up time.\r
-        * \r
-        * We need to sync because we're changing the URL of the datasource inorder to get the correct\r
-        * connection.  The synch prevents different threads from getting the incorrect connection -i.e., one pointing\r
-        * to the wrong URL.\r
-        */\r
-       Connection conn = null;\r
-       synchronized (JDBCTools.class) {\r
-               BasicDataSource dataSource = (BasicDataSource)getDataSource(dataSourceName);\r
-               // Get the template URL value from the JNDI datasource and substitute the databaseName\r
-               String urlTemplate = dataSource.getUrl();\r
-               String databaseName = getDatabaseName(repositoryName, cspaceInstanceId);\r
-               String connectionUrl = urlTemplate.replace(URL_DATABASE_NAME, databaseName);\r
-\r
-               // ATTENTION!\r
-               // Turns out the Tomcat BasicDataSource used a connection pool, so changing the url does not\r
-               // get you a corresponding connection. Use the more basic implementation for now, unless\r
-               // and until we do things right by creating additional JNDI data sources.\r
-               \r
-               //dataSource.setUrl(connectionUrl);\r
-               String user = dataSource.getUsername();\r
-               String password = dataSource.getPassword();\r
-               \r
-               try {\r
-                       //conn = dataSource.getConnection();\r
-                       conn = DriverManager.getConnection(connectionUrl, user, password);\r
-                       result = conn;\r
-                       if (logger.isTraceEnabled() == true && conn != null) {\r
-                               logger.trace(String.format("Connection made to repository = '%s' using datasource = '%s'", repositoryName, dataSourceName));\r
-                       }\r
-               } finally {\r
-                       dataSource.setUrl(urlTemplate); // Reset the data source URL value back to the template value\r
-               }\r
-       }\r
-               \r
-        return result;\r
-    }\r
-\r
-    public static CachedRowSet executeQuery(String dataSourceName, String repositoryName, String cspaceInstanceId, String sql) throws Exception {\r
-        Connection conn = null;\r
-        Statement stmt = null;\r
-        try {\r
-            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);\r
-            stmt = conn.createStatement();\r
-             \r
-            RowSetFactory rowSetFactory = RowSetProvider.newFactory();\r
-            CachedRowSet crs = rowSetFactory.createCachedRowSet();\r
-\r
-            stmt = conn.createStatement();\r
-            try (ResultSet resultSet = stmt.executeQuery(sql)) {\r
-                crs.populate(resultSet);\r
-            }\r
-            return crs;\r
-        } catch (SQLException sqle) {\r
-            SQLException tempException = sqle;\r
-            while (null != tempException) {       // SQLExceptions can be chained. Loop to log all.\r
-                logger.debug("SQL Exception: " + sqle.getLocalizedMessage());\r
-                tempException = tempException.getNextException();\r
-            }\r
-            throw new RuntimeException("SQL Exception in executeQuery: ", sqle);\r
-        } finally {\r
-            try {\r
-                if (stmt != null) {\r
-                    stmt.close();\r
-                }\r
-                if (conn != null) {\r
-                    conn.close();\r
-                }\r
-            } catch (SQLException sqle) {\r
-                logger.debug("SQL Exception closing statement/connection in executeQuery: " + sqle.getLocalizedMessage());\r
-                return null;\r
-            }\r
-        }\r
-    }\r
-    \r
-    public static CachedRowSet executePreparedQuery(final PreparedStatementBuilder builder,\r
-            String dataSourceName, String repositoryName, String cspaceInstanceId) throws Exception {\r
-        Connection conn = null;\r
-        PreparedStatement ps = null;\r
-        try {\r
-            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);\r
-            RowSetFactory rowSetFactory = RowSetProvider.newFactory();\r
-            CachedRowSet crs = rowSetFactory.createCachedRowSet();\r
-            ps = builder.build(conn);\r
-            // FIXME: transition this log statement to DEBUG level when appropriate\r
-            if (logger.isInfoEnabled()) {\r
-                logger.info("prepared statement=" + ps.toString());\r
-            }\r
-            try (ResultSet resultSet = ps.executeQuery()) {\r
-                crs.populate(resultSet);\r
-            }\r
-            return crs;\r
-        } catch (SQLException sqle) {\r
-            SQLException tempException = sqle;\r
-            while (null != tempException) {       // SQLExceptions can be chained. Loop to log all.\r
-                logger.debug("SQL Exception: " + sqle.getLocalizedMessage());\r
-                tempException = tempException.getNextException();\r
-            }\r
-            throw new RuntimeException("SQL Exception in executePreparedQuery: ", sqle);\r
-        } finally {\r
-            try {\r
-                if (ps != null) {\r
-                    ps.close();\r
-                }\r
-                if (conn != null) {\r
-                    conn.close();\r
-                }\r
-            } catch (SQLException sqle) {\r
-                logger.debug("SQL Exception closing statement/connection in executePreparedQuery: " + sqle.getLocalizedMessage());\r
-                return null;\r
-            }\r
-        }\r
-    }\r
-    \r
-    // FIXME: This method's code significantly overlaps that of executePrepareQuery(), above,\r
-    // and the two could be refactored into a single method, if desired.\r
-    public static List<CachedRowSet> executePreparedQueries(final List<PreparedStatementBuilder> builders,\r
-            String dataSourceName, String repositoryName, String cspaceInstanceId, Boolean executeWithinTransaction) throws Exception {\r
-        Connection conn = null;\r
-        PreparedStatement ps = null;\r
-        List<CachedRowSet> results = new ArrayList<>();\r
-        try {\r
-            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);\r
-            if (executeWithinTransaction) {\r
-                conn.setAutoCommit(false);\r
-            }\r
-            RowSetFactory rowSetFactory = RowSetProvider.newFactory();\r
-            CachedRowSet crs = rowSetFactory.createCachedRowSet();\r
-            int statementCount = 0;\r
-            for (PreparedStatementBuilder builder : builders) {\r
-                ps = builder.build(conn);\r
-                // FIXME: transition this log statement to DEBUG level when appropriate\r
-                if (logger.isInfoEnabled()) {\r
-                    statementCount++;\r
-                    logger.info("prepared statement " + statementCount + "=" + ps.toString());\r
-                }\r
-                // Try executing each statement, first as a query, then as an update\r
-                try {\r
-                    ResultSet resultSet = ps.executeQuery();\r
-                    if (resultSet != null) {\r
-                        crs.populate(resultSet);\r
-                        results.add(crs);\r
-                    }\r
-                } catch (Exception e) {\r
-                    int rowcount = ps.executeUpdate();\r
-                       logger.debug(String.format("Row count for builder %s is %d", ps.toString(), rowcount));\r
-                    // Throw uncaught exception here if update attempt also fails\r
-                }\r
-            }\r
-            return results;\r
-        } catch (SQLException sqle) {\r
-            if (executeWithinTransaction && conn != null) {\r
-                conn.rollback();\r
-            }\r
-            SQLException tempException = sqle;\r
-            while (null != tempException) {       // SQLExceptions can be chained. Loop to log all.\r
-                logger.debug("SQL Exception: " + sqle.getLocalizedMessage());\r
-                tempException = tempException.getNextException();\r
-            }\r
-            throw new RuntimeException("SQL Exception in executePreparedQueries: ", sqle);\r
-        } finally {\r
-            try {\r
-                if (ps != null) {\r
-                    ps.close();\r
-                }\r
-                if (conn != null) {\r
-                    if (executeWithinTransaction) {\r
-                        conn.commit();\r
-                    }\r
-                    conn.close();\r
-                }\r
-            } catch (SQLException sqle) {\r
-                logger.debug("SQL Exception closing statement/connection in executePreparedQueries: " + sqle.getLocalizedMessage());\r
-                return null;\r
-            }\r
-        }\r
-    }\r
-\r
-    public static int executeUpdate(String dataSourceName,\r
-               String repositoryName, \r
-               String cspaceInstanceId, \r
-               String sql) throws Exception {\r
-        Connection conn = null;\r
-        Statement stmt = null;\r
-        try {\r
-            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);\r
-            stmt = conn.createStatement();\r
-            int rows = stmt.executeUpdate(sql);\r
-            stmt.close();\r
-            return rows;\r
-        } catch (RuntimeException rte) {\r
-            logger.debug("Exception in executeUpdate: " + rte.getLocalizedMessage());\r
-            logger.debug(rte.getStackTrace().toString());\r
-            throw rte;\r
-        } catch (SQLException sqle) {\r
-            SQLException tempException = sqle;\r
-            String msg = "";\r
-            while (null != tempException) {       // SQLExceptions can be chained. Loop to log all.\r
-                if (!msg.isEmpty()) {\r
-                    msg = msg + "::next::";\r
-                }\r
-                msg = msg + sqle.getLocalizedMessage();\r
-                logger.debug("SQL Exception: " + msg);\r
-                tempException = tempException.getNextException();\r
-            }\r
-            throw new RuntimeException("SQL Exception in executeUpdate: " + msg, sqle);\r
-        } finally {\r
-            try {\r
-                if (stmt != null) {\r
-                    stmt.close();\r
-                }\r
-                if (conn != null) {\r
-                    conn.close();\r
-                }\r
-            } catch (SQLException sqle) {\r
-                logger.debug("SQL Exception closing statement/connection in executeUpdate: " + sqle.getLocalizedMessage());\r
-                return -1;\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Returns the database product name, from the metadata for a\r
-     * JDBC connection to the default repository.\r
-     * \r
-     * Assumes that the database product name will be the same for the\r
-     * default repository and for all other repositories to which JDBC\r
-     * connections will be made, through the methods of this class.\r
-     * \r
-     * @return the database product name\r
-     */\r
-    public static String getDatabaseProductName(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId) {\r
-       if (DBProductName == null) {\r
-               Connection conn = null;\r
-               try {\r
-                   conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);\r
-                   DBProductName = conn.getMetaData().getDatabaseProductName();\r
-               } catch (Exception e) {\r
-                       if (logger.isTraceEnabled() == true) {\r
-                               logger.trace(String.format("Could not open a connection. DataSource='%s' DB='%s'.",\r
-                                               dataSourceName, repositoryName));\r
-                       }\r
-               } finally {\r
-                   try {\r
-                       if (conn != null) {\r
-                           conn.close();\r
-                       }\r
-                   } catch (SQLException sqle) {\r
-                       logger.debug("SQL Exception closing statement/connection in getDatabaseProductName: "\r
-                                       + sqle.getLocalizedMessage());\r
-                   }\r
-               }\r
-       }\r
-       \r
-        return DBProductName;\r
-    }\r
-\r
-    /**\r
-     * Returns an enumerated value uniquely identifying the database product type;\r
-     * e.g. MySQL, PostgreSQL, based on the database product name.\r
-     * \r
-     * @return an enumerated value identifying the database product type\r
-     * @throws Exception \r
-     */\r
-    public static DatabaseProductType getDatabaseProductType(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId) throws Exception {\r
-       DatabaseProductType result = DatabaseProductType.UNRECOGNIZED;\r
-       \r
-        String productName = getDatabaseProductName(dataSourceName, repositoryName, cspaceInstanceId);\r
-        if (productName.matches("(?i).*mysql.*")) {\r
-               result = DatabaseProductType.MYSQL;\r
-        } else if (productName.matches("(?i).*postgresql.*")) {\r
-               result = DatabaseProductType.POSTGRESQL;\r
-        } else {\r
-            throw new Exception("Unrecognized database system " + productName);\r
-        }\r
-       \r
-        return result;\r
-    }\r
-    \r
-    //\r
-    // Same as method above except the cspace instance ID is not needed.\r
-    //\r
-    public static DatabaseProductType getDatabaseProductType(String dataSourceName,\r
-               String repositoryName) throws Exception {\r
-       DatabaseProductType result = DatabaseProductType.UNRECOGNIZED;\r
-       \r
-        String productName = getDatabaseProductName(dataSourceName, repositoryName, null);\r
-        if (productName.matches("(?i).*mysql.*")) {\r
-               result = DatabaseProductType.MYSQL;\r
-        } else if (productName.matches("(?i).*postgresql.*")) {\r
-               result = DatabaseProductType.POSTGRESQL;\r
-        } else {\r
-            throw new Exception("Unrecognized database system " + productName);\r
-        }\r
-       \r
-        return result;\r
-    }\r
-    \r
-    /*\r
-     * By convention, the repository name and database name are the same.  However, this\r
-     * call encapulates that convention and allows overrides.\r
-     */\r
-    public static String getDatabaseName(String repoName, String cspaceInstanceId) {\r
-       String result = repoName;\r
-       \r
-       //\r
-       // Insert code here if you want to map the repo name to a database name -otherwise\r
-       // we'll assume they are the same thing.\r
-       //\r
-       if (repoName.equalsIgnoreCase(DEFAULT_NUXEO_REPOSITORY_NAME)) {\r
-               result = DEFAULT_NUXEO_DATABASE_NAME;\r
-       }\r
-       \r
-       //\r
-       // If we have a non-null 'cspaceInstanceId' instance ID then we need to append it\r
-       // as a suffix to the database name.\r
-       //\r
-       if (cspaceInstanceId != null && !cspaceInstanceId.trim().isEmpty()) {\r
-               if (result.endsWith(cspaceInstanceId) == false) { // ensure we don't already have the suffix\r
-                       result = result + cspaceInstanceId;\r
-               }\r
-       }\r
-       \r
-       return result;\r
-    }\r
-        \r
-    /**\r
-     * Returns the catalog/database name for an open JDBC connection.\r
-     * \r
-     * @param conn an open JDBC Connection\r
-     * @return the catalog name.\r
-     * @throws SQLException \r
-     */\r
-    public static String getDatabaseName(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId,\r
-               Connection conn) throws Exception {\r
-        String databaseName = null;\r
-        \r
-        if (conn != null) {\r
-               DatabaseMetaData metadata = conn.getMetaData();\r
-               String urlStr = metadata.getURL();\r
-               \r
-               // Format of the PostgreSQL JDBC URL:\r
-               // http://jdbc.postgresql.org/documentation/80/connect.html\r
-               if (getDatabaseProductType(dataSourceName, repositoryName, cspaceInstanceId) == DatabaseProductType.POSTGRESQL) {\r
-                   String tokens[] = urlStr.split(JDBC_URL_DATABASE_SEPARATOR);\r
-                   databaseName = tokens[tokens.length - 1];\r
-                   // Format of the MySQL JDBC URL:\r
-                   // http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html\r
-                   // FIXME: the last token could contain optional parameters, not accounted for here.\r
-               } else if (getDatabaseProductType(dataSourceName, repositoryName, cspaceInstanceId) == DatabaseProductType.MYSQL) {\r
-                   String tokens[] = urlStr.split(JDBC_URL_DATABASE_SEPARATOR);\r
-                   databaseName = tokens[tokens.length - 1];\r
-               }\r
-        }\r
-        \r
-        return databaseName;\r
-    }\r
-    \r
-    /**\r
-     * Grant a specified privilege to a database user. This privilege will\r
-     * be applied to all 'public' schema tables within the specified repository.\r
-     * \r
-     * @param dataSourceName a JDBC datasource name.\r
-     * @param repositoryName a repository (e.g. RDBMS database) name.\r
-     * @param cspaceInstanceId a CollectionSpace instance identifier.\r
-     * @param privilegeName a database privilege (e.g. SELECT) to be granted.\r
-     * @param databaseUserName a database user to receive the privilege grant.\r
-     */\r
-    public static void grantPrivilegeToDatabaseUser(String dataSourceName, String repositoryName,\r
-             String cspaceInstanceId, String privilegeName, String databaseUserName) {\r
-        Statement stmt = null;\r
-        Connection conn = null;\r
-        String sql = String.format("GRANT %s ON ALL TABLES IN SCHEMA public TO %s", privilegeName, databaseUserName);\r
-        try {\r
-            DatabaseProductType databaseProductType = JDBCTools.getDatabaseProductType(dataSourceName, repositoryName,\r
-                       cspaceInstanceId);\r
-            if (databaseProductType == DatabaseProductType.MYSQL) {\r
-                // Nothing to do here: MYSQL already does wildcard grants in init_db.sql\r
-            } else if(databaseProductType != DatabaseProductType.POSTGRESQL) {\r
-                throw new Exception("Unrecognized database system " + databaseProductType);\r
-            } else {\r
-                String databaseName = JDBCTools.getDatabaseName(repositoryName, cspaceInstanceId);\r
-                // Verify that the database user exists before executing the grant\r
-                if (hasDatabaseUser(dataSourceName, repositoryName, cspaceInstanceId,\r
-                        databaseProductType, databaseUserName)) {\r
-                    conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);\r
-                    stmt = conn.createStatement();                \r
-                    stmt.execute(sql);\r
-                }\r
-            }\r
-            \r
-        } catch (SQLException sqle) {\r
-            SQLException tempException = sqle;\r
-            // SQLExceptions can be chained. Loop to log all.\r
-            while (null != tempException) {\r
-                logger.debug("SQL Exception: " + sqle.getLocalizedMessage());\r
-                tempException = tempException.getNextException();\r
-            }\r
-            logger.debug("SQL problem in executeQuery: ", sqle);\r
-        } catch (Throwable e) {\r
-            logger.debug(String.format("Problem granting privileges to database user: %s SQL: %s ERROR: %s",\r
-                    databaseUserName, sql, e));\r
-        } finally {\r
-            try {\r
-                if (stmt != null) {\r
-                    stmt.close();\r
-                }\r
-                 if (conn != null) {\r
-                    conn.close();\r
-                }\r
-            } catch (SQLException sqle) {\r
-                // nothing we can do here except log\r
-                logger.warn("SQL Exception when closing statement/connection: " + sqle.getLocalizedMessage());\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Create a database user, if that user doesn't already exist.\r
-     * \r
-     * @param conn a database connection.\r
-     * @param dbType a database product type.\r
-     * @param username the name of the database user to create.\r
-     * @param userPW the initial password for that database user.\r
-     */\r
-    public static void createNewDatabaseUser(String dataSourceName, String repositoryName,\r
-             String cspaceInstanceId, DatabaseProductType dbType, String username, String userPW) throws Exception {\r
-        Statement stmt = null;\r
-        Connection conn = null;\r
-        if (dbType != DatabaseProductType.POSTGRESQL) {\r
-            throw new UnsupportedOperationException("createNewDatabaseUser only supports PostgreSQL");\r
-        }\r
-        try {\r
-            if (hasDatabaseUser(dataSourceName, repositoryName, cspaceInstanceId, dbType, username)) {\r
-                if (logger.isDebugEnabled()) {\r
-                    logger.debug("User: " + username + " already exists.");\r
-                }\r
-            } else {\r
-                conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);\r
-                stmt = conn.createStatement();\r
-                String sql = "CREATE ROLE " + username + " WITH PASSWORD '" + userPW + "' LOGIN";\r
-                stmt.executeUpdate(sql);\r
-                if (logger.isDebugEnabled()) {\r
-                    logger.debug("Created User: " + username);\r
-                }\r
-            }\r
-        } catch (Exception e) {\r
-            logger.error("createNewDatabaseUser failed on exception: " + e.getLocalizedMessage());\r
-            throw e;\r
-        } finally {\r
-            try {\r
-                if (stmt != null) {\r
-                    stmt.close();\r
-                }\r
-                if (conn != null) {\r
-                    conn.close();\r
-                }\r
-            } catch (SQLException sqle) {\r
-                // nothing we can do here except log\r
-                logger.warn("SQL Exception when closing statement/connection: " + sqle.getLocalizedMessage());\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Identify whether a database exists.\r
-     * \r
-     * @param dbType a database product type.\r
-     * @param dbName a database product name.\r
-     * @return true if a database with that name exists, false if that database does not exit.\r
-     * @throws Exception\r
-     */\r
-    public static boolean hasDatabase(DatabaseProductType dbType, String dbName) throws Exception {\r
-        PreparedStatement pstmt = null;\r
-        Connection conn = null;\r
-        String dbExistsQuery = "";\r
-        if (dbType == DatabaseProductType.POSTGRESQL) {\r
-           dbExistsQuery = "SELECT 1 AS result FROM pg_database WHERE datname=?";\r
-        } else if (dbType == DatabaseProductType.MYSQL) {\r
-           dbExistsQuery = "SELECT 1 AS result FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME=?";\r
-        } else {\r
-            throw new UnsupportedOperationException("hasDatabase encountered unknown database product type");\r
-        }\r
-        try {\r
-            DataSource csadminDataSource = JDBCTools.getDataSource(JDBCTools.CSADMIN_DATASOURCE_NAME);\r
-            conn = csadminDataSource.getConnection();\r
-            pstmt = conn.prepareStatement(dbExistsQuery); // create a statement\r
-            pstmt.setString(1, dbName); // set dbName param\r
-            ResultSet rs = pstmt.executeQuery();\r
-            // extract data from the ResultSet\r
-            boolean dbExists = rs.next();  // Will return a value of 1 if database exists\r
-            rs.close();\r
-            return dbExists;\r
-        } catch (Exception e) {\r
-            logger.error("hasDatabase failed on exception: " + e.getLocalizedMessage());\r
-            throw e;\r
-        } finally {\r
-            try {\r
-                if (pstmt != null) {\r
-                    pstmt.close();\r
-                }\r
-                if (conn != null) {\r
-                    conn.close();\r
-                }\r
-            } catch (SQLException sqle) {\r
-                // nothing we can do here except log\r
-                logger.warn("SQL Exception when closing statement/connection: " + sqle.getLocalizedMessage());\r
-           }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Identify whether a database user exists.\r
-     * \r
-     * @param dataSourceName a JDBC datasource name.\r
-     * @param repositoryName a repository (e.g. RDBMS database) name.\r
-     * @param cspaceInstanceId a CollectionSpace instance identifier.\r
-     * @param dbType a database product type.\r
-     * @param username the name of the database user to create.\r
-     * @param userPW the initial password for that database user.\r
-     * @return true if a database user with that name exists, false if that user does not exist.\r
-     * @throws Exception\r
-     */\r
-    public static boolean hasDatabaseUser(String dataSourceName, String repositoryName,\r
-             String cspaceInstanceId, DatabaseProductType dbType, String username) throws Exception {\r
-        PreparedStatement pstmt = null;\r
-        Statement stmt = null;\r
-        Connection conn = null;\r
-        final String USER_EXISTS_QUERY_POSTGRESQL = "SELECT 1 AS result FROM pg_roles WHERE rolname=?";\r
-        if (dbType != DatabaseProductType.POSTGRESQL) {\r
-            throw new UnsupportedOperationException("hasDatabaseUser only supports PostgreSQL");\r
-        }\r
-        try {\r
-            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);\r
-            pstmt = conn.prepareStatement(USER_EXISTS_QUERY_POSTGRESQL);\r
-            pstmt.setString(1, username);\r
-            ResultSet rs = pstmt.executeQuery();\r
-            boolean userExists = rs.next(); // Will return a value of 1 if user exists\r
-            rs.close();\r
-            return userExists;\r
-        } catch (Exception e) {\r
-            logger.error("hasDatabaseUser failed on exception: " + e.getLocalizedMessage());\r
-            throw e;\r
-        } finally {\r
-            try {\r
-                if (pstmt != null) {\r
-                    pstmt.close();\r
-                }\r
-                if (stmt != null) {\r
-                    stmt.close();\r
-                }\r
-                if (conn != null) {\r
-                    conn.close();\r
-                }\r
-            } catch (SQLException sqle) {\r
-                // nothing we can do here except log\r
-                logger.warn("SQL Exception when closing statement/connection: " + sqle.getLocalizedMessage());\r
-           }\r
-        }\r
-    }\r
-    \r
-    \r
-    // -----------------------------\r
-    // Utility methods for debugging\r
-    // -----------------------------\r
-\r
-    /**\r
-     * Prints metadata, such as database username and connection URL,\r
-     * for an open JDBC connection.  This is a utility method for use\r
-     * during debugging.\r
-     * \r
-     * @param conn an open JDBC Connection\r
-     * @throws SQLException \r
-     */\r
-    private static void printConnectionMetaData(Connection conn) throws SQLException {\r
-        if (conn != null) {\r
-            DatabaseMetaData metadata = conn.getMetaData();\r
-            // FIXME: Outputs via System.out, rather than Logger, for\r
-            // cases where this may be called during server startup.\r
-            System.out.println("username=" + metadata.getUserName());\r
-            System.out.println("database url=" + metadata.getURL());\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * Prints metadata related to a JDBC ResultSet, such as column names.\r
-     * This is a utility method for use during debugging.\r
-     * \r
-     * @param rs a ResultSet.\r
-     * @throws SQLException \r
-     */\r
-    public static void printResultSetMetaData(ResultSet rs) throws SQLException {\r
-        if (rs == null) {\r
-            return;\r
-        }\r
-        ResultSetMetaData metadata = rs.getMetaData();\r
-        if (metadata == null) {\r
-            return;\r
-        }\r
-        int numberOfColumns = metadata.getColumnCount();\r
-        for (int i = 1; i <= numberOfColumns; i++) {\r
-            logger.debug(metadata.getColumnName(i));\r
-            // Insert other debug statements to retrieve additional per-column metadata here ...\r
-        }\r
-    }\r
-               \r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.storage;
+
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.config.ConfigUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+
+import java.sql.DatabaseMetaData;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.sql.rowset.CachedRowSet;
+import javax.sql.rowset.RowSetFactory;
+import javax.sql.rowset.RowSetProvider;
+
+import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
+import org.collectionspace.services.common.ServiceMain;
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class JDBCTools {
+    public static HashMap<String, DataSource> cachedDataSources = new HashMap<String, DataSource>();
+    public static String CSPACE_DATASOURCE_NAME = "CspaceDS";
+    public static String NUXEO_DATASOURCE_NAME = "NuxeoDS";
+    // Default database names
+    // public static String DEFAULT_CSPACE_DATABASE_NAME = ConfigUtils.DEFAULT_CSPACE_DATABASE_NAME;
+    public static String DEFAULT_NUXEO_REPOSITORY_NAME = ConfigUtils.DEFAULT_NUXEO_REPOSITORY_NAME;
+    public static String DEFAULT_NUXEO_DATABASE_NAME = ConfigUtils.DEFAULT_NUXEO_DATABASE_NAME;
+    public static String CSADMIN_DATASOURCE_NAME = "CsadminDS";
+    public static String NUXEO_READER_DATASOURCE_NAME = "NuxeoReaderDS";
+    public static String NUXEO_USER_NAME = "nuxeo";
+    public static String SQL_WILDCARD = "%";
+    public static String DATABASE_SELECT_PRIVILEGE_NAME = "SELECT";
+
+    
+    //
+    // Private constants
+    //
+    private static String DBProductName = null;
+
+    //todo: make sure this will get instantiated in the right order
+    final static Logger logger = LoggerFactory.getLogger(JDBCTools.class);
+       private static final CharSequence URL_DATABASE_NAME = "${DatabaseName}";
+    private static String JDBC_URL_DATABASE_SEPARATOR = "\\/";
+        
+       //
+       // As a side-effect of calling JDBCTools.getDataSource(...), the DataSource instance will be
+       // cached in a static hash map of the JDBCTools class.  This will speed up lookups as well as protect our
+       // code from JNDI lookup problems -for example, if the JNDI context gets stepped on or corrupted.
+       //    
+    public static DataSource getDataSource(String dataSourceName) throws NamingException {
+       DataSource result = null;
+       
+       //
+       // First, see if we already have this DataSource instance cached
+       //
+       result = cachedDataSources.get(dataSourceName);
+       if (result == null) {           
+               InitialContext ctx = new InitialContext();
+               Context envCtx = null;
+
+               if (logger.isDebugEnabled() == true) {
+                       logger.debug("Looking up DataSource instance in JNDI with name: " + dataSourceName);
+               }
+                       
+               try {
+                       envCtx = (Context) ctx.lookup("java:comp/env");
+                       DataSource ds = (DataSource) envCtx.lookup("jdbc/" + dataSourceName);
+                       if (ds == null) {
+                           throw new IllegalArgumentException("DataSource instance not found: " + dataSourceName);
+                       } else {
+                               result = ds;
+                               // now cache this DataSource instance for future references
+                               cachedDataSources.put(dataSourceName, result);
+                       }
+               } finally {
+                   if (ctx != null) {
+                       try {
+                           ctx.close();
+                       } catch (Exception e) {
+                               logger.error("Error getting DataSource for: " + dataSourceName, e);
+                       }
+                   }
+                   if (envCtx != null) {
+                       try {
+                               envCtx.close();
+                       } catch (Exception e) {
+                               logger.error("Error getting DataSource for: " + dataSourceName, e);
+                       }
+                   }
+               }
+       }
+       
+       if (result != null) {
+//             DataSource resultClone = result.
+       }
+       
+       return result;
+    }
+    
+    //
+    // Use this version of the getConnection() method when you don't want to qualify the database name
+    // with a CollectionSpace instance ID.
+    //
+    public static Connection getConnection(String dataSourceName,
+               String databaseName) throws NamingException, SQLException {
+       return getConnection(dataSourceName, databaseName, null);
+    }
+    
+    public static Connection getConnection(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId) throws NamingException, SQLException {
+       Connection result = null;
+       
+       if (Tools.isEmpty(dataSourceName) || Tools.isEmpty(repositoryName)) {
+               String errMsg = String.format(
+                               "The getConnection() method was called with an empty or null repository name = '%s' and/or data source name = '%s'.", 
+                               dataSourceName, repositoryName);
+            logger.error(errMsg);
+            throw new NamingException(errMsg);
+        }
+               
+       /*
+        * We synch this block as a workaround to not have separate DataSource instances for
+        * each Nuxeo repo/DB.  Ideally, we should replace the need for this synch block by
+        * registering a separate DataSource for each repo/db at init/start-up time.
+        * 
+        * We need to sync because we're changing the URL of the datasource inorder to get the correct
+        * connection.  The synch prevents different threads from getting the incorrect connection -i.e., one pointing
+        * to the wrong URL.
+        */
+       Connection conn = null;
+       synchronized (JDBCTools.class) {
+               BasicDataSource dataSource = (BasicDataSource)getDataSource(dataSourceName);
+               // Get the template URL value from the JNDI datasource and substitute the databaseName
+               String urlTemplate = dataSource.getUrl();
+               String databaseName = getDatabaseName(repositoryName, cspaceInstanceId);
+               String connectionUrl = urlTemplate.replace(URL_DATABASE_NAME, databaseName);
+
+               // ATTENTION!
+               // Turns out the Tomcat BasicDataSource used a connection pool, so changing the url does not
+               // get you a corresponding connection. Use the more basic implementation for now, unless
+               // and until we do things right by creating additional JNDI data sources.
+               
+               //dataSource.setUrl(connectionUrl);
+               String user = dataSource.getUsername();
+               String password = dataSource.getPassword();
+               
+               try {
+                       //conn = dataSource.getConnection();
+                       conn = DriverManager.getConnection(connectionUrl, user, password);
+                       result = conn;
+                       if (logger.isTraceEnabled() == true && conn != null) {
+                               logger.trace(String.format("Connection made to repository = '%s' using datasource = '%s'", repositoryName, dataSourceName));
+                       }
+               } finally {
+                       dataSource.setUrl(urlTemplate); // Reset the data source URL value back to the template value
+               }
+       }
+               
+        return result;
+    }
+
+    public static CachedRowSet executeQuery(String dataSourceName, String repositoryName, String cspaceInstanceId, String sql) throws Exception {
+        Connection conn = null;
+        Statement stmt = null;
+        try {
+            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);
+            stmt = conn.createStatement();
+             
+            RowSetFactory rowSetFactory = RowSetProvider.newFactory();
+            CachedRowSet crs = rowSetFactory.createCachedRowSet();
+
+            stmt = conn.createStatement();
+            try (ResultSet resultSet = stmt.executeQuery(sql)) {
+                crs.populate(resultSet);
+            }
+            return crs;
+        } catch (SQLException sqle) {
+            SQLException tempException = sqle;
+            while (null != tempException) {       // SQLExceptions can be chained. Loop to log all.
+                logger.debug("SQL Exception: " + sqle.getLocalizedMessage());
+                tempException = tempException.getNextException();
+            }
+            throw new RuntimeException("SQL Exception in executeQuery: ", sqle);
+        } finally {
+            try {
+                if (stmt != null) {
+                    stmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException sqle) {
+                logger.debug("SQL Exception closing statement/connection in executeQuery: " + sqle.getLocalizedMessage());
+                return null;
+            }
+        }
+    }
+    
+    public static CachedRowSet executePreparedQuery(final PreparedStatementBuilder builder,
+            String dataSourceName, String repositoryName, String cspaceInstanceId) throws Exception {
+        Connection conn = null;
+        PreparedStatement ps = null;
+        try {
+            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);
+            RowSetFactory rowSetFactory = RowSetProvider.newFactory();
+            CachedRowSet crs = rowSetFactory.createCachedRowSet();
+            ps = builder.build(conn);
+            // FIXME: transition this log statement to DEBUG level when appropriate
+            if (logger.isInfoEnabled()) {
+                logger.info("prepared statement=" + ps.toString());
+            }
+            try (ResultSet resultSet = ps.executeQuery()) {
+                crs.populate(resultSet);
+            }
+            return crs;
+        } catch (SQLException sqle) {
+            SQLException tempException = sqle;
+            while (null != tempException) {       // SQLExceptions can be chained. Loop to log all.
+                logger.debug("SQL Exception: " + sqle.getLocalizedMessage());
+                tempException = tempException.getNextException();
+            }
+            throw new RuntimeException("SQL Exception in executePreparedQuery: ", sqle);
+        } finally {
+            try {
+                if (ps != null) {
+                    ps.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException sqle) {
+                logger.debug("SQL Exception closing statement/connection in executePreparedQuery: " + sqle.getLocalizedMessage());
+                return null;
+            }
+        }
+    }
+    
+    // FIXME: This method's code significantly overlaps that of executePrepareQuery(), above,
+    // and the two could be refactored into a single method, if desired.
+    public static List<CachedRowSet> executePreparedQueries(final List<PreparedStatementBuilder> builders,
+            String dataSourceName, String repositoryName, String cspaceInstanceId, Boolean executeWithinTransaction) throws Exception {
+        Connection conn = null;
+        PreparedStatement ps = null;
+        List<CachedRowSet> results = new ArrayList<>();
+        try {
+            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);
+            if (executeWithinTransaction) {
+                conn.setAutoCommit(false);
+            }
+            RowSetFactory rowSetFactory = RowSetProvider.newFactory();
+            CachedRowSet crs = rowSetFactory.createCachedRowSet();
+            int statementCount = 0;
+            for (PreparedStatementBuilder builder : builders) {
+                ps = builder.build(conn);
+                // FIXME: transition this log statement to DEBUG level when appropriate
+                if (logger.isInfoEnabled()) {
+                    statementCount++;
+                    logger.info("prepared statement " + statementCount + "=" + ps.toString());
+                }
+                // Try executing each statement, first as a query, then as an update
+                try {
+                    ResultSet resultSet = ps.executeQuery();
+                    if (resultSet != null) {
+                        crs.populate(resultSet);
+                        results.add(crs);
+                    }
+                } catch (Exception e) {
+                    int rowcount = ps.executeUpdate();
+                       logger.debug(String.format("Row count for builder %s is %d", ps.toString(), rowcount));
+                    // Throw uncaught exception here if update attempt also fails
+                }
+            }
+            return results;
+        } catch (SQLException sqle) {
+            if (executeWithinTransaction && conn != null) {
+                conn.rollback();
+            }
+            SQLException tempException = sqle;
+            while (null != tempException) {       // SQLExceptions can be chained. Loop to log all.
+                logger.debug("SQL Exception: " + sqle.getLocalizedMessage());
+                tempException = tempException.getNextException();
+            }
+            throw new RuntimeException("SQL Exception in executePreparedQueries: ", sqle);
+        } finally {
+            try {
+                if (ps != null) {
+                    ps.close();
+                }
+                if (conn != null) {
+                    if (executeWithinTransaction) {
+                        conn.commit();
+                    }
+                    conn.close();
+                }
+            } catch (SQLException sqle) {
+                logger.debug("SQL Exception closing statement/connection in executePreparedQueries: " + sqle.getLocalizedMessage());
+                return null;
+            }
+        }
+    }
+
+    public static int executeUpdate(String dataSourceName,
+               String repositoryName, 
+               String cspaceInstanceId, 
+               String sql) throws Exception {
+        Connection conn = null;
+        Statement stmt = null;
+        try {
+            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);
+            stmt = conn.createStatement();
+            int rows = stmt.executeUpdate(sql);
+            stmt.close();
+            return rows;
+        } catch (RuntimeException rte) {
+            logger.debug("Exception in executeUpdate: " + rte.getLocalizedMessage());
+            logger.debug(rte.getStackTrace().toString());
+            throw rte;
+        } catch (SQLException sqle) {
+            SQLException tempException = sqle;
+            String msg = "";
+            while (null != tempException) {       // SQLExceptions can be chained. Loop to log all.
+                if (!msg.isEmpty()) {
+                    msg = msg + "::next::";
+                }
+                msg = msg + sqle.getLocalizedMessage();
+                logger.debug("SQL Exception: " + msg);
+                tempException = tempException.getNextException();
+            }
+            throw new RuntimeException("SQL Exception in executeUpdate: " + msg, sqle);
+        } finally {
+            try {
+                if (stmt != null) {
+                    stmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException sqle) {
+                logger.debug("SQL Exception closing statement/connection in executeUpdate: " + sqle.getLocalizedMessage());
+                return -1;
+            }
+        }
+    }
+
+    /**
+     * Returns the database product name, from the metadata for a
+     * JDBC connection to the default repository.
+     * 
+     * Assumes that the database product name will be the same for the
+     * default repository and for all other repositories to which JDBC
+     * connections will be made, through the methods of this class.
+     * 
+     * @return the database product name
+     */
+    public static String getDatabaseProductName(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId) {
+       if (DBProductName == null) {
+               Connection conn = null;
+               try {
+                   conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);
+                   DBProductName = conn.getMetaData().getDatabaseProductName();
+               } catch (Exception e) {
+                       if (logger.isTraceEnabled() == true) {
+                               logger.trace(String.format("Could not open a connection. DataSource='%s' DB='%s'.",
+                                               dataSourceName, repositoryName));
+                       }
+               } finally {
+                   try {
+                       if (conn != null) {
+                           conn.close();
+                       }
+                   } catch (SQLException sqle) {
+                       logger.debug("SQL Exception closing statement/connection in getDatabaseProductName: "
+                                       + sqle.getLocalizedMessage());
+                   }
+               }
+       }
+       
+        return DBProductName;
+    }
+
+    /**
+     * Returns an enumerated value uniquely identifying the database product type;
+     * e.g. MySQL, PostgreSQL, based on the database product name.
+     * 
+     * @return an enumerated value identifying the database product type
+     * @throws Exception 
+     */
+    public static DatabaseProductType getDatabaseProductType(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId) throws Exception {
+       DatabaseProductType result = DatabaseProductType.UNRECOGNIZED;
+       
+        String productName = getDatabaseProductName(dataSourceName, repositoryName, cspaceInstanceId);
+        if (productName.matches("(?i).*mysql.*")) {
+               result = DatabaseProductType.MYSQL;
+        } else if (productName.matches("(?i).*postgresql.*")) {
+               result = DatabaseProductType.POSTGRESQL;
+        } else {
+            throw new Exception("Unrecognized database system " + productName);
+        }
+       
+        return result;
+    }
+    
+    //
+    // Same as method above except the cspace instance ID is not needed.
+    //
+    public static DatabaseProductType getDatabaseProductType(String dataSourceName,
+               String repositoryName) throws Exception {
+       DatabaseProductType result = DatabaseProductType.UNRECOGNIZED;
+       
+        String productName = getDatabaseProductName(dataSourceName, repositoryName, null);
+        if (productName.matches("(?i).*mysql.*")) {
+               result = DatabaseProductType.MYSQL;
+        } else if (productName.matches("(?i).*postgresql.*")) {
+               result = DatabaseProductType.POSTGRESQL;
+        } else {
+            throw new Exception("Unrecognized database system " + productName);
+        }
+       
+        return result;
+    }
+    
+    /*
+     * By convention, the repository name and database name are the same.  However, this
+     * call encapulates that convention and allows overrides.
+     */
+    public static String getDatabaseName(String repoName, String cspaceInstanceId) {
+       String result = repoName;
+       
+       //
+       // Insert code here if you want to map the repo name to a database name -otherwise
+       // we'll assume they are the same thing.
+       //
+       if (repoName.equalsIgnoreCase(DEFAULT_NUXEO_REPOSITORY_NAME)) {
+               result = DEFAULT_NUXEO_DATABASE_NAME;
+       }
+       
+       //
+       // If we have a non-null 'cspaceInstanceId' instance ID then we need to append it
+       // as a suffix to the database name.
+       //
+       if (cspaceInstanceId != null && !cspaceInstanceId.trim().isEmpty()) {
+               if (result.endsWith(cspaceInstanceId) == false) { // ensure we don't already have the suffix
+                       result = result + cspaceInstanceId;
+               }
+       }
+       
+       return result;
+    }
+        
+    /**
+     * Returns the catalog/database name for an open JDBC connection.
+     * 
+     * @param conn an open JDBC Connection
+     * @return the catalog name.
+     * @throws SQLException 
+     */
+    public static String getDatabaseName(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId,
+               Connection conn) throws Exception {
+        String databaseName = null;
+        
+        if (conn != null) {
+               DatabaseMetaData metadata = conn.getMetaData();
+               String urlStr = metadata.getURL();
+               
+               // Format of the PostgreSQL JDBC URL:
+               // http://jdbc.postgresql.org/documentation/80/connect.html
+               if (getDatabaseProductType(dataSourceName, repositoryName, cspaceInstanceId) == DatabaseProductType.POSTGRESQL) {
+                   String tokens[] = urlStr.split(JDBC_URL_DATABASE_SEPARATOR);
+                   databaseName = tokens[tokens.length - 1];
+                   // Format of the MySQL JDBC URL:
+                   // http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html
+                   // FIXME: the last token could contain optional parameters, not accounted for here.
+               } else if (getDatabaseProductType(dataSourceName, repositoryName, cspaceInstanceId) == DatabaseProductType.MYSQL) {
+                   String tokens[] = urlStr.split(JDBC_URL_DATABASE_SEPARATOR);
+                   databaseName = tokens[tokens.length - 1];
+               }
+        }
+        
+        return databaseName;
+    }
+    
+    /**
+     * Grant a specified privilege to a database user. This privilege will
+     * be applied to all 'public' schema tables within the specified repository.
+     * 
+     * @param dataSourceName a JDBC datasource name.
+     * @param repositoryName a repository (e.g. RDBMS database) name.
+     * @param cspaceInstanceId a CollectionSpace instance identifier.
+     * @param privilegeName a database privilege (e.g. SELECT) to be granted.
+     * @param databaseUserName a database user to receive the privilege grant.
+     */
+    public static void grantPrivilegeToDatabaseUser(String dataSourceName, String repositoryName,
+             String cspaceInstanceId, String privilegeName, String databaseUserName) {
+        Statement stmt = null;
+        Connection conn = null;
+        String sql = String.format("GRANT %s ON ALL TABLES IN SCHEMA public TO %s", privilegeName, databaseUserName);
+        try {
+            DatabaseProductType databaseProductType = JDBCTools.getDatabaseProductType(dataSourceName, repositoryName,
+                       cspaceInstanceId);
+            if (databaseProductType == DatabaseProductType.MYSQL) {
+                // Nothing to do here: MYSQL already does wildcard grants in init_db.sql
+            } else if(databaseProductType != DatabaseProductType.POSTGRESQL) {
+                throw new Exception("Unrecognized database system " + databaseProductType);
+            } else {
+                String databaseName = JDBCTools.getDatabaseName(repositoryName, cspaceInstanceId);
+                // Verify that the database user exists before executing the grant
+                if (hasDatabaseUser(dataSourceName, repositoryName, cspaceInstanceId,
+                        databaseProductType, databaseUserName)) {
+                    conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);
+                    stmt = conn.createStatement();                
+                    stmt.execute(sql);
+                }
+            }
+            
+        } catch (SQLException sqle) {
+            SQLException tempException = sqle;
+            // SQLExceptions can be chained. Loop to log all.
+            while (null != tempException) {
+                logger.debug("SQL Exception: " + sqle.getLocalizedMessage());
+                tempException = tempException.getNextException();
+            }
+            logger.debug("SQL problem in executeQuery: ", sqle);
+        } catch (Throwable e) {
+            logger.debug(String.format("Problem granting privileges to database user: %s SQL: %s ERROR: %s",
+                    databaseUserName, sql, e));
+        } finally {
+            try {
+                if (stmt != null) {
+                    stmt.close();
+                }
+                 if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException sqle) {
+                // nothing we can do here except log
+                logger.warn("SQL Exception when closing statement/connection: " + sqle.getLocalizedMessage());
+            }
+        }
+    }
+    
+    /**
+     * Create a database user, if that user doesn't already exist.
+     * 
+     * @param conn a database connection.
+     * @param dbType a database product type.
+     * @param username the name of the database user to create.
+     * @param userPW the initial password for that database user.
+     */
+    public static void createNewDatabaseUser(String dataSourceName, String repositoryName,
+             String cspaceInstanceId, DatabaseProductType dbType, String username, String userPW) throws Exception {
+        Statement stmt = null;
+        Connection conn = null;
+        if (dbType != DatabaseProductType.POSTGRESQL) {
+            throw new UnsupportedOperationException("createNewDatabaseUser only supports PostgreSQL");
+        }
+        try {
+            if (hasDatabaseUser(dataSourceName, repositoryName, cspaceInstanceId, dbType, username)) {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("User: " + username + " already exists.");
+                }
+            } else {
+                conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);
+                stmt = conn.createStatement();
+                String sql = "CREATE ROLE " + username + " WITH PASSWORD '" + userPW + "' LOGIN";
+                stmt.executeUpdate(sql);
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Created User: " + username);
+                }
+            }
+        } catch (Exception e) {
+            logger.error("createNewDatabaseUser failed on exception: " + e.getLocalizedMessage());
+            throw e;
+        } finally {
+            try {
+                if (stmt != null) {
+                    stmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException sqle) {
+                // nothing we can do here except log
+                logger.warn("SQL Exception when closing statement/connection: " + sqle.getLocalizedMessage());
+            }
+        }
+    }
+    
+    /**
+     * Identify whether a database exists.
+     * 
+     * @param dbType a database product type.
+     * @param dbName a database product name.
+     * @return true if a database with that name exists, false if that database does not exit.
+     * @throws Exception
+     */
+    public static boolean hasDatabase(DatabaseProductType dbType, String dbName) throws Exception {
+        PreparedStatement pstmt = null;
+        Connection conn = null;
+        String dbExistsQuery = "";
+        if (dbType == DatabaseProductType.POSTGRESQL) {
+           dbExistsQuery = "SELECT 1 AS result FROM pg_database WHERE datname=?";
+        } else if (dbType == DatabaseProductType.MYSQL) {
+           dbExistsQuery = "SELECT 1 AS result FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME=?";
+        } else {
+            throw new UnsupportedOperationException("hasDatabase encountered unknown database product type");
+        }
+        try {
+            DataSource csadminDataSource = JDBCTools.getDataSource(JDBCTools.CSADMIN_DATASOURCE_NAME);
+            conn = csadminDataSource.getConnection();
+            pstmt = conn.prepareStatement(dbExistsQuery); // create a statement
+            pstmt.setString(1, dbName); // set dbName param
+            ResultSet rs = pstmt.executeQuery();
+            // extract data from the ResultSet
+            boolean dbExists = rs.next();  // Will return a value of 1 if database exists
+            rs.close();
+            return dbExists;
+        } catch (Exception e) {
+            logger.error("hasDatabase failed on exception: " + e.getLocalizedMessage());
+            throw e;
+        } finally {
+            try {
+                if (pstmt != null) {
+                    pstmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException sqle) {
+                // nothing we can do here except log
+                logger.warn("SQL Exception when closing statement/connection: " + sqle.getLocalizedMessage());
+           }
+        }
+    }
+    
+    /**
+     * Identify whether a database user exists.
+     * 
+     * @param dataSourceName a JDBC datasource name.
+     * @param repositoryName a repository (e.g. RDBMS database) name.
+     * @param cspaceInstanceId a CollectionSpace instance identifier.
+     * @param dbType a database product type.
+     * @param username the name of the database user to create.
+     * @param userPW the initial password for that database user.
+     * @return true if a database user with that name exists, false if that user does not exist.
+     * @throws Exception
+     */
+    public static boolean hasDatabaseUser(String dataSourceName, String repositoryName,
+             String cspaceInstanceId, DatabaseProductType dbType, String username) throws Exception {
+        PreparedStatement pstmt = null;
+        Statement stmt = null;
+        Connection conn = null;
+        final String USER_EXISTS_QUERY_POSTGRESQL = "SELECT 1 AS result FROM pg_roles WHERE rolname=?";
+        if (dbType != DatabaseProductType.POSTGRESQL) {
+            throw new UnsupportedOperationException("hasDatabaseUser only supports PostgreSQL");
+        }
+        try {
+            conn = getConnection(dataSourceName, repositoryName, cspaceInstanceId);
+            pstmt = conn.prepareStatement(USER_EXISTS_QUERY_POSTGRESQL);
+            pstmt.setString(1, username);
+            ResultSet rs = pstmt.executeQuery();
+            boolean userExists = rs.next(); // Will return a value of 1 if user exists
+            rs.close();
+            return userExists;
+        } catch (Exception e) {
+            logger.error("hasDatabaseUser failed on exception: " + e.getLocalizedMessage());
+            throw e;
+        } finally {
+            try {
+                if (pstmt != null) {
+                    pstmt.close();
+                }
+                if (stmt != null) {
+                    stmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException sqle) {
+                // nothing we can do here except log
+                logger.warn("SQL Exception when closing statement/connection: " + sqle.getLocalizedMessage());
+           }
+        }
+    }
+    
+    
+    // -----------------------------
+    // Utility methods for debugging
+    // -----------------------------
+
+    /**
+     * Prints metadata, such as database username and connection URL,
+     * for an open JDBC connection.  This is a utility method for use
+     * during debugging.
+     * 
+     * @param conn an open JDBC Connection
+     * @throws SQLException 
+     */
+    private static void printConnectionMetaData(Connection conn) throws SQLException {
+        if (conn != null) {
+            DatabaseMetaData metadata = conn.getMetaData();
+            // FIXME: Outputs via System.out, rather than Logger, for
+            // cases where this may be called during server startup.
+            System.out.println("username=" + metadata.getUserName());
+            System.out.println("database url=" + metadata.getURL());
+        }
+    }
+    
+    /**
+     * Prints metadata related to a JDBC ResultSet, such as column names.
+     * This is a utility method for use during debugging.
+     * 
+     * @param rs a ResultSet.
+     * @throws SQLException 
+     */
+    public static void printResultSetMetaData(ResultSet rs) throws SQLException {
+        if (rs == null) {
+            return;
+        }
+        ResultSetMetaData metadata = rs.getMetaData();
+        if (metadata == null) {
+            return;
+        }
+        int numberOfColumns = metadata.getColumnCount();
+        for (int i = 1; i <= numberOfColumns; i++) {
+            logger.debug(metadata.getColumnName(i));
+            // Insert other debug statements to retrieve additional per-column metadata here ...
+        }
+    }
+               
+}
index 49e4f91556f04ac0d41b04f6b55adfb82923e939..65f577013c31a32ac1c82e7043f6f974d2dc631e 100644 (file)
@@ -1,74 +1,74 @@
-package org.collectionspace.services.common.storage.jpa;\r
-\r
-import java.util.List;\r
-\r
-import org.collectionspace.services.common.api.RefName;\r
-import org.collectionspace.services.common.document.AbstractDocumentHandlerImpl;\r
-import org.collectionspace.services.common.document.DocumentFilter;\r
-import org.collectionspace.services.common.document.DocumentWrapper;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.collectionspace.services.lifecycle.Lifecycle;\r
-import org.collectionspace.services.lifecycle.TransitionDef;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-\r
-public abstract class JpaDocumentHandler<T, TL, WT, WLT>\r
-       extends AbstractDocumentHandlerImpl<T, TL, WT, WLT>{\r
-\r
-       @Override\r
-       protected String getRefnameDisplayName(DocumentWrapper<WT> wrapDoc) {\r
-               return ""; // Empty string since we don't yet support this feature in JPA documents\r
-       }\r
-       \r
-       @Override\r
-       public RefName.RefNameInterface getRefName(DocumentWrapper<WT> docWrapper, String tenantName, String serviceName) {\r
-               //\r
-               // Not implemented\r
-               //\r
-               return null;\r
-       }\r
-       \r
-    /**\r
-     * Extract paging info.\r
-     *\r
-     * @param commonsList the commons list\r
-     * @return the tL\r
-     * @throws Exception the exception\r
-     */\r
-    public TL extractPagingInfo(TL theCommonList, DocumentWrapper<WLT> wrapDoc)\r
-            throws Exception {\r
-        AbstractCommonList commonList = (AbstractCommonList) theCommonList;\r
-\r
-        DocumentFilter docFilter = this.getDocumentFilter();\r
-        long pageSize = docFilter.getPageSize();\r
-        long pageNum = pageSize != 0 ? docFilter.getOffset() / pageSize : pageSize;\r
-        // set the page size and page number\r
-        commonList.setPageNum(pageNum);\r
-        commonList.setPageSize(pageSize);\r
-        List docList = (List)wrapDoc.getWrappedObject();\r
-        // Set num of items in list. this is useful to our testing framework.\r
-        commonList.setItemsInPage(docList.size());\r
-        // set the total result size\r
-        commonList.setTotalItems(docList.size());\r
-\r
-        return (TL) commonList;\r
-    }\r
-    \r
-    public Lifecycle getLifecycle(String docTypeName) {\r
-       Lifecycle result = new Lifecycle();\r
-       result.setName("Life cycles are not supported by the JPA-based services.");\r
-       return result; // NOTE: As of 3/2012, none of the JPA-based services support a life cycle type.\r
-    }\r
-    \r
-    @Override\r
-    public Lifecycle getLifecycle() {\r
-       return getLifecycle(null); // NOTE: As of 3/2012, none of the JPA-based services support a life cycle type.\r
-    }\r
-    \r
-       @Override\r
-       public void handleWorkflowTransition(\r
-                       DocumentWrapper<DocumentModel> wrapDoc, TransitionDef transitionDef)\r
-                       throws Exception {\r
-               // Do nothing.  JPA document handlers do not support workflow transitions yet.\r
-       }\r
-    \r
-}\r
+package org.collectionspace.services.common.storage.jpa;
+
+import java.util.List;
+
+import org.collectionspace.services.common.api.RefName;
+import org.collectionspace.services.common.document.AbstractDocumentHandlerImpl;
+import org.collectionspace.services.common.document.DocumentFilter;
+import org.collectionspace.services.common.document.DocumentWrapper;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.lifecycle.Lifecycle;
+import org.collectionspace.services.lifecycle.TransitionDef;
+import org.nuxeo.ecm.core.api.DocumentModel;
+
+public abstract class JpaDocumentHandler<T, TL, WT, WLT>
+       extends AbstractDocumentHandlerImpl<T, TL, WT, WLT>{
+
+       @Override
+       protected String getRefnameDisplayName(DocumentWrapper<WT> wrapDoc) {
+               return ""; // Empty string since we don't yet support this feature in JPA documents
+       }
+       
+       @Override
+       public RefName.RefNameInterface getRefName(DocumentWrapper<WT> docWrapper, String tenantName, String serviceName) {
+               //
+               // Not implemented
+               //
+               return null;
+       }
+       
+    /**
+     * Extract paging info.
+     *
+     * @param commonsList the commons list
+     * @return the tL
+     * @throws Exception the exception
+     */
+    public TL extractPagingInfo(TL theCommonList, DocumentWrapper<WLT> wrapDoc)
+            throws Exception {
+        AbstractCommonList commonList = (AbstractCommonList) theCommonList;
+
+        DocumentFilter docFilter = this.getDocumentFilter();
+        long pageSize = docFilter.getPageSize();
+        long pageNum = pageSize != 0 ? docFilter.getOffset() / pageSize : pageSize;
+        // set the page size and page number
+        commonList.setPageNum(pageNum);
+        commonList.setPageSize(pageSize);
+        List docList = (List)wrapDoc.getWrappedObject();
+        // Set num of items in list. this is useful to our testing framework.
+        commonList.setItemsInPage(docList.size());
+        // set the total result size
+        commonList.setTotalItems(docList.size());
+
+        return (TL) commonList;
+    }
+    
+    public Lifecycle getLifecycle(String docTypeName) {
+       Lifecycle result = new Lifecycle();
+       result.setName("Life cycles are not supported by the JPA-based services.");
+       return result; // NOTE: As of 3/2012, none of the JPA-based services support a life cycle type.
+    }
+    
+    @Override
+    public Lifecycle getLifecycle() {
+       return getLifecycle(null); // NOTE: As of 3/2012, none of the JPA-based services support a life cycle type.
+    }
+    
+       @Override
+       public void handleWorkflowTransition(
+                       DocumentWrapper<DocumentModel> wrapDoc, TransitionDef transitionDef)
+                       throws Exception {
+               // Do nothing.  JPA document handlers do not support workflow transitions yet.
+       }
+    
+}
index 96d6fc649fd7456c80965c7e2628465299956722..8f1174659105c8ab7213ae6ebf7826b7368983cb 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts for\r
- * CollectionSpace, an open source collections management system for museums and\r
- * related institutions:\r
- *\r
- * http://www.collectionspace.org http://wiki.collectionspace.org\r
- *\r
- * Copyright 2009 University of California at Berkeley\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0. You may\r
- * not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- *\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-package org.collectionspace.services.common.vocabulary;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.nuxeo.ecm.core.api.ClientException;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import org.nuxeo.ecm.core.api.DocumentModelList;\r
-import org.nuxeo.ecm.core.api.model.Property;\r
-import org.nuxeo.ecm.core.api.model.PropertyException;\r
-import org.nuxeo.ecm.core.api.model.PropertyNotFoundException;\r
-import org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty;\r
-import org.nuxeo.ecm.core.api.repository.RepositoryInstance;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import org.collectionspace.services.client.CollectionSpaceClient;\r
-import org.collectionspace.services.client.IQueryManager;\r
-import org.collectionspace.services.client.IRelationsManager;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.common.ServiceMain;\r
-import org.collectionspace.services.common.StoredValuesUriTemplate;\r
-import org.collectionspace.services.common.UriTemplateFactory;\r
-import org.collectionspace.services.common.UriTemplateRegistry;\r
-import org.collectionspace.services.common.UriTemplateRegistryKey;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.context.AbstractServiceContextImpl;\r
-import org.collectionspace.services.common.api.RefNameUtils;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.api.RefNameUtils.AuthorityTermInfo;\r
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
-import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;\r
-import org.collectionspace.services.common.context.ServiceBindingUtils;\r
-import org.collectionspace.services.common.document.DocumentException;\r
-import org.collectionspace.services.common.document.DocumentFilter;\r
-import org.collectionspace.services.common.document.DocumentNotFoundException;\r
-import org.collectionspace.services.common.document.DocumentUtils;\r
-import org.collectionspace.services.common.document.DocumentWrapper;\r
-import org.collectionspace.services.common.query.QueryManager;\r
-import org.collectionspace.services.common.relation.RelationUtils;\r
-import org.collectionspace.services.common.repository.RepositoryClient;\r
-import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;\r
-import org.collectionspace.services.nuxeo.client.java.RepositoryInstanceInterface;\r
-import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;\r
-import org.collectionspace.services.common.security.SecurityUtils;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.collectionspace.services.nuxeo.util.NuxeoUtils;\r
-\r
-/**\r
- * RefNameServiceUtils is a collection of services utilities related to refName\r
- * usage.\r
- *\r
- * $LastChangedRevision: $ $LastChangedDate: $\r
- */\r
-public class RefNameServiceUtils {\r
-\r
-    public static class AuthRefConfigInfo {\r
-\r
-        public String getQualifiedDisplayName() {\r
-            return (Tools.isBlank(schema))\r
-                    ? displayName : DocumentUtils.appendSchemaName(schema, displayName);\r
-        }\r
-\r
-        public String getDisplayName() {\r
-            return displayName;\r
-        }\r
-\r
-        public void setDisplayName(String displayName) {\r
-            this.displayName = displayName;\r
-        }\r
-        String displayName;\r
-        String schema;\r
-\r
-        public String getSchema() {\r
-            return schema;\r
-        }\r
-\r
-        public void setSchema(String schema) {\r
-            this.schema = schema;\r
-        }\r
-\r
-        public String getFullPath() {\r
-            return fullPath;\r
-        }\r
-\r
-        public void setFullPath(String fullPath) {\r
-            this.fullPath = fullPath;\r
-        }\r
-        String fullPath;\r
-        protected String[] pathEls;\r
-\r
-        public AuthRefConfigInfo(AuthRefConfigInfo arci) {\r
-            this.displayName = arci.displayName;\r
-            this.schema = arci.schema;\r
-            this.fullPath = arci.fullPath;\r
-            this.pathEls = arci.pathEls;\r
-            // Skip the pathElse check, since we are creatign from another (presumably valid) arci.\r
-        }\r
-\r
-        public AuthRefConfigInfo(String displayName, String schema, String fullPath, String[] pathEls) {\r
-            this.displayName = displayName;\r
-            this.schema = schema;\r
-            this.fullPath = fullPath;\r
-            this.pathEls = pathEls;\r
-            checkPathEls();\r
-        }\r
-\r
-        // Split a config value string like "intakes_common:collector", or\r
-        // "collectionobjects_common:contentPeoples|contentPeople"\r
-        // "collectionobjects_common:assocEventGroupList/*/assocEventPlace"\r
-        // If has a pipe ('|') second part is a displayLabel, and first is path\r
-        // Otherwise, entry is a path, and can use the last pathElement as displayName\r
-        // Should be schema qualified.\r
-        public AuthRefConfigInfo(String configString) {\r
-            String[] pair = configString.split("\\|", 2);\r
-            String[] pathEls;\r
-            String displayName, fullPath;\r
-            if (pair.length == 1) {\r
-                // no label specifier, so we'll defer getting label\r
-                fullPath = pair[0];\r
-                pathEls = pair[0].split("/");\r
-                displayName = pathEls[pathEls.length - 1];\r
-            } else {\r
-                fullPath = pair[0];\r
-                pathEls = pair[0].split("/");\r
-                displayName = pair[1];\r
-            }\r
-            String[] schemaSplit = pathEls[0].split(":", 2);\r
-            String schema;\r
-            if (schemaSplit.length == 1) {    // schema not specified\r
-                schema = null;\r
-            } else {\r
-                schema = schemaSplit[0];\r
-                if (pair.length == 1 && pathEls.length == 1) {    // simplest case of field in top level schema, no labelll\r
-                    displayName = schemaSplit[1];    // Have to fix up displayName to have no schema\r
-                }\r
-            }\r
-            this.displayName = displayName;\r
-            this.schema = schema;\r
-            this.fullPath = fullPath;\r
-            this.pathEls = pathEls;\r
-            checkPathEls();\r
-        }\r
-\r
-        protected void checkPathEls() {\r
-            int len = pathEls.length;\r
-            if (len < 1) {\r
-                throw new InternalError("Bad values in authRef info - caller screwed up:" + fullPath);\r
-            }\r
-            // Handle case of them putting a leading slash on the path\r
-            if (len > 1 && pathEls[0].endsWith(":")) {\r
-                len--;\r
-                String[] newArray = new String[len];\r
-                newArray[0] = pathEls[0] + pathEls[1];\r
-                if (len >= 2) {\r
-                    System.arraycopy(pathEls, 2, newArray, 1, len - 1);\r
-                }\r
-                pathEls = newArray;\r
-            }\r
-        }\r
-    }\r
-\r
-    public static class AuthRefInfo extends AuthRefConfigInfo {\r
-\r
-        public Property getProperty() {\r
-            return property;\r
-        }\r
-\r
-        public void setProperty(Property property) {\r
-            this.property = property;\r
-        }\r
-        Property property;\r
-\r
-        public AuthRefInfo(String displayName, String schema, String fullPath, String[] pathEls, Property prop) {\r
-            super(displayName, schema, fullPath, pathEls);\r
-            this.property = prop;\r
-        }\r
-\r
-        public AuthRefInfo(AuthRefConfigInfo arci, Property prop) {\r
-            super(arci);\r
-            this.property = prop;\r
-        }\r
-    }\r
-    \r
-    private static final Logger logger = LoggerFactory.getLogger(RefNameServiceUtils.class);\r
-    private static ArrayList<String> refNameServiceTypes = null;\r
-\r
-    public static void updateRefNamesInRelations(\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,\r
-            RepositoryInstanceInterface repoSession,\r
-            String oldRefName,\r
-            String newRefName) throws Exception {\r
-       //\r
-       // First, look for and update all the places where the refName is the "subject" of the relationship\r
-       //\r
-       RelationUtils.updateRefNamesInRelations(ctx, repoClient, repoSession, IRelationsManager.SUBJECT_REFNAME, oldRefName, newRefName);\r
-       \r
-       //\r
-       // Next, look for and update all the places where the refName is the "object" of the relationship\r
-       //\r
-       RelationUtils.updateRefNamesInRelations(ctx, repoClient, repoSession, IRelationsManager.OBJECT_REFNAME, oldRefName, newRefName);\r
-    }\r
-    \r
-    public static List<AuthRefConfigInfo> getConfiguredAuthorityRefs(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {\r
-        List<String> authRefFields =\r
-                ((AbstractServiceContextImpl) ctx).getAllPartsPropertyValues(\r
-                ServiceBindingUtils.AUTH_REF_PROP, ServiceBindingUtils.QUALIFIED_PROP_NAMES);\r
-        ArrayList<AuthRefConfigInfo> authRefsInfo = new ArrayList<AuthRefConfigInfo>(authRefFields.size());\r
-        for (String spec : authRefFields) {\r
-            AuthRefConfigInfo arci = new AuthRefConfigInfo(spec);\r
-            authRefsInfo.add(arci);\r
-        }\r
-        return authRefsInfo;\r
-    }\r
-\r
-    public static AuthorityRefDocList getAuthorityRefDocs(\r
-               RepositoryInstanceInterface repoSession,\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            UriTemplateRegistry uriTemplateRegistry,\r
-            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,\r
-            List<String> serviceTypes,\r
-            String refName,\r
-            String refPropName, // authRef or termRef, authorities or vocab terms.\r
-            DocumentFilter filter, boolean computeTotal)\r
-            throws DocumentException, DocumentNotFoundException {\r
-        AuthorityRefDocList wrapperList = new AuthorityRefDocList();\r
-        AbstractCommonList commonList = (AbstractCommonList) wrapperList;\r
-        int pageNum = filter.getStartPage();\r
-        int pageSize = filter.getPageSize();\r
-        \r
-        List<AuthorityRefDocList.AuthorityRefDocItem> list =\r
-                wrapperList.getAuthorityRefDocItem();\r
-\r
-        Map<String, ServiceBindingType> queriedServiceBindings = new HashMap<String, ServiceBindingType>();\r
-        Map<String, List<AuthRefConfigInfo>> authRefFieldsByService = new HashMap<String, List<AuthRefConfigInfo>>();\r
-\r
-        RepositoryJavaClientImpl nuxeoRepoClient = (RepositoryJavaClientImpl) repoClient;\r
-        try {\r
-            // Ignore any provided page size and number query parameters in\r
-            // the following call, as they pertain to the list of authority\r
-            // references to be returned, not to the list of documents to be\r
-            // scanned for those references.\r
-            \r
-            // Get a list of possibly referencing documents. This list is\r
-            // lazily loaded, page by page. Ideally, only one page will\r
-            // need to be loaded to fill one page of results. Some number\r
-            // of possibly referencing documents will be false positives,\r
-            // so use a page size of double the requested page size to\r
-            // account for those.\r
-            DocumentModelList docList = findAllAuthorityRefDocs(ctx, repoClient, repoSession,\r
-                    serviceTypes, refName, refPropName, queriedServiceBindings, authRefFieldsByService,\r
-                    filter.getWhereClause(), null, 2*pageSize, computeTotal);\r
-\r
-            if (docList == null) { // found no authRef fields - nothing to process\r
-                return wrapperList;\r
-            }\r
-\r
-            // set the fieldsReturned list. Even though this is a fixed schema, app layer treats\r
-            // this like other abstract common lists\r
-            /*\r
-             * <xs:element name="docType" type="xs:string" minOccurs="1" />\r
-             * <xs:element name="docId" type="xs:string" minOccurs="1" />\r
-             * <xs:element name="docNumber" type="xs:string" minOccurs="0" />\r
-             * <xs:element name="docName" type="xs:string" minOccurs="0" />\r
-             * <xs:element name="sourceField" type="xs:string" minOccurs="1" />\r
-             * <xs:element name="uri" type="xs:anyURI" minOccurs="1" />\r
-             * <xs:element name="refName" type="xs:String" minOccurs="1" />\r
-             * <xs:element name="updatedAt" type="xs:string" minOccurs="1" />\r
-             * <xs:element name="workflowState" type="xs:string" minOccurs="1"\r
-             * />\r
-             */\r
-            String fieldList = "docType|docId|docNumber|docName|sourceField|uri|refName|updatedAt|workflowState";\r
-            commonList.setFieldsReturned(fieldList);\r
-\r
-            // As a side-effect, the method called below modifies the value of\r
-            // the 'list' variable, which holds the list of references to\r
-            // an authority item.\r
-            //\r
-            // There can be more than one reference to a particular authority\r
-            // item within any individual document scanned, so the number of\r
-            // authority references may potentially exceed the total number\r
-            // of documents scanned.\r
-\r
-            // Strip off displayName and only match the base, so we get references to all \r
-            // the NPTs as well as the PT.\r
-               String strippedRefName = RefNameUtils.stripAuthorityTermDisplayName(refName);\r
-               \r
-               // *** Need to pass in pagination info here. \r
-            int nRefsFound = processRefObjsDocListForList(docList, ctx.getTenantId(), strippedRefName, \r
-                       queriedServiceBindings, authRefFieldsByService, // the actual list size needs to be updated to the size of "list"\r
-                    list, pageSize, pageNum);\r
-               \r
-            commonList.setPageSize(pageSize);\r
-            \r
-            // Values returned in the pagination block above the list items\r
-            // need to reflect the number of references to authority items\r
-            // returned, rather than the number of documents originally scanned\r
-            // to find such references.\r
-            // This will be an estimate only...\r
-            commonList.setPageNum(pageNum);\r
-               commonList.setTotalItems(nRefsFound);   // Accurate if total was scanned, otherwise, just an estimate\r
-            commonList.setItemsInPage(list.size());\r
-\r
-            /* Pagination is now handled in the processing step\r
-            // Slice the list to return only the specified page of items\r
-            // in the list results.\r
-            //\r
-            // FIXME: There may well be a pattern-based way to do this\r
-            // in our framework, and if we can eliminate much of the\r
-            // non-DRY code below, that would be desirable.\r
-            \r
-            int startIndex = 0;\r
-            int endIndex = 0;\r
-            \r
-            // Return all results if pageSize is 0.\r
-            if (pageSize == 0) {\r
-                startIndex = 0;\r
-                endIndex = list.size();\r
-            } else {\r
-               startIndex = pageNum * pageSize;\r
-            }\r
-            \r
-            // Return an empty list when the start of the requested page is\r
-            // beyond the last item in the list.\r
-            if (startIndex > list.size()) {\r
-                wrapperList.getAuthorityRefDocItem().clear();\r
-                commonList.setItemsInPage(wrapperList.getAuthorityRefDocItem().size());\r
-                return wrapperList;\r
-            }\r
-\r
-            // Otherwise, return a list of items from the start of the specified\r
-            // page through the last item on that page, or otherwise through the\r
-            // last item in the entire list, if that occurs earlier than the end\r
-            // of the specified page.\r
-            if (endIndex == 0) {\r
-                int pageEndIndex = ((startIndex + pageSize));\r
-                endIndex = (pageEndIndex > list.size()) ? list.size() : pageEndIndex;\r
-            }\r
-            \r
-            // Slice the list to return only the specified page of results.\r
-            // Note: the second argument to List.subList(), endIndex, is\r
-            // exclusive of the item at its index position, reflecting the\r
-            // zero-index nature of the list.\r
-            List<AuthorityRefDocList.AuthorityRefDocItem> currentPageList =\r
-                    new ArrayList<AuthorityRefDocList.AuthorityRefDocItem>(list.subList(startIndex, endIndex));\r
-            wrapperList.getAuthorityRefDocItem().clear();\r
-            wrapperList.getAuthorityRefDocItem().addAll(currentPageList);\r
-            commonList.setItemsInPage(currentPageList.size());\r
-            */\r
-            \r
-            if (logger.isDebugEnabled() && (nRefsFound < docList.size())) {\r
-                logger.debug("Internal curiosity: got fewer matches of refs than # docs matched..."); // We found a ref to ourself and have excluded it.\r
-            }\r
-        } catch (Exception e) {\r
-            logger.error("Could not retrieve a list of documents referring to the specified authority item", e);\r
-            wrapperList = null;\r
-        }\r
-\r
-        return wrapperList;\r
-    }\r
-\r
-    private static ArrayList<String> getRefNameServiceTypes() {\r
-        if (refNameServiceTypes == null) {\r
-            refNameServiceTypes = new ArrayList<String>();\r
-            refNameServiceTypes.add(ServiceBindingUtils.SERVICE_TYPE_AUTHORITY);\r
-            refNameServiceTypes.add(ServiceBindingUtils.SERVICE_TYPE_OBJECT);\r
-            refNameServiceTypes.add(ServiceBindingUtils.SERVICE_TYPE_PROCEDURE);\r
-        }\r
-        return refNameServiceTypes;\r
-    }\r
-    \r
-    // Seems like a good value - no real data to set this well.\r
-    // Note: can set this value lower during debugging; e.g. to 3 - ADR 2012-07-10\r
-    private static final int N_OBJS_TO_UPDATE_PER_LOOP = 100;\r
-\r
-    public static int updateAuthorityRefDocs(\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,\r
-            RepositoryInstanceInterface repoSession,\r
-            String oldRefName,\r
-            String newRefName,\r
-            String refPropName) throws Exception {\r
-        Map<String, ServiceBindingType> queriedServiceBindings = new HashMap<String, ServiceBindingType>();\r
-        Map<String, List<AuthRefConfigInfo>> authRefFieldsByService = new HashMap<String, List<AuthRefConfigInfo>>();\r
-\r
-        int docsScanned = 0;\r
-        int nRefsFound = 0;\r
-        int currentPage = 0;\r
-        int docsInCurrentPage = 0;\r
-        final String WHERE_CLAUSE_ADDITIONS_VALUE = null;\r
-        final String ORDER_BY_VALUE = CollectionSpaceClient.CORE_CREATED_AT  // "collectionspace_core:createdAt";\r
-                                          + ", " + IQueryManager.NUXEO_UUID; // CSPACE-6333: Add secondary sort on uuid, in case records have the same createdAt timestamp.\r
-\r
-        if (repoClient instanceof RepositoryJavaClientImpl == false) {\r
-            throw new InternalError("updateAuthorityRefDocs() called with unknown repoClient type!");\r
-        }\r
-        \r
-        try { // REM - How can we deal with transaction and timeout issues here?\r
-            final int pageSize = N_OBJS_TO_UPDATE_PER_LOOP;\r
-            DocumentModelList docList;\r
-            boolean morePages = true;\r
-            while (morePages) {\r
-\r
-                docList = findAuthorityRefDocs(ctx, repoClient, repoSession,\r
-                        getRefNameServiceTypes(), oldRefName, refPropName,\r
-                        queriedServiceBindings, authRefFieldsByService, WHERE_CLAUSE_ADDITIONS_VALUE, ORDER_BY_VALUE, pageSize, currentPage, false);\r
-\r
-                if (docList == null) {\r
-                    logger.debug("updateAuthorityRefDocs: no documents could be found that referenced the old refName");\r
-                    break;\r
-                }\r
-                docsInCurrentPage = docList.size();\r
-                logger.debug("updateAuthorityRefDocs: current page=" + currentPage + " documents included in page=" + docsInCurrentPage);\r
-                if (docsInCurrentPage == 0) {\r
-                    logger.debug("updateAuthorityRefDocs: no more documents requiring refName updates could be found");\r
-                    break;\r
-                }\r
-                if (docsInCurrentPage < pageSize) {\r
-                    logger.debug("updateAuthorityRefDocs: assuming no more documents requiring refName updates will be found, as docsInCurrentPage < pageSize");\r
-                    morePages = false;\r
-                }\r
-\r
-                // Only match complete refNames - unless and until we decide how to resolve changes\r
-                // to NPTs we will defer that and only change PTs or refNames as passed in.\r
-                int nRefsFoundThisPage = processRefObjsDocListForUpdate(docList, ctx.getTenantId(), oldRefName, \r
-                               queriedServiceBindings, authRefFieldsByService, // Perform the refName updates on the list of document models\r
-                        newRefName);\r
-                if (nRefsFoundThisPage > 0) {\r
-                    ((RepositoryJavaClientImpl) repoClient).saveDocListWithoutHandlerProcessing(ctx, repoSession, docList, true); // Flush the document model list out to Nuxeo storage\r
-                    nRefsFound += nRefsFoundThisPage;\r
-                }\r
-\r
-                // FIXME: Per REM, set a limit of num objects - something like\r
-                // 1000K objects - and also add a log Warning after some threshold\r
-                docsScanned += docsInCurrentPage;\r
-                if (morePages) {\r
-                    currentPage++;\r
-                }\r
-\r
-            }\r
-        } catch (Exception e) {\r
-            logger.error("Internal error updating the AuthorityRefDocs: " + e.getLocalizedMessage());\r
-            logger.debug(Tools.errorToString(e, true));\r
-            throw e;\r
-        }\r
-        logger.debug("updateAuthorityRefDocs replaced a total of " + nRefsFound + " authority references, within as many as " + docsScanned + " scanned document(s)");\r
-        return nRefsFound;\r
-    }\r
-\r
-    private static DocumentModelList findAllAuthorityRefDocs(\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,\r
-            RepositoryInstanceInterface repoSession, List<String> serviceTypes,\r
-            String refName,\r
-            String refPropName,\r
-            Map<String, ServiceBindingType> queriedServiceBindings,\r
-            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,\r
-            String whereClauseAdditions,\r
-            String orderByClause,\r
-            int pageSize,\r
-            boolean computeTotal) throws DocumentException, DocumentNotFoundException {\r
-               \r
-       return new LazyAuthorityRefDocList(ctx, repoClient, repoSession,\r
-                       serviceTypes, refName, refPropName, queriedServiceBindings, authRefFieldsByService,\r
-                       whereClauseAdditions, orderByClause, pageSize, computeTotal);\r
-    }\r
-    \r
-    protected static DocumentModelList findAuthorityRefDocs(\r
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r
-            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,\r
-            RepositoryInstanceInterface repoSession, List<String> serviceTypes,\r
-            String refName,\r
-            String refPropName,\r
-            Map<String, ServiceBindingType> queriedServiceBindings,\r
-            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,\r
-            String whereClauseAdditions,\r
-            String orderByClause,\r
-            int pageSize,\r
-            int pageNum,\r
-            boolean computeTotal) throws DocumentException, DocumentNotFoundException {\r
-\r
-        // Get the service bindings for this tenant\r
-        TenantBindingConfigReaderImpl tReader =\r
-                ServiceMain.getInstance().getTenantBindingConfigReader();\r
-        // We need to get all the procedures, authorities, and objects.\r
-        List<ServiceBindingType> servicebindings = tReader.getServiceBindingsByType(ctx.getTenantId(), serviceTypes);\r
-        if (servicebindings == null || servicebindings.isEmpty()) {\r
-            logger.error("RefNameServiceUtils.getAuthorityRefDocs: No services bindings found, cannot proceed!");\r
-            return null;\r
-        }\r
-        // Filter the list for current user rights\r
-        servicebindings = SecurityUtils.getReadableServiceBindingsForCurrentUser(servicebindings);\r
-\r
-        ArrayList<String> docTypes = new ArrayList<String>();\r
-\r
-        String query = computeWhereClauseForAuthorityRefDocs(refName, refPropName, docTypes, servicebindings, // REM - Side effect that docTypes array gets set.  Any others?\r
-                queriedServiceBindings, authRefFieldsByService);\r
-        if (query == null) { // found no authRef fields - nothing to query\r
-            return null;\r
-        }\r
-        // Additional qualifications, like workflow state\r
-        if (Tools.notBlank(whereClauseAdditions)) {\r
-            query += " AND " + whereClauseAdditions;\r
-        }\r
-        // Now we have to issue the search\r
-        RepositoryJavaClientImpl nuxeoRepoClient = (RepositoryJavaClientImpl) repoClient;\r
-        DocumentWrapper<DocumentModelList> docListWrapper = nuxeoRepoClient.findDocs(ctx, repoSession,\r
-                docTypes, query, orderByClause, pageSize, pageNum, computeTotal);\r
-        // Now we gather the info for each document into the list and return\r
-        DocumentModelList docList = docListWrapper.getWrappedObject();\r
-        return docList;\r
-    }\r
-    private static final boolean READY_FOR_COMPLEX_QUERY = true;\r
-\r
-    private static String computeWhereClauseForAuthorityRefDocs(\r
-            String refName,\r
-            String refPropName,\r
-            ArrayList<String> docTypes,\r
-            List<ServiceBindingType> servicebindings,\r
-            Map<String, ServiceBindingType> queriedServiceBindings,\r
-            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService) {\r
-\r
-        boolean fFirst = true;\r
-        List<String> authRefFieldPaths;\r
-        for (ServiceBindingType sb : servicebindings) {\r
-            // Gets the property names for each part, qualified with the part label (which\r
-            // is also the table name, the way that the repository works).\r
-            authRefFieldPaths =\r
-                    ServiceBindingUtils.getAllPartsPropertyValues(sb,\r
-                    refPropName, ServiceBindingUtils.QUALIFIED_PROP_NAMES);\r
-            if (authRefFieldPaths.isEmpty()) {\r
-                continue;\r
-            }\r
-            ArrayList<AuthRefConfigInfo> authRefsInfo = new ArrayList<AuthRefConfigInfo>();\r
-            for (String spec : authRefFieldPaths) {\r
-                AuthRefConfigInfo arci = new AuthRefConfigInfo(spec);\r
-                authRefsInfo.add(arci);\r
-            }\r
-\r
-            String docType = sb.getObject().getName();\r
-            queriedServiceBindings.put(docType, sb);\r
-            authRefFieldsByService.put(docType, authRefsInfo);\r
-            docTypes.add(docType);\r
-            fFirst = false;\r
-        }\r
-        if (fFirst) { // found no authRef fields - nothing to query\r
-            return null;\r
-        }\r
-        // We used to build a complete matches query, but that was too complex.\r
-        // Just build a keyword query based upon some key pieces - the urn syntax elements and the shortID\r
-        // Note that this will also match the Item itself, but that will get filtered out when\r
-        // we compute actual matches.\r
-        AuthorityTermInfo authTermInfo = RefNameUtils.parseAuthorityTermInfo(refName);\r
-\r
-        String keywords = RefNameUtils.URN_PREFIX\r
-                + " AND " + (authTermInfo.inAuthority.name != null\r
-                ? authTermInfo.inAuthority.name : authTermInfo.inAuthority.csid)\r
-                + " AND " + (authTermInfo.name != null\r
-                ? authTermInfo.name : authTermInfo.csid);\r
-\r
-        String whereClauseStr = QueryManager.createWhereClauseFromKeywords(keywords);\r
-\r
-        if (logger.isTraceEnabled()) {\r
-            logger.trace("The 'where' clause to find refObjs is: ", whereClauseStr);\r
-        }\r
-\r
-        return whereClauseStr;\r
-    }\r
-    \r
-    // TODO there are multiple copies of this that should be put somewhere common.\r
-       protected static String getRefname(DocumentModel docModel) throws ClientException {\r
-               String result = (String)docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,\r
-                               CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME);\r
-               return result;\r
-       }\r
-\r
-    private static int processRefObjsDocListForUpdate(\r
-            DocumentModelList docList,\r
-            String tenantId,\r
-            String refName,\r
-            Map<String, ServiceBindingType> queriedServiceBindings,\r
-            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,\r
-            String newAuthorityRefName) {\r
-       return processRefObjsDocList(docList, tenantId, refName, false, queriedServiceBindings,\r
-                       authRefFieldsByService, null, 0, 0, newAuthorityRefName);\r
-    }\r
-                       \r
-    private static int processRefObjsDocListForList(\r
-            DocumentModelList docList,\r
-            String tenantId,\r
-            String refName,\r
-            Map<String, ServiceBindingType> queriedServiceBindings,\r
-            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,\r
-            List<AuthorityRefDocList.AuthorityRefDocItem> list, \r
-            int pageSize, int pageNum) {\r
-       return processRefObjsDocList(docList, tenantId, refName, true, queriedServiceBindings,\r
-                       authRefFieldsByService, list, pageSize, pageNum, null);\r
-    }\r
-                       \r
-\r
-       /*\r
-     * Runs through the list of found docs, processing them. If list is\r
-     * non-null, then processing means gather the info for items. If list is\r
-     * null, and newRefName is non-null, then processing means replacing and\r
-     * updating. If processing/updating, this must be called in the context of\r
-     * an open session, and caller must release Session after calling this.\r
-     *\r
-     */\r
-    private static int processRefObjsDocList(\r
-            DocumentModelList docList,\r
-            String tenantId,\r
-            String refName,\r
-            boolean matchBaseOnly,\r
-            Map<String, ServiceBindingType> queriedServiceBindings,\r
-            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,\r
-            List<AuthorityRefDocList.AuthorityRefDocItem> list,\r
-            int pageSize, int pageNum, // Only used when constructing a list.\r
-            String newAuthorityRefName) {\r
-        UriTemplateRegistry registry = ServiceMain.getInstance().getUriTemplateRegistry();\r
-        Iterator<DocumentModel> iter = docList.iterator();\r
-        int nRefsFoundTotal = 0;\r
-        boolean foundSelf = false;\r
-\r
-        // When paginating results, we have to guess at the total. First guess is the number of docs returned\r
-        // by the query. However, this returns some false positives, so may be high. \r
-        // In addition, we can match multiple fields per doc, so this may be low. Fun, eh?\r
-        int nDocsReturnedInQuery = (int)docList.totalSize();\r
-        int nDocsProcessed = 0;\r
-        int firstItemInPage = pageNum*pageSize;\r
-        while (iter.hasNext()) {\r
-            DocumentModel docModel = iter.next();\r
-            AuthorityRefDocList.AuthorityRefDocItem ilistItem;\r
-\r
-            String docType = docModel.getDocumentType().getName(); // REM - This will be a tentant qualified document type\r
-            docType = ServiceBindingUtils.getUnqualifiedTenantDocType(docType);\r
-            ServiceBindingType sb = queriedServiceBindings.get(docType);\r
-            if (sb == null) {\r
-                throw new RuntimeException(\r
-                        "getAuthorityRefDocs: No Service Binding for docType: " + docType);\r
-            }\r
-\r
-            if (list == null) { // no list - should be update refName case.\r
-                if (newAuthorityRefName == null) {\r
-                    throw new InternalError("processRefObjsDocList() called with neither an itemList nor a new RefName!");\r
-                }\r
-                ilistItem = null;\r
-                pageSize = 0;\r
-                firstItemInPage = 0;   // Do not paginate if updating, rather than building list\r
-            } else {    // Have a list - refObjs case\r
-                if (newAuthorityRefName != null) {\r
-                    throw new InternalError("processRefObjsDocList() called with both an itemList and a new RefName!");\r
-                }\r
-                if(firstItemInPage > 100) {\r
-                       logger.warn("Processing a large offset (size:{}, num:{}) for refObjs - will be expensive!!!",\r
-                                               pageSize, pageNum);\r
-                }\r
-                // Note that we have to go through check all the fields to determine the actual page start\r
-                ilistItem = new AuthorityRefDocList.AuthorityRefDocItem();\r
-                String csid = NuxeoUtils.getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString());\r
-                try {\r
-                       String itemRefName = getRefname(docModel);\r
-                       ilistItem.setRefName(itemRefName);\r
-                } catch (ClientException ce) {\r
-                    throw new RuntimeException(\r
-                            "processRefObjsDocList: Problem fetching refName from item Object: " \r
-                                       + ce.getLocalizedMessage());\r
-                }\r
-                ilistItem.setDocId(csid);\r
-                String uri = "";\r
-                UriTemplateRegistryKey key = new UriTemplateRegistryKey(tenantId, docType);\r
-                StoredValuesUriTemplate template = registry.get(key);\r
-                if (template != null) {\r
-                    Map<String, String> additionalValues = new HashMap<String, String>();\r
-                    if (template.getUriTemplateType() == UriTemplateFactory.RESOURCE) {\r
-                        additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, csid);\r
-                        uri = template.buildUri(additionalValues);\r
-                    } else if (template.getUriTemplateType() == UriTemplateFactory.ITEM) {\r
-                        try {\r
-                            String inAuthorityCsid = (String) docModel.getPropertyValue("inAuthority"); // AuthorityItemJAXBSchema.IN_AUTHORITY\r
-                            additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, inAuthorityCsid);\r
-                            additionalValues.put(UriTemplateFactory.ITEM_IDENTIFIER_VAR, csid);\r
-                            uri = template.buildUri(additionalValues);\r
-                        } catch (Exception e) {\r
-                            logger.warn("Could not extract inAuthority property from authority item record: " + e.getMessage());\r
-                        }\r
-                    } else if (template.getUriTemplateType() == UriTemplateFactory.CONTACT) {\r
-                        // FIXME: Generating contact sub-resource URIs requires additional work,\r
-                        // as a follow-on to CSPACE-5271 - ADR 2012-08-16\r
-                        // Sets the default (empty string) value for uri, for now\r
-                    } else {\r
-                        logger.warn("Unrecognized URI template type = " + template.getUriTemplateType());\r
-                        // Sets the default (empty string) value for uri\r
-                    }\r
-                } else { // (if template == null)\r
-                    logger.warn("Could not retrieve URI template from registry via tenant ID "\r
-                            + tenantId + " and docType " + docType);\r
-                    // Sets the default (empty string) value for uri\r
-                }\r
-                ilistItem.setUri(uri);\r
-                try {\r
-                    ilistItem.setWorkflowState(docModel.getCurrentLifeCycleState());\r
-                    ilistItem.setUpdatedAt(DocHandlerBase.getUpdatedAtAsString(docModel));\r
-                } catch (Exception e) {\r
-                    logger.error("Error getting core values for doc [" + csid + "]: " + e.getLocalizedMessage());\r
-                }\r
-                ilistItem.setDocType(docType);\r
-                ilistItem.setDocNumber(\r
-                        ServiceBindingUtils.getMappedFieldInDoc(sb, ServiceBindingUtils.OBJ_NUMBER_PROP, docModel));\r
-                ilistItem.setDocName(\r
-                        ServiceBindingUtils.getMappedFieldInDoc(sb, ServiceBindingUtils.OBJ_NAME_PROP, docModel));\r
-            }\r
-            // Now, we have to loop over the authRefFieldsByService to figure\r
-            // out which field(s) matched this.\r
-            List<AuthRefConfigInfo> matchingAuthRefFields = authRefFieldsByService.get(docType);\r
-            if (matchingAuthRefFields == null || matchingAuthRefFields.isEmpty()) {\r
-                throw new RuntimeException(\r
-                        "getAuthorityRefDocs: internal logic error: can't fetch authRefFields for DocType.");\r
-            }\r
-            //String authRefAncestorField = "";\r
-            //String authRefDescendantField = "";\r
-            //String sourceField = "";\r
-\r
-            ArrayList<RefNameServiceUtils.AuthRefInfo> foundProps = new ArrayList<RefNameServiceUtils.AuthRefInfo>();\r
-            try {\r
-                findAuthRefPropertiesInDoc(docModel, matchingAuthRefFields, refName, matchBaseOnly, foundProps); // REM - side effect that foundProps is set\r
-                if(!foundProps.isEmpty()) {\r
-                    int nRefsFoundInDoc = 0;\r
-                       for (RefNameServiceUtils.AuthRefInfo ari : foundProps) {\r
-                               if (ilistItem != null) {\r
-                                       // So this is a true positive, and not a false one. We have to consider pagination now.\r
-                                       if(nRefsFoundTotal >= firstItemInPage) {        // skipped enough already\r
-                                               if (nRefsFoundInDoc == 0) {    // First one?\r
-                                                       ilistItem.setSourceField(ari.getQualifiedDisplayName());\r
-                                               } else {    // duplicates from one object\r
-                                                       ilistItem = cloneAuthRefDocItem(ilistItem, ari.getQualifiedDisplayName());\r
-                                               }\r
-                                               list.add(ilistItem);\r
-                                       nRefsFoundInDoc++;      // Only increment if processed, or clone logic above will fail\r
-                                       }\r
-                               } else {    // update refName case\r
-                                       Property propToUpdate = ari.getProperty();\r
-                                       propToUpdate.setValue(newAuthorityRefName);\r
-                               }\r
-                               nRefsFoundTotal++;              // Whether we processed or not, we found - essential to pagination logic\r
-                       }\r
-                } else if(ilistItem != null) {\r
-                       String docRefName = ilistItem.getRefName();\r
-                    if (matchBaseOnly?\r
-                                       (docRefName!=null && docRefName.startsWith(refName))\r
-                                       :refName.equals(docRefName)) {\r
-                               // We found the self for an item\r
-                               foundSelf = true;\r
-                               logger.debug("getAuthorityRefDocs: Result: "\r
-                                                               + docType + " [" + NuxeoUtils.getCsid(docModel)\r
-                                                               + "] appears to be self for: ["\r
-                                                               + refName + "]");\r
-                       } else {\r
-                               logger.debug("getAuthorityRefDocs: Result: "\r
-                                                               + docType + " [" + NuxeoUtils.getCsid(docModel)\r
-                                                               + "] does not reference ["\r
-                                                               + refName + "]");\r
-                       }\r
-                }\r
-            } catch (ClientException ce) {\r
-               throw new RuntimeException(\r
-                               "getAuthorityRefDocs: Problem fetching values from repo: " + ce.getLocalizedMessage());\r
-            }\r
-            nDocsProcessed++;\r
-            // Done processing that doc. Are we done with the whole page?\r
-            // Note pageSize <=0 means do them all\r
-            if((pageSize > 0) && ((nRefsFoundTotal-firstItemInPage)>=pageSize)) {\r
-               // Quitting early, so we need to estimate the total. Assume one per doc\r
-               // for the rest of the docs we matched in the query\r
-               int unprocessedDocs = nDocsReturnedInQuery - nDocsProcessed;\r
-               if(unprocessedDocs>0) {\r
-                       // We generally match ourselves in the keyword search. If we already saw ourselves\r
-                       // then do not try to correct for this. Otherwise, decrement the total.\r
-                       // Yes, this is fairly goofy, but the whole estimation mechanism is goofy. \r
-                       if(!foundSelf)\r
-                               unprocessedDocs--;\r
-                       nRefsFoundTotal += unprocessedDocs;\r
-               }\r
-               break;\r
-            }\r
-        } // close while(iterator)\r
-        return nRefsFoundTotal;\r
-    }\r
-\r
-    private static AuthorityRefDocList.AuthorityRefDocItem cloneAuthRefDocItem(\r
-            AuthorityRefDocList.AuthorityRefDocItem ilistItem, String sourceField) {\r
-        AuthorityRefDocList.AuthorityRefDocItem newlistItem = new AuthorityRefDocList.AuthorityRefDocItem();\r
-        newlistItem.setDocId(ilistItem.getDocId());\r
-        newlistItem.setDocName(ilistItem.getDocName());\r
-        newlistItem.setDocNumber(ilistItem.getDocNumber());\r
-        newlistItem.setDocType(ilistItem.getDocType());\r
-        newlistItem.setUri(ilistItem.getUri());\r
-        newlistItem.setSourceField(sourceField);\r
-        return newlistItem;\r
-    }\r
-\r
-    public static List<AuthRefInfo> findAuthRefPropertiesInDoc(\r
-            DocumentModel docModel,\r
-            List<AuthRefConfigInfo> authRefFieldInfo,\r
-            String refNameToMatch,\r
-            List<AuthRefInfo> foundProps) {\r
-       return findAuthRefPropertiesInDoc(docModel, authRefFieldInfo, \r
-                                                                       refNameToMatch, false, foundProps);\r
-    }\r
-    \r
-    public static List<AuthRefInfo> findAuthRefPropertiesInDoc(\r
-            DocumentModel docModel,\r
-            List<AuthRefConfigInfo> authRefFieldInfo,\r
-            String refNameToMatch,\r
-            boolean matchBaseOnly,\r
-            List<AuthRefInfo> foundProps) {\r
-        // Assume that authRefFieldInfo is keyed by the field name (possibly mapped for UI)\r
-        // and the values are elPaths to the field, where intervening group structures in\r
-        // lists of complex structures are replaced with "*". Thus, valid paths include\r
-        // the following (note that the ServiceBindingUtils prepend schema names to configured values):\r
-        // "schemaname:fieldname"\r
-        // "schemaname:scalarlistname"\r
-        // "schemaname:complexfieldname/fieldname"\r
-        // "schemaname:complexlistname/*/fieldname"\r
-        // "schemaname:complexlistname/*/scalarlistname"\r
-        // "schemaname:complexlistname/*/complexfieldname/fieldname"\r
-        // "schemaname:complexlistname/*/complexlistname/*/fieldname"\r
-        // etc.\r
-        for (AuthRefConfigInfo arci : authRefFieldInfo) {\r
-            try {\r
-                // Get first property and work down as needed.\r
-                Property prop = docModel.getProperty(arci.pathEls[0]);\r
-                findAuthRefPropertiesInProperty(foundProps, prop, arci, 0, refNameToMatch, matchBaseOnly);\r
-            } catch (Exception e) {\r
-                logger.error("Problem fetching property: " + arci.pathEls[0]);\r
-            }\r
-        }\r
-        return foundProps;\r
-    }\r
-\r
-    private static List<AuthRefInfo> findAuthRefPropertiesInProperty(\r
-            List<AuthRefInfo> foundProps,\r
-            Property prop,\r
-            AuthRefConfigInfo arci,\r
-            int pathStartIndex, // Supports recursion and we work down the path\r
-            String refNameToMatch,\r
-            boolean matchBaseOnly ) {\r
-        if (pathStartIndex >= arci.pathEls.length) {\r
-            throw new ArrayIndexOutOfBoundsException("Index = " + pathStartIndex + " for path: "\r
-                    + arci.pathEls.toString());\r
-        }\r
-        AuthRefInfo ari = null;\r
-        if (prop == null) {\r
-            return foundProps;\r
-        }\r
-\r
-        if (prop instanceof StringProperty) {    // scalar string\r
-            addARIifMatches(refNameToMatch, matchBaseOnly, arci, prop, foundProps);\r
-        } else if (prop instanceof List) {\r
-            List<Property> propList = (List<Property>) prop;\r
-            // run through list. Must either be list of Strings, or Complex\r
-            for (Property listItemProp : propList) {\r
-                if (listItemProp instanceof StringProperty) {\r
-                    if (arci.pathEls.length - pathStartIndex != 1) {\r
-                        logger.error("Configuration for authRefs does not match schema structure: "\r
-                                + arci.pathEls.toString());\r
-                        break;\r
-                    } else {\r
-                        addARIifMatches(refNameToMatch, matchBaseOnly, arci, listItemProp, foundProps);\r
-                    }\r
-                } else if (listItemProp.isComplex()) {\r
-                    // Just recurse to handle this. Note that since this is a list of complex, \r
-                    // which should look like listName/*/... we add 2 to the path start index \r
-                    findAuthRefPropertiesInProperty(foundProps, listItemProp, arci,\r
-                            pathStartIndex + 2, refNameToMatch, matchBaseOnly);\r
-                } else {\r
-                    logger.error("Configuration for authRefs does not match schema structure: "\r
-                            + arci.pathEls.toString());\r
-                    break;\r
-                }\r
-            }\r
-        } else if (prop.isComplex()) {\r
-            String localPropName = arci.pathEls[pathStartIndex];\r
-            try {\r
-                Property localProp = prop.get(localPropName);\r
-                // Now just recurse, pushing down the path 1 step\r
-                findAuthRefPropertiesInProperty(foundProps, localProp, arci,\r
-                        pathStartIndex, refNameToMatch, matchBaseOnly);\r
-            } catch (PropertyNotFoundException pnfe) {\r
-                logger.error("Could not find property: [" + localPropName + "] in path: "\r
-                        + arci.getFullPath());\r
-                // Fall through - ari will be null and we will continue...\r
-            }\r
-        } else {\r
-            logger.error("Configuration for authRefs does not match schema structure: "\r
-                    + arci.pathEls.toString());\r
-        }\r
-\r
-        if (ari != null) {\r
-            foundProps.add(ari); //FIXME: REM - This is dead code.  'ari' is never touched after being initalized to null.  Why?\r
-        }\r
-\r
-        return foundProps;\r
-    }\r
-\r
-    private static void addARIifMatches(\r
-            String refNameToMatch,\r
-            boolean matchBaseOnly,\r
-            AuthRefConfigInfo arci,\r
-            Property prop,\r
-            List<AuthRefInfo> foundProps) {\r
-        // Need to either match a passed refName \r
-        // OR have no refName to match but be non-empty\r
-        try {\r
-            String value = (String) prop.getValue();\r
-            if (((refNameToMatch != null) && \r
-                               (matchBaseOnly?\r
-                                       (value!=null && value.startsWith(refNameToMatch))\r
-                                       :refNameToMatch.equals(value)))\r
-                    || ((refNameToMatch == null) && Tools.notBlank(value))) {\r
-                // Found a match\r
-                logger.debug("Found a match on property: " + prop.getPath() + " with value: [" + value + "]");\r
-                AuthRefInfo ari = new AuthRefInfo(arci, prop);\r
-                foundProps.add(ari);\r
-            }\r
-        } catch (PropertyException pe) {\r
-            logger.debug("PropertyException on: " + prop.getPath() + pe.getLocalizedMessage());\r
-        }\r
-    }\r
-\r
-    /*\r
-     * Identifies whether the refName was found in the supplied field. If passed\r
-     * a new RefName, will set that into fields in which the old one was found.\r
-     *\r
-     * Only works for: * Scalar fields * Repeatable scalar fields (aka\r
-     * multi-valued fields)\r
-     *\r
-     * Does not work for: * Structured fields (complexTypes) * Repeatable\r
-     * structured fields (repeatable complexTypes) private static int\r
-     * refNameFoundInField(String oldRefName, Property fieldValue, String\r
-     * newRefName) { int nFound = 0; if (fieldValue instanceof List) {\r
-     * List<Property> fieldValueList = (List) fieldValue; for (Property\r
-     * listItemValue : fieldValueList) { try { if ((listItemValue instanceof\r
-     * StringProperty) &&\r
-     * oldRefName.equalsIgnoreCase((String)listItemValue.getValue())) {\r
-     * nFound++; if(newRefName!=null) { fieldValue.setValue(newRefName); } else\r
-     * { // We cannot quit after the first, if we are replacing values. // If we\r
-     * are just looking (not replacing), finding one is enough. break; } } }\r
-     * catch( PropertyException pe ) {} } } else { try { if ((fieldValue\r
-     * instanceof StringProperty) &&\r
-     * oldRefName.equalsIgnoreCase((String)fieldValue.getValue())) { nFound++;\r
-     * if(newRefName!=null) { fieldValue.setValue(newRefName); } } } catch(\r
-     * PropertyException pe ) {} } return nFound; }\r
-     */\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright 2009 University of California at Berkeley
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.collectionspace.services.common.vocabulary;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.nuxeo.ecm.core.api.ClientException;
+import org.nuxeo.ecm.core.api.DocumentModel;
+import org.nuxeo.ecm.core.api.DocumentModelList;
+import org.nuxeo.ecm.core.api.model.Property;
+import org.nuxeo.ecm.core.api.model.PropertyException;
+import org.nuxeo.ecm.core.api.model.PropertyNotFoundException;
+import org.nuxeo.ecm.core.api.model.impl.primitives.StringProperty;
+import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.IQueryManager;
+import org.collectionspace.services.client.IRelationsManager;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.ServiceMain;
+import org.collectionspace.services.common.StoredValuesUriTemplate;
+import org.collectionspace.services.common.UriTemplateFactory;
+import org.collectionspace.services.common.UriTemplateRegistry;
+import org.collectionspace.services.common.UriTemplateRegistryKey;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.context.AbstractServiceContextImpl;
+import org.collectionspace.services.common.api.RefNameUtils;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.api.RefNameUtils.AuthorityTermInfo;
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
+import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
+import org.collectionspace.services.common.context.ServiceBindingUtils;
+import org.collectionspace.services.common.document.DocumentException;
+import org.collectionspace.services.common.document.DocumentFilter;
+import org.collectionspace.services.common.document.DocumentNotFoundException;
+import org.collectionspace.services.common.document.DocumentUtils;
+import org.collectionspace.services.common.document.DocumentWrapper;
+import org.collectionspace.services.common.query.QueryManager;
+import org.collectionspace.services.common.relation.RelationUtils;
+import org.collectionspace.services.common.repository.RepositoryClient;
+import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
+import org.collectionspace.services.nuxeo.client.java.RepositoryInstanceInterface;
+import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;
+import org.collectionspace.services.common.security.SecurityUtils;
+import org.collectionspace.services.config.service.ServiceBindingType;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.nuxeo.util.NuxeoUtils;
+
+/**
+ * RefNameServiceUtils is a collection of services utilities related to refName
+ * usage.
+ *
+ * $LastChangedRevision: $ $LastChangedDate: $
+ */
+public class RefNameServiceUtils {
+
+    public static class AuthRefConfigInfo {
+
+        public String getQualifiedDisplayName() {
+            return (Tools.isBlank(schema))
+                    ? displayName : DocumentUtils.appendSchemaName(schema, displayName);
+        }
+
+        public String getDisplayName() {
+            return displayName;
+        }
+
+        public void setDisplayName(String displayName) {
+            this.displayName = displayName;
+        }
+        String displayName;
+        String schema;
+
+        public String getSchema() {
+            return schema;
+        }
+
+        public void setSchema(String schema) {
+            this.schema = schema;
+        }
+
+        public String getFullPath() {
+            return fullPath;
+        }
+
+        public void setFullPath(String fullPath) {
+            this.fullPath = fullPath;
+        }
+        String fullPath;
+        protected String[] pathEls;
+
+        public AuthRefConfigInfo(AuthRefConfigInfo arci) {
+            this.displayName = arci.displayName;
+            this.schema = arci.schema;
+            this.fullPath = arci.fullPath;
+            this.pathEls = arci.pathEls;
+            // Skip the pathElse check, since we are creatign from another (presumably valid) arci.
+        }
+
+        public AuthRefConfigInfo(String displayName, String schema, String fullPath, String[] pathEls) {
+            this.displayName = displayName;
+            this.schema = schema;
+            this.fullPath = fullPath;
+            this.pathEls = pathEls;
+            checkPathEls();
+        }
+
+        // Split a config value string like "intakes_common:collector", or
+        // "collectionobjects_common:contentPeoples|contentPeople"
+        // "collectionobjects_common:assocEventGroupList/*/assocEventPlace"
+        // If has a pipe ('|') second part is a displayLabel, and first is path
+        // Otherwise, entry is a path, and can use the last pathElement as displayName
+        // Should be schema qualified.
+        public AuthRefConfigInfo(String configString) {
+            String[] pair = configString.split("\\|", 2);
+            String[] pathEls;
+            String displayName, fullPath;
+            if (pair.length == 1) {
+                // no label specifier, so we'll defer getting label
+                fullPath = pair[0];
+                pathEls = pair[0].split("/");
+                displayName = pathEls[pathEls.length - 1];
+            } else {
+                fullPath = pair[0];
+                pathEls = pair[0].split("/");
+                displayName = pair[1];
+            }
+            String[] schemaSplit = pathEls[0].split(":", 2);
+            String schema;
+            if (schemaSplit.length == 1) {    // schema not specified
+                schema = null;
+            } else {
+                schema = schemaSplit[0];
+                if (pair.length == 1 && pathEls.length == 1) {    // simplest case of field in top level schema, no labelll
+                    displayName = schemaSplit[1];    // Have to fix up displayName to have no schema
+                }
+            }
+            this.displayName = displayName;
+            this.schema = schema;
+            this.fullPath = fullPath;
+            this.pathEls = pathEls;
+            checkPathEls();
+        }
+
+        protected void checkPathEls() {
+            int len = pathEls.length;
+            if (len < 1) {
+                throw new InternalError("Bad values in authRef info - caller screwed up:" + fullPath);
+            }
+            // Handle case of them putting a leading slash on the path
+            if (len > 1 && pathEls[0].endsWith(":")) {
+                len--;
+                String[] newArray = new String[len];
+                newArray[0] = pathEls[0] + pathEls[1];
+                if (len >= 2) {
+                    System.arraycopy(pathEls, 2, newArray, 1, len - 1);
+                }
+                pathEls = newArray;
+            }
+        }
+    }
+
+    public static class AuthRefInfo extends AuthRefConfigInfo {
+
+        public Property getProperty() {
+            return property;
+        }
+
+        public void setProperty(Property property) {
+            this.property = property;
+        }
+        Property property;
+
+        public AuthRefInfo(String displayName, String schema, String fullPath, String[] pathEls, Property prop) {
+            super(displayName, schema, fullPath, pathEls);
+            this.property = prop;
+        }
+
+        public AuthRefInfo(AuthRefConfigInfo arci, Property prop) {
+            super(arci);
+            this.property = prop;
+        }
+    }
+    
+    private static final Logger logger = LoggerFactory.getLogger(RefNameServiceUtils.class);
+    private static ArrayList<String> refNameServiceTypes = null;
+
+    public static void updateRefNamesInRelations(
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,
+            RepositoryInstanceInterface repoSession,
+            String oldRefName,
+            String newRefName) throws Exception {
+       //
+       // First, look for and update all the places where the refName is the "subject" of the relationship
+       //
+       RelationUtils.updateRefNamesInRelations(ctx, repoClient, repoSession, IRelationsManager.SUBJECT_REFNAME, oldRefName, newRefName);
+       
+       //
+       // Next, look for and update all the places where the refName is the "object" of the relationship
+       //
+       RelationUtils.updateRefNamesInRelations(ctx, repoClient, repoSession, IRelationsManager.OBJECT_REFNAME, oldRefName, newRefName);
+    }
+    
+    public static List<AuthRefConfigInfo> getConfiguredAuthorityRefs(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {
+        List<String> authRefFields =
+                ((AbstractServiceContextImpl) ctx).getAllPartsPropertyValues(
+                ServiceBindingUtils.AUTH_REF_PROP, ServiceBindingUtils.QUALIFIED_PROP_NAMES);
+        ArrayList<AuthRefConfigInfo> authRefsInfo = new ArrayList<AuthRefConfigInfo>(authRefFields.size());
+        for (String spec : authRefFields) {
+            AuthRefConfigInfo arci = new AuthRefConfigInfo(spec);
+            authRefsInfo.add(arci);
+        }
+        return authRefsInfo;
+    }
+
+    public static AuthorityRefDocList getAuthorityRefDocs(
+               RepositoryInstanceInterface repoSession,
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            UriTemplateRegistry uriTemplateRegistry,
+            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,
+            List<String> serviceTypes,
+            String refName,
+            String refPropName, // authRef or termRef, authorities or vocab terms.
+            DocumentFilter filter, boolean computeTotal)
+            throws DocumentException, DocumentNotFoundException {
+        AuthorityRefDocList wrapperList = new AuthorityRefDocList();
+        AbstractCommonList commonList = (AbstractCommonList) wrapperList;
+        int pageNum = filter.getStartPage();
+        int pageSize = filter.getPageSize();
+        
+        List<AuthorityRefDocList.AuthorityRefDocItem> list =
+                wrapperList.getAuthorityRefDocItem();
+
+        Map<String, ServiceBindingType> queriedServiceBindings = new HashMap<String, ServiceBindingType>();
+        Map<String, List<AuthRefConfigInfo>> authRefFieldsByService = new HashMap<String, List<AuthRefConfigInfo>>();
+
+        RepositoryJavaClientImpl nuxeoRepoClient = (RepositoryJavaClientImpl) repoClient;
+        try {
+            // Ignore any provided page size and number query parameters in
+            // the following call, as they pertain to the list of authority
+            // references to be returned, not to the list of documents to be
+            // scanned for those references.
+            
+            // Get a list of possibly referencing documents. This list is
+            // lazily loaded, page by page. Ideally, only one page will
+            // need to be loaded to fill one page of results. Some number
+            // of possibly referencing documents will be false positives,
+            // so use a page size of double the requested page size to
+            // account for those.
+            DocumentModelList docList = findAllAuthorityRefDocs(ctx, repoClient, repoSession,
+                    serviceTypes, refName, refPropName, queriedServiceBindings, authRefFieldsByService,
+                    filter.getWhereClause(), null, 2*pageSize, computeTotal);
+
+            if (docList == null) { // found no authRef fields - nothing to process
+                return wrapperList;
+            }
+
+            // set the fieldsReturned list. Even though this is a fixed schema, app layer treats
+            // this like other abstract common lists
+            /*
+             * <xs:element name="docType" type="xs:string" minOccurs="1" />
+             * <xs:element name="docId" type="xs:string" minOccurs="1" />
+             * <xs:element name="docNumber" type="xs:string" minOccurs="0" />
+             * <xs:element name="docName" type="xs:string" minOccurs="0" />
+             * <xs:element name="sourceField" type="xs:string" minOccurs="1" />
+             * <xs:element name="uri" type="xs:anyURI" minOccurs="1" />
+             * <xs:element name="refName" type="xs:String" minOccurs="1" />
+             * <xs:element name="updatedAt" type="xs:string" minOccurs="1" />
+             * <xs:element name="workflowState" type="xs:string" minOccurs="1"
+             * />
+             */
+            String fieldList = "docType|docId|docNumber|docName|sourceField|uri|refName|updatedAt|workflowState";
+            commonList.setFieldsReturned(fieldList);
+
+            // As a side-effect, the method called below modifies the value of
+            // the 'list' variable, which holds the list of references to
+            // an authority item.
+            //
+            // There can be more than one reference to a particular authority
+            // item within any individual document scanned, so the number of
+            // authority references may potentially exceed the total number
+            // of documents scanned.
+
+            // Strip off displayName and only match the base, so we get references to all 
+            // the NPTs as well as the PT.
+               String strippedRefName = RefNameUtils.stripAuthorityTermDisplayName(refName);
+               
+               // *** Need to pass in pagination info here. 
+            int nRefsFound = processRefObjsDocListForList(docList, ctx.getTenantId(), strippedRefName, 
+                       queriedServiceBindings, authRefFieldsByService, // the actual list size needs to be updated to the size of "list"
+                    list, pageSize, pageNum);
+               
+            commonList.setPageSize(pageSize);
+            
+            // Values returned in the pagination block above the list items
+            // need to reflect the number of references to authority items
+            // returned, rather than the number of documents originally scanned
+            // to find such references.
+            // This will be an estimate only...
+            commonList.setPageNum(pageNum);
+               commonList.setTotalItems(nRefsFound);   // Accurate if total was scanned, otherwise, just an estimate
+            commonList.setItemsInPage(list.size());
+
+            /* Pagination is now handled in the processing step
+            // Slice the list to return only the specified page of items
+            // in the list results.
+            //
+            // FIXME: There may well be a pattern-based way to do this
+            // in our framework, and if we can eliminate much of the
+            // non-DRY code below, that would be desirable.
+            
+            int startIndex = 0;
+            int endIndex = 0;
+            
+            // Return all results if pageSize is 0.
+            if (pageSize == 0) {
+                startIndex = 0;
+                endIndex = list.size();
+            } else {
+               startIndex = pageNum * pageSize;
+            }
+            
+            // Return an empty list when the start of the requested page is
+            // beyond the last item in the list.
+            if (startIndex > list.size()) {
+                wrapperList.getAuthorityRefDocItem().clear();
+                commonList.setItemsInPage(wrapperList.getAuthorityRefDocItem().size());
+                return wrapperList;
+            }
+
+            // Otherwise, return a list of items from the start of the specified
+            // page through the last item on that page, or otherwise through the
+            // last item in the entire list, if that occurs earlier than the end
+            // of the specified page.
+            if (endIndex == 0) {
+                int pageEndIndex = ((startIndex + pageSize));
+                endIndex = (pageEndIndex > list.size()) ? list.size() : pageEndIndex;
+            }
+            
+            // Slice the list to return only the specified page of results.
+            // Note: the second argument to List.subList(), endIndex, is
+            // exclusive of the item at its index position, reflecting the
+            // zero-index nature of the list.
+            List<AuthorityRefDocList.AuthorityRefDocItem> currentPageList =
+                    new ArrayList<AuthorityRefDocList.AuthorityRefDocItem>(list.subList(startIndex, endIndex));
+            wrapperList.getAuthorityRefDocItem().clear();
+            wrapperList.getAuthorityRefDocItem().addAll(currentPageList);
+            commonList.setItemsInPage(currentPageList.size());
+            */
+            
+            if (logger.isDebugEnabled() && (nRefsFound < docList.size())) {
+                logger.debug("Internal curiosity: got fewer matches of refs than # docs matched..."); // We found a ref to ourself and have excluded it.
+            }
+        } catch (Exception e) {
+            logger.error("Could not retrieve a list of documents referring to the specified authority item", e);
+            wrapperList = null;
+        }
+
+        return wrapperList;
+    }
+
+    private static ArrayList<String> getRefNameServiceTypes() {
+        if (refNameServiceTypes == null) {
+            refNameServiceTypes = new ArrayList<String>();
+            refNameServiceTypes.add(ServiceBindingUtils.SERVICE_TYPE_AUTHORITY);
+            refNameServiceTypes.add(ServiceBindingUtils.SERVICE_TYPE_OBJECT);
+            refNameServiceTypes.add(ServiceBindingUtils.SERVICE_TYPE_PROCEDURE);
+        }
+        return refNameServiceTypes;
+    }
+    
+    // Seems like a good value - no real data to set this well.
+    // Note: can set this value lower during debugging; e.g. to 3 - ADR 2012-07-10
+    private static final int N_OBJS_TO_UPDATE_PER_LOOP = 100;
+
+    public static int updateAuthorityRefDocs(
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,
+            RepositoryInstanceInterface repoSession,
+            String oldRefName,
+            String newRefName,
+            String refPropName) throws Exception {
+        Map<String, ServiceBindingType> queriedServiceBindings = new HashMap<String, ServiceBindingType>();
+        Map<String, List<AuthRefConfigInfo>> authRefFieldsByService = new HashMap<String, List<AuthRefConfigInfo>>();
+
+        int docsScanned = 0;
+        int nRefsFound = 0;
+        int currentPage = 0;
+        int docsInCurrentPage = 0;
+        final String WHERE_CLAUSE_ADDITIONS_VALUE = null;
+        final String ORDER_BY_VALUE = CollectionSpaceClient.CORE_CREATED_AT  // "collectionspace_core:createdAt";
+                                          + ", " + IQueryManager.NUXEO_UUID; // CSPACE-6333: Add secondary sort on uuid, in case records have the same createdAt timestamp.
+
+        if (repoClient instanceof RepositoryJavaClientImpl == false) {
+            throw new InternalError("updateAuthorityRefDocs() called with unknown repoClient type!");
+        }
+        
+        try { // REM - How can we deal with transaction and timeout issues here?
+            final int pageSize = N_OBJS_TO_UPDATE_PER_LOOP;
+            DocumentModelList docList;
+            boolean morePages = true;
+            while (morePages) {
+
+                docList = findAuthorityRefDocs(ctx, repoClient, repoSession,
+                        getRefNameServiceTypes(), oldRefName, refPropName,
+                        queriedServiceBindings, authRefFieldsByService, WHERE_CLAUSE_ADDITIONS_VALUE, ORDER_BY_VALUE, pageSize, currentPage, false);
+
+                if (docList == null) {
+                    logger.debug("updateAuthorityRefDocs: no documents could be found that referenced the old refName");
+                    break;
+                }
+                docsInCurrentPage = docList.size();
+                logger.debug("updateAuthorityRefDocs: current page=" + currentPage + " documents included in page=" + docsInCurrentPage);
+                if (docsInCurrentPage == 0) {
+                    logger.debug("updateAuthorityRefDocs: no more documents requiring refName updates could be found");
+                    break;
+                }
+                if (docsInCurrentPage < pageSize) {
+                    logger.debug("updateAuthorityRefDocs: assuming no more documents requiring refName updates will be found, as docsInCurrentPage < pageSize");
+                    morePages = false;
+                }
+
+                // Only match complete refNames - unless and until we decide how to resolve changes
+                // to NPTs we will defer that and only change PTs or refNames as passed in.
+                int nRefsFoundThisPage = processRefObjsDocListForUpdate(docList, ctx.getTenantId(), oldRefName, 
+                               queriedServiceBindings, authRefFieldsByService, // Perform the refName updates on the list of document models
+                        newRefName);
+                if (nRefsFoundThisPage > 0) {
+                    ((RepositoryJavaClientImpl) repoClient).saveDocListWithoutHandlerProcessing(ctx, repoSession, docList, true); // Flush the document model list out to Nuxeo storage
+                    nRefsFound += nRefsFoundThisPage;
+                }
+
+                // FIXME: Per REM, set a limit of num objects - something like
+                // 1000K objects - and also add a log Warning after some threshold
+                docsScanned += docsInCurrentPage;
+                if (morePages) {
+                    currentPage++;
+                }
+
+            }
+        } catch (Exception e) {
+            logger.error("Internal error updating the AuthorityRefDocs: " + e.getLocalizedMessage());
+            logger.debug(Tools.errorToString(e, true));
+            throw e;
+        }
+        logger.debug("updateAuthorityRefDocs replaced a total of " + nRefsFound + " authority references, within as many as " + docsScanned + " scanned document(s)");
+        return nRefsFound;
+    }
+
+    private static DocumentModelList findAllAuthorityRefDocs(
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,
+            RepositoryInstanceInterface repoSession, List<String> serviceTypes,
+            String refName,
+            String refPropName,
+            Map<String, ServiceBindingType> queriedServiceBindings,
+            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,
+            String whereClauseAdditions,
+            String orderByClause,
+            int pageSize,
+            boolean computeTotal) throws DocumentException, DocumentNotFoundException {
+               
+       return new LazyAuthorityRefDocList(ctx, repoClient, repoSession,
+                       serviceTypes, refName, refPropName, queriedServiceBindings, authRefFieldsByService,
+                       whereClauseAdditions, orderByClause, pageSize, computeTotal);
+    }
+    
+    protected static DocumentModelList findAuthorityRefDocs(
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+            RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient,
+            RepositoryInstanceInterface repoSession, List<String> serviceTypes,
+            String refName,
+            String refPropName,
+            Map<String, ServiceBindingType> queriedServiceBindings,
+            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,
+            String whereClauseAdditions,
+            String orderByClause,
+            int pageSize,
+            int pageNum,
+            boolean computeTotal) throws DocumentException, DocumentNotFoundException {
+
+        // Get the service bindings for this tenant
+        TenantBindingConfigReaderImpl tReader =
+                ServiceMain.getInstance().getTenantBindingConfigReader();
+        // We need to get all the procedures, authorities, and objects.
+        List<ServiceBindingType> servicebindings = tReader.getServiceBindingsByType(ctx.getTenantId(), serviceTypes);
+        if (servicebindings == null || servicebindings.isEmpty()) {
+            logger.error("RefNameServiceUtils.getAuthorityRefDocs: No services bindings found, cannot proceed!");
+            return null;
+        }
+        // Filter the list for current user rights
+        servicebindings = SecurityUtils.getReadableServiceBindingsForCurrentUser(servicebindings);
+
+        ArrayList<String> docTypes = new ArrayList<String>();
+
+        String query = computeWhereClauseForAuthorityRefDocs(refName, refPropName, docTypes, servicebindings, // REM - Side effect that docTypes array gets set.  Any others?
+                queriedServiceBindings, authRefFieldsByService);
+        if (query == null) { // found no authRef fields - nothing to query
+            return null;
+        }
+        // Additional qualifications, like workflow state
+        if (Tools.notBlank(whereClauseAdditions)) {
+            query += " AND " + whereClauseAdditions;
+        }
+        // Now we have to issue the search
+        RepositoryJavaClientImpl nuxeoRepoClient = (RepositoryJavaClientImpl) repoClient;
+        DocumentWrapper<DocumentModelList> docListWrapper = nuxeoRepoClient.findDocs(ctx, repoSession,
+                docTypes, query, orderByClause, pageSize, pageNum, computeTotal);
+        // Now we gather the info for each document into the list and return
+        DocumentModelList docList = docListWrapper.getWrappedObject();
+        return docList;
+    }
+    private static final boolean READY_FOR_COMPLEX_QUERY = true;
+
+    private static String computeWhereClauseForAuthorityRefDocs(
+            String refName,
+            String refPropName,
+            ArrayList<String> docTypes,
+            List<ServiceBindingType> servicebindings,
+            Map<String, ServiceBindingType> queriedServiceBindings,
+            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService) {
+
+        boolean fFirst = true;
+        List<String> authRefFieldPaths;
+        for (ServiceBindingType sb : servicebindings) {
+            // Gets the property names for each part, qualified with the part label (which
+            // is also the table name, the way that the repository works).
+            authRefFieldPaths =
+                    ServiceBindingUtils.getAllPartsPropertyValues(sb,
+                    refPropName, ServiceBindingUtils.QUALIFIED_PROP_NAMES);
+            if (authRefFieldPaths.isEmpty()) {
+                continue;
+            }
+            ArrayList<AuthRefConfigInfo> authRefsInfo = new ArrayList<AuthRefConfigInfo>();
+            for (String spec : authRefFieldPaths) {
+                AuthRefConfigInfo arci = new AuthRefConfigInfo(spec);
+                authRefsInfo.add(arci);
+            }
+
+            String docType = sb.getObject().getName();
+            queriedServiceBindings.put(docType, sb);
+            authRefFieldsByService.put(docType, authRefsInfo);
+            docTypes.add(docType);
+            fFirst = false;
+        }
+        if (fFirst) { // found no authRef fields - nothing to query
+            return null;
+        }
+        // We used to build a complete matches query, but that was too complex.
+        // Just build a keyword query based upon some key pieces - the urn syntax elements and the shortID
+        // Note that this will also match the Item itself, but that will get filtered out when
+        // we compute actual matches.
+        AuthorityTermInfo authTermInfo = RefNameUtils.parseAuthorityTermInfo(refName);
+
+        String keywords = RefNameUtils.URN_PREFIX
+                + " AND " + (authTermInfo.inAuthority.name != null
+                ? authTermInfo.inAuthority.name : authTermInfo.inAuthority.csid)
+                + " AND " + (authTermInfo.name != null
+                ? authTermInfo.name : authTermInfo.csid);
+
+        String whereClauseStr = QueryManager.createWhereClauseFromKeywords(keywords);
+
+        if (logger.isTraceEnabled()) {
+            logger.trace("The 'where' clause to find refObjs is: ", whereClauseStr);
+        }
+
+        return whereClauseStr;
+    }
+    
+    // TODO there are multiple copies of this that should be put somewhere common.
+       protected static String getRefname(DocumentModel docModel) throws ClientException {
+               String result = (String)docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,
+                               CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME);
+               return result;
+       }
+
+    private static int processRefObjsDocListForUpdate(
+            DocumentModelList docList,
+            String tenantId,
+            String refName,
+            Map<String, ServiceBindingType> queriedServiceBindings,
+            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,
+            String newAuthorityRefName) {
+       return processRefObjsDocList(docList, tenantId, refName, false, queriedServiceBindings,
+                       authRefFieldsByService, null, 0, 0, newAuthorityRefName);
+    }
+                       
+    private static int processRefObjsDocListForList(
+            DocumentModelList docList,
+            String tenantId,
+            String refName,
+            Map<String, ServiceBindingType> queriedServiceBindings,
+            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,
+            List<AuthorityRefDocList.AuthorityRefDocItem> list, 
+            int pageSize, int pageNum) {
+       return processRefObjsDocList(docList, tenantId, refName, true, queriedServiceBindings,
+                       authRefFieldsByService, list, pageSize, pageNum, null);
+    }
+                       
+
+       /*
+     * Runs through the list of found docs, processing them. If list is
+     * non-null, then processing means gather the info for items. If list is
+     * null, and newRefName is non-null, then processing means replacing and
+     * updating. If processing/updating, this must be called in the context of
+     * an open session, and caller must release Session after calling this.
+     *
+     */
+    private static int processRefObjsDocList(
+            DocumentModelList docList,
+            String tenantId,
+            String refName,
+            boolean matchBaseOnly,
+            Map<String, ServiceBindingType> queriedServiceBindings,
+            Map<String, List<AuthRefConfigInfo>> authRefFieldsByService,
+            List<AuthorityRefDocList.AuthorityRefDocItem> list,
+            int pageSize, int pageNum, // Only used when constructing a list.
+            String newAuthorityRefName) {
+        UriTemplateRegistry registry = ServiceMain.getInstance().getUriTemplateRegistry();
+        Iterator<DocumentModel> iter = docList.iterator();
+        int nRefsFoundTotal = 0;
+        boolean foundSelf = false;
+
+        // When paginating results, we have to guess at the total. First guess is the number of docs returned
+        // by the query. However, this returns some false positives, so may be high. 
+        // In addition, we can match multiple fields per doc, so this may be low. Fun, eh?
+        int nDocsReturnedInQuery = (int)docList.totalSize();
+        int nDocsProcessed = 0;
+        int firstItemInPage = pageNum*pageSize;
+        while (iter.hasNext()) {
+            DocumentModel docModel = iter.next();
+            AuthorityRefDocList.AuthorityRefDocItem ilistItem;
+
+            String docType = docModel.getDocumentType().getName(); // REM - This will be a tentant qualified document type
+            docType = ServiceBindingUtils.getUnqualifiedTenantDocType(docType);
+            ServiceBindingType sb = queriedServiceBindings.get(docType);
+            if (sb == null) {
+                throw new RuntimeException(
+                        "getAuthorityRefDocs: No Service Binding for docType: " + docType);
+            }
+
+            if (list == null) { // no list - should be update refName case.
+                if (newAuthorityRefName == null) {
+                    throw new InternalError("processRefObjsDocList() called with neither an itemList nor a new RefName!");
+                }
+                ilistItem = null;
+                pageSize = 0;
+                firstItemInPage = 0;   // Do not paginate if updating, rather than building list
+            } else {    // Have a list - refObjs case
+                if (newAuthorityRefName != null) {
+                    throw new InternalError("processRefObjsDocList() called with both an itemList and a new RefName!");
+                }
+                if(firstItemInPage > 100) {
+                       logger.warn("Processing a large offset (size:{}, num:{}) for refObjs - will be expensive!!!",
+                                               pageSize, pageNum);
+                }
+                // Note that we have to go through check all the fields to determine the actual page start
+                ilistItem = new AuthorityRefDocList.AuthorityRefDocItem();
+                String csid = NuxeoUtils.getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString());
+                try {
+                       String itemRefName = getRefname(docModel);
+                       ilistItem.setRefName(itemRefName);
+                } catch (ClientException ce) {
+                    throw new RuntimeException(
+                            "processRefObjsDocList: Problem fetching refName from item Object: " 
+                                       + ce.getLocalizedMessage());
+                }
+                ilistItem.setDocId(csid);
+                String uri = "";
+                UriTemplateRegistryKey key = new UriTemplateRegistryKey(tenantId, docType);
+                StoredValuesUriTemplate template = registry.get(key);
+                if (template != null) {
+                    Map<String, String> additionalValues = new HashMap<String, String>();
+                    if (template.getUriTemplateType() == UriTemplateFactory.RESOURCE) {
+                        additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, csid);
+                        uri = template.buildUri(additionalValues);
+                    } else if (template.getUriTemplateType() == UriTemplateFactory.ITEM) {
+                        try {
+                            String inAuthorityCsid = (String) docModel.getPropertyValue("inAuthority"); // AuthorityItemJAXBSchema.IN_AUTHORITY
+                            additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, inAuthorityCsid);
+                            additionalValues.put(UriTemplateFactory.ITEM_IDENTIFIER_VAR, csid);
+                            uri = template.buildUri(additionalValues);
+                        } catch (Exception e) {
+                            logger.warn("Could not extract inAuthority property from authority item record: " + e.getMessage());
+                        }
+                    } else if (template.getUriTemplateType() == UriTemplateFactory.CONTACT) {
+                        // FIXME: Generating contact sub-resource URIs requires additional work,
+                        // as a follow-on to CSPACE-5271 - ADR 2012-08-16
+                        // Sets the default (empty string) value for uri, for now
+                    } else {
+                        logger.warn("Unrecognized URI template type = " + template.getUriTemplateType());
+                        // Sets the default (empty string) value for uri
+                    }
+                } else { // (if template == null)
+                    logger.warn("Could not retrieve URI template from registry via tenant ID "
+                            + tenantId + " and docType " + docType);
+                    // Sets the default (empty string) value for uri
+                }
+                ilistItem.setUri(uri);
+                try {
+                    ilistItem.setWorkflowState(docModel.getCurrentLifeCycleState());
+                    ilistItem.setUpdatedAt(DocHandlerBase.getUpdatedAtAsString(docModel));
+                } catch (Exception e) {
+                    logger.error("Error getting core values for doc [" + csid + "]: " + e.getLocalizedMessage());
+                }
+                ilistItem.setDocType(docType);
+                ilistItem.setDocNumber(
+                        ServiceBindingUtils.getMappedFieldInDoc(sb, ServiceBindingUtils.OBJ_NUMBER_PROP, docModel));
+                ilistItem.setDocName(
+                        ServiceBindingUtils.getMappedFieldInDoc(sb, ServiceBindingUtils.OBJ_NAME_PROP, docModel));
+            }
+            // Now, we have to loop over the authRefFieldsByService to figure
+            // out which field(s) matched this.
+            List<AuthRefConfigInfo> matchingAuthRefFields = authRefFieldsByService.get(docType);
+            if (matchingAuthRefFields == null || matchingAuthRefFields.isEmpty()) {
+                throw new RuntimeException(
+                        "getAuthorityRefDocs: internal logic error: can't fetch authRefFields for DocType.");
+            }
+            //String authRefAncestorField = "";
+            //String authRefDescendantField = "";
+            //String sourceField = "";
+
+            ArrayList<RefNameServiceUtils.AuthRefInfo> foundProps = new ArrayList<RefNameServiceUtils.AuthRefInfo>();
+            try {
+                findAuthRefPropertiesInDoc(docModel, matchingAuthRefFields, refName, matchBaseOnly, foundProps); // REM - side effect that foundProps is set
+                if(!foundProps.isEmpty()) {
+                    int nRefsFoundInDoc = 0;
+                       for (RefNameServiceUtils.AuthRefInfo ari : foundProps) {
+                               if (ilistItem != null) {
+                                       // So this is a true positive, and not a false one. We have to consider pagination now.
+                                       if(nRefsFoundTotal >= firstItemInPage) {        // skipped enough already
+                                               if (nRefsFoundInDoc == 0) {    // First one?
+                                                       ilistItem.setSourceField(ari.getQualifiedDisplayName());
+                                               } else {    // duplicates from one object
+                                                       ilistItem = cloneAuthRefDocItem(ilistItem, ari.getQualifiedDisplayName());
+                                               }
+                                               list.add(ilistItem);
+                                       nRefsFoundInDoc++;      // Only increment if processed, or clone logic above will fail
+                                       }
+                               } else {    // update refName case
+                                       Property propToUpdate = ari.getProperty();
+                                       propToUpdate.setValue(newAuthorityRefName);
+                               }
+                               nRefsFoundTotal++;              // Whether we processed or not, we found - essential to pagination logic
+                       }
+                } else if(ilistItem != null) {
+                       String docRefName = ilistItem.getRefName();
+                    if (matchBaseOnly?
+                                       (docRefName!=null && docRefName.startsWith(refName))
+                                       :refName.equals(docRefName)) {
+                               // We found the self for an item
+                               foundSelf = true;
+                               logger.debug("getAuthorityRefDocs: Result: "
+                                                               + docType + " [" + NuxeoUtils.getCsid(docModel)
+                                                               + "] appears to be self for: ["
+                                                               + refName + "]");
+                       } else {
+                               logger.debug("getAuthorityRefDocs: Result: "
+                                                               + docType + " [" + NuxeoUtils.getCsid(docModel)
+                                                               + "] does not reference ["
+                                                               + refName + "]");
+                       }
+                }
+            } catch (ClientException ce) {
+               throw new RuntimeException(
+                               "getAuthorityRefDocs: Problem fetching values from repo: " + ce.getLocalizedMessage());
+            }
+            nDocsProcessed++;
+            // Done processing that doc. Are we done with the whole page?
+            // Note pageSize <=0 means do them all
+            if((pageSize > 0) && ((nRefsFoundTotal-firstItemInPage)>=pageSize)) {
+               // Quitting early, so we need to estimate the total. Assume one per doc
+               // for the rest of the docs we matched in the query
+               int unprocessedDocs = nDocsReturnedInQuery - nDocsProcessed;
+               if(unprocessedDocs>0) {
+                       // We generally match ourselves in the keyword search. If we already saw ourselves
+                       // then do not try to correct for this. Otherwise, decrement the total.
+                       // Yes, this is fairly goofy, but the whole estimation mechanism is goofy. 
+                       if(!foundSelf)
+                               unprocessedDocs--;
+                       nRefsFoundTotal += unprocessedDocs;
+               }
+               break;
+            }
+        } // close while(iterator)
+        return nRefsFoundTotal;
+    }
+
+    private static AuthorityRefDocList.AuthorityRefDocItem cloneAuthRefDocItem(
+            AuthorityRefDocList.AuthorityRefDocItem ilistItem, String sourceField) {
+        AuthorityRefDocList.AuthorityRefDocItem newlistItem = new AuthorityRefDocList.AuthorityRefDocItem();
+        newlistItem.setDocId(ilistItem.getDocId());
+        newlistItem.setDocName(ilistItem.getDocName());
+        newlistItem.setDocNumber(ilistItem.getDocNumber());
+        newlistItem.setDocType(ilistItem.getDocType());
+        newlistItem.setUri(ilistItem.getUri());
+        newlistItem.setSourceField(sourceField);
+        return newlistItem;
+    }
+
+    public static List<AuthRefInfo> findAuthRefPropertiesInDoc(
+            DocumentModel docModel,
+            List<AuthRefConfigInfo> authRefFieldInfo,
+            String refNameToMatch,
+            List<AuthRefInfo> foundProps) {
+       return findAuthRefPropertiesInDoc(docModel, authRefFieldInfo, 
+                                                                       refNameToMatch, false, foundProps);
+    }
+    
+    public static List<AuthRefInfo> findAuthRefPropertiesInDoc(
+            DocumentModel docModel,
+            List<AuthRefConfigInfo> authRefFieldInfo,
+            String refNameToMatch,
+            boolean matchBaseOnly,
+            List<AuthRefInfo> foundProps) {
+        // Assume that authRefFieldInfo is keyed by the field name (possibly mapped for UI)
+        // and the values are elPaths to the field, where intervening group structures in
+        // lists of complex structures are replaced with "*". Thus, valid paths include
+        // the following (note that the ServiceBindingUtils prepend schema names to configured values):
+        // "schemaname:fieldname"
+        // "schemaname:scalarlistname"
+        // "schemaname:complexfieldname/fieldname"
+        // "schemaname:complexlistname/*/fieldname"
+        // "schemaname:complexlistname/*/scalarlistname"
+        // "schemaname:complexlistname/*/complexfieldname/fieldname"
+        // "schemaname:complexlistname/*/complexlistname/*/fieldname"
+        // etc.
+        for (AuthRefConfigInfo arci : authRefFieldInfo) {
+            try {
+                // Get first property and work down as needed.
+                Property prop = docModel.getProperty(arci.pathEls[0]);
+                findAuthRefPropertiesInProperty(foundProps, prop, arci, 0, refNameToMatch, matchBaseOnly);
+            } catch (Exception e) {
+                logger.error("Problem fetching property: " + arci.pathEls[0]);
+            }
+        }
+        return foundProps;
+    }
+
+    private static List<AuthRefInfo> findAuthRefPropertiesInProperty(
+            List<AuthRefInfo> foundProps,
+            Property prop,
+            AuthRefConfigInfo arci,
+            int pathStartIndex, // Supports recursion and we work down the path
+            String refNameToMatch,
+            boolean matchBaseOnly ) {
+        if (pathStartIndex >= arci.pathEls.length) {
+            throw new ArrayIndexOutOfBoundsException("Index = " + pathStartIndex + " for path: "
+                    + arci.pathEls.toString());
+        }
+        AuthRefInfo ari = null;
+        if (prop == null) {
+            return foundProps;
+        }
+
+        if (prop instanceof StringProperty) {    // scalar string
+            addARIifMatches(refNameToMatch, matchBaseOnly, arci, prop, foundProps);
+        } else if (prop instanceof List) {
+            List<Property> propList = (List<Property>) prop;
+            // run through list. Must either be list of Strings, or Complex
+            for (Property listItemProp : propList) {
+                if (listItemProp instanceof StringProperty) {
+                    if (arci.pathEls.length - pathStartIndex != 1) {
+                        logger.error("Configuration for authRefs does not match schema structure: "
+                                + arci.pathEls.toString());
+                        break;
+                    } else {
+                        addARIifMatches(refNameToMatch, matchBaseOnly, arci, listItemProp, foundProps);
+                    }
+                } else if (listItemProp.isComplex()) {
+                    // Just recurse to handle this. Note that since this is a list of complex, 
+                    // which should look like listName/*/... we add 2 to the path start index 
+                    findAuthRefPropertiesInProperty(foundProps, listItemProp, arci,
+                            pathStartIndex + 2, refNameToMatch, matchBaseOnly);
+                } else {
+                    logger.error("Configuration for authRefs does not match schema structure: "
+                            + arci.pathEls.toString());
+                    break;
+                }
+            }
+        } else if (prop.isComplex()) {
+            String localPropName = arci.pathEls[pathStartIndex];
+            try {
+                Property localProp = prop.get(localPropName);
+                // Now just recurse, pushing down the path 1 step
+                findAuthRefPropertiesInProperty(foundProps, localProp, arci,
+                        pathStartIndex, refNameToMatch, matchBaseOnly);
+            } catch (PropertyNotFoundException pnfe) {
+                logger.error("Could not find property: [" + localPropName + "] in path: "
+                        + arci.getFullPath());
+                // Fall through - ari will be null and we will continue...
+            }
+        } else {
+            logger.error("Configuration for authRefs does not match schema structure: "
+                    + arci.pathEls.toString());
+        }
+
+        if (ari != null) {
+            foundProps.add(ari); //FIXME: REM - This is dead code.  'ari' is never touched after being initalized to null.  Why?
+        }
+
+        return foundProps;
+    }
+
+    private static void addARIifMatches(
+            String refNameToMatch,
+            boolean matchBaseOnly,
+            AuthRefConfigInfo arci,
+            Property prop,
+            List<AuthRefInfo> foundProps) {
+        // Need to either match a passed refName 
+        // OR have no refName to match but be non-empty
+        try {
+            String value = (String) prop.getValue();
+            if (((refNameToMatch != null) && 
+                               (matchBaseOnly?
+                                       (value!=null && value.startsWith(refNameToMatch))
+                                       :refNameToMatch.equals(value)))
+                    || ((refNameToMatch == null) && Tools.notBlank(value))) {
+                // Found a match
+                logger.debug("Found a match on property: " + prop.getPath() + " with value: [" + value + "]");
+                AuthRefInfo ari = new AuthRefInfo(arci, prop);
+                foundProps.add(ari);
+            }
+        } catch (PropertyException pe) {
+            logger.debug("PropertyException on: " + prop.getPath() + pe.getLocalizedMessage());
+        }
+    }
+
+    /*
+     * Identifies whether the refName was found in the supplied field. If passed
+     * a new RefName, will set that into fields in which the old one was found.
+     *
+     * Only works for: * Scalar fields * Repeatable scalar fields (aka
+     * multi-valued fields)
+     *
+     * Does not work for: * Structured fields (complexTypes) * Repeatable
+     * structured fields (repeatable complexTypes) private static int
+     * refNameFoundInField(String oldRefName, Property fieldValue, String
+     * newRefName) { int nFound = 0; if (fieldValue instanceof List) {
+     * List<Property> fieldValueList = (List) fieldValue; for (Property
+     * listItemValue : fieldValueList) { try { if ((listItemValue instanceof
+     * StringProperty) &&
+     * oldRefName.equalsIgnoreCase((String)listItemValue.getValue())) {
+     * nFound++; if(newRefName!=null) { fieldValue.setValue(newRefName); } else
+     * { // We cannot quit after the first, if we are replacing values. // If we
+     * are just looking (not replacing), finding one is enough. break; } } }
+     * catch( PropertyException pe ) {} } } else { try { if ((fieldValue
+     * instanceof StringProperty) &&
+     * oldRefName.equalsIgnoreCase((String)fieldValue.getValue())) { nFound++;
+     * if(newRefName!=null) { fieldValue.setValue(newRefName); } } } catch(
+     * PropertyException pe ) {} } return nFound; }
+     */
+}
index 629dfd00ccf2e5602c999a4ebf6ca722f71b356a..14d1f69e1a7e65debb96c47deadfc606e7aab38c 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.nuxeo.client.java;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-import org.apache.commons.lang.builder.ToStringBuilder;\r
-import org.jvnet.jaxb2_commons.lang.ToString;\r
-import javax.xml.parsers.DocumentBuilder;\r
-import javax.xml.parsers.DocumentBuilderFactory;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.w3c.dom.Document;\r
-import org.w3c.dom.Element;\r
-\r
-import javax.xml.bind.annotation.XmlAccessType;\r
-import javax.xml.bind.annotation.XmlAccessorType;\r
-import javax.xml.bind.annotation.XmlElement;\r
-import javax.xml.bind.annotation.XmlRootElement;\r
-import javax.xml.bind.annotation.XmlTransient;\r
-import javax.xml.bind.annotation.XmlType;\r
-import javax.xml.bind.annotation.XmlSeeAlso;\r
-\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * This class allows us to generically represent and marshall a set of list\r
- * results for any object. The base information is provided by the\r
- * AbstractCommonList.xsd and associated class, defining the list header.\r
- * A array of itemInfo objects define the results-specific info, where\r
- * each itemInfo is a map of Strings that represent the fields returned for\r
- * each item.\r
- *\r
- * @author pschmitz\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-@XmlAccessorType(XmlAccessType.NONE)\r
-// We use the same root as the superclass, so unmarshalling will work (more or less)\r
-@XmlRootElement(name = "abstract-common-list")\r
-public class CommonList extends AbstractCommonList {\r
-       \r
-       /** The logger. */\r
-       private final Logger logger = LoggerFactory.getLogger(CommonList.class);\r
-       @XmlTransient\r
-       private DocumentBuilderFactory factory;\r
-       @XmlTransient\r
-       private DocumentBuilder parser;\r
-       @XmlTransient\r
-       private Document doc;\r
-    \r
-    public CommonList()\r
-       throws javax.xml.parsers.ParserConfigurationException {\r
-       super();\r
-       factory = DocumentBuilderFactory.newInstance();\r
-        //Get the DocumentBuilder\r
-        parser = factory.newDocumentBuilder();\r
-        //Create blank DOM Document\r
-        doc = parser.newDocument();\r
-    }\r
-        \r
-       @XmlTransient\r
-       private String fieldKeys[] = null;\r
-       \r
-       //Add methods to add new items, and to set the fieldKeys. Could make\r
-       //them an array of strings rather than arraylist.\r
-       \r
-       /**\r
-        * @return the current set of fieldKeys.\r
-        */\r
-       public String[] getFieldKeys() {\r
-               return fieldKeys;\r
-       }\r
-       \r
-       /**\r
-        * Sets the keys to assume when fetching fields from the itemInfo maps.\r
-        * As a side-effect, will build and set super.fieldsReturned.\r
-        * This MUST be called before attempting to add items (with addItem).\r
-        * \r
-        * @param fieldKeys     the keys to use\r
-        * \r
-        */\r
-       public void setFieldsReturned(String[] fieldKeys) {\r
-               this.fieldKeys = fieldKeys;\r
-               String fieldsImploded = Tools.implode(fieldKeys, "|");  \r
-               setFieldsReturned(fieldsImploded);\r
-       }\r
-\r
-       private void addItem(List<Element> anyList, String key, Object value) {\r
-               if (value != null ) {\r
-                       Element el = doc.createElement(key);\r
-                       if (value instanceof String) {\r
-                               el.setTextContent((String)value);\r
-                               anyList.add(el);\r
-                       } else if (value instanceof List<?>) {\r
-                               @SuppressWarnings("unchecked") // We expect and assume String values only here\r
-                               List<String> valueList = (List<String>)value;\r
-                               for (String val : valueList) {\r
-                                       addItem(anyList, key, val);\r
-                               }\r
-                       } else {\r
-                               logger.error("Unknown value type found while processing common list results: "\r
-                                               + value.getClass().getCanonicalName());\r
-                       }\r
-               } else {\r
-                       logger.trace("Null value encountered while processing common list results for key: "\r
-                                       + key);\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * Adds an item to the results list. Each item should have fields\r
-        * associated to keys defined in the fieldKeys. \r
-        * Caller must call setFieldsReturned() before calling this.\r
-        * \r
-        * @param itemInfo\r
-        * @throws RuntimeException if this is called before fieldKeys has been set.\r
-        */\r
-       public void addItem(HashMap<String, Object> itemInfo) {\r
-               if (fieldKeys == null) {\r
-                       throw new RuntimeException(\r
-                                       "CommonList.addItem: Cannot add items before fieldKeys are set.");\r
-               }\r
-               List<AbstractCommonList.ListItem> itemsList = getListItem();\r
-               AbstractCommonList.ListItem listItem = new AbstractCommonList.ListItem();\r
-               itemsList.add(listItem);\r
-               \r
-               List<Element> anyList = listItem.getAny();\r
-               for (String key : fieldKeys) {\r
-                       Object value = itemInfo.get(key);\r
-                       addItem(anyList, key, value);\r
-               }\r
-       }\r
-\r
-}\r
-\r
-\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.nuxeo.client.java;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.jvnet.jaxb2_commons.lang.ToString;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class allows us to generically represent and marshall a set of list
+ * results for any object. The base information is provided by the
+ * AbstractCommonList.xsd and associated class, defining the list header.
+ * A array of itemInfo objects define the results-specific info, where
+ * each itemInfo is a map of Strings that represent the fields returned for
+ * each item.
+ *
+ * @author pschmitz
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+// We use the same root as the superclass, so unmarshalling will work (more or less)
+@XmlRootElement(name = "abstract-common-list")
+public class CommonList extends AbstractCommonList {
+       
+       /** The logger. */
+       private final Logger logger = LoggerFactory.getLogger(CommonList.class);
+       @XmlTransient
+       private DocumentBuilderFactory factory;
+       @XmlTransient
+       private DocumentBuilder parser;
+       @XmlTransient
+       private Document doc;
+    
+    public CommonList()
+       throws javax.xml.parsers.ParserConfigurationException {
+       super();
+       factory = DocumentBuilderFactory.newInstance();
+        //Get the DocumentBuilder
+        parser = factory.newDocumentBuilder();
+        //Create blank DOM Document
+        doc = parser.newDocument();
+    }
+        
+       @XmlTransient
+       private String fieldKeys[] = null;
+       
+       //Add methods to add new items, and to set the fieldKeys. Could make
+       //them an array of strings rather than arraylist.
+       
+       /**
+        * @return the current set of fieldKeys.
+        */
+       public String[] getFieldKeys() {
+               return fieldKeys;
+       }
+       
+       /**
+        * Sets the keys to assume when fetching fields from the itemInfo maps.
+        * As a side-effect, will build and set super.fieldsReturned.
+        * This MUST be called before attempting to add items (with addItem).
+        * 
+        * @param fieldKeys     the keys to use
+        * 
+        */
+       public void setFieldsReturned(String[] fieldKeys) {
+               this.fieldKeys = fieldKeys;
+               String fieldsImploded = Tools.implode(fieldKeys, "|");  
+               setFieldsReturned(fieldsImploded);
+       }
+
+       private void addItem(List<Element> anyList, String key, Object value) {
+               if (value != null ) {
+                       Element el = doc.createElement(key);
+                       if (value instanceof String) {
+                               el.setTextContent((String)value);
+                               anyList.add(el);
+                       } else if (value instanceof List<?>) {
+                               @SuppressWarnings("unchecked") // We expect and assume String values only here
+                               List<String> valueList = (List<String>)value;
+                               for (String val : valueList) {
+                                       addItem(anyList, key, val);
+                               }
+                       } else {
+                               logger.error("Unknown value type found while processing common list results: "
+                                               + value.getClass().getCanonicalName());
+                       }
+               } else {
+                       logger.trace("Null value encountered while processing common list results for key: "
+                                       + key);
+               }
+       }
+       
+       /**
+        * Adds an item to the results list. Each item should have fields
+        * associated to keys defined in the fieldKeys. 
+        * Caller must call setFieldsReturned() before calling this.
+        * 
+        * @param itemInfo
+        * @throws RuntimeException if this is called before fieldKeys has been set.
+        */
+       public void addItem(HashMap<String, Object> itemInfo) {
+               if (fieldKeys == null) {
+                       throw new RuntimeException(
+                                       "CommonList.addItem: Cannot add items before fieldKeys are set.");
+               }
+               List<AbstractCommonList.ListItem> itemsList = getListItem();
+               AbstractCommonList.ListItem listItem = new AbstractCommonList.ListItem();
+               itemsList.add(listItem);
+               
+               List<Element> anyList = listItem.getAny();
+               for (String key : fieldKeys) {
+                       Object value = itemInfo.get(key);
+                       addItem(anyList, key, value);
+               }
+       }
+
+}
+
+
index e60f1ee6a4c37f9502c5f8038417c8695f76be30..337a3d37debd1f06aa2e91421d884a1091010641 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.nuxeo.client.java;\r
-\r
-import java.lang.reflect.Method;\r
-import java.util.ArrayList;\r
-import java.util.GregorianCalendar;\r
-import java.util.HashMap;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-\r
-import javax.ws.rs.core.MultivaluedMap;\r
-\r
-import org.collectionspace.services.client.CollectionSpaceClient;\r
-import org.collectionspace.services.client.IQueryManager;\r
-import org.collectionspace.services.client.IRelationsManager;\r
-import org.collectionspace.services.common.ReflectionMapper;\r
-import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.config.ServiceConfigUtils;\r
-import org.collectionspace.services.common.context.AbstractServiceContextImpl;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.DocumentException;\r
-import org.collectionspace.services.common.document.DocumentWrapper;\r
-import org.collectionspace.services.common.query.QueryContext;\r
-import org.collectionspace.services.common.relation.nuxeo.RelationsUtils;\r
-import org.collectionspace.services.config.service.DocHandlerParams;\r
-import org.collectionspace.services.config.service.ListResultField;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.collectionspace.services.nuxeo.client.java.CommonList;\r
-import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;\r
-import org.collectionspace.services.nuxeo.util.NuxeoUtils;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import org.nuxeo.ecm.core.api.DocumentModelList;\r
-import org.nuxeo.ecm.core.api.repository.RepositoryInstance;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * This class is generified by the marker type T,\r
- * where T is expected to map to something like BlobCommon, MediaCommon, ObjectexitCommon, etc.,\r
- * and so on for every JAXB-generated schema class.\r
- *\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- *\r
- */\r
-public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T, AbstractCommonList> {\r
-\r
-    /** The logger. */\r
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());\r
-\r
-    private AbstractCommonList commonList;\r
-    \r
-    protected static final int NUM_STANDARD_LIST_RESULT_FIELDS = 5;\r
-    protected static final String STANDARD_LIST_CSID_FIELD = "csid";\r
-    protected static final String STANDARD_LIST_URI_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_URI;\r
-    protected static final String STANDARD_LIST_REFNAME_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME;\r
-    protected static final String STANDARD_LIST_UPDATED_AT_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT;\r
-    protected static final String STANDARD_LIST_WORKFLOW_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_WORKFLOWSTATE;\r
-    protected static final String STANDARD_LIST_MARK_RT_FIELD = "related";\r
-\r
-    @Override\r
-    public AbstractCommonList getCommonPartList() {\r
-        return commonList;\r
-    }\r
-\r
-    @Override\r
-       public void setCommonPartList(AbstractCommonList aCommonList) {\r
-        this.commonList = aCommonList;\r
-    }\r
-\r
-    private T commonPart;\r
-\r
-    @Override\r
-    public T getCommonPart() {\r
-        return (T)commonPart;\r
-    }\r
-\r
-    @Override\r
-       public void setCommonPart(T commonPart) {\r
-        this.commonPart = commonPart;\r
-    }\r
-\r
-\r
-    /** Subclass DocHandlers may override this method to control exact creation of the common list.\r
-     *  This class instantiates an AbstractCommonList from the classname returned by getDocHandlerParams().AbstractCommonListClassname.\r
-     * @return\r
-     * @throws Exception\r
-     */\r
-    public AbstractCommonList createAbstractCommonListImpl() throws Exception {\r
-        //  String classname = this.commonList.getClass().getName();\r
-       ServiceContext ctx = this.getServiceContext();\r
-        String classname = ServiceConfigUtils.getDocHandlerParams(ctx).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
-\r
-    /** DocHandlerBase calls this method with the CSID as id */\r
-    public Object createItemForCommonList(DocumentModel docModel, String label, String id) throws Exception {\r
-       ServiceContext ctx = this.getServiceContext();\r
-        return createItemForCommonList(ServiceConfigUtils.getDocHandlerParams(ctx).getCommonListItemClassname(),\r
-                       docModel, label, id, true);\r
-    }\r
-\r
-    public String getSummaryFields(AbstractCommonList theCommonList) throws DocumentException {\r
-       ServiceContext ctx = this.getServiceContext();\r
-        return ServiceConfigUtils.getDocHandlerParams(ctx).getSummaryFields();\r
-    }\r
-\r
-    public void setListItemArrayExtended(boolean isExtended) throws DocumentException {\r
-       ServiceContext ctx = this.getServiceContext();\r
-       ServiceConfigUtils.getDocHandlerParams(ctx).getListResultsFields().setExtended(isExtended);\r
-    }\r
-    \r
-    public boolean isListItemArrayExtended() throws DocumentException {\r
-       ServiceContext ctx = this.getServiceContext();\r
-               return ServiceConfigUtils.getDocHandlerParams(ctx).getListResultsFields().isExtended();\r
-    }\r
-    \r
-    public List<ListResultField> getListItemsArray() throws DocumentException {\r
-       ServiceContext ctx = this.getServiceContext();\r
-        return ServiceConfigUtils.getDocHandlerParams(ctx).getListResultsFields().getListResultField();\r
-    }\r
-\r
-    @Override\r
-    public T extractCommonPart(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {\r
-        throw new UnsupportedOperationException();\r
-    }\r
-\r
-       @Override\r
-       public void fillCommonPart(T objectexitObject, DocumentWrapper<DocumentModel> wrapDoc) throws Exception {\r
-        throw new UnsupportedOperationException();\r
-    }\r
-\r
-       protected static String getRefname(DocumentModel docModel) throws Exception {\r
-               String result = (String)docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,\r
-                               CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME);\r
-               return result;\r
-       }\r
-       \r
-       public static String getUpdatedAtAsString(DocumentModel docModel) throws Exception {\r
-                       GregorianCalendar cal = (GregorianCalendar)\r
-                                                               docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,\r
-                                                                               CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT);\r
-                       String updatedAt = GregorianCalendarDateTimeUtils.formatAsISO8601Timestamp(cal);\r
-                       return updatedAt;\r
-       }\r
-\r
-    @Override\r
-    public AbstractCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {\r
-       CommonList commonList = new CommonList();\r
-        String markRtSbj = null;\r
-        RepositoryInstanceInterface repoSession = null;\r
-       RepositoryJavaClientImpl repoClient = null;\r
-       RepositoryJavaClientImpl nuxeoRepoClient = null;\r
-       boolean releaseRepoSession = false;\r
-       \r
-       AbstractServiceContextImpl sc = (AbstractServiceContextImpl)getServiceContext();\r
-       MultivaluedMap<String, String> queryParams = getServiceContext().getQueryParams();\r
-       markRtSbj = queryParams.getFirst(IQueryManager.MARK_RELATED_TO_CSID_AS_SUBJECT);  // REM - We need to document what this query param is for -i.e., what's its purpose?\r
-       if(markRtSbj!=null && markRtSbj.isEmpty())\r
-               markRtSbj = null;\r
-  \r
-       try {\r
-            if(markRtSbj!=null) {\r
-                       repoClient = (RepositoryJavaClientImpl)this.getRepositoryClient(sc);\r
-                   nuxeoRepoClient = (RepositoryJavaClientImpl) repoClient;\r
-                       repoSession = this.getRepositorySession();\r
-                       if (repoSession == null) {\r
-                               repoSession = repoClient.getRepositorySession(sc);\r
-                               releaseRepoSession = true;\r
-                       }\r
-            }\r
-            \r
-               String commonSchema = getServiceContext().getCommonPartLabel();\r
-               extractPagingInfo(commonList, wrapDoc);\r
-               List<ListResultField> resultsFields = getListItemsArray();\r
-               int nFields = resultsFields.size() + NUM_STANDARD_LIST_RESULT_FIELDS;\r
-               int baseFields = NUM_STANDARD_LIST_RESULT_FIELDS;\r
-               if(markRtSbj!=null) {\r
-                       nFields++;\r
-                       baseFields++;\r
-               }\r
-               String fields[] = new String[nFields]; // REM - Why can't this just be a static array defined once at the top?  Then there'd be no need for these hardcoded "[x]" statements and no need for NUM_STANDARD_LIST_RESULT_FIELDS constant as well. \r
-               fields[0] = STANDARD_LIST_CSID_FIELD;\r
-               fields[1] = STANDARD_LIST_URI_FIELD;\r
-               fields[2] = STANDARD_LIST_REFNAME_FIELD;\r
-               fields[3] = STANDARD_LIST_UPDATED_AT_FIELD;\r
-               fields[4] = STANDARD_LIST_WORKFLOW_FIELD;\r
-               if(markRtSbj != null) {\r
-                   fields[5] = STANDARD_LIST_MARK_RT_FIELD;\r
-               }\r
-               for(int i = baseFields; i < nFields; i++) {\r
-                       ListResultField field = resultsFields.get(i - baseFields); \r
-                       fields[i] = field.getElement();\r
-               }\r
-                       commonList.setFieldsReturned(fields);\r
-                       Iterator<DocumentModel> iter = wrapDoc.getWrappedObject().iterator();\r
-                       HashMap<String, Object> item = new HashMap<String, Object>();\r
-                       while (iter.hasNext()) {\r
-                               DocumentModel docModel = iter.next();\r
-                               String id = NuxeoUtils.getCsid(docModel);\r
-                               item.put(STANDARD_LIST_CSID_FIELD, id);\r
-                               if (markRtSbj != null) {\r
-                                       String relationClause = RelationsUtils.buildWhereClause(\r
-                                                       markRtSbj, null, null, id, null);\r
-                                       String whereClause = relationClause\r
-                                                       + IQueryManager.SEARCH_QUALIFIER_AND\r
-                                                       + NuxeoUtils.buildWorkflowNotDeletedWhereClause();\r
-                                       QueryContext queryContext = new QueryContext(sc,\r
-                                                       whereClause);\r
-                                       queryContext.setDocType(IRelationsManager.DOC_TYPE);\r
-                                       String query = NuxeoUtils.buildNXQLQuery(sc, queryContext);\r
-                                       // Search for 1 relation that matches. 1 is enough to fail\r
-                                       // the filter\r
-                                       DocumentModelList docList = repoSession.query(query, null,\r
-                                                       1, 0, false);\r
-                                       item.put(STANDARD_LIST_MARK_RT_FIELD,\r
-                                                       docList.isEmpty() ? "false" : "true");\r
-                               }\r
-                               String uri = getUri(docModel);\r
-                               item.put(STANDARD_LIST_URI_FIELD, uri);\r
-                               item.put(STANDARD_LIST_REFNAME_FIELD, getRefname(docModel));\r
-                               item.put(STANDARD_LIST_UPDATED_AT_FIELD,\r
-                                               getUpdatedAtAsString(docModel));\r
-                               item.put(STANDARD_LIST_WORKFLOW_FIELD,\r
-                                               docModel.getCurrentLifeCycleState());\r
-\r
-                               for (ListResultField field : resultsFields) {\r
-                                       String schema = field.getSchema();\r
-                                       if (schema == null || schema.trim().isEmpty()) {\r
-                                               schema = commonSchema;\r
-                                       }\r
-                                       Object value = getListResultValue(docModel, schema, field);\r
-                                       if (value != null && value instanceof String) { // If it is String that is either null or empty, we set our value to null\r
-                                               String strValue = (String) value;\r
-                                               if (strValue.trim().isEmpty() == true) {\r
-                                                       value = null; // We found an "empty" string value, so just set the value to null so we don't return anything.\r
-                                               }\r
-                                       }\r
-                                       if (value != null) {\r
-                                               item.put(field.getElement(), value);\r
-                                       }\r
-                               }\r
-                               commonList.addItem(item);\r
-                               item.clear();\r
-                       }\r
-       } catch (Exception e) {\r
-               if (logger.isDebugEnabled()) {\r
-                       logger.debug("Caught exception ", e);\r
-               }\r
-               throw new DocumentException(e);\r
-               } finally {\r
-                       // If we got/aquired a new session then we're responsible for releasing it.\r
-                       if (releaseRepoSession && repoSession != null) {\r
-                               repoClient.releaseRepositorySession(sc, repoSession);\r
-                       }\r
-       }\r
-\r
-       return commonList;\r
-    }\r
-\r
-    // TODO - get rid of this if we can - appears to be unused.\r
-    @Override\r
-    public String getQProperty(String prop) throws DocumentException {\r
-       ServiceContext ctx = this.getServiceContext();\r
-        return ServiceConfigUtils.getDocHandlerParams(ctx).getSchemaName() + ":" + prop;\r
-    }\r
-\r
-    //============= dublin core handling =======================================\r
-\r
-    @Override\r
-    public void fillAllParts(DocumentWrapper<DocumentModel> wrapDoc, Action action) throws Exception {\r
-        super.fillAllParts(wrapDoc, action);\r
-        fillDublinCoreObject(wrapDoc);\r
-    }\r
-\r
-    /**\r
-     * Fill dublin core object, but only if there are document handler parameters in the service\r
-     * bindings.\r
-     *\r
-     * @param wrapDoc the wrap doc\r
-     * @throws Exception the exception\r
-     */\r
-    // TODO - Remove this? \r
-    // This look like it is never used in a sensible way. It just stuffs a static\r
-    // String that matches the service name into a bogus field.\r
-    protected void fillDublinCoreObject(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {\r
-       DocHandlerParams.Params docHandlerParams = null;\r
-       try {\r
-               docHandlerParams = ServiceConfigUtils.getDocHandlerParams(getServiceContext());\r
-       } catch (Exception e) {\r
-               logger.warn(e.getMessage());\r
-       }\r
-       \r
-       if (docHandlerParams != null) {\r
-               String title = docHandlerParams.getDublinCoreTitle();\r
-               if (Tools.isEmpty(title) == false){\r
-                       DocumentModel docModel = wrapDoc.getWrappedObject();\r
-                       docModel.setPropertyValue("dublincore:title", title);\r
-               }\r
-       }\r
-    }\r
-\r
-    //================== UTILITY METHODS ================================================\r
-    public static ReflectionMapper.STATUS callPropertySetterWithXPathValue(DocumentModel docModel,\r
-                           Object listItem,\r
-                           String setterName,\r
-                           String schema,\r
-                           String xpath)\r
-                           throws Exception {\r
-        //Object prop = docModel.getProperty(label, elementName);\r
-        String value = (String)NuxeoUtils.getXPathValue(docModel, schema, xpath);\r
-        return ReflectionMapper.callSetter(listItem, setterName, value);\r
-    }\r
-\r
-    public static ReflectionMapper.STATUS callSimplePropertySetter(Object target, String name, Object arg) {\r
-        return ReflectionMapper.callSetter(target, name, arg);\r
-    }\r
-\r
-    /**   @param commonListClassname is a package-qualified java classname, including inner class $ notation, such as\r
-     *                             "org.collectionspace.services.objectexit.ObjectexitCommonList$ObjectexitListItem".\r
-     *    @param includeStdFields set to true to have the method set Uri and Csid automatically, based on id param.\r
-     */\r
-    public Object createItemForCommonList(String commonListClassname, DocumentModel docModel, \r
-               String schema, String id, boolean includeStdFields) throws Exception {\r
-        //createItemForCommonList(docModel, label, id);\r
-        Object item = ReflectionMapper.instantiate(commonListClassname);\r
-        List<ListResultField> resultsFields = getListItemsArray();\r
-        for (ListResultField field : resultsFields ){\r
-               callPropertySetterWithXPathValue(docModel, item, \r
-                               field.getSetter(), schema, field.getXpath());\r
-        }\r
-        if (includeStdFields){\r
-               callSimplePropertySetter(item, "setCsid", id);\r
-               callSimplePropertySetter(item, "setUri", getServiceContextPath() + id);\r
-        }\r
-        return item;\r
-    }\r
-\r
-    /** Subclasses should override this method if they don't want to automatically\r
-     *  call List createItemsList(AbstractCommonList commonList, String listItemMethodName)\r
-     *  which will use introspection to create a summary list, and will find the primary\r
-     *  field for you if specified.\r
-     */\r
-    public List createItemsList(AbstractCommonList commonList) throws Exception {\r
-       ServiceContext ctx = this.getServiceContext();\r
-        return createItemsList(commonList, \r
-                       ServiceConfigUtils.getDocHandlerParams(ctx).getListResultsItemMethodName());\r
-    }\r
-\r
-    /** e.g. createItemsList(commonList, "getObjectexitListItem" */\r
-    public List createItemsList(AbstractCommonList commonList, String listItemMethodName) throws Exception {\r
-        Class commonListClass = commonList.getClass();\r
-        Class[] types = new Class[] {};\r
-        try {\r
-            Method m = commonListClass.getMethod(listItemMethodName, types);\r
-            return (List)(ReflectionMapper.fireGetMethod(m, commonList));\r
-        } catch (NoSuchMethodException nsm){\r
-            return new ArrayList();\r
-        }\r
-    }\r
-\r
-\r
-\r
-}\r
-\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.nuxeo.client.java;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.ws.rs.core.MultivaluedMap;
+
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.IQueryManager;
+import org.collectionspace.services.client.IRelationsManager;
+import org.collectionspace.services.common.ReflectionMapper;
+import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.config.ServiceConfigUtils;
+import org.collectionspace.services.common.context.AbstractServiceContextImpl;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.DocumentException;
+import org.collectionspace.services.common.document.DocumentWrapper;
+import org.collectionspace.services.common.query.QueryContext;
+import org.collectionspace.services.common.relation.nuxeo.RelationsUtils;
+import org.collectionspace.services.config.service.DocHandlerParams;
+import org.collectionspace.services.config.service.ListResultField;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.nuxeo.client.java.CommonList;
+import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
+import org.collectionspace.services.nuxeo.util.NuxeoUtils;
+import org.nuxeo.ecm.core.api.DocumentModel;
+import org.nuxeo.ecm.core.api.DocumentModelList;
+import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class is generified by the marker type T,
+ * where T is expected to map to something like BlobCommon, MediaCommon, ObjectexitCommon, etc.,
+ * and so on for every JAXB-generated schema class.
+ *
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ *
+ */
+public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T, AbstractCommonList> {
+
+    /** The logger. */
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    private AbstractCommonList commonList;
+    
+    protected static final int NUM_STANDARD_LIST_RESULT_FIELDS = 5;
+    protected static final String STANDARD_LIST_CSID_FIELD = "csid";
+    protected static final String STANDARD_LIST_URI_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_URI;
+    protected static final String STANDARD_LIST_REFNAME_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME;
+    protected static final String STANDARD_LIST_UPDATED_AT_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT;
+    protected static final String STANDARD_LIST_WORKFLOW_FIELD = CollectionSpaceClient.COLLECTIONSPACE_CORE_WORKFLOWSTATE;
+    protected static final String STANDARD_LIST_MARK_RT_FIELD = "related";
+
+    @Override
+    public AbstractCommonList getCommonPartList() {
+        return commonList;
+    }
+
+    @Override
+       public void setCommonPartList(AbstractCommonList aCommonList) {
+        this.commonList = aCommonList;
+    }
+
+    private T commonPart;
+
+    @Override
+    public T getCommonPart() {
+        return (T)commonPart;
+    }
+
+    @Override
+       public void setCommonPart(T commonPart) {
+        this.commonPart = commonPart;
+    }
+
+
+    /** Subclass DocHandlers may override this method to control exact creation of the common list.
+     *  This class instantiates an AbstractCommonList from the classname returned by getDocHandlerParams().AbstractCommonListClassname.
+     * @return
+     * @throws Exception
+     */
+    public AbstractCommonList createAbstractCommonListImpl() throws Exception {
+        //  String classname = this.commonList.getClass().getName();
+       ServiceContext ctx = this.getServiceContext();
+        String classname = ServiceConfigUtils.getDocHandlerParams(ctx).getAbstractCommonListClassname();
+        if (classname == null){
+            throw new Exception("in createAbstractCommonListImpl. getDocHandlerParams().getAbstractCommonListClassname() is null");
+        }
+        classname = classname.trim();
+        return (AbstractCommonList)(ReflectionMapper.instantiate(classname));
+    }
+
+
+    /** DocHandlerBase calls this method with the CSID as id */
+    public Object createItemForCommonList(DocumentModel docModel, String label, String id) throws Exception {
+       ServiceContext ctx = this.getServiceContext();
+        return createItemForCommonList(ServiceConfigUtils.getDocHandlerParams(ctx).getCommonListItemClassname(),
+                       docModel, label, id, true);
+    }
+
+    public String getSummaryFields(AbstractCommonList theCommonList) throws DocumentException {
+       ServiceContext ctx = this.getServiceContext();
+        return ServiceConfigUtils.getDocHandlerParams(ctx).getSummaryFields();
+    }
+
+    public void setListItemArrayExtended(boolean isExtended) throws DocumentException {
+       ServiceContext ctx = this.getServiceContext();
+       ServiceConfigUtils.getDocHandlerParams(ctx).getListResultsFields().setExtended(isExtended);
+    }
+    
+    public boolean isListItemArrayExtended() throws DocumentException {
+       ServiceContext ctx = this.getServiceContext();
+               return ServiceConfigUtils.getDocHandlerParams(ctx).getListResultsFields().isExtended();
+    }
+    
+    public List<ListResultField> getListItemsArray() throws DocumentException {
+       ServiceContext ctx = this.getServiceContext();
+        return ServiceConfigUtils.getDocHandlerParams(ctx).getListResultsFields().getListResultField();
+    }
+
+    @Override
+    public T extractCommonPart(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+        throw new UnsupportedOperationException();
+    }
+
+       @Override
+       public void fillCommonPart(T objectexitObject, DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+        throw new UnsupportedOperationException();
+    }
+
+       protected static String getRefname(DocumentModel docModel) throws Exception {
+               String result = (String)docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,
+                               CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME);
+               return result;
+       }
+       
+       public static String getUpdatedAtAsString(DocumentModel docModel) throws Exception {
+                       GregorianCalendar cal = (GregorianCalendar)
+                                                               docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,
+                                                                               CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT);
+                       String updatedAt = GregorianCalendarDateTimeUtils.formatAsISO8601Timestamp(cal);
+                       return updatedAt;
+       }
+
+    @Override
+    public AbstractCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {
+       CommonList commonList = new CommonList();
+        String markRtSbj = null;
+        RepositoryInstanceInterface repoSession = null;
+       RepositoryJavaClientImpl repoClient = null;
+       RepositoryJavaClientImpl nuxeoRepoClient = null;
+       boolean releaseRepoSession = false;
+       
+       AbstractServiceContextImpl sc = (AbstractServiceContextImpl)getServiceContext();
+       MultivaluedMap<String, String> queryParams = getServiceContext().getQueryParams();
+       markRtSbj = queryParams.getFirst(IQueryManager.MARK_RELATED_TO_CSID_AS_SUBJECT);  // REM - We need to document what this query param is for -i.e., what's its purpose?
+       if(markRtSbj!=null && markRtSbj.isEmpty())
+               markRtSbj = null;
+  
+       try {
+            if(markRtSbj!=null) {
+                       repoClient = (RepositoryJavaClientImpl)this.getRepositoryClient(sc);
+                   nuxeoRepoClient = (RepositoryJavaClientImpl) repoClient;
+                       repoSession = this.getRepositorySession();
+                       if (repoSession == null) {
+                               repoSession = repoClient.getRepositorySession(sc);
+                               releaseRepoSession = true;
+                       }
+            }
+            
+               String commonSchema = getServiceContext().getCommonPartLabel();
+               extractPagingInfo(commonList, wrapDoc);
+               List<ListResultField> resultsFields = getListItemsArray();
+               int nFields = resultsFields.size() + NUM_STANDARD_LIST_RESULT_FIELDS;
+               int baseFields = NUM_STANDARD_LIST_RESULT_FIELDS;
+               if(markRtSbj!=null) {
+                       nFields++;
+                       baseFields++;
+               }
+               String fields[] = new String[nFields]; // REM - Why can't this just be a static array defined once at the top?  Then there'd be no need for these hardcoded "[x]" statements and no need for NUM_STANDARD_LIST_RESULT_FIELDS constant as well. 
+               fields[0] = STANDARD_LIST_CSID_FIELD;
+               fields[1] = STANDARD_LIST_URI_FIELD;
+               fields[2] = STANDARD_LIST_REFNAME_FIELD;
+               fields[3] = STANDARD_LIST_UPDATED_AT_FIELD;
+               fields[4] = STANDARD_LIST_WORKFLOW_FIELD;
+               if(markRtSbj != null) {
+                   fields[5] = STANDARD_LIST_MARK_RT_FIELD;
+               }
+               for(int i = baseFields; i < nFields; i++) {
+                       ListResultField field = resultsFields.get(i - baseFields); 
+                       fields[i] = field.getElement();
+               }
+                       commonList.setFieldsReturned(fields);
+                       Iterator<DocumentModel> iter = wrapDoc.getWrappedObject().iterator();
+                       HashMap<String, Object> item = new HashMap<String, Object>();
+                       while (iter.hasNext()) {
+                               DocumentModel docModel = iter.next();
+                               String id = NuxeoUtils.getCsid(docModel);
+                               item.put(STANDARD_LIST_CSID_FIELD, id);
+                               if (markRtSbj != null) {
+                                       String relationClause = RelationsUtils.buildWhereClause(
+                                                       markRtSbj, null, null, id, null);
+                                       String whereClause = relationClause
+                                                       + IQueryManager.SEARCH_QUALIFIER_AND
+                                                       + NuxeoUtils.buildWorkflowNotDeletedWhereClause();
+                                       QueryContext queryContext = new QueryContext(sc,
+                                                       whereClause);
+                                       queryContext.setDocType(IRelationsManager.DOC_TYPE);
+                                       String query = NuxeoUtils.buildNXQLQuery(sc, queryContext);
+                                       // Search for 1 relation that matches. 1 is enough to fail
+                                       // the filter
+                                       DocumentModelList docList = repoSession.query(query, null,
+                                                       1, 0, false);
+                                       item.put(STANDARD_LIST_MARK_RT_FIELD,
+                                                       docList.isEmpty() ? "false" : "true");
+                               }
+                               String uri = getUri(docModel);
+                               item.put(STANDARD_LIST_URI_FIELD, uri);
+                               item.put(STANDARD_LIST_REFNAME_FIELD, getRefname(docModel));
+                               item.put(STANDARD_LIST_UPDATED_AT_FIELD,
+                                               getUpdatedAtAsString(docModel));
+                               item.put(STANDARD_LIST_WORKFLOW_FIELD,
+                                               docModel.getCurrentLifeCycleState());
+
+                               for (ListResultField field : resultsFields) {
+                                       String schema = field.getSchema();
+                                       if (schema == null || schema.trim().isEmpty()) {
+                                               schema = commonSchema;
+                                       }
+                                       Object value = getListResultValue(docModel, schema, field);
+                                       if (value != null && value instanceof String) { // If it is String that is either null or empty, we set our value to null
+                                               String strValue = (String) value;
+                                               if (strValue.trim().isEmpty() == true) {
+                                                       value = null; // We found an "empty" string value, so just set the value to null so we don't return anything.
+                                               }
+                                       }
+                                       if (value != null) {
+                                               item.put(field.getElement(), value);
+                                       }
+                               }
+                               commonList.addItem(item);
+                               item.clear();
+                       }
+       } catch (Exception e) {
+               if (logger.isDebugEnabled()) {
+                       logger.debug("Caught exception ", e);
+               }
+               throw new DocumentException(e);
+               } finally {
+                       // If we got/aquired a new session then we're responsible for releasing it.
+                       if (releaseRepoSession && repoSession != null) {
+                               repoClient.releaseRepositorySession(sc, repoSession);
+                       }
+       }
+
+       return commonList;
+    }
+
+    // TODO - get rid of this if we can - appears to be unused.
+    @Override
+    public String getQProperty(String prop) throws DocumentException {
+       ServiceContext ctx = this.getServiceContext();
+        return ServiceConfigUtils.getDocHandlerParams(ctx).getSchemaName() + ":" + prop;
+    }
+
+    //============= dublin core handling =======================================
+
+    @Override
+    public void fillAllParts(DocumentWrapper<DocumentModel> wrapDoc, Action action) throws Exception {
+        super.fillAllParts(wrapDoc, action);
+        fillDublinCoreObject(wrapDoc);
+    }
+
+    /**
+     * Fill dublin core object, but only if there are document handler parameters in the service
+     * bindings.
+     *
+     * @param wrapDoc the wrap doc
+     * @throws Exception the exception
+     */
+    // TODO - Remove this? 
+    // This look like it is never used in a sensible way. It just stuffs a static
+    // String that matches the service name into a bogus field.
+    protected void fillDublinCoreObject(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+       DocHandlerParams.Params docHandlerParams = null;
+       try {
+               docHandlerParams = ServiceConfigUtils.getDocHandlerParams(getServiceContext());
+       } catch (Exception e) {
+               logger.warn(e.getMessage());
+       }
+       
+       if (docHandlerParams != null) {
+               String title = docHandlerParams.getDublinCoreTitle();
+               if (Tools.isEmpty(title) == false){
+                       DocumentModel docModel = wrapDoc.getWrappedObject();
+                       docModel.setPropertyValue("dublincore:title", title);
+               }
+       }
+    }
+
+    //================== UTILITY METHODS ================================================
+    public static ReflectionMapper.STATUS callPropertySetterWithXPathValue(DocumentModel docModel,
+                           Object listItem,
+                           String setterName,
+                           String schema,
+                           String xpath)
+                           throws Exception {
+        //Object prop = docModel.getProperty(label, elementName);
+        String value = (String)NuxeoUtils.getXPathValue(docModel, schema, xpath);
+        return ReflectionMapper.callSetter(listItem, setterName, value);
+    }
+
+    public static ReflectionMapper.STATUS callSimplePropertySetter(Object target, String name, Object arg) {
+        return ReflectionMapper.callSetter(target, name, arg);
+    }
+
+    /**   @param commonListClassname is a package-qualified java classname, including inner class $ notation, such as
+     *                             "org.collectionspace.services.objectexit.ObjectexitCommonList$ObjectexitListItem".
+     *    @param includeStdFields set to true to have the method set Uri and Csid automatically, based on id param.
+     */
+    public Object createItemForCommonList(String commonListClassname, DocumentModel docModel, 
+               String schema, String id, boolean includeStdFields) throws Exception {
+        //createItemForCommonList(docModel, label, id);
+        Object item = ReflectionMapper.instantiate(commonListClassname);
+        List<ListResultField> resultsFields = getListItemsArray();
+        for (ListResultField field : resultsFields ){
+               callPropertySetterWithXPathValue(docModel, item, 
+                               field.getSetter(), schema, field.getXpath());
+        }
+        if (includeStdFields){
+               callSimplePropertySetter(item, "setCsid", id);
+               callSimplePropertySetter(item, "setUri", getServiceContextPath() + id);
+        }
+        return item;
+    }
+
+    /** Subclasses should override this method if they don't want to automatically
+     *  call List createItemsList(AbstractCommonList commonList, String listItemMethodName)
+     *  which will use introspection to create a summary list, and will find the primary
+     *  field for you if specified.
+     */
+    public List createItemsList(AbstractCommonList commonList) throws Exception {
+       ServiceContext ctx = this.getServiceContext();
+        return createItemsList(commonList, 
+                       ServiceConfigUtils.getDocHandlerParams(ctx).getListResultsItemMethodName());
+    }
+
+    /** e.g. createItemsList(commonList, "getObjectexitListItem" */
+    public List createItemsList(AbstractCommonList commonList, String listItemMethodName) throws Exception {
+        Class commonListClass = commonList.getClass();
+        Class[] types = new Class[] {};
+        try {
+            Method m = commonListClass.getMethod(listItemMethodName, types);
+            return (List)(ReflectionMapper.fireGetMethod(m, commonList));
+        } catch (NoSuchMethodException nsm){
+            return new ArrayList();
+        }
+    }
+
+
+
+}
+
index 144450c81712c4fffd23c8163ea5ceee09c296e4..7dbd1b9fad1594460435b8ce25d57d96c11cd184 100644 (file)
-/*\r
- * (C) Copyright 2006-2010 Nuxeo SAS (http://nuxeo.com/) and contributors.\r
- *\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the GNU Lesser General Public License\r
- * (LGPL) version 2.1 which accompanies this distribution, and is available at\r
- * http://www.gnu.org/licenses/lgpl.html\r
- *\r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * Contributors:\r
- *     bstefanescu, jcarsique\r
- *\r
- * $Id$\r
- */\r
-\r
-package org.collectionspace.services.nuxeo.client.java;\r
-\r
-import java.util.Collection;\r
-import java.util.HashMap;\r
-import java.util.Iterator;\r
-import java.util.Map.Entry;\r
-\r
-import org.collectionspace.services.common.repository.RepositoryInstanceWrapperAdvice;\r
-import org.collectionspace.services.config.tenant.RepositoryDomainType;\r
-import org.jboss.remoting.InvokerLocator;\r
-import org.nuxeo.ecm.core.api.repository.Repository;\r
-import org.nuxeo.ecm.core.api.repository.RepositoryInstance;\r
-import org.nuxeo.ecm.core.api.repository.RepositoryInstanceHandler;\r
-import org.nuxeo.ecm.core.api.repository.RepositoryManager;\r
-import org.nuxeo.ecm.core.client.DefaultLoginHandler;\r
-import org.nuxeo.ecm.core.client.LoginHandler;\r
-import org.nuxeo.runtime.api.Framework;\r
-import org.nuxeo.runtime.transaction.TransactionHelper;\r
-\r
-import javax.transaction.TransactionManager;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.springframework.aop.framework.ProxyFactory;\r
-\r
-/**\r
- * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>\r
- *\r
- */\r
-public final class NuxeoClientEmbedded {\r
-\r
-       private Logger logger = LoggerFactory.getLogger(NuxeoClientEmbedded.class);\r
-       \r
-    private LoginHandler loginHandler;\r
-\r
-    private final HashMap<String, RepositoryInstanceInterface> repositoryInstances;\r
-\r
-    private InvokerLocator locator;\r
-\r
-    private RepositoryManager repositoryMgr;\r
-\r
-    private static final NuxeoClientEmbedded instance = new NuxeoClientEmbedded();\r
-        \r
-    /**\r
-     * Constructs a new NuxeoClient. NOTE: Using {@link #getInstance()} instead\r
-     * of this constructor is recommended.\r
-     */\r
-    private NuxeoClientEmbedded() {\r
-        loginHandler = loginHandler == null ? new DefaultLoginHandler()\r
-                : loginHandler;\r
-        repositoryInstances = new HashMap<String, RepositoryInstanceInterface>();\r
-    }\r
-    \r
-    public static NuxeoClientEmbedded getInstance() {\r
-        return instance;\r
-    }\r
-\r
-    public synchronized void tryDisconnect() throws Exception {\r
-        if (locator == null) {\r
-            return; // do nothing\r
-        }\r
-        doDisconnect();\r
-    }\r
-\r
-    private void doDisconnect() throws Exception {\r
-        locator = null;\r
-        // close repository sessions if any\r
-        Iterator<Entry<String, RepositoryInstanceInterface>> it = repositoryInstances.entrySet().iterator();\r
-        while (it.hasNext()) {\r
-            Entry<String, RepositoryInstanceInterface> repo = it.next();\r
-            try {\r
-                repo.getValue().close();\r
-            } catch (Exception e) {\r
-                logger.debug("Error while trying to close " + repo, e);\r
-            }\r
-            it.remove();\r
-        }\r
-\r
-        repositoryMgr = null;\r
-    }\r
-\r
-    public synchronized boolean isConnected() {\r
-        return true;\r
-    }\r
-\r
-    public InvokerLocator getLocator() {\r
-        return locator;\r
-    }\r
-\r
-    public synchronized LoginHandler getLoginHandler() {\r
-        return loginHandler;\r
-    }\r
-\r
-    public synchronized void setLoginHandler(LoginHandler loginHandler) {\r
-        this.loginHandler = loginHandler;\r
-    }\r
-\r
-    public RepositoryManager getRepositoryManager() throws Exception {\r
-        if (repositoryMgr == null) {\r
-            repositoryMgr = Framework.getService(RepositoryManager.class);\r
-        }\r
-        return repositoryMgr;\r
-    }\r
-\r
-    /**\r
-     * Gets the repositories available on the connected server.\r
-     *\r
-     * @return the repositories\r
-     */\r
-    public Repository[] getRepositories() throws Exception {\r
-        Collection<Repository> repos = getRepositoryManager().getRepositories();\r
-        return repos.toArray(new Repository[repos.size()]);\r
-    }\r
-\r
-    public Repository getDefaultRepository() throws Exception {\r
-        return getRepositoryManager().getDefaultRepository();\r
-    }\r
-\r
-    public Repository getRepository(String name) throws Exception {\r
-        return getRepositoryManager().getRepository(name);\r
-    }\r
-\r
-    /*\r
-     * Open a Nuxeo repo session using the passed in repoDomain and use the default tx timeout period\r
-     */\r
-    public RepositoryInstanceInterface openRepository(RepositoryDomainType repoDomain) throws Exception {\r
-        return openRepository(repoDomain.getRepositoryName(), -1);\r
-    }\r
-    \r
-    /*\r
-     * Open a Nuxeo repo session using the passed in repoDomain and use the default tx timeout period\r
-     */\r
-    public RepositoryInstanceInterface openRepository(String repoName) throws Exception {\r
-        return openRepository(repoName, -1);\r
-    }    \r
-\r
-    public RepositoryInstanceInterface openRepository(String repoName, int timeoutSeconds) throws Exception {\r
-       RepositoryInstanceInterface result = null;\r
-       \r
-       //\r
-       // If the called passed in a custom timeout setting, use it to configure Nuxeo's transaction manager.\r
-       //\r
-       if (timeoutSeconds > 0) {\r
-               TransactionManager transactionMgr = TransactionHelper.lookupTransactionManager();\r
-               transactionMgr.setTransactionTimeout(timeoutSeconds);\r
-               if (logger.isInfoEnabled()) {\r
-                       logger.info(String.format("Changing current request's transaction timeout period to %d seconds",\r
-                                       timeoutSeconds));\r
-               }\r
-       }\r
-       \r
-       //\r
-       // Start a new Nuxeo transaction\r
-       //\r
-       boolean startedTransaction = false;\r
-       if (TransactionHelper.isTransactionActive() == false) {\r
-               startedTransaction = TransactionHelper.startTransaction();\r
-               if (startedTransaction == false) {\r
-                       String errMsg = "Could not start a Nuxeo transaction with the TransactionHelper class.";\r
-                       logger.error(errMsg);\r
-                       throw new Exception(errMsg);\r
-               }\r
-       } else {\r
-               logger.warn("A request to start a new transaction was made, but a transaction is already open.");\r
-       }\r
-       \r
-       //\r
-       // From the repository name that the caller passed in, get an instance of Nuxeo's Repository class.\r
-       // The Repository class is just a metadata description of the repository.\r
-       //\r
-        Repository repository;\r
-        if (repoName != null) {\r
-               repository = getRepositoryManager().getRepository(repoName);\r
-        } else {\r
-               repository = getRepositoryManager().getDefaultRepository();\r
-               logger.warn(String.format("Using default repository '%s' because no name was specified.", repository.getName()));\r
-        }\r
-        \r
-        //\r
-        // Using the Repository class, get a Spring AOP proxied instance.  We use Spring AOP to "wrap" all calls to the\r
-        // Nuxeo repository so we can check for network related failures and perform a series of retries.\r
-        //\r
-        if (repository != null) {\r
-            result = getRepositoryInstanceWrapper(repository);\r
-               logger.trace(String.format("A new transaction was started on thread '%d' : %s.",\r
-                               Thread.currentThread().getId(), startedTransaction ? "true" : "false"));\r
-               logger.trace(String.format("Added a new repository instance to our repo list.  Current count is now: %d",\r
-                               repositoryInstances.size()));\r
-        } else {\r
-               String errMsg = String.format("Could not open a session to the Nuxeo repository='%s'", repoName);\r
-               logger.error(errMsg);\r
-               throw new Exception(errMsg);\r
-        }      \r
-       \r
-        \r
-        return result;\r
-    }\r
-    \r
-    //\r
-    // Returns a proxied interface to a Nuxeo repository instance.  Our proxy uses Spring AOP to\r
-    // wrap each call to the Nuxeo repo with code that catches network related errors/exceptions and\r
-    // re-attempts the calls to see if it recovers.\r
-    //\r
-    private RepositoryInstanceInterface getAOPProxy(RepositoryInstance repositoryInstance) {\r
-       RepositoryInstanceInterface result = null;\r
-       \r
-       try {\r
-                       ProxyFactory factory = new ProxyFactory(new RepositoryInstanceWrapper(repositoryInstance));\r
-                       factory.addAdvice(new RepositoryInstanceWrapperAdvice());\r
-                       factory.setExposeProxy(true);\r
-                       result = (RepositoryInstanceInterface)factory.getProxy();\r
-       } catch (Exception e) {\r
-               logger.error("Could not create AOP proxy for: " + RepositoryInstanceWrapper.class.getName(), e);\r
-       }\r
-       \r
-       return result;\r
-    }\r
-    \r
-    /*\r
-     * From the Repository object (a description of the repository), get repository instance wrapper.  Our wrapper\r
-     * will using the Spring AOP mechanism to intercept all calls to the repository.  We will wrap all the calls to the\r
-     * Nuxeo repository and check for network related failures.  We will retry all calls to the Nuxeo repo that fail because\r
-     * of network erros.\r
-     */\r
-    private RepositoryInstanceInterface getRepositoryInstanceWrapper(Repository repository) throws Exception {\r
-       RepositoryInstanceInterface result = null;\r
-               \r
-       RepositoryInstance repositoryInstance = new RepositoryInstanceHandler(repository).getProxy();  // A Nuxeo repo instance handler proxy\r
-        if (repositoryInstance != null) {\r
-               result = this.getAOPProxy(repositoryInstance);  // This is our AOP proxy\r
-               if (result != null) {\r
-                       String key = result.getSessionId();\r
-                       repositoryInstances.put(key, result);\r
-               } else {\r
-                       String errMsg = String.format("Could not instantiate a Spring AOP proxy for class '%s'.",\r
-                                       RepositoryInstanceWrapper.class.getName());\r
-                       logger.error(errMsg);\r
-                       throw new Exception(errMsg);\r
-               }\r
-        } else {\r
-               String errMsg = String.format("Could not create a new repository instance for '%s' repository.", repository.getName());\r
-               logger.error(errMsg);\r
-               throw new Exception(errMsg);\r
-        }\r
-       \r
-       return result;\r
-    }\r
-\r
-    public void releaseRepository(RepositoryInstanceInterface repo) throws Exception {\r
-       String key = repo.getSessionId();\r
-\r
-        try {\r
-               repo.save();\r
-            repo.close();\r
-        } catch (Exception e) {\r
-               logger.error("Possible data loss.  Could not save and/or release the repository.", e);\r
-               throw e;\r
-        } finally {\r
-            RepositoryInstanceInterface wasRemoved = repositoryInstances.remove(key);\r
-            if (logger.isTraceEnabled()) {\r
-               if (wasRemoved != null) {\r
-                       logger.trace("Removed a repository instance from our repo list.  Current count is now: "\r
-                                       + repositoryInstances.size());\r
-               } else {\r
-                       logger.trace("Could not remove a repository instance from our repo list.  Current count is now: "\r
-                                       + repositoryInstances.size());\r
-               }\r
-            }\r
-            if (TransactionHelper.isTransactionActiveOrMarkedRollback() == true) {\r
-               TransactionHelper.commitOrRollbackTransaction();\r
-               logger.trace(String.format("Transaction closed on thread '%d'", Thread.currentThread().getId()));\r
-            }\r
-        }\r
-    }    \r
-}\r
+/*
+ * (C) Copyright 2006-2010 Nuxeo SAS (http://nuxeo.com/) and contributors.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser General Public License
+ * (LGPL) version 2.1 which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Contributors:
+ *     bstefanescu, jcarsique
+ *
+ * $Id$
+ */
+
+package org.collectionspace.services.nuxeo.client.java;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map.Entry;
+
+import org.collectionspace.services.common.repository.RepositoryInstanceWrapperAdvice;
+import org.collectionspace.services.config.tenant.RepositoryDomainType;
+import org.jboss.remoting.InvokerLocator;
+import org.nuxeo.ecm.core.api.repository.Repository;
+import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
+import org.nuxeo.ecm.core.api.repository.RepositoryInstanceHandler;
+import org.nuxeo.ecm.core.api.repository.RepositoryManager;
+import org.nuxeo.ecm.core.client.DefaultLoginHandler;
+import org.nuxeo.ecm.core.client.LoginHandler;
+import org.nuxeo.runtime.api.Framework;
+import org.nuxeo.runtime.transaction.TransactionHelper;
+
+import javax.transaction.TransactionManager;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.aop.framework.ProxyFactory;
+
+/**
+ * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
+ *
+ */
+public final class NuxeoClientEmbedded {
+
+       private Logger logger = LoggerFactory.getLogger(NuxeoClientEmbedded.class);
+       
+    private LoginHandler loginHandler;
+
+    private final HashMap<String, RepositoryInstanceInterface> repositoryInstances;
+
+    private InvokerLocator locator;
+
+    private RepositoryManager repositoryMgr;
+
+    private static final NuxeoClientEmbedded instance = new NuxeoClientEmbedded();
+        
+    /**
+     * Constructs a new NuxeoClient. NOTE: Using {@link #getInstance()} instead
+     * of this constructor is recommended.
+     */
+    private NuxeoClientEmbedded() {
+        loginHandler = loginHandler == null ? new DefaultLoginHandler()
+                : loginHandler;
+        repositoryInstances = new HashMap<String, RepositoryInstanceInterface>();
+    }
+    
+    public static NuxeoClientEmbedded getInstance() {
+        return instance;
+    }
+
+    public synchronized void tryDisconnect() throws Exception {
+        if (locator == null) {
+            return; // do nothing
+        }
+        doDisconnect();
+    }
+
+    private void doDisconnect() throws Exception {
+        locator = null;
+        // close repository sessions if any
+        Iterator<Entry<String, RepositoryInstanceInterface>> it = repositoryInstances.entrySet().iterator();
+        while (it.hasNext()) {
+            Entry<String, RepositoryInstanceInterface> repo = it.next();
+            try {
+                repo.getValue().close();
+            } catch (Exception e) {
+                logger.debug("Error while trying to close " + repo, e);
+            }
+            it.remove();
+        }
+
+        repositoryMgr = null;
+    }
+
+    public synchronized boolean isConnected() {
+        return true;
+    }
+
+    public InvokerLocator getLocator() {
+        return locator;
+    }
+
+    public synchronized LoginHandler getLoginHandler() {
+        return loginHandler;
+    }
+
+    public synchronized void setLoginHandler(LoginHandler loginHandler) {
+        this.loginHandler = loginHandler;
+    }
+
+    public RepositoryManager getRepositoryManager() throws Exception {
+        if (repositoryMgr == null) {
+            repositoryMgr = Framework.getService(RepositoryManager.class);
+        }
+        return repositoryMgr;
+    }
+
+    /**
+     * Gets the repositories available on the connected server.
+     *
+     * @return the repositories
+     */
+    public Repository[] getRepositories() throws Exception {
+        Collection<Repository> repos = getRepositoryManager().getRepositories();
+        return repos.toArray(new Repository[repos.size()]);
+    }
+
+    public Repository getDefaultRepository() throws Exception {
+        return getRepositoryManager().getDefaultRepository();
+    }
+
+    public Repository getRepository(String name) throws Exception {
+        return getRepositoryManager().getRepository(name);
+    }
+
+    /*
+     * Open a Nuxeo repo session using the passed in repoDomain and use the default tx timeout period
+     */
+    public RepositoryInstanceInterface openRepository(RepositoryDomainType repoDomain) throws Exception {
+        return openRepository(repoDomain.getRepositoryName(), -1);
+    }
+    
+    /*
+     * Open a Nuxeo repo session using the passed in repoDomain and use the default tx timeout period
+     */
+    public RepositoryInstanceInterface openRepository(String repoName) throws Exception {
+        return openRepository(repoName, -1);
+    }    
+
+    public RepositoryInstanceInterface openRepository(String repoName, int timeoutSeconds) throws Exception {
+       RepositoryInstanceInterface result = null;
+       
+       //
+       // If the called passed in a custom timeout setting, use it to configure Nuxeo's transaction manager.
+       //
+       if (timeoutSeconds > 0) {
+               TransactionManager transactionMgr = TransactionHelper.lookupTransactionManager();
+               transactionMgr.setTransactionTimeout(timeoutSeconds);
+               if (logger.isInfoEnabled()) {
+                       logger.info(String.format("Changing current request's transaction timeout period to %d seconds",
+                                       timeoutSeconds));
+               }
+       }
+       
+       //
+       // Start a new Nuxeo transaction
+       //
+       boolean startedTransaction = false;
+       if (TransactionHelper.isTransactionActive() == false) {
+               startedTransaction = TransactionHelper.startTransaction();
+               if (startedTransaction == false) {
+                       String errMsg = "Could not start a Nuxeo transaction with the TransactionHelper class.";
+                       logger.error(errMsg);
+                       throw new Exception(errMsg);
+               }
+       } else {
+               logger.warn("A request to start a new transaction was made, but a transaction is already open.");
+       }
+       
+       //
+       // From the repository name that the caller passed in, get an instance of Nuxeo's Repository class.
+       // The Repository class is just a metadata description of the repository.
+       //
+        Repository repository;
+        if (repoName != null) {
+               repository = getRepositoryManager().getRepository(repoName);
+        } else {
+               repository = getRepositoryManager().getDefaultRepository();
+               logger.warn(String.format("Using default repository '%s' because no name was specified.", repository.getName()));
+        }
+        
+        //
+        // Using the Repository class, get a Spring AOP proxied instance.  We use Spring AOP to "wrap" all calls to the
+        // Nuxeo repository so we can check for network related failures and perform a series of retries.
+        //
+        if (repository != null) {
+            result = getRepositoryInstanceWrapper(repository);
+               logger.trace(String.format("A new transaction was started on thread '%d' : %s.",
+                               Thread.currentThread().getId(), startedTransaction ? "true" : "false"));
+               logger.trace(String.format("Added a new repository instance to our repo list.  Current count is now: %d",
+                               repositoryInstances.size()));
+        } else {
+               String errMsg = String.format("Could not open a session to the Nuxeo repository='%s'", repoName);
+               logger.error(errMsg);
+               throw new Exception(errMsg);
+        }      
+       
+        
+        return result;
+    }
+    
+    //
+    // Returns a proxied interface to a Nuxeo repository instance.  Our proxy uses Spring AOP to
+    // wrap each call to the Nuxeo repo with code that catches network related errors/exceptions and
+    // re-attempts the calls to see if it recovers.
+    //
+    private RepositoryInstanceInterface getAOPProxy(RepositoryInstance repositoryInstance) {
+       RepositoryInstanceInterface result = null;
+       
+       try {
+                       ProxyFactory factory = new ProxyFactory(new RepositoryInstanceWrapper(repositoryInstance));
+                       factory.addAdvice(new RepositoryInstanceWrapperAdvice());
+                       factory.setExposeProxy(true);
+                       result = (RepositoryInstanceInterface)factory.getProxy();
+       } catch (Exception e) {
+               logger.error("Could not create AOP proxy for: " + RepositoryInstanceWrapper.class.getName(), e);
+       }
+       
+       return result;
+    }
+    
+    /*
+     * From the Repository object (a description of the repository), get repository instance wrapper.  Our wrapper
+     * will using the Spring AOP mechanism to intercept all calls to the repository.  We will wrap all the calls to the
+     * Nuxeo repository and check for network related failures.  We will retry all calls to the Nuxeo repo that fail because
+     * of network erros.
+     */
+    private RepositoryInstanceInterface getRepositoryInstanceWrapper(Repository repository) throws Exception {
+       RepositoryInstanceInterface result = null;
+               
+       RepositoryInstance repositoryInstance = new RepositoryInstanceHandler(repository).getProxy();  // A Nuxeo repo instance handler proxy
+        if (repositoryInstance != null) {
+               result = this.getAOPProxy(repositoryInstance);  // This is our AOP proxy
+               if (result != null) {
+                       String key = result.getSessionId();
+                       repositoryInstances.put(key, result);
+               } else {
+                       String errMsg = String.format("Could not instantiate a Spring AOP proxy for class '%s'.",
+                                       RepositoryInstanceWrapper.class.getName());
+                       logger.error(errMsg);
+                       throw new Exception(errMsg);
+               }
+        } else {
+               String errMsg = String.format("Could not create a new repository instance for '%s' repository.", repository.getName());
+               logger.error(errMsg);
+               throw new Exception(errMsg);
+        }
+       
+       return result;
+    }
+
+    public void releaseRepository(RepositoryInstanceInterface repo) throws Exception {
+       String key = repo.getSessionId();
+
+        try {
+               repo.save();
+            repo.close();
+        } catch (Exception e) {
+               logger.error("Possible data loss.  Could not save and/or release the repository.", e);
+               throw e;
+        } finally {
+            RepositoryInstanceInterface wasRemoved = repositoryInstances.remove(key);
+            if (logger.isTraceEnabled()) {
+               if (wasRemoved != null) {
+                       logger.trace("Removed a repository instance from our repo list.  Current count is now: "
+                                       + repositoryInstances.size());
+               } else {
+                       logger.trace("Could not remove a repository instance from our repo list.  Current count is now: "
+                                       + repositoryInstances.size());
+               }
+            }
+            if (TransactionHelper.isTransactionActiveOrMarkedRollback() == true) {
+               TransactionHelper.commitOrRollbackTransaction();
+               logger.trace(String.format("Transaction closed on thread '%d'", Thread.currentThread().getId()));
+            }
+        }
+    }    
+}
index e1f509b1a6bbfc41e7dc949e647408af9b2c62fc..06900aad59087abb90159b66e4118282947646d3 100644 (file)
-package org.collectionspace.services.nuxeo.client.java;\r
-\r
-import java.io.File;\r
-import java.io.IOException;\r
-import java.util.Hashtable;\r
-import java.util.Iterator;\r
-\r
-import javax.naming.InitialContext;\r
-import javax.naming.NamingException;\r
-import javax.servlet.ServletContext;\r
-\r
-import org.collectionspace.services.common.api.JEEServerDeployment;\r
-import org.collectionspace.services.config.RepositoryClientConfigType;\r
-import org.collectionspace.services.config.tenant.RepositoryDomainType;\r
-import org.collectionspace.services.nuxeo.util.NuxeoUtils;\r
-\r
-import org.nuxeo.ecm.core.NXCore;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import org.nuxeo.ecm.core.api.DocumentModelList;\r
-import org.nuxeo.ecm.core.model.Repository;\r
-import org.nuxeo.osgi.application.FrameworkBootstrap;\r
-import org.nuxeo.ecm.core.repository.RepositoryDescriptor;\r
-import org.nuxeo.ecm.core.repository.RepositoryFactory;\r
-import org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl;\r
-import org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionFactoryImpl;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class NuxeoConnectorEmbedded {\r
-       /*\r
-    <host>127.0.0.1</host>\r
-    <port>62474</port> <!-- java -->\r
- */\r
-       private Logger logger = LoggerFactory.getLogger(NuxeoConnectorEmbedded.class);\r
-\r
-       public final static String NUXEO_CLIENT_DIR = JEEServerDeployment.NUXEO_CLIENT_DIR;\r
-       public final static String NUXEO_SERVER_DIR = JEEServerDeployment.NUXEO_SERVER_DIR;\r
-       private final static String ERROR_CONNECTOR_NOT_INITIALIZED = "NuxeoConnector is not initialized!";\r
-               \r
-       private final static String CSPACE_JEESERVER_HOME = "CSPACE_CONTAINER";\r
-       private final static String CSPACE_NUXEO_HOME = "CSPACE_NUXEO_HOME";\r
-       \r
-       private static final NuxeoConnectorEmbedded self = new NuxeoConnectorEmbedded();\r
-       private NuxeoClientEmbedded client;\r
-       private ServletContext servletContext = null;\r
-       private volatile boolean initialized = false; // use volatile for lazy\r
-                                                                                                       // initialization in\r
-                                                                                                       // singleton\r
-       private RepositoryClientConfigType repositoryClientConfig;\r
-       public FrameworkBootstrap fb;\r
-\r
-       private NuxeoConnectorEmbedded() {\r
-       }\r
-\r
-       public final static NuxeoConnectorEmbedded getInstance() {\r
-               return self;\r
-       }\r
-       \r
-       private String getNuxeoServerPath(String serverRootPath) throws IOException {\r
-               String result = null;\r
-               //\r
-               // Look for the CSPACE_NUXEO_HOME environment variable that might contain the fully qualified path of the\r
-               // Nuxeo EP configuration directory.\r
-               //\r
-               String prop = System.getenv(CSPACE_NUXEO_HOME);\r
-               if (prop != null && !prop.isEmpty()) {\r
-                       result = prop;\r
-               } else {\r
-                       //\r
-                       // Could not find the 'CSPACE_NUXEO_HOME' environment variable, so using the default location instead.\r
-                       //\r
-                       result = serverRootPath + "/" + NUXEO_SERVER_DIR;\r
-               }\r
-               \r
-               return result;\r
-       }\r
-       \r
-       private File getNuxeoServerDir(String serverRootPath) throws IOException {\r
-               File result = null;\r
-               String errMsg = null;\r
-               \r
-               String path = getNuxeoServerPath(serverRootPath);\r
-               if (path != null) {\r
-                       File temp = new File(path);\r
-                       if (temp.exists() == true) {\r
-                               result = temp;\r
-                       } else {\r
-                               errMsg = "The Nuxeo EP configuration directory is missing or inaccessible at: '" + path + "'.";\r
-                       }\r
-               }\r
-               \r
-               if (result == null) {\r
-                       if (errMsg == null) {\r
-                               path = path != null ? path : "<empty>";\r
-                               errMsg = "Unknown error trying to find Nuxeo configuration: '" +\r
-                                               CSPACE_NUXEO_HOME + "' = " +\r
-                                               path;\r
-                       }\r
-                       throw new IOException(errMsg);\r
-               }\r
-               \r
-               return result;\r
-       }\r
-\r
-       //\r
-       // Start/boot the Nuxeo EP server instance\r
-       //\r
-       private void startNuxeoEP(String serverRootPath) throws Exception {\r
-               File nuxeoHomeDir = getNuxeoServerDir(serverRootPath);\r
-\r
-               if (logger.isInfoEnabled() == true) {\r
-                       logger.info("Starting Nuxeo EP server from configuration at: "\r
-                                       + nuxeoHomeDir.getCanonicalPath());\r
-               }\r
-               \r
-               fb = new FrameworkBootstrap(NuxeoConnectorEmbedded.class.getClassLoader(),\r
-                               nuxeoHomeDir);\r
-               fb.initialize();\r
-               fb.start();\r
-       }\r
-\r
-       /**\r
-        * release releases resources occupied by Nuxeo remoting client runtime\r
-        * \r
-        * @throws java.lang.Exception\r
-        */\r
-       public void release() throws Exception {\r
-               if (initialized == true) {\r
-                       try {\r
-                               client.tryDisconnect();\r
-                       } catch (Exception e) {\r
-                               logger.error("Failed to disconnect Nuxeo connection.", e);\r
-                               throw e;\r
-                       }\r
-               }\r
-       }\r
-\r
-       public void initialize(String serverRootPath,\r
-                       RepositoryClientConfigType repositoryClientConfig,\r
-                       ServletContext servletContext) throws Exception {\r
-               if (initialized == false) {\r
-                       synchronized (this) {\r
-                               if (initialized == false) {\r
-                                       this.servletContext = servletContext;\r
-                                       this.repositoryClientConfig = repositoryClientConfig;\r
-                                       startNuxeoEP(serverRootPath);\r
-                                       client = NuxeoClientEmbedded.getInstance();\r
-                                       initialized = true;\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-       \r
-       public String getDatabaseName(String repoName) {\r
-               String result = null;\r
-               \r
-               try {\r
-                       this.getRepositoryDescriptor(repoName);\r
-               } catch (Exception e1) {\r
-                       // TODO Auto-generated catch block\r
-                       e1.printStackTrace();\r
-               }\r
-               \r
-               Repository repository = null;\r
-               try {\r
-                       repository = this.lookupRepository(repoName);\r
-               } catch (Exception e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-               \r
-               ConnectionFactoryImpl connectionFactory = (ConnectionFactoryImpl)repository;\r
-               ManagedConnectionFactoryImpl managedConnectionFactory = connectionFactory.getManagedConnectionFactory();\r
-               String serverUrl = managedConnectionFactory.getServerURL();\r
-               \r
-               return result;\r
-       }\r
-\r
-       /**\r
-        * releaseRepositorySession releases given repository session\r
-        * \r
-        * @param repoSession\r
-        * @throws java.lang.Exception\r
-        */\r
-       public void releaseRepositorySession(RepositoryInstanceInterface repoSession)\r
-                       throws Exception {\r
-               if (repoSession != null) {\r
-                       getClient().releaseRepository(repoSession);\r
-\r
-                       if (logger.isDebugEnabled()) {\r
-                               logger.debug("releaseRepositorySession() released repository session");\r
-                       }\r
-               }\r
-       }\r
-\r
-       /**\r
-        * getRepositorySession get session to default repository\r
-        * \r
-        * @return RepositoryInstance\r
-        * @throws java.lang.Exception\r
-        */\r
-       public RepositoryInstanceInterface getRepositorySession(RepositoryDomainType repoDomain) throws Exception {\r
-               RepositoryInstanceInterface repoSession = getClient().openRepository(repoDomain);\r
-               \r
-               if (logger.isDebugEnabled() && repoSession != null) {\r
-                       logger.debug("getRepositorySession() opened repository session");\r
-                       String repoName = repoDomain.getRepositoryName();\r
-                       String databaseName = this.getDatabaseName(repoName); // For debugging purposes only\r
-               }\r
-               \r
-               return repoSession;\r
-       }\r
-\r
-    public Repository lookupRepository(String name) throws Exception {\r
-        Repository repo;\r
-        try {\r
-            // needed by glassfish\r
-            repo = (Repository) new InitialContext().lookup("NXRepository/"\r
-                    + name);\r
-        } catch (NamingException e) {\r
-            try {\r
-                // needed by jboss\r
-                repo = (Repository) new InitialContext().lookup("java:NXRepository/"\r
-                        + name);\r
-            } catch (NamingException ee) {\r
-                repo = (Repository) NXCore.getRepositoryService().getRepositoryManager().getRepository(\r
-                        name);\r
-            }\r
-        }\r
-        if (repo == null) {\r
-            throw new IllegalArgumentException("Repository not found: " + name);\r
-        }\r
-        return repo;\r
-    }\r
-    \r
-    public RepositoryDescriptor getRepositoryDescriptor(String name) throws Exception {\r
-       RepositoryDescriptor repo = null;\r
-        Iterable<RepositoryDescriptor> descriptorsList = NXCore.getRepositoryService().getRepositoryManager().getDescriptors();\r
-        for (RepositoryDescriptor descriptor : descriptorsList) {\r
-               String homeDir = descriptor.getHomeDirectory();\r
-               String config = descriptor.getConfigurationFile();\r
-               RepositoryFactory factor = descriptor.getFactory();\r
-        }\r
-\r
-        return repo;\r
-    }\r
-       \r
-       /**\r
-        * getClient get Nuxeo client for accessing Nuxeo services remotely using\r
-        * Nuxeo Java (EJB) Remote APIS\r
-        * \r
-        * @return NuxeoClient\r
-        * @throws java.lang.Exception\r
-        */\r
-       public NuxeoClientEmbedded getClient() throws Exception {\r
-               if (initialized == true) {\r
-                       if (client.isConnected()) {\r
-                               return client;\r
-                       }\r
-               }\r
-               //\r
-               // Nuxeo connection was not initialized\r
-               //\r
-               logger.error(ERROR_CONNECTOR_NOT_INITIALIZED);\r
-               throw new IllegalStateException(ERROR_CONNECTOR_NOT_INITIALIZED);\r
-       }\r
-       \r
-       void releaseClient() throws Exception {\r
-               if (initialized == true) {\r
-                       // Do nothing.\r
-               } else {\r
-                       //\r
-                       // Nuxeo connection was not initialized\r
-                       //\r
-                       logger.error(ERROR_CONNECTOR_NOT_INITIALIZED);\r
-                       throw new IllegalStateException(ERROR_CONNECTOR_NOT_INITIALIZED);\r
-               }\r
-       }\r
-\r
-       /**\r
-        * retrieveWorkspaceIds retrieves all workspace ids from default repository\r
-        * \r
-        * @param repoDomain\r
-        *            a repository domain for a given tenant - see the tenant bindings XML file for details\r
-        * @return\r
-        * @throws java.lang.Exception\r
-        */\r
-       public Hashtable<String, String> retrieveWorkspaceIds(RepositoryDomainType repoDomain)\r
-                       throws Exception {\r
-               RepositoryInstanceInterface repoSession = null;\r
-               Hashtable<String, String> workspaceIds = new Hashtable<String, String>();\r
-               try {\r
-                       repoSession = getRepositorySession(repoDomain);\r
-                       DocumentModel rootDoc = repoSession.getRootDocument();\r
-                       DocumentModelList rootChildrenList = repoSession.getChildren(rootDoc.getRef());\r
-                       Iterator<DocumentModel> diter = rootChildrenList.iterator();\r
-                       while (diter.hasNext()) {\r
-                               DocumentModel domain = diter.next();\r
-                               String domainPath = "/" + repoDomain.getStorageName();\r
-                               if (!domain.getPathAsString().equalsIgnoreCase(domainPath)) {\r
-                                       continue; // If it's not our domain folder/directory then skip it\r
-                               }\r
-                               if (logger.isDebugEnabled()) {\r
-                                       logger.debug("domain=" + domain.toString());\r
-                               }\r
-                               DocumentModelList domainChildrenList = repoSession.getChildren(domain.getRef());\r
-                               Iterator<DocumentModel> witer = domainChildrenList.iterator();\r
-                               while (witer.hasNext()) {\r
-                                       DocumentModel childNode = witer.next();\r
-                                       if (NuxeoUtils.Workspaces.equalsIgnoreCase(childNode.getName())) { \r
-                                               DocumentModelList workspaceList = repoSession\r
-                                                               .getChildren(childNode.getRef());\r
-                                               Iterator<DocumentModel> wsiter = workspaceList\r
-                                                               .iterator();\r
-                                               while (wsiter.hasNext()) {\r
-                                                       DocumentModel workspace = wsiter.next();\r
-                                                       if (logger.isDebugEnabled()) {\r
-                                                               logger.debug("workspace name="\r
-                                                                               + workspace.getName() + " id="\r
-                                                                               + workspace.getId());\r
-                                                       }\r
-                                                       workspaceIds.put(workspace.getName().toLowerCase(),\r
-                                                                       workspace.getId());\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-               } catch (Exception e) {\r
-                       if (logger.isDebugEnabled()) {\r
-                               logger.debug("retrieveWorkspaceIds() caught exception ", e);\r
-                       }\r
-                       throw e;\r
-               } finally {\r
-                       if (repoSession != null) {\r
-                               releaseRepositorySession(repoSession);\r
-                       }\r
-               }\r
-               \r
-               return workspaceIds;\r
-       }       \r
-}\r
+package org.collectionspace.services.nuxeo.client.java;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.ServletContext;
+
+import org.collectionspace.services.common.api.JEEServerDeployment;
+import org.collectionspace.services.config.RepositoryClientConfigType;
+import org.collectionspace.services.config.tenant.RepositoryDomainType;
+import org.collectionspace.services.nuxeo.util.NuxeoUtils;
+
+import org.nuxeo.ecm.core.NXCore;
+import org.nuxeo.ecm.core.api.DocumentModel;
+import org.nuxeo.ecm.core.api.DocumentModelList;
+import org.nuxeo.ecm.core.model.Repository;
+import org.nuxeo.osgi.application.FrameworkBootstrap;
+import org.nuxeo.ecm.core.repository.RepositoryDescriptor;
+import org.nuxeo.ecm.core.repository.RepositoryFactory;
+import org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl;
+import org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionFactoryImpl;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NuxeoConnectorEmbedded {
+       /*
+    <host>127.0.0.1</host>
+    <port>62474</port> <!-- java -->
+ */
+       private Logger logger = LoggerFactory.getLogger(NuxeoConnectorEmbedded.class);
+
+       public final static String NUXEO_CLIENT_DIR = JEEServerDeployment.NUXEO_CLIENT_DIR;
+       public final static String NUXEO_SERVER_DIR = JEEServerDeployment.NUXEO_SERVER_DIR;
+       private final static String ERROR_CONNECTOR_NOT_INITIALIZED = "NuxeoConnector is not initialized!";
+               
+       private final static String CSPACE_JEESERVER_HOME = "CSPACE_CONTAINER";
+       private final static String CSPACE_NUXEO_HOME = "CSPACE_NUXEO_HOME";
+       
+       private static final NuxeoConnectorEmbedded self = new NuxeoConnectorEmbedded();
+       private NuxeoClientEmbedded client;
+       private ServletContext servletContext = null;
+       private volatile boolean initialized = false; // use volatile for lazy
+                                                                                                       // initialization in
+                                                                                                       // singleton
+       private RepositoryClientConfigType repositoryClientConfig;
+       public FrameworkBootstrap fb;
+
+       private NuxeoConnectorEmbedded() {
+       }
+
+       public final static NuxeoConnectorEmbedded getInstance() {
+               return self;
+       }
+       
+       private String getNuxeoServerPath(String serverRootPath) throws IOException {
+               String result = null;
+               //
+               // Look for the CSPACE_NUXEO_HOME environment variable that might contain the fully qualified path of the
+               // Nuxeo EP configuration directory.
+               //
+               String prop = System.getenv(CSPACE_NUXEO_HOME);
+               if (prop != null && !prop.isEmpty()) {
+                       result = prop;
+               } else {
+                       //
+                       // Could not find the 'CSPACE_NUXEO_HOME' environment variable, so using the default location instead.
+                       //
+                       result = serverRootPath + "/" + NUXEO_SERVER_DIR;
+               }
+               
+               return result;
+       }
+       
+       private File getNuxeoServerDir(String serverRootPath) throws IOException {
+               File result = null;
+               String errMsg = null;
+               
+               String path = getNuxeoServerPath(serverRootPath);
+               if (path != null) {
+                       File temp = new File(path);
+                       if (temp.exists() == true) {
+                               result = temp;
+                       } else {
+                               errMsg = "The Nuxeo EP configuration directory is missing or inaccessible at: '" + path + "'.";
+                       }
+               }
+               
+               if (result == null) {
+                       if (errMsg == null) {
+                               path = path != null ? path : "<empty>";
+                               errMsg = "Unknown error trying to find Nuxeo configuration: '" +
+                                               CSPACE_NUXEO_HOME + "' = " +
+                                               path;
+                       }
+                       throw new IOException(errMsg);
+               }
+               
+               return result;
+       }
+
+       //
+       // Start/boot the Nuxeo EP server instance
+       //
+       private void startNuxeoEP(String serverRootPath) throws Exception {
+               File nuxeoHomeDir = getNuxeoServerDir(serverRootPath);
+
+               if (logger.isInfoEnabled() == true) {
+                       logger.info("Starting Nuxeo EP server from configuration at: "
+                                       + nuxeoHomeDir.getCanonicalPath());
+               }
+               
+               fb = new FrameworkBootstrap(NuxeoConnectorEmbedded.class.getClassLoader(),
+                               nuxeoHomeDir);
+               fb.initialize();
+               fb.start();
+       }
+
+       /**
+        * release releases resources occupied by Nuxeo remoting client runtime
+        * 
+        * @throws java.lang.Exception
+        */
+       public void release() throws Exception {
+               if (initialized == true) {
+                       try {
+                               client.tryDisconnect();
+                       } catch (Exception e) {
+                               logger.error("Failed to disconnect Nuxeo connection.", e);
+                               throw e;
+                       }
+               }
+       }
+
+       public void initialize(String serverRootPath,
+                       RepositoryClientConfigType repositoryClientConfig,
+                       ServletContext servletContext) throws Exception {
+               if (initialized == false) {
+                       synchronized (this) {
+                               if (initialized == false) {
+                                       this.servletContext = servletContext;
+                                       this.repositoryClientConfig = repositoryClientConfig;
+                                       startNuxeoEP(serverRootPath);
+                                       client = NuxeoClientEmbedded.getInstance();
+                                       initialized = true;
+                               }
+                       }
+               }
+       }
+       
+       public String getDatabaseName(String repoName) {
+               String result = null;
+               
+               try {
+                       this.getRepositoryDescriptor(repoName);
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+               
+               Repository repository = null;
+               try {
+                       repository = this.lookupRepository(repoName);
+               } catch (Exception e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+               
+               ConnectionFactoryImpl connectionFactory = (ConnectionFactoryImpl)repository;
+               ManagedConnectionFactoryImpl managedConnectionFactory = connectionFactory.getManagedConnectionFactory();
+               String serverUrl = managedConnectionFactory.getServerURL();
+               
+               return result;
+       }
+
+       /**
+        * releaseRepositorySession releases given repository session
+        * 
+        * @param repoSession
+        * @throws java.lang.Exception
+        */
+       public void releaseRepositorySession(RepositoryInstanceInterface repoSession)
+                       throws Exception {
+               if (repoSession != null) {
+                       getClient().releaseRepository(repoSession);
+
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("releaseRepositorySession() released repository session");
+                       }
+               }
+       }
+
+       /**
+        * getRepositorySession get session to default repository
+        * 
+        * @return RepositoryInstance
+        * @throws java.lang.Exception
+        */
+       public RepositoryInstanceInterface getRepositorySession(RepositoryDomainType repoDomain) throws Exception {
+               RepositoryInstanceInterface repoSession = getClient().openRepository(repoDomain);
+               
+               if (logger.isDebugEnabled() && repoSession != null) {
+                       logger.debug("getRepositorySession() opened repository session");
+                       String repoName = repoDomain.getRepositoryName();
+                       String databaseName = this.getDatabaseName(repoName); // For debugging purposes only
+               }
+               
+               return repoSession;
+       }
+
+    public Repository lookupRepository(String name) throws Exception {
+        Repository repo;
+        try {
+            // needed by glassfish
+            repo = (Repository) new InitialContext().lookup("NXRepository/"
+                    + name);
+        } catch (NamingException e) {
+            try {
+                // needed by jboss
+                repo = (Repository) new InitialContext().lookup("java:NXRepository/"
+                        + name);
+            } catch (NamingException ee) {
+                repo = (Repository) NXCore.getRepositoryService().getRepositoryManager().getRepository(
+                        name);
+            }
+        }
+        if (repo == null) {
+            throw new IllegalArgumentException("Repository not found: " + name);
+        }
+        return repo;
+    }
+    
+    public RepositoryDescriptor getRepositoryDescriptor(String name) throws Exception {
+       RepositoryDescriptor repo = null;
+        Iterable<RepositoryDescriptor> descriptorsList = NXCore.getRepositoryService().getRepositoryManager().getDescriptors();
+        for (RepositoryDescriptor descriptor : descriptorsList) {
+               String homeDir = descriptor.getHomeDirectory();
+               String config = descriptor.getConfigurationFile();
+               RepositoryFactory factor = descriptor.getFactory();
+        }
+
+        return repo;
+    }
+       
+       /**
+        * getClient get Nuxeo client for accessing Nuxeo services remotely using
+        * Nuxeo Java (EJB) Remote APIS
+        * 
+        * @return NuxeoClient
+        * @throws java.lang.Exception
+        */
+       public NuxeoClientEmbedded getClient() throws Exception {
+               if (initialized == true) {
+                       if (client.isConnected()) {
+                               return client;
+                       }
+               }
+               //
+               // Nuxeo connection was not initialized
+               //
+               logger.error(ERROR_CONNECTOR_NOT_INITIALIZED);
+               throw new IllegalStateException(ERROR_CONNECTOR_NOT_INITIALIZED);
+       }
+       
+       void releaseClient() throws Exception {
+               if (initialized == true) {
+                       // Do nothing.
+               } else {
+                       //
+                       // Nuxeo connection was not initialized
+                       //
+                       logger.error(ERROR_CONNECTOR_NOT_INITIALIZED);
+                       throw new IllegalStateException(ERROR_CONNECTOR_NOT_INITIALIZED);
+               }
+       }
+
+       /**
+        * retrieveWorkspaceIds retrieves all workspace ids from default repository
+        * 
+        * @param repoDomain
+        *            a repository domain for a given tenant - see the tenant bindings XML file for details
+        * @return
+        * @throws java.lang.Exception
+        */
+       public Hashtable<String, String> retrieveWorkspaceIds(RepositoryDomainType repoDomain)
+                       throws Exception {
+               RepositoryInstanceInterface repoSession = null;
+               Hashtable<String, String> workspaceIds = new Hashtable<String, String>();
+               try {
+                       repoSession = getRepositorySession(repoDomain);
+                       DocumentModel rootDoc = repoSession.getRootDocument();
+                       DocumentModelList rootChildrenList = repoSession.getChildren(rootDoc.getRef());
+                       Iterator<DocumentModel> diter = rootChildrenList.iterator();
+                       while (diter.hasNext()) {
+                               DocumentModel domain = diter.next();
+                               String domainPath = "/" + repoDomain.getStorageName();
+                               if (!domain.getPathAsString().equalsIgnoreCase(domainPath)) {
+                                       continue; // If it's not our domain folder/directory then skip it
+                               }
+                               if (logger.isDebugEnabled()) {
+                                       logger.debug("domain=" + domain.toString());
+                               }
+                               DocumentModelList domainChildrenList = repoSession.getChildren(domain.getRef());
+                               Iterator<DocumentModel> witer = domainChildrenList.iterator();
+                               while (witer.hasNext()) {
+                                       DocumentModel childNode = witer.next();
+                                       if (NuxeoUtils.Workspaces.equalsIgnoreCase(childNode.getName())) { 
+                                               DocumentModelList workspaceList = repoSession
+                                                               .getChildren(childNode.getRef());
+                                               Iterator<DocumentModel> wsiter = workspaceList
+                                                               .iterator();
+                                               while (wsiter.hasNext()) {
+                                                       DocumentModel workspace = wsiter.next();
+                                                       if (logger.isDebugEnabled()) {
+                                                               logger.debug("workspace name="
+                                                                               + workspace.getName() + " id="
+                                                                               + workspace.getId());
+                                                       }
+                                                       workspaceIds.put(workspace.getName().toLowerCase(),
+                                                                       workspace.getId());
+                                               }
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       if (logger.isDebugEnabled()) {
+                               logger.debug("retrieveWorkspaceIds() caught exception ", e);
+                       }
+                       throw e;
+               } finally {
+                       if (repoSession != null) {
+                               releaseRepositorySession(repoSession);
+                       }
+               }
+               
+               return workspaceIds;
+       }       
+}
index ddbb4970029ec7fd9118748a86618870cfabc9a1..ec1d553baebdd31239bdf901811d8551f1b06b8e 100644 (file)
@@ -1,53 +1,53 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.nuxeo.client.java;\r
-\r
-import javax.xml.bind.annotation.XmlRegistry;\r
-\r
-/**\r
- * ObjectFactory for CommonList \r
- */\r
-@XmlRegistry\r
-public class ObjectFactory {\r
-    /**\r
-     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.collectionspace.services.jaxb\r
-     * \r
-     */\r
-    public ObjectFactory() {\r
-    }\r
-\r
-    /**\r
-     * Create an instance of {@link tCommonList }\r
-     * \r
-     */\r
-    public CommonList createCommonList() {\r
-       try {\r
-               //-System.out.println("CL_ObjectFactory:createAbstractCommonList");\r
-               return new CommonList();\r
-       } catch(Exception e) {\r
-               return null;\r
-       }\r
-    }\r
-\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.nuxeo.client.java;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+/**
+ * ObjectFactory for CommonList 
+ */
+@XmlRegistry
+public class ObjectFactory {
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.collectionspace.services.jaxb
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link tCommonList }
+     * 
+     */
+    public CommonList createCommonList() {
+       try {
+               //-System.out.println("CL_ObjectFactory:createAbstractCommonList");
+               return new CommonList();
+       } catch(Exception e) {
+               return null;
+       }
+    }
+
+}
index 8ce7ccd12beada3ac1e5be9dc2e291fbd1122184..a35db35b5a1cf74808820cbe174c0e70c36586d1 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.nuxeo.client.java;\r
-\r
-import java.io.InputStream;\r
-import java.io.ByteArrayInputStream;\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
-import org.collectionspace.services.client.PayloadInputPart;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.DocumentUtils;\r
-import org.collectionspace.services.config.service.ObjectPartType;\r
-\r
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;\r
-import javax.ws.rs.core.MediaType;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.w3c.dom.Document;\r
-\r
-/**\r
- * RemoteDocumentModelHandler\r
- *\r
- * @author pschmitz\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- * @param <T> The {DocumentType}Common class\r
- * @param <TL> The {DocumentType}CommonList class\r
- */\r
-public abstract class RemoteSubItemDocumentModelHandlerImpl<T, TL> extends\r
-               RemoteDocumentModelHandlerImpl<T, TL> {\r
-\r
-    private final Logger logger = LoggerFactory.getLogger(RemoteSubItemDocumentModelHandlerImpl.class);\r
-    private final String SI_LABEL = "subitem";\r
-    // We must align this to the schema:\r
-    //   <xs:element name="owner" type="xs:string" />\r
-       //   <xs:element name="isPrimary" type="xs:boolean"/>\r
-       //   <xs:element name="order" type="xs:unsignedInt"/>\r
-    private final String[] fields = {"owner", "isPrimary", "order"};\r
-\r
-    /**\r
-     * Override fillPart to handle the Subitem XML part into the Subitem document model\r
-     * @param part to fill\r
-     * @param docModel for the given object\r
-     * @param partMeta metadata for the object to fill\r
-     * @throws Exception\r
-     */\r
-       @Override\r
-    protected void fillPart(PayloadInputPart part, DocumentModel docModel, \r
-                                               ObjectPartType partMeta, Action action, ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx)\r
-            throws Exception {\r
-               ByteArrayInputStream bas = new ByteArrayInputStream(part.getElementBody().asXML().getBytes());\r
-        InputStream payload = bas;//part.getBody(/*InputStream.class, null*/);\r
-\r
-        //check if this is an xml part\r
-        // TODO - we could configure the parts that have subitem content, \r
-        // and then check that here, so skip other parts.\r
-        if(part.getMediaType().equals(MediaType.APPLICATION_XML_TYPE)){\r
-            if(payload != null){\r
-                Document document = DocumentUtils.parseDocument(payload, partMeta,\r
-                               false /*don't validate*/);\r
-                //TODO: callback to handler if registered to validate the\r
-                //document\r
-                Map<String, Object> objectProps = DocumentUtils.parseProperties(document.getFirstChild());\r
-                // Now pull out the subitem props and set them into the Subitem schema\r
-                Map<String, Object> subitemProps = null;\r
-                for(String key:fields){\r
-                       // Fetch and remove as we go, so can safely set remaining values below\r
-                       String value = (String)(objectProps.remove(key));\r
-                       if(value!=null) {\r
-                       if(subitemProps == null) {\r
-                               subitemProps = new HashMap<String, Object>();\r
-                       }\r
-                       subitemProps.put(key, value);\r
-                       }\r
-                }\r
-               if(subitemProps != null) {\r
-                       docModel.setProperties(SI_LABEL, subitemProps);\r
-               }\r
-               // Set all remaining values on the common part.\r
-                docModel.setProperties(partMeta.getLabel(), objectProps);\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * extractPart extracts an XML object from given DocumentModel\r
-     * This overridden form checks for schemas that extend subitem, and merges\r
-     * in the subitem properties for that part.\r
-     * @param docModel\r
-     * @param schema of the object to extract\r
-     * @param partMeta metadata for the object to extract\r
-     * @throws Exception\r
-     */\r
-       @Override\r
-    protected Map<String, Object> extractPart(DocumentModel docModel, String schema, ObjectPartType partMeta)\r
-            throws Exception {\r
-       Map<String, Object> map = extractPart( docModel, schema, partMeta, null ); \r
-               if(schemaHasSubItem(schema)) {\r
-                       extractPart(docModel, SI_LABEL, partMeta, map);\r
-               }\r
-       return map;\r
-    }\r
-       \r
-       // TODO HACK - should make this info be configured in the part metadata.\r
-       public abstract boolean schemaHasSubItem(String schema);\r
-\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.nuxeo.client.java;
+
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.collectionspace.services.client.PayloadInputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.DocumentUtils;
+import org.collectionspace.services.config.service.ObjectPartType;
+
+import org.jboss.resteasy.plugins.providers.multipart.InputPart;
+import javax.ws.rs.core.MediaType;
+import org.nuxeo.ecm.core.api.DocumentModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+
+/**
+ * RemoteDocumentModelHandler
+ *
+ * @author pschmitz
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ * @param <T> The {DocumentType}Common class
+ * @param <TL> The {DocumentType}CommonList class
+ */
+public abstract class RemoteSubItemDocumentModelHandlerImpl<T, TL> extends
+               RemoteDocumentModelHandlerImpl<T, TL> {
+
+    private final Logger logger = LoggerFactory.getLogger(RemoteSubItemDocumentModelHandlerImpl.class);
+    private final String SI_LABEL = "subitem";
+    // We must align this to the schema:
+    //   <xs:element name="owner" type="xs:string" />
+       //   <xs:element name="isPrimary" type="xs:boolean"/>
+       //   <xs:element name="order" type="xs:unsignedInt"/>
+    private final String[] fields = {"owner", "isPrimary", "order"};
+
+    /**
+     * Override fillPart to handle the Subitem XML part into the Subitem document model
+     * @param part to fill
+     * @param docModel for the given object
+     * @param partMeta metadata for the object to fill
+     * @throws Exception
+     */
+       @Override
+    protected void fillPart(PayloadInputPart part, DocumentModel docModel, 
+                                               ObjectPartType partMeta, Action action, ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx)
+            throws Exception {
+               ByteArrayInputStream bas = new ByteArrayInputStream(part.getElementBody().asXML().getBytes());
+        InputStream payload = bas;//part.getBody(/*InputStream.class, null*/);
+
+        //check if this is an xml part
+        // TODO - we could configure the parts that have subitem content, 
+        // and then check that here, so skip other parts.
+        if(part.getMediaType().equals(MediaType.APPLICATION_XML_TYPE)){
+            if(payload != null){
+                Document document = DocumentUtils.parseDocument(payload, partMeta,
+                               false /*don't validate*/);
+                //TODO: callback to handler if registered to validate the
+                //document
+                Map<String, Object> objectProps = DocumentUtils.parseProperties(document.getFirstChild());
+                // Now pull out the subitem props and set them into the Subitem schema
+                Map<String, Object> subitemProps = null;
+                for(String key:fields){
+                       // Fetch and remove as we go, so can safely set remaining values below
+                       String value = (String)(objectProps.remove(key));
+                       if(value!=null) {
+                       if(subitemProps == null) {
+                               subitemProps = new HashMap<String, Object>();
+                       }
+                       subitemProps.put(key, value);
+                       }
+                }
+               if(subitemProps != null) {
+                       docModel.setProperties(SI_LABEL, subitemProps);
+               }
+               // Set all remaining values on the common part.
+                docModel.setProperties(partMeta.getLabel(), objectProps);
+            }
+        }
+    }
+    
+    /**
+     * extractPart extracts an XML object from given DocumentModel
+     * This overridden form checks for schemas that extend subitem, and merges
+     * in the subitem properties for that part.
+     * @param docModel
+     * @param schema of the object to extract
+     * @param partMeta metadata for the object to extract
+     * @throws Exception
+     */
+       @Override
+    protected Map<String, Object> extractPart(DocumentModel docModel, String schema, ObjectPartType partMeta)
+            throws Exception {
+       Map<String, Object> map = extractPart( docModel, schema, partMeta, null ); 
+               if(schemaHasSubItem(schema)) {
+                       extractPart(docModel, SI_LABEL, partMeta, map);
+               }
+       return map;
+    }
+       
+       // TODO HACK - should make this info be configured in the part metadata.
+       public abstract boolean schemaHasSubItem(String schema);
+
+}
index 272613476164beeb5a12a897c069af78b2a1d893..648de4f715cfc9cf0d8eab2f7283898d5a501c4a 100644 (file)
@@ -1,3 +1,3 @@
-// We make the CommonList act like an AbstractCommonList, by setting its namespace\r
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://collectionspace.org/services/jaxb")\r
-package org.collectionspace.services.nuxeo.client.java;\r
+// We make the CommonList act like an AbstractCommonList, by setting its namespace
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://collectionspace.org/services/jaxb")
+package org.collectionspace.services.nuxeo.client.java;
index 2b2bfac6ecc3b1730be31d291ee2cc064006fd23..a5d1843011b9dbdd0eda123f711d82870eb2a28e 100644 (file)
@@ -1,26 +1,26 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
-    Version schema (XSD)\r
-    \r
-    Used for: JAXB binding between XML and Java objects\r
-    \r
-    $LastChangedRevision: 1161 $\r
-    $LastChangedDate: 2010-01-08 10:38:27 -0800 (Fri, 08 Jan 2010) $\r
--->\r
-\r
-<xs:schema \r
-  xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-  xmlns="http://collectionspace.org/services/common"\r
-  targetNamespace="http://collectionspace.org/services/common"\r
-  version="0.1"\r
->\r
-    <xs:element name="version">\r
-        <xs:complexType>\r
-            <xs:sequence>\r
-                <xs:element name="versionString" type="xs:string"/>\r
-            </xs:sequence>\r
-        </xs:complexType>\r
-    </xs:element>\r
-</xs:schema>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Version schema (XSD)
+    
+    Used for: JAXB binding between XML and Java objects
+    
+    $LastChangedRevision: 1161 $
+    $LastChangedDate: 2010-01-08 10:38:27 -0800 (Fri, 08 Jan 2010) $
+-->
+
+<xs:schema 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns="http://collectionspace.org/services/common"
+  targetNamespace="http://collectionspace.org/services/common"
+  version="0.1"
+>
+    <xs:element name="version">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="versionString" type="xs:string"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
+
index ef3166317acc3b7f209e5d62abb030cba92105d9..8b67149c1adc432f7f956ee206f1b35f8290f98e 100644 (file)
@@ -1,99 +1,99 @@
-/**\r
- * This document is a part of the source code and related artifacts for\r
- * CollectionSpace, an open source collections management system for museums and\r
- * related institutions:\r
- *\r
- * http://www.collectionspace.org http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2012 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0. You may\r
- * not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-package org.collectionspace.services.common.test;\r
-\r
-import java.util.HashMap;\r
-import java.util.Iterator;\r
-import java.util.Map;\r
-import org.collectionspace.services.common.ServiceMain;\r
-import org.collectionspace.services.common.StoredValuesUriTemplate;\r
-import org.collectionspace.services.common.UriTemplateFactory;\r
-import org.collectionspace.services.common.UriTemplateRegistry;\r
-import org.collectionspace.services.common.UriTemplateRegistryKey;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.testng.Assert;\r
-import org.testng.annotations.BeforeSuite;\r
-import org.testng.annotations.Test;\r
-\r
-public class UriTemplateRegistryTest {\r
-\r
-    private static final Logger logger = LoggerFactory.getLogger(UriTemplateRegistryTest.class);\r
-    UriTemplateRegistry registry;\r
-    final static String TEST_TENANT_ID = "1";\r
-    final static String TEST_DOCTYPE_NAME = "Doctype";\r
-    final static String TEST_TEMPATE = "/doctypes";\r
-    final static UriTemplateFactory.UriTemplateType TEST_URI_TEMPLATE_TYPE =\r
-            UriTemplateFactory.RESOURCE;\r
-\r
-    private void testBanner(String msg) {\r
-        String BANNER = "-------------------------------------------------------";\r
-        logger.debug("\r" + BANNER + "\r\n" + this.getClass().getName() + "\r\n" + msg + "\r\n" + BANNER);\r
-    }\r
-\r
-    /**\r
-     * Create a test entry in the registry.\r
-     */\r
-    @BeforeSuite\r
-    private void setUp() {\r
-        UriTemplateRegistryKey key = new UriTemplateRegistryKey(TEST_TENANT_ID, TEST_DOCTYPE_NAME);\r
-        Map<String,String> storedValues = new HashMap<String,String>();\r
-        StoredValuesUriTemplate template = new StoredValuesUriTemplate(TEST_URI_TEMPLATE_TYPE, TEST_TEMPATE, storedValues);\r
-        registry = new UriTemplateRegistry();\r
-        registry.put(key, template);\r
-    }\r
-\r
-    @Test\r
-    public void registryContainsEntries() {\r
-        testBanner("registryContainsEntries");\r
-        Assert.assertNotNull(registry);\r
-        Assert.assertFalse(registry.isEmpty());\r
-    }\r
-\r
-    /**\r
-     * Identify a valid entry in the registry, then use its key to successfully\r
-     * retrieve the entry once again.\r
-     */\r
-    @Test(dependsOnMethods = {"registryContainsEntries"})\r
-    public void getRegistryEntryByKey() {\r
-        testBanner("getRegistryEntryByKey");\r
-        UriTemplateRegistryKey key;\r
-        StoredValuesUriTemplate template;\r
-        boolean hasValidKey = false;\r
-        boolean hasValidTemplate = false;\r
-        for (Map.Entry<UriTemplateRegistryKey, StoredValuesUriTemplate> entry : registry.entrySet()) {\r
-            key = entry.getKey();\r
-            template = entry.getValue();\r
-            if (key != null && Tools.notBlank(key.getTenantId()) && Tools.notBlank(key.getDocType())) {\r
-                hasValidKey = true;\r
-            }\r
-            if (template != null && template.getUriTemplateType() != null && Tools.notBlank(template.toString())) {\r
-                hasValidTemplate = true;\r
-            }\r
-            Assert.assertTrue(hasValidKey && hasValidTemplate);\r
-            StoredValuesUriTemplate retrievedTemplate = registry.get(key);\r
-            Assert.assertNotNull(retrievedTemplate);\r
-            Assert.assertEquals(template.toString(), retrievedTemplate.toString());\r
-        }\r
-    }\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2012 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.collectionspace.services.common.test;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import org.collectionspace.services.common.ServiceMain;
+import org.collectionspace.services.common.StoredValuesUriTemplate;
+import org.collectionspace.services.common.UriTemplateFactory;
+import org.collectionspace.services.common.UriTemplateRegistry;
+import org.collectionspace.services.common.UriTemplateRegistryKey;
+import org.collectionspace.services.common.api.Tools;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+public class UriTemplateRegistryTest {
+
+    private static final Logger logger = LoggerFactory.getLogger(UriTemplateRegistryTest.class);
+    UriTemplateRegistry registry;
+    final static String TEST_TENANT_ID = "1";
+    final static String TEST_DOCTYPE_NAME = "Doctype";
+    final static String TEST_TEMPATE = "/doctypes";
+    final static UriTemplateFactory.UriTemplateType TEST_URI_TEMPLATE_TYPE =
+            UriTemplateFactory.RESOURCE;
+
+    private void testBanner(String msg) {
+        String BANNER = "-------------------------------------------------------";
+        logger.debug("\r" + BANNER + "\r\n" + this.getClass().getName() + "\r\n" + msg + "\r\n" + BANNER);
+    }
+
+    /**
+     * Create a test entry in the registry.
+     */
+    @BeforeSuite
+    private void setUp() {
+        UriTemplateRegistryKey key = new UriTemplateRegistryKey(TEST_TENANT_ID, TEST_DOCTYPE_NAME);
+        Map<String,String> storedValues = new HashMap<String,String>();
+        StoredValuesUriTemplate template = new StoredValuesUriTemplate(TEST_URI_TEMPLATE_TYPE, TEST_TEMPATE, storedValues);
+        registry = new UriTemplateRegistry();
+        registry.put(key, template);
+    }
+
+    @Test
+    public void registryContainsEntries() {
+        testBanner("registryContainsEntries");
+        Assert.assertNotNull(registry);
+        Assert.assertFalse(registry.isEmpty());
+    }
+
+    /**
+     * Identify a valid entry in the registry, then use its key to successfully
+     * retrieve the entry once again.
+     */
+    @Test(dependsOnMethods = {"registryContainsEntries"})
+    public void getRegistryEntryByKey() {
+        testBanner("getRegistryEntryByKey");
+        UriTemplateRegistryKey key;
+        StoredValuesUriTemplate template;
+        boolean hasValidKey = false;
+        boolean hasValidTemplate = false;
+        for (Map.Entry<UriTemplateRegistryKey, StoredValuesUriTemplate> entry : registry.entrySet()) {
+            key = entry.getKey();
+            template = entry.getValue();
+            if (key != null && Tools.notBlank(key.getTenantId()) && Tools.notBlank(key.getDocType())) {
+                hasValidKey = true;
+            }
+            if (template != null && template.getUriTemplateType() != null && Tools.notBlank(template.toString())) {
+                hasValidTemplate = true;
+            }
+            Assert.assertTrue(hasValidKey && hasValidTemplate);
+            StoredValuesUriTemplate retrievedTemplate = registry.get(key);
+            Assert.assertNotNull(retrievedTemplate);
+            Assert.assertEquals(template.toString(), retrievedTemplate.toString());
+        }
+    }
+}
index b6fcbf5e60d91bacb5f60a34cfe135bd78c2e3a5..68e12173de5e1545de157356e578c9821337e925 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts for\r
- * CollectionSpace, an open source collections management system for museums and\r
- * related institutions:\r
- *\r
- * http://www.collectionspace.org http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2012 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0. You may\r
- * not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- */\r
-package org.collectionspace.services.common.test;\r
-\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-import org.collectionspace.services.common.StoredValuesUriTemplate;\r
-import org.collectionspace.services.common.UriTemplate;\r
-import org.collectionspace.services.common.UriTemplateFactory;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.testng.Assert;\r
-import org.testng.annotations.Test;\r
-\r
-public class UriTemplateTest {\r
-\r
-    private final static String EXAMPLE_SERVICE_NAME = "examples";\r
-    private final static String EXAMPLE_CSID = "a87f6616-4146-4c17-a41a-048597cc12aa";\r
-    private final static String EXAMPLE_ITEM_CSID = "5d1c2f45-6d02-4376-8852-71893eaf8b1b";\r
-    private final static String EXAMPLE_CONTACT_CSID = "f01e9edb-4f9c-4716-a9cb-5e954fc29577";\r
-    private final static HashMap<String, String> EMPTY_VALUES_MAP = new HashMap<String, String>();\r
-    private static final Logger logger = LoggerFactory.getLogger(UriTemplateTest.class);\r
-\r
-    private void testBanner(String msg) {\r
-        String BANNER = "-------------------------------------------------------";\r
-        logger.debug("\r" + BANNER + "\r\n" + this.getClass().getName() + "\r\n" + msg + "\r\n" + BANNER);\r
-    }\r
-\r
-    @Test\r
-    public void createResourceUriTemplate() {\r
-        testBanner("createResourceUriTemplate");\r
-        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);\r
-        Assert.assertNotNull(resourceTemplate, "Resource template is null; it was not created successfully.");\r
-        logger.debug("Resource template URI path = " + resourceTemplate.toString());\r
-        Assert.assertNotNull(resourceTemplate.getUriTemplateType(), "Resource template type is null; it was not set successfully.");\r
-        Assert.assertEquals(resourceTemplate.getUriTemplateType(), UriTemplateFactory.RESOURCE,\r
-                "Resource template type + " + resourceTemplate.getUriTemplateType()\r
-                + " doesn't match expected type: " + UriTemplateFactory.RESOURCE);\r
-        Assert.assertNotNull(resourceTemplate.toString(), "Resource template URI path is null; it was not set successfully.");\r
-        Assert.assertEquals(resourceTemplate.toString(), UriTemplateFactory.RESOURCE_PATH_PATTERN,\r
-                "Resource template URI path " + resourceTemplate.toString()\r
-                + " doesn't match expected path: " + UriTemplateFactory.RESOURCE_PATH_PATTERN);\r
-    }\r
-\r
-    @Test(dependsOnMethods = {"createResourceUriTemplate"})\r
-    public void buildResourceUri() {\r
-        testBanner("buildResourceUri");\r
-        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);\r
-        Map<String, String> resourceUriVars = new HashMap<String, String>();\r
-        resourceUriVars.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);\r
-        resourceUriVars.put(UriTemplateFactory.IDENTIFIER_VAR, EXAMPLE_CSID);\r
-        String uriStr = resourceTemplate.buildUri(resourceUriVars);\r
-        logger.debug("Generated URI string = " + uriStr);\r
-        Assert.assertFalse(Tools.isBlank(uriStr), "Generated URI string is null or blank.");\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_SERVICE_NAME), "Generated URI string does not contain expected service name value: " + EXAMPLE_SERVICE_NAME);\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_CSID), "Generated URI string does not contain expected identifier value: " + EXAMPLE_CSID);\r
-    }\r
-\r
-    @Test(dependsOnMethods = {"buildResourceUri"})\r
-    public void buildResourceUriWithStoredValues() {\r
-        testBanner("buildResourceUriWithStoredValues");\r
-        Map<String, String> storedValuesMap = new HashMap<String, String>();\r
-        storedValuesMap.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);\r
-        StoredValuesUriTemplate storedValuesResourceTemplate =\r
-                UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE, storedValuesMap);\r
-        Map<String, String> additionalValues = new HashMap<String, String>();\r
-        additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, EXAMPLE_CSID);\r
-        String uriStr = storedValuesResourceTemplate.buildUri(additionalValues);\r
-        logger.debug("Generated URI string = " + uriStr);\r
-        Assert.assertTrue(Tools.notBlank(uriStr), "Generated URI string is null or blank.");\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_SERVICE_NAME), "Generated URI string does not contain expected service name value: " + EXAMPLE_SERVICE_NAME);\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_CSID), "Generated URI string does not contain expected identifier value: " + EXAMPLE_CSID);\r
-    }\r
-\r
-    @Test(dependsOnMethods = {"buildResourceUriWithStoredValues"})\r
-    public void buildItemUri() {\r
-        testBanner("buildItemUri");\r
-        Map<String, String> storedValuesMap = new HashMap<String, String>();\r
-        storedValuesMap.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);\r
-        StoredValuesUriTemplate itemTemplate =\r
-                UriTemplateFactory.getURITemplate(UriTemplateFactory.ITEM, storedValuesMap);\r
-        Map<String, String> additionalValues = new HashMap<String, String>();\r
-        additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, EXAMPLE_CSID);\r
-        additionalValues.put(UriTemplateFactory.ITEM_IDENTIFIER_VAR, EXAMPLE_ITEM_CSID);\r
-        String uriStr = itemTemplate.buildUri(additionalValues);\r
-        logger.debug("Generated URI string = " + uriStr);\r
-        Assert.assertTrue(Tools.notBlank(uriStr), "Generated URI string is null or blank.");\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_SERVICE_NAME), "Generated URI string does not contain expected service name value: " + EXAMPLE_SERVICE_NAME);\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_CSID), "Generated URI string does not contain expected identifier value: " + EXAMPLE_CSID);\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_ITEM_CSID), "Generated URI string does not contain expected item identifier value: " + EXAMPLE_ITEM_CSID);\r
-    }\r
-\r
-    @Test(dependsOnMethods = {"buildItemUri"})\r
-    public void buildContactUri() {\r
-        testBanner("buildContactUri");\r
-        StoredValuesUriTemplate contactTemplate =\r
-                UriTemplateFactory.getURITemplate(UriTemplateFactory.CONTACT);\r
-        Map<String, String> additionalValues = new HashMap<String, String>();\r
-        additionalValues.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);\r
-        additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, EXAMPLE_CSID);\r
-        additionalValues.put(UriTemplateFactory.ITEM_IDENTIFIER_VAR, EXAMPLE_ITEM_CSID);\r
-        additionalValues.put(UriTemplateFactory.CONTACT_IDENTIFIER_VAR, EXAMPLE_CONTACT_CSID);\r
-        String uriStr = contactTemplate.buildUri(additionalValues);\r
-        logger.debug("Generated URI string = " + uriStr);\r
-        Assert.assertTrue(Tools.notBlank(uriStr), "Generated URI string is null or blank.");\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_SERVICE_NAME), "Generated URI string does not contain expected service name value: " + EXAMPLE_SERVICE_NAME);\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_CSID), "Generated URI string does not contain expected identifier value: " + EXAMPLE_CSID);\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_ITEM_CSID), "Generated URI string does not contain expected item identifier value: " + EXAMPLE_ITEM_CSID);\r
-        Assert.assertTrue(uriStr.contains(EXAMPLE_CONTACT_CSID), "Generated URI string does not contain expected contact identifier value: " + EXAMPLE_CONTACT_CSID);\r
-    }\r
-\r
-    // Negative tests: errors are anticipated and checked for in each of the following tests\r
-    @Test(dependsOnMethods = {"buildResourceUri"})\r
-    public void buildResourceUriWithMissingValue() {\r
-        testBanner("buildResourceUriWithMissingValue");\r
-        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);\r
-        Map<String, String> resourceUriVars = new HashMap<String, String>();\r
-        resourceUriVars.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);\r
-        // The required 'identifier' value is missing from the Map from which the URI will be built\r
-        logger.debug("This is a negative test, and an error message is expected here:");\r
-        String uriStr = resourceTemplate.buildUri(resourceUriVars);\r
-        logger.debug("Generated URI string = " + uriStr);\r
-        Assert.assertTrue(Tools.isBlank(uriStr), "Generated URI string was not blank, but should have been.");\r
-    }\r
-\r
-    @Test(dependsOnMethods = {"buildResourceUri"})\r
-    public void buildResourceUriWithNullValue() {\r
-        testBanner("buildResourceUriWithNullValue");\r
-        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);\r
-        Map<String, String> resourceUriVars = new HashMap<String, String>();\r
-        resourceUriVars.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);\r
-        resourceUriVars.put(UriTemplateFactory.IDENTIFIER_VAR, null);\r
-        logger.debug("This is a negative test, and an error message is expected here:");\r
-        String uriStr = resourceTemplate.buildUri(resourceUriVars);\r
-        logger.debug("Generated URI string = " + uriStr);\r
-        Assert.assertTrue(Tools.isBlank(uriStr), "Generated URI string was not blank, but should have been.");\r
-    }\r
-\r
-    @Test(dependsOnMethods = {"buildResourceUri"})\r
-    public void buildResourceUriWithEmptyValuesMap() {\r
-        testBanner("buildResourceUriWithEmptyValuesMap");\r
-        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);\r
-        logger.debug("This is a negative test, and an error message is expected here:");\r
-        String uriStr = resourceTemplate.buildUri(EMPTY_VALUES_MAP);\r
-        logger.debug("Generated URI string = " + uriStr);\r
-        Assert.assertTrue(Tools.isBlank(uriStr), "Generated URI string was not blank, but should have been.");\r
-    }\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2012 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.collectionspace.services.common.test;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.collectionspace.services.common.StoredValuesUriTemplate;
+import org.collectionspace.services.common.UriTemplate;
+import org.collectionspace.services.common.UriTemplateFactory;
+import org.collectionspace.services.common.api.Tools;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class UriTemplateTest {
+
+    private final static String EXAMPLE_SERVICE_NAME = "examples";
+    private final static String EXAMPLE_CSID = "a87f6616-4146-4c17-a41a-048597cc12aa";
+    private final static String EXAMPLE_ITEM_CSID = "5d1c2f45-6d02-4376-8852-71893eaf8b1b";
+    private final static String EXAMPLE_CONTACT_CSID = "f01e9edb-4f9c-4716-a9cb-5e954fc29577";
+    private final static HashMap<String, String> EMPTY_VALUES_MAP = new HashMap<String, String>();
+    private static final Logger logger = LoggerFactory.getLogger(UriTemplateTest.class);
+
+    private void testBanner(String msg) {
+        String BANNER = "-------------------------------------------------------";
+        logger.debug("\r" + BANNER + "\r\n" + this.getClass().getName() + "\r\n" + msg + "\r\n" + BANNER);
+    }
+
+    @Test
+    public void createResourceUriTemplate() {
+        testBanner("createResourceUriTemplate");
+        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);
+        Assert.assertNotNull(resourceTemplate, "Resource template is null; it was not created successfully.");
+        logger.debug("Resource template URI path = " + resourceTemplate.toString());
+        Assert.assertNotNull(resourceTemplate.getUriTemplateType(), "Resource template type is null; it was not set successfully.");
+        Assert.assertEquals(resourceTemplate.getUriTemplateType(), UriTemplateFactory.RESOURCE,
+                "Resource template type + " + resourceTemplate.getUriTemplateType()
+                + " doesn't match expected type: " + UriTemplateFactory.RESOURCE);
+        Assert.assertNotNull(resourceTemplate.toString(), "Resource template URI path is null; it was not set successfully.");
+        Assert.assertEquals(resourceTemplate.toString(), UriTemplateFactory.RESOURCE_PATH_PATTERN,
+                "Resource template URI path " + resourceTemplate.toString()
+                + " doesn't match expected path: " + UriTemplateFactory.RESOURCE_PATH_PATTERN);
+    }
+
+    @Test(dependsOnMethods = {"createResourceUriTemplate"})
+    public void buildResourceUri() {
+        testBanner("buildResourceUri");
+        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);
+        Map<String, String> resourceUriVars = new HashMap<String, String>();
+        resourceUriVars.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);
+        resourceUriVars.put(UriTemplateFactory.IDENTIFIER_VAR, EXAMPLE_CSID);
+        String uriStr = resourceTemplate.buildUri(resourceUriVars);
+        logger.debug("Generated URI string = " + uriStr);
+        Assert.assertFalse(Tools.isBlank(uriStr), "Generated URI string is null or blank.");
+        Assert.assertTrue(uriStr.contains(EXAMPLE_SERVICE_NAME), "Generated URI string does not contain expected service name value: " + EXAMPLE_SERVICE_NAME);
+        Assert.assertTrue(uriStr.contains(EXAMPLE_CSID), "Generated URI string does not contain expected identifier value: " + EXAMPLE_CSID);
+    }
+
+    @Test(dependsOnMethods = {"buildResourceUri"})
+    public void buildResourceUriWithStoredValues() {
+        testBanner("buildResourceUriWithStoredValues");
+        Map<String, String> storedValuesMap = new HashMap<String, String>();
+        storedValuesMap.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);
+        StoredValuesUriTemplate storedValuesResourceTemplate =
+                UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE, storedValuesMap);
+        Map<String, String> additionalValues = new HashMap<String, String>();
+        additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, EXAMPLE_CSID);
+        String uriStr = storedValuesResourceTemplate.buildUri(additionalValues);
+        logger.debug("Generated URI string = " + uriStr);
+        Assert.assertTrue(Tools.notBlank(uriStr), "Generated URI string is null or blank.");
+        Assert.assertTrue(uriStr.contains(EXAMPLE_SERVICE_NAME), "Generated URI string does not contain expected service name value: " + EXAMPLE_SERVICE_NAME);
+        Assert.assertTrue(uriStr.contains(EXAMPLE_CSID), "Generated URI string does not contain expected identifier value: " + EXAMPLE_CSID);
+    }
+
+    @Test(dependsOnMethods = {"buildResourceUriWithStoredValues"})
+    public void buildItemUri() {
+        testBanner("buildItemUri");
+        Map<String, String> storedValuesMap = new HashMap<String, String>();
+        storedValuesMap.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);
+        StoredValuesUriTemplate itemTemplate =
+                UriTemplateFactory.getURITemplate(UriTemplateFactory.ITEM, storedValuesMap);
+        Map<String, String> additionalValues = new HashMap<String, String>();
+        additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, EXAMPLE_CSID);
+        additionalValues.put(UriTemplateFactory.ITEM_IDENTIFIER_VAR, EXAMPLE_ITEM_CSID);
+        String uriStr = itemTemplate.buildUri(additionalValues);
+        logger.debug("Generated URI string = " + uriStr);
+        Assert.assertTrue(Tools.notBlank(uriStr), "Generated URI string is null or blank.");
+        Assert.assertTrue(uriStr.contains(EXAMPLE_SERVICE_NAME), "Generated URI string does not contain expected service name value: " + EXAMPLE_SERVICE_NAME);
+        Assert.assertTrue(uriStr.contains(EXAMPLE_CSID), "Generated URI string does not contain expected identifier value: " + EXAMPLE_CSID);
+        Assert.assertTrue(uriStr.contains(EXAMPLE_ITEM_CSID), "Generated URI string does not contain expected item identifier value: " + EXAMPLE_ITEM_CSID);
+    }
+
+    @Test(dependsOnMethods = {"buildItemUri"})
+    public void buildContactUri() {
+        testBanner("buildContactUri");
+        StoredValuesUriTemplate contactTemplate =
+                UriTemplateFactory.getURITemplate(UriTemplateFactory.CONTACT);
+        Map<String, String> additionalValues = new HashMap<String, String>();
+        additionalValues.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);
+        additionalValues.put(UriTemplateFactory.IDENTIFIER_VAR, EXAMPLE_CSID);
+        additionalValues.put(UriTemplateFactory.ITEM_IDENTIFIER_VAR, EXAMPLE_ITEM_CSID);
+        additionalValues.put(UriTemplateFactory.CONTACT_IDENTIFIER_VAR, EXAMPLE_CONTACT_CSID);
+        String uriStr = contactTemplate.buildUri(additionalValues);
+        logger.debug("Generated URI string = " + uriStr);
+        Assert.assertTrue(Tools.notBlank(uriStr), "Generated URI string is null or blank.");
+        Assert.assertTrue(uriStr.contains(EXAMPLE_SERVICE_NAME), "Generated URI string does not contain expected service name value: " + EXAMPLE_SERVICE_NAME);
+        Assert.assertTrue(uriStr.contains(EXAMPLE_CSID), "Generated URI string does not contain expected identifier value: " + EXAMPLE_CSID);
+        Assert.assertTrue(uriStr.contains(EXAMPLE_ITEM_CSID), "Generated URI string does not contain expected item identifier value: " + EXAMPLE_ITEM_CSID);
+        Assert.assertTrue(uriStr.contains(EXAMPLE_CONTACT_CSID), "Generated URI string does not contain expected contact identifier value: " + EXAMPLE_CONTACT_CSID);
+    }
+
+    // Negative tests: errors are anticipated and checked for in each of the following tests
+    @Test(dependsOnMethods = {"buildResourceUri"})
+    public void buildResourceUriWithMissingValue() {
+        testBanner("buildResourceUriWithMissingValue");
+        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);
+        Map<String, String> resourceUriVars = new HashMap<String, String>();
+        resourceUriVars.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);
+        // The required 'identifier' value is missing from the Map from which the URI will be built
+        logger.debug("This is a negative test, and an error message is expected here:");
+        String uriStr = resourceTemplate.buildUri(resourceUriVars);
+        logger.debug("Generated URI string = " + uriStr);
+        Assert.assertTrue(Tools.isBlank(uriStr), "Generated URI string was not blank, but should have been.");
+    }
+
+    @Test(dependsOnMethods = {"buildResourceUri"})
+    public void buildResourceUriWithNullValue() {
+        testBanner("buildResourceUriWithNullValue");
+        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);
+        Map<String, String> resourceUriVars = new HashMap<String, String>();
+        resourceUriVars.put(UriTemplateFactory.SERVICENAME_VAR, EXAMPLE_SERVICE_NAME);
+        resourceUriVars.put(UriTemplateFactory.IDENTIFIER_VAR, null);
+        logger.debug("This is a negative test, and an error message is expected here:");
+        String uriStr = resourceTemplate.buildUri(resourceUriVars);
+        logger.debug("Generated URI string = " + uriStr);
+        Assert.assertTrue(Tools.isBlank(uriStr), "Generated URI string was not blank, but should have been.");
+    }
+
+    @Test(dependsOnMethods = {"buildResourceUri"})
+    public void buildResourceUriWithEmptyValuesMap() {
+        testBanner("buildResourceUriWithEmptyValuesMap");
+        UriTemplate resourceTemplate = UriTemplateFactory.getURITemplate(UriTemplateFactory.RESOURCE);
+        logger.debug("This is a negative test, and an error message is expected here:");
+        String uriStr = resourceTemplate.buildUri(EMPTY_VALUES_MAP);
+        logger.debug("Generated URI string = " + uriStr);
+        Assert.assertTrue(Tools.isBlank(uriStr), "Generated URI string was not blank, but should have been.");
+    }
+}
index 5b774d78dff4d73bfd714c6314bd9d01d374c8cd..6a10fa2c8ad8c75386694ed6483cac29ebcdd610 100644 (file)
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<document repository="default" id="aa13777e-941d-4db9-b746-145502d49e97">\r
-  <schema xmlns:collectionobjects_naturalhistory="http://collectionspace.org/collectionobject/" name="collectionobjects_naturalhistory">\r
-    <collectionobjects_naturalhistory:nh-int/>\r
-    <collectionobjects_naturalhistory:nh-note>In test-data</collectionobjects_naturalhistory:nh-note>\r
-  </schema>\r
-  <schema xmlns:collectionobjects_common="http://collectionspace.org/collectionobject/" name="collectionobjects_common">\r
-    <collectionobjects_common:distinguishingFeatures/>\r
-    <collectionobjects_common:sex>Male</collectionobjects_common:sex>\r
-  </schema>\r
-</document>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<document repository="default" id="aa13777e-941d-4db9-b746-145502d49e97">
+  <schema xmlns:collectionobjects_naturalhistory="http://collectionspace.org/collectionobject/" name="collectionobjects_naturalhistory">
+    <collectionobjects_naturalhistory:nh-int/>
+    <collectionobjects_naturalhistory:nh-note>In test-data</collectionobjects_naturalhistory:nh-note>
+  </schema>
+  <schema xmlns:collectionobjects_common="http://collectionspace.org/collectionobject/" name="collectionobjects_common">
+    <collectionobjects_common:distinguishingFeatures/>
+    <collectionobjects_common:sex>Male</collectionobjects_common:sex>
+  </schema>
+</document>
index 154045b74cca6bf652e45cd932d6b490c498853f..f09806fb6abfb82dbbac3e5a8d4908575a18562a 100644 (file)
-package org.collectionspace.services.common.config;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import org.collectionspace.services.config.types.PropertyItemType;\r
-import org.collectionspace.services.config.types.PropertyType;\r
-\r
-public class PropertyItemUtils {\r
-\r
-       /**\r
-     * @param propNodeList the wrapping list node from JAXB\r
-     * @param propName the property to fetch\r
-     * @return the String value of the named property\r
-     */\r
-    public static String getPropertyValueByNameFromNodeList(List<PropertyType> propNodeList,\r
-               String propName) {\r
-               if(propNodeList.isEmpty()) {\r
-                       return null;\r
-               }\r
-               return getPropertyValueByName(propNodeList.get(0).getItem(), propName);\r
-    }\r
-       \r
-       \r
-       /**\r
-     * @param propList the list of properties.\r
-     * @param propName the property to fetch\r
-     * @return the String value of the named property\r
-     */\r
-    public static String getPropertyValueByName(List<PropertyItemType> propList,\r
-               String propName) {\r
-       if(propName==null) {\r
-               throw new IllegalArgumentException("PropertyItemUtils.getPropertyValues: null property name!");\r
-       }\r
-       for(PropertyItemType propItem:propList) {\r
-               if(propName.equals(propItem.getKey())) {\r
-                       return propItem.getValue();\r
-               }\r
-       }\r
-       return null;\r
-    }\r
-    \r
-    /**\r
-     * @param propNodeList the JAXB wrapping node of for the list to search for the named property\r
-     * @param propName the name of the property of interest\r
-     * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null\r
-     * @return a List of string values found for the named property\r
-     */\r
-    public static List<String> getPropertyValuesByNameInNodeList(\r
-               List<PropertyType> propNodeList, String propName, String qualPrefix) {\r
-       return getPropertyValuesByNameInNodeList(propNodeList, propName, qualPrefix, null);\r
-    }\r
-    \r
-    /**\r
-     * @param propNodeList the JAXB wrapping node of for the list to search for the named property\r
-     * @param propName the name of the property of interest\r
-     * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null\r
-     * @param values and existing list to append values to. If null, a new one will be created.\r
-     * @return values, or that is null, a new List of string values found for the named property\r
-     */\r
-    public static List<String> getPropertyValuesByNameInNodeList(\r
-               List<PropertyType> propNodeList, String propName, String qualPrefix,\r
-               List<String> values) {\r
-               if(propNodeList.isEmpty()) {\r
-               if(values==null)\r
-                       values = new ArrayList<String>();\r
-               return values;\r
-               }\r
-       return getPropertyValuesByName(propNodeList.get(0).getItem(), \r
-                                                                       propName, qualPrefix, values);\r
-    }\r
-    \r
-    /**\r
-     * @param propNodeList the Item list to search for the named property\r
-     * @param propName the name of the property of interest\r
-     * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null\r
-     * @return a List of string values found for the named property\r
-     */\r
-    public static List<String> getPropertyValuesByName(\r
-               List<PropertyItemType> propItems, String propName, String qualPrefix) {\r
-       return getPropertyValuesByName(propItems, propName, qualPrefix, null);\r
-    }\r
-    \r
-    /**\r
-     * @param propNodeList the Item list to search for the named property\r
-     * @param propName the name of the property of interest\r
-     * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null\r
-     * @param values and existing list to append values to. If null, a new one will be created.\r
-     * @return values, or that is null, a new List of string values found for the named property\r
-     */\r
-    public static List<String> getPropertyValuesByName(\r
-               List<PropertyItemType> propItems, String propName, String qualPrefix,\r
-               List<String> values ) {\r
-       if(values==null)\r
-               values = new ArrayList<String>();\r
-       for(PropertyItemType propItem:propItems) {\r
-               if(propName.equals(propItem.getKey())) {\r
-                       // TODO - the trim() belongs here, not down a few lines.\r
-                       String value = propItem.getValue();\r
-                       if(value!=null) {\r
-                               values.add((qualPrefix!=null)?(qualPrefix+value):value.trim());\r
-                       }\r
-               }\r
-       }\r
-       return values;\r
-    }\r
-\r
-    /**\r
-     * @param propNodeList the wrapping list node from JAXB\r
-     * @param propName the property to set\r
-     * @param value the new value to set\r
-     * @param onlyIfNotSet if true, will not override an existing value\r
-     * @return true if set, false if an existing value was left as is.\r
-     */\r
-    public static boolean setPropertyValueInNodeList(List<PropertyType> propNodeList,\r
-               String propName, String value,\r
-               boolean onlyIfNotSet) {\r
-               if(propNodeList.isEmpty()) {\r
-                       propNodeList.add(new PropertyType());\r
-               }\r
-               List<PropertyItemType> propList = propNodeList.get(0).getItem();\r
-               return setPropertyValue(propList, propName, value, onlyIfNotSet);\r
-    }\r
-   \r
-    /**\r
-     * @param propName the property to set\r
-     * @param value the new value to set\r
-     * @param onlyIfNotSet if true, will not override an existing value\r
-     * @return true if set, false if an existing value was left as is.\r
-     */\r
-    public static boolean setPropertyValue(List<PropertyItemType> propList,\r
-               String propName, String value,\r
-               boolean onlyIfNotSet) {\r
-       boolean valueFound = false;\r
-       boolean valueSet = false;\r
-       if(propName==null) {\r
-               throw new IllegalArgumentException("ServiceBindingUtils.setPropertyValue: null property name!");\r
-       }\r
-       for(PropertyItemType propItem:propList) {\r
-               if(propName.equals(propItem.getKey())) {\r
-                       if(!onlyIfNotSet) {\r
-                               propItem.setValue(value);\r
-                               valueSet = true;\r
-                       }\r
-                       // whether we set it or not, we found it, so break;\r
-                               valueFound = true;\r
-                               break;\r
-               }\r
-       }\r
-       if(!valueFound) {\r
-               PropertyItemType propItem = new PropertyItemType();\r
-               propItem.setKey(propName);\r
-                       propItem.setValue(value);\r
-                       propList.add(propItem);\r
-                       valueSet = true;\r
-       }\r
-       return valueSet;\r
-    }\r
-    \r
-}\r
+package org.collectionspace.services.common.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.collectionspace.services.config.types.PropertyItemType;
+import org.collectionspace.services.config.types.PropertyType;
+
+public class PropertyItemUtils {
+
+       /**
+     * @param propNodeList the wrapping list node from JAXB
+     * @param propName the property to fetch
+     * @return the String value of the named property
+     */
+    public static String getPropertyValueByNameFromNodeList(List<PropertyType> propNodeList,
+               String propName) {
+               if(propNodeList.isEmpty()) {
+                       return null;
+               }
+               return getPropertyValueByName(propNodeList.get(0).getItem(), propName);
+    }
+       
+       
+       /**
+     * @param propList the list of properties.
+     * @param propName the property to fetch
+     * @return the String value of the named property
+     */
+    public static String getPropertyValueByName(List<PropertyItemType> propList,
+               String propName) {
+       if(propName==null) {
+               throw new IllegalArgumentException("PropertyItemUtils.getPropertyValues: null property name!");
+       }
+       for(PropertyItemType propItem:propList) {
+               if(propName.equals(propItem.getKey())) {
+                       return propItem.getValue();
+               }
+       }
+       return null;
+    }
+    
+    /**
+     * @param propNodeList the JAXB wrapping node of for the list to search for the named property
+     * @param propName the name of the property of interest
+     * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null
+     * @return a List of string values found for the named property
+     */
+    public static List<String> getPropertyValuesByNameInNodeList(
+               List<PropertyType> propNodeList, String propName, String qualPrefix) {
+       return getPropertyValuesByNameInNodeList(propNodeList, propName, qualPrefix, null);
+    }
+    
+    /**
+     * @param propNodeList the JAXB wrapping node of for the list to search for the named property
+     * @param propName the name of the property of interest
+     * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null
+     * @param values and existing list to append values to. If null, a new one will be created.
+     * @return values, or that is null, a new List of string values found for the named property
+     */
+    public static List<String> getPropertyValuesByNameInNodeList(
+               List<PropertyType> propNodeList, String propName, String qualPrefix,
+               List<String> values) {
+               if(propNodeList.isEmpty()) {
+               if(values==null)
+                       values = new ArrayList<String>();
+               return values;
+               }
+       return getPropertyValuesByName(propNodeList.get(0).getItem(), 
+                                                                       propName, qualPrefix, values);
+    }
+    
+    /**
+     * @param propNodeList the Item list to search for the named property
+     * @param propName the name of the property of interest
+     * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null
+     * @return a List of string values found for the named property
+     */
+    public static List<String> getPropertyValuesByName(
+               List<PropertyItemType> propItems, String propName, String qualPrefix) {
+       return getPropertyValuesByName(propItems, propName, qualPrefix, null);
+    }
+    
+    /**
+     * @param propNodeList the Item list to search for the named property
+     * @param propName the name of the property of interest
+     * @param qualPrefix a namespace qualifier prefix (with ':') to prepend, or null
+     * @param values and existing list to append values to. If null, a new one will be created.
+     * @return values, or that is null, a new List of string values found for the named property
+     */
+    public static List<String> getPropertyValuesByName(
+               List<PropertyItemType> propItems, String propName, String qualPrefix,
+               List<String> values ) {
+       if(values==null)
+               values = new ArrayList<String>();
+       for(PropertyItemType propItem:propItems) {
+               if(propName.equals(propItem.getKey())) {
+                       // TODO - the trim() belongs here, not down a few lines.
+                       String value = propItem.getValue();
+                       if(value!=null) {
+                               values.add((qualPrefix!=null)?(qualPrefix+value):value.trim());
+                       }
+               }
+       }
+       return values;
+    }
+
+    /**
+     * @param propNodeList the wrapping list node from JAXB
+     * @param propName the property to set
+     * @param value the new value to set
+     * @param onlyIfNotSet if true, will not override an existing value
+     * @return true if set, false if an existing value was left as is.
+     */
+    public static boolean setPropertyValueInNodeList(List<PropertyType> propNodeList,
+               String propName, String value,
+               boolean onlyIfNotSet) {
+               if(propNodeList.isEmpty()) {
+                       propNodeList.add(new PropertyType());
+               }
+               List<PropertyItemType> propList = propNodeList.get(0).getItem();
+               return setPropertyValue(propList, propName, value, onlyIfNotSet);
+    }
+   
+    /**
+     * @param propName the property to set
+     * @param value the new value to set
+     * @param onlyIfNotSet if true, will not override an existing value
+     * @return true if set, false if an existing value was left as is.
+     */
+    public static boolean setPropertyValue(List<PropertyItemType> propList,
+               String propName, String value,
+               boolean onlyIfNotSet) {
+       boolean valueFound = false;
+       boolean valueSet = false;
+       if(propName==null) {
+               throw new IllegalArgumentException("ServiceBindingUtils.setPropertyValue: null property name!");
+       }
+       for(PropertyItemType propItem:propList) {
+               if(propName.equals(propItem.getKey())) {
+                       if(!onlyIfNotSet) {
+                               propItem.setValue(value);
+                               valueSet = true;
+                       }
+                       // whether we set it or not, we found it, so break;
+                               valueFound = true;
+                               break;
+               }
+       }
+       if(!valueFound) {
+               PropertyItemType propItem = new PropertyItemType();
+               propItem.setKey(propName);
+                       propItem.setValue(value);
+                       propList.add(propItem);
+                       valueSet = true;
+       }
+       return valueSet;
+    }
+    
+}
index d18316afc439864cbba0150febce32e2e724ffba..2068e34f3ee13d634f8514b5c61eb9ef3f88dd6b 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index 114bacd9095ebabd62e67f67a23ab9f47a1b4da6..ea892d40b88411e7cbee54985176d30d40aca775 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.contact</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.contact</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d18316afc439864cbba0150febce32e2e724ffba..2068e34f3ee13d634f8514b5c61eb9ef3f88dd6b 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index 9a453ba2d8630d7e9cb9fb86fa345e9f6f604f7d..4b8b48d5bc95681f98c18518b3f312369b9a80fa 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.contact.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.contact.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d5ffa928fc49cb9adbeffe35a67ce23f39be1ce6..c927d5dba3f01b9c0b2a43b682ccc46e62ce5486 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-/*\r
- * LT - List type\r
- * ILT - Authority item list type\r
- * P - Proxy type\r
- */\r
-public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>\r
-       extends AuthorityClient<AUTHORITY_ITEM_TYPE, P> {\r
-    /**\r
-     * Creates the contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemcsid the itemcsid\r
-     * @param multipart the multipart\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<Response> createContact(String parentcsid,\r
-            String itemcsid, PoxPayloadOut xmlPayload);\r
-    \r
-    /**\r
-     * Creates the contact.\r
-     *\r
-     * @param parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param multipart\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<Response> createContactForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier,\r
-               PoxPayloadOut xmlPayload);\r
-    \r
-    /**\r
-     * Creates the contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid\r
-     * @param multipart\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<Response> createContactForItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid,\r
-               PoxPayloadOut xmlPayload);\r
-    \r
-    /**\r
-     * Creates the contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param multipart\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<Response> createContactForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier,\r
-               PoxPayloadOut xmlPayload);\r
-    \r
-    /**\r
-     * Read contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> readContact(String parentcsid,\r
-            String itemcsid, String csid);\r
-    \r
-    /**\r
-     * Read contact.\r
-     *\r
-     * @param parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> readContactForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier,\r
-               String csid);\r
-\r
-    /**\r
-     * Read contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid\r
-     * @param csid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> readContactInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid,\r
-               String csid);\r
-\r
-    /**\r
-     * Read contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> readContactForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier,\r
-               String csid);\r
-            \r
-\r
-    /**\r
-     * Read contact list.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemcsid the itemcsid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<AbstractCommonList> readContactList(String parentcsid,\r
-            String itemcsid);\r
-    \r
-    /**\r
-     * Read contact list.\r
-     *\r
-     * @param parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<AbstractCommonList> readContactListForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier);\r
-\r
-    /**\r
-     * Read contact list.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid);\r
-\r
-    /**\r
-     * Read contact list.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier);\r
-\r
-    /**\r
-     * Update contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @param multipart the multipart\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> updateContact(String parentcsid,\r
-            String itemcsid, String csid, PoxPayloadOut xmlPayload);\r
-    \r
-    /**\r
-     * Update contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid the csid\r
-     * @param multipart the multipart\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> updateContactForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier,\r
-               String csid,\r
-               PoxPayloadOut xmlPayload);\r
-\r
-    /**\r
-     * Update contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @param multipart the multipart\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> updateContactInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid,\r
-               String csid,\r
-               PoxPayloadOut xmlPayload);\r
-\r
-    /**\r
-     * Update contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid the csid\r
-     * @param multipart the multipart\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<String> updateContactForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier,\r
-               String csid,\r
-               PoxPayloadOut xmlPayload);\r
-\r
-    /**\r
-     * Delete contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<Response> deleteContact(String parentcsid,\r
-        String itemcsid, String csid);\r
-    \r
-    /**\r
-     * Delete contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<Response> deleteContactForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier,\r
-               String csid);\r
-\r
-    /**\r
-     * Delete contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<Response> deleteContactInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid,\r
-               String csid);\r
-\r
-    /**\r
-     * Delete contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier,\r
-               String csid);\r
-    \r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.jboss.resteasy.client.ClientResponse;
+
+/*
+ * LT - List type
+ * ILT - Authority item list type
+ * P - Proxy type
+ */
+public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
+       extends AuthorityClient<AUTHORITY_ITEM_TYPE, P> {
+    /**
+     * Creates the contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     * @param multipart the multipart
+     * @return the client response
+     */
+    public ClientResponse<Response> createContact(String parentcsid,
+            String itemcsid, PoxPayloadOut xmlPayload);
+    
+    /**
+     * Creates the contact.
+     *
+     * @param parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @param multipart
+     * @return the client response
+     */
+    public ClientResponse<Response> createContactForNamedItem(
+               String parentcsid,
+               String itemspecifier,
+               PoxPayloadOut xmlPayload);
+    
+    /**
+     * Creates the contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid
+     * @param multipart
+     * @return the client response
+     */
+    public ClientResponse<Response> createContactForItemInNamedAuthority(
+               String parentspecifier,
+               String itemcsid,
+               PoxPayloadOut xmlPayload);
+    
+    /**
+     * Creates the contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @param multipart
+     * @return the client response
+     */
+    public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier,
+               PoxPayloadOut xmlPayload);
+    
+    /**
+     * Read contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @return the client response
+     */
+    public ClientResponse<String> readContact(String parentcsid,
+            String itemcsid, String csid);
+    
+    /**
+     * Read contact.
+     *
+     * @param parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @param csid
+     * @return the client response
+     */
+    public ClientResponse<String> readContactForNamedItem(
+               String parentcsid,
+               String itemspecifier,
+               String csid);
+
+    /**
+     * Read contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid
+     * @param csid
+     * @return the client response
+     */
+    public ClientResponse<String> readContactInNamedAuthority(
+               String parentspecifier,
+               String itemcsid,
+               String csid);
+
+    /**
+     * Read contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @param csid
+     * @return the client response
+     */
+    public ClientResponse<String> readContactForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier,
+               String csid);
+            
+
+    /**
+     * Read contact list.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     * @return the client response
+     */
+    public ClientResponse<AbstractCommonList> readContactList(String parentcsid,
+            String itemcsid);
+    
+    /**
+     * Read contact list.
+     *
+     * @param parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @return the client response
+     */
+    public ClientResponse<AbstractCommonList> readContactListForNamedItem(
+               String parentcsid,
+               String itemspecifier);
+
+    /**
+     * Read contact list.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid
+     * @return the client response
+     */
+    public ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(
+               String parentspecifier,
+               String itemcsid);
+
+    /**
+     * Read contact list.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @return the client response
+     */
+    public ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier);
+
+    /**
+     * Update contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
+    public ClientResponse<String> updateContact(String parentcsid,
+            String itemcsid, String csid, PoxPayloadOut xmlPayload);
+    
+    /**
+     * Update contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
+    public ClientResponse<String> updateContactForNamedItem(
+               String parentcsid,
+               String itemspecifier,
+               String csid,
+               PoxPayloadOut xmlPayload);
+
+    /**
+     * Update contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
+    public ClientResponse<String> updateContactInNamedAuthority(
+               String parentspecifier,
+               String itemcsid,
+               String csid,
+               PoxPayloadOut xmlPayload);
+
+    /**
+     * Update contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
+    public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier,
+               String csid,
+               PoxPayloadOut xmlPayload);
+
+    /**
+     * Delete contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @return the client response
+     */
+    public ClientResponse<Response> deleteContact(String parentcsid,
+        String itemcsid, String csid);
+    
+    /**
+     * Delete contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @param csid the csid
+     * @return the client response
+     */
+    public ClientResponse<Response> deleteContactForNamedItem(
+               String parentcsid,
+               String itemspecifier,
+               String csid);
+
+    /**
+     * Delete contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @return the client response
+     */
+    public ClientResponse<Response> deleteContactInNamedAuthority(
+               String parentspecifier,
+               String itemcsid,
+               String csid);
+
+    /**
+     * Delete contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @param csid the csid
+     * @return the client response
+     */
+    public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier,
+               String csid);
+    
+}
index 9f55df44bc365530bfb37ac357b5777922d1bf83..c90004b997e48bb1c52402dcebbbb11446546828 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.core.Response;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-\r
-/*\r
- * LT - List type\r
- * ILT - Authority item list type\r
- * P - Proxy type\r
- */\r
-public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P extends AuthorityWithContactsProxy>\r
-       extends AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P>\r
-       implements AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P> {\r
-       \r
-       @Override\r
-    public ClientResponse<Response> createContact(String parentcsid,\r
-            String itemcsid, PoxPayloadOut xmlPayload) {\r
-        return getProxy().createContact(parentcsid, itemcsid, xmlPayload.getBytes());\r
-    }\r
-    \r
-    /**\r
-     * Creates the contact.\r
-     *\r
-     * @param parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param multipart\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<Response> createContactForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier,\r
-               PoxPayloadOut xmlPayload) {\r
-       return getProxy().createContactForNamedItem(parentcsid, itemspecifier, xmlPayload.getBytes());\r
-    }\r
-    /**\r
-     * Creates the contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid\r
-     * @param multipart\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<Response> createContactForItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid,\r
-               PoxPayloadOut xmlPayload) {\r
-       return getProxy().createContactForItemInNamedAuthority(parentspecifier,\r
-                       itemcsid, xmlPayload.getBytes());\r
-    }\r
-    /**\r
-     * Creates the contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param multipart\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<Response> createContactForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier,\r
-               PoxPayloadOut xmlPayload) {\r
-       return getProxy().createContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier,\r
-                       xmlPayload.getBytes());\r
-    }\r
-    \r
-    /**\r
-     * Read contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> readContact(String parentcsid,\r
-            String itemcsid, String csid) {\r
-        return getProxy().readContact(parentcsid, itemcsid, csid);\r
-    }\r
-    \r
-    /**\r
-     * Read contact.\r
-     *\r
-     * @param parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> readContactForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier,\r
-               String csid){\r
-       return getProxy().readContactForNamedItem(parentcsid, itemspecifier, csid);\r
-    }\r
-\r
-    /**\r
-     * Read contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid\r
-     * @param csid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> readContactInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid,\r
-               String csid){\r
-       return getProxy().readContactInNamedAuthority(parentspecifier, itemcsid, csid);\r
-    }\r
-\r
-    /**\r
-     * Read contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> readContactForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier,\r
-               String csid){\r
-       return getProxy().readContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid);\r
-    }\r
-            \r
-\r
-    /**\r
-     * Read contact list.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemcsid the itemcsid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<AbstractCommonList> readContactList(String parentcsid,\r
-            String itemcsid) {\r
-        return getProxy().readContactList(parentcsid, itemcsid);\r
-    }\r
-    \r
-    /**\r
-     * Read contact list.\r
-     *\r
-     * @param parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<AbstractCommonList> readContactListForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier){\r
-       return getProxy().readContactList(parentcsid, itemspecifier);\r
-    }\r
-\r
-    /**\r
-     * Read contact list.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid){\r
-       return getProxy().readContactList(parentspecifier, itemcsid);\r
-    }\r
-\r
-    /**\r
-     * Read contact list.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier){\r
-       return getProxy().readContactList(parentspecifier, itemspecifier);\r
-    }\r
-\r
-    /**\r
-     * Update contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @param multipart the multipart\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> updateContact(String parentcsid,\r
-            String itemcsid, String csid, PoxPayloadOut xmlPayload) {\r
-        return getProxy().updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());\r
-    }\r
-    \r
-    /**\r
-     * Update contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid the csid\r
-     * @param multipart the multipart\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> updateContactForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier,\r
-               String csid,\r
-               PoxPayloadOut xmlPayload) {\r
-       return getProxy().updateContactForNamedItem(parentcsid, itemspecifier, csid, xmlPayload.getBytes());\r
-    }\r
-\r
-    /**\r
-     * Update contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @param multipart the multipart\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> updateContactInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid,\r
-               String csid,\r
-               PoxPayloadOut xmlPayload) {\r
-       return getProxy().updateContactInNamedAuthority(parentspecifier, itemcsid, csid, xmlPayload.getBytes());\r
-    }\r
-\r
-    /**\r
-     * Update contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid the csid\r
-     * @param multipart the multipart\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<String> updateContactForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier,\r
-               String csid,\r
-               PoxPayloadOut xmlPayload) {\r
-       return getProxy().updateContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid,\r
-                       xmlPayload.getBytes());\r
-    }\r
-\r
-    /**\r
-     * Delete contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<Response> deleteContact(String parentcsid,\r
-        String itemcsid, String csid) {\r
-        return getProxy().deleteContact(parentcsid,\r
-            itemcsid, csid);\r
-    }\r
-    \r
-    /**\r
-     * Delete contact.\r
-     *\r
-     * @param parentcsid the parentcsid\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<Response> deleteContactForNamedItem(\r
-               String parentcsid,\r
-               String itemspecifier,\r
-               String csid) {\r
-       return getProxy().deleteContactForNamedItem(parentcsid,\r
-                       itemspecifier, csid);\r
-    }\r
-\r
-    /**\r
-     * Delete contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemcsid the itemcsid\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<Response> deleteContactInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemcsid,\r
-               String csid) {\r
-       return getProxy().deleteContactInNamedAuthority(parentspecifier,\r
-                       itemcsid, csid);\r
-    }\r
-\r
-    /**\r
-     * Delete contact.\r
-     *\r
-     * @param parentspecifier (shortIdentifier)\r
-     * @param itemspecifier (shortIdentifier)\r
-     * @param csid the csid\r
-     * @return the client response\r
-     */\r
-    @Override\r
-       public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(\r
-               String parentspecifier,\r
-               String itemspecifier,\r
-               String csid) {\r
-       return getProxy().deleteContactForNamedItemInNamedAuthority(parentspecifier,\r
-                       itemspecifier, csid);\r
-    }\r
-    \r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
+/*
+ * LT - List type
+ * ILT - Authority item list type
+ * P - Proxy type
+ */
+public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P extends AuthorityWithContactsProxy>
+       extends AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P>
+       implements AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P> {
+       
+       @Override
+    public ClientResponse<Response> createContact(String parentcsid,
+            String itemcsid, PoxPayloadOut xmlPayload) {
+        return getProxy().createContact(parentcsid, itemcsid, xmlPayload.getBytes());
+    }
+    
+    /**
+     * Creates the contact.
+     *
+     * @param parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @param multipart
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<Response> createContactForNamedItem(
+               String parentcsid,
+               String itemspecifier,
+               PoxPayloadOut xmlPayload) {
+       return getProxy().createContactForNamedItem(parentcsid, itemspecifier, xmlPayload.getBytes());
+    }
+    /**
+     * Creates the contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid
+     * @param multipart
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<Response> createContactForItemInNamedAuthority(
+               String parentspecifier,
+               String itemcsid,
+               PoxPayloadOut xmlPayload) {
+       return getProxy().createContactForItemInNamedAuthority(parentspecifier,
+                       itemcsid, xmlPayload.getBytes());
+    }
+    /**
+     * Creates the contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @param multipart
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier,
+               PoxPayloadOut xmlPayload) {
+       return getProxy().createContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier,
+                       xmlPayload.getBytes());
+    }
+    
+    /**
+     * Read contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> readContact(String parentcsid,
+            String itemcsid, String csid) {
+        return getProxy().readContact(parentcsid, itemcsid, csid);
+    }
+    
+    /**
+     * Read contact.
+     *
+     * @param parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @param csid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> readContactForNamedItem(
+               String parentcsid,
+               String itemspecifier,
+               String csid){
+       return getProxy().readContactForNamedItem(parentcsid, itemspecifier, csid);
+    }
+
+    /**
+     * Read contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid
+     * @param csid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> readContactInNamedAuthority(
+               String parentspecifier,
+               String itemcsid,
+               String csid){
+       return getProxy().readContactInNamedAuthority(parentspecifier, itemcsid, csid);
+    }
+
+    /**
+     * Read contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @param csid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> readContactForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier,
+               String csid){
+       return getProxy().readContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid);
+    }
+            
+
+    /**
+     * Read contact list.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<AbstractCommonList> readContactList(String parentcsid,
+            String itemcsid) {
+        return getProxy().readContactList(parentcsid, itemcsid);
+    }
+    
+    /**
+     * Read contact list.
+     *
+     * @param parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<AbstractCommonList> readContactListForNamedItem(
+               String parentcsid,
+               String itemspecifier){
+       return getProxy().readContactList(parentcsid, itemspecifier);
+    }
+
+    /**
+     * Read contact list.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(
+               String parentspecifier,
+               String itemcsid){
+       return getProxy().readContactList(parentspecifier, itemcsid);
+    }
+
+    /**
+     * Read contact list.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier){
+       return getProxy().readContactList(parentspecifier, itemspecifier);
+    }
+
+    /**
+     * Update contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> updateContact(String parentcsid,
+            String itemcsid, String csid, PoxPayloadOut xmlPayload) {
+        return getProxy().updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());
+    }
+    
+    /**
+     * Update contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> updateContactForNamedItem(
+               String parentcsid,
+               String itemspecifier,
+               String csid,
+               PoxPayloadOut xmlPayload) {
+       return getProxy().updateContactForNamedItem(parentcsid, itemspecifier, csid, xmlPayload.getBytes());
+    }
+
+    /**
+     * Update contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> updateContactInNamedAuthority(
+               String parentspecifier,
+               String itemcsid,
+               String csid,
+               PoxPayloadOut xmlPayload) {
+       return getProxy().updateContactInNamedAuthority(parentspecifier, itemcsid, csid, xmlPayload.getBytes());
+    }
+
+    /**
+     * Update contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier,
+               String csid,
+               PoxPayloadOut xmlPayload) {
+       return getProxy().updateContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid,
+                       xmlPayload.getBytes());
+    }
+
+    /**
+     * Delete contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<Response> deleteContact(String parentcsid,
+        String itemcsid, String csid) {
+        return getProxy().deleteContact(parentcsid,
+            itemcsid, csid);
+    }
+    
+    /**
+     * Delete contact.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemspecifier (shortIdentifier)
+     * @param csid the csid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<Response> deleteContactForNamedItem(
+               String parentcsid,
+               String itemspecifier,
+               String csid) {
+       return getProxy().deleteContactForNamedItem(parentcsid,
+                       itemspecifier, csid);
+    }
+
+    /**
+     * Delete contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemcsid the itemcsid
+     * @param csid the csid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<Response> deleteContactInNamedAuthority(
+               String parentspecifier,
+               String itemcsid,
+               String csid) {
+       return getProxy().deleteContactInNamedAuthority(parentspecifier,
+                       itemcsid, csid);
+    }
+
+    /**
+     * Delete contact.
+     *
+     * @param parentspecifier (shortIdentifier)
+     * @param itemspecifier (shortIdentifier)
+     * @param csid the csid
+     * @return the client response
+     */
+    @Override
+       public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
+               String parentspecifier,
+               String itemspecifier,
+               String csid) {
+       return getProxy().deleteContactForNamedItemInNamedAuthority(parentspecifier,
+                       itemspecifier, csid);
+    }
+    
+}
index c31f4bb188c2a934a940d8fc65db6762b3e2a231..98e8eec0508661eb5bb16fc9def2b00eead946cd 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.DELETE;\r
-import javax.ws.rs.GET;\r
-import javax.ws.rs.POST;\r
-import javax.ws.rs.PUT;\r
-import javax.ws.rs.Path;\r
-import javax.ws.rs.PathParam;\r
-import javax.ws.rs.Produces;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-/*\r
- * ILT = Item list type\r
- * LT = List type\r
- */\r
-public interface AuthorityWithContactsProxy extends AuthorityProxy {\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/")\r
-    public ClientResponse<AbstractCommonList> readContactList(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemcsid") String itemcsid);\r
-\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")\r
-    ClientResponse<AbstractCommonList> readContactListForNamedItem(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemspecifier") String itemspecifier);\r
-    \r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")\r
-    ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemcsid") String itemcsid);\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")\r
-    ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemspecifier") String itemspecifier);\r
-\r
-    //(C)reate Contact\r
-    @POST\r
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/")\r
-    ClientResponse<Response> createContact(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemcsid") String itemcsid,\r
-            byte[] xmlPayload);\r
-    @POST\r
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")\r
-    ClientResponse<Response> createContactForNamedItem(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemspecifier") String itemspecifier,\r
-            byte[] xmlPayload);\r
-    @POST\r
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")\r
-    ClientResponse<Response> createContactForItemInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemcsid") String itemcsid,\r
-            byte[] xmlPayload);\r
-    @POST\r
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")\r
-    ClientResponse<Response> createContactForNamedItemInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemspecifier") String itemspecifier,\r
-            byte[] xmlPayload);\r
-\r
-     //(R)ead Contact\r
-    @GET\r
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")\r
-    ClientResponse<String> readContact(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemcsid") String itemcsid,\r
-            @PathParam("csid") String csid);\r
-    @GET\r
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
-    ClientResponse<String> readContactForNamedItem(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemspecifier") String itemspecifier,\r
-            @PathParam("csid") String csid);\r
-    @GET\r
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")\r
-    ClientResponse<String> readContactInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemcsid") String itemcsid,\r
-            @PathParam("csid") String csid);\r
-    @GET\r
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
-    ClientResponse<String> readContactForNamedItemInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemspecifier") String itemspecifier,\r
-            @PathParam("csid") String csid);\r
-\r
-    //(U)pdate Contact\r
-    @PUT\r
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")\r
-    ClientResponse<String> updateContact(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemcsid") String itemcsid,\r
-            @PathParam("csid") String csid,\r
-            byte[] xmlPayload);\r
-    @PUT\r
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
-    ClientResponse<String> updateContactForNamedItem(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemspecifier") String itemspecifier,\r
-            @PathParam("csid") String csid,\r
-            byte[] xmlPayload);\r
-    @PUT\r
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")\r
-    ClientResponse<String> updateContactInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemcsid") String itemcsid,\r
-            @PathParam("csid") String csid,\r
-            byte[] xmlPayload);\r
-    @PUT\r
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
-    ClientResponse<String> updateContactForNamedItemInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemspecifier") String itemspecifier,\r
-            @PathParam("csid") String csid,\r
-            byte[] xmlPayload);\r
-\r
-    //(D)elete Contact\r
-    @DELETE\r
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")\r
-    ClientResponse<Response> deleteContact(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemcsid") String itemcsid,\r
-            @PathParam("csid") String csid);\r
-    \r
-    @DELETE\r
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
-    ClientResponse<Response> deleteContactForNamedItem(\r
-            @PathParam("parentcsid") String parentcsid,\r
-            @PathParam("itemspecifier") String itemspecifier,\r
-            @PathParam("csid") String csid);\r
-    @DELETE\r
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")\r
-    ClientResponse<Response> deleteContactInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemcsid") String itemcsid,\r
-            @PathParam("csid") String csid);\r
-    \r
-    @DELETE\r
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
-    ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(\r
-            @PathParam("parentspecifier") String parentspecifier,\r
-            @PathParam("itemspecifier") String itemspecifier,\r
-            @PathParam("csid") String csid);\r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.jboss.resteasy.client.ClientResponse;
+
+/*
+ * ILT = Item list type
+ * LT = List type
+ */
+public interface AuthorityWithContactsProxy extends AuthorityProxy {
+    @GET
+    @Produces({"application/xml"})
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/")
+    public ClientResponse<AbstractCommonList> readContactList(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemcsid") String itemcsid);
+
+    @GET
+    @Produces({"application/xml"})
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
+    ClientResponse<AbstractCommonList> readContactListForNamedItem(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemspecifier") String itemspecifier);
+    
+    @GET
+    @Produces({"application/xml"})
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
+    ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemcsid") String itemcsid);
+    @GET
+    @Produces({"application/xml"})
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
+    ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemspecifier") String itemspecifier);
+
+    //(C)reate Contact
+    @POST
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/")
+    ClientResponse<Response> createContact(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemcsid") String itemcsid,
+            byte[] xmlPayload);
+    @POST
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
+    ClientResponse<Response> createContactForNamedItem(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemspecifier") String itemspecifier,
+            byte[] xmlPayload);
+    @POST
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
+    ClientResponse<Response> createContactForItemInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemcsid") String itemcsid,
+            byte[] xmlPayload);
+    @POST
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
+    ClientResponse<Response> createContactForNamedItemInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemspecifier") String itemspecifier,
+            byte[] xmlPayload);
+
+     //(R)ead Contact
+    @GET
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
+    ClientResponse<String> readContact(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemcsid") String itemcsid,
+            @PathParam("csid") String csid);
+    @GET
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
+    ClientResponse<String> readContactForNamedItem(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemspecifier") String itemspecifier,
+            @PathParam("csid") String csid);
+    @GET
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
+    ClientResponse<String> readContactInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemcsid") String itemcsid,
+            @PathParam("csid") String csid);
+    @GET
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
+    ClientResponse<String> readContactForNamedItemInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemspecifier") String itemspecifier,
+            @PathParam("csid") String csid);
+
+    //(U)pdate Contact
+    @PUT
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
+    ClientResponse<String> updateContact(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemcsid") String itemcsid,
+            @PathParam("csid") String csid,
+            byte[] xmlPayload);
+    @PUT
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
+    ClientResponse<String> updateContactForNamedItem(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemspecifier") String itemspecifier,
+            @PathParam("csid") String csid,
+            byte[] xmlPayload);
+    @PUT
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
+    ClientResponse<String> updateContactInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemcsid") String itemcsid,
+            @PathParam("csid") String csid,
+            byte[] xmlPayload);
+    @PUT
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
+    ClientResponse<String> updateContactForNamedItemInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemspecifier") String itemspecifier,
+            @PathParam("csid") String csid,
+            byte[] xmlPayload);
+
+    //(D)elete Contact
+    @DELETE
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
+    ClientResponse<Response> deleteContact(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemcsid") String itemcsid,
+            @PathParam("csid") String csid);
+    
+    @DELETE
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
+    ClientResponse<Response> deleteContactForNamedItem(
+            @PathParam("parentcsid") String parentcsid,
+            @PathParam("itemspecifier") String itemspecifier,
+            @PathParam("csid") String csid);
+    @DELETE
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
+    ClientResponse<Response> deleteContactInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemcsid") String itemcsid,
+            @PathParam("csid") String csid);
+    
+    @DELETE
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
+    ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
+            @PathParam("parentspecifier") String parentspecifier,
+            @PathParam("itemspecifier") String itemspecifier,
+            @PathParam("csid") String csid);
+}
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index c602d4fb8f097e248ecf6eb36115265dff0bd1b0..cb42c3caf51c5d8f33035c867e7a52ed19c629ca 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.dimension</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.dimension</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index c7eb0bb79b5a2ed40b3c6006af13f20db2872afd..ebd0b5f50ffc973481f9d001c0307b1c812ddf25 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.dimension.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.dimension.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index f546b4867b4a42c81957012276faf3f234a0c6c3..c1a8f84a49d4845cb4196884a0393609c324a3c0 100644 (file)
-\r
-<project name="dimension.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        dimension service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy dimension in ${jee.server.nuxeo}">\r
-        <ant antfile="nuxeo-platform-cs-dimension/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy dimension from ${jee.server.nuxeo}">\r
-        <ant antfile="nuxeo-platform-cs-dimension/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for dimension" depends="package">\r
-        <ant antfile="nuxeo-platform-cs-dimension/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-\r
-</project>\r
+
+<project name="dimension.3rdparty" default="package" basedir=".">
+    <description>
+        dimension service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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 dimension in ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-dimension/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy dimension from ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-dimension/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for dimension" depends="package">
+        <ant antfile="nuxeo-platform-cs-dimension/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+
+</project>
index c60c0e4983d91bf6b832d67c080f9e7323c4f0d8..67e2476131cd70034f05b9953c76d6e4c6d5b0eb 100644 (file)
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
-    Dimension schema (XSD)\r
-    \r
-    Entity  : Dimension\r
-    Part    : Common\r
-    Used for: Nuxeo EP core document type\r
-\r
-    $LastChangedRevision: 860 $\r
-    $LastChangedDate: 2009-10-14 14:48:05 -0700 (Wed, 14 Oct 2009) $\r
--->\r
-\r
-<xs:schema \r
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-    xmlns:ns="http://collectionspace.org/dimension/"\r
-    xmlns="http://collectionspace.org/dimension/"\r
-    targetNamespace="http://collectionspace.org/dimension/"\r
-    version="0.1">\r
-    \r
-    <!-- See http://wiki.collectionspace.org/display/collectionspace/Dimension+Schema -->\r
-\r
-    <xs:element name="measuredPart" type="xs:string"/>\r
-    <xs:element name="dimension" type="xs:string"/>\r
-    <xs:element name="measuredBy" type="xs:string"/>\r
-    <xs:element name="measurementUnit" type="xs:string"/>\r
-    <xs:element name="measurementMethod" type="xs:string"/>\r
-    <xs:element name="value" type="xs:decimal"/>\r
-    <xs:element name="valueDate" type="xs:string"/>\r
-    <xs:element name="valueQualifier" type="xs:string"/>\r
-    <xs:element name="dimensionNote" type="xs:string"/>\r
-    \r
-</xs:schema>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Dimension schema (XSD)
+    
+    Entity  : Dimension
+    Part    : Common
+    Used for: Nuxeo EP core document type
+
+    $LastChangedRevision: 860 $
+    $LastChangedDate: 2009-10-14 14:48:05 -0700 (Wed, 14 Oct 2009) $
+-->
+
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/dimension/"
+    xmlns="http://collectionspace.org/dimension/"
+    targetNamespace="http://collectionspace.org/dimension/"
+    version="0.1">
+    
+    <!-- See http://wiki.collectionspace.org/display/collectionspace/Dimension+Schema -->
+
+    <xs:element name="measuredPart" type="xs:string"/>
+    <xs:element name="dimension" type="xs:string"/>
+    <xs:element name="measuredBy" type="xs:string"/>
+    <xs:element name="measurementUnit" type="xs:string"/>
+    <xs:element name="measurementMethod" type="xs:string"/>
+    <xs:element name="value" type="xs:decimal"/>
+    <xs:element name="valueDate" type="xs:string"/>
+    <xs:element name="valueQualifier" type="xs:string"/>
+    <xs:element name="dimensionNote" type="xs:string"/>
+    
+</xs:schema>
index 62e2d9d213eeaf7d66bcbd5279bedae2a9536730..3926d94a9eb04fbd1d6940e630e1c3c1c3f47db9 100644 (file)
@@ -1,23 +1,23 @@
-\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.dimension</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.dimension.3rdparty</artifactId>\r
-    <name>services.dimension.3rdparty</name>\r
-    <packaging>pom</packaging>\r
-    <description>\r
-        3rd party build for dimension service\r
-    </description>\r
-\r
-    <modules>\r
-        <module>nuxeo-platform-cs-dimension</module>\r
-    </modules>\r
-</project>\r
+
+<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.dimension</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.dimension.3rdparty</artifactId>
+    <name>services.dimension.3rdparty</name>
+    <packaging>pom</packaging>
+    <description>
+        3rd party build for dimension service
+    </description>
+
+    <modules>
+        <module>nuxeo-platform-cs-dimension</module>
+    </modules>
+</project>
index 731846a8e3686a42f3632548655b6e7d647cd3c2..4cae2b747cf52fdac00729c5f5429e54f8873d4a 100644 (file)
-\r
-<project name="dimension" default="package" basedir=".">\r
-    <description>\r
-        Dimension service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy dimension service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy dimension service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-    description="distribute dimension service">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="dimension" default="package" basedir=".">
+    <description>
+        Dimension service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 dimension service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy dimension service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+    description="distribute dimension service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index eafd148c21c0b4e61c610fa663c154e92397768b..c044f36e55894867dddbd5af09713325b6764cbe 100644 (file)
@@ -1,86 +1,86 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.dimension</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.dimension.client</artifactId>\r
-    <name>services.dimension.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.dimension.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.IntegrationTests</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        -->\r
-        \r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-dimension-client</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.dimension</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.dimension.client</artifactId>
+    <name>services.dimension.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.dimension.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- 
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.IntegrationTests</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        -->
+        
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-dimension-client</finalName>
+    </build>
+</project>
+
index 3b9aefd983eb4b9b5c3b0a26e0b802d4a5351e89..17f1212918b589af3e2297680fd6f936dc3d6a4b 100644 (file)
@@ -1,42 +1,42 @@
-package org.collectionspace.services.client.test;\r
-\r
-/*\r
- * XMLReplay test classes shoud ***NOT*** be part of the IntegrationTests module.  Move them out into the org.collectionspace.services.client (src/main.test) module ASAP!\r
- */\r
-\r
-/*\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.ServiceResult;\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay;\r
-import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplayTest;\r
-import org.testng.annotations.Test;\r
-\r
-import java.util.List;\r
-*/\r
-\r
-/**\r
- * User: laramie\r
- * $LastChangedRevision:  $\r
- * $LastChangedDate:  $\r
- */\r
-public class DimensionXmlReplayTest /*extends XmlReplayTest*/ { \r
-\r
-       /*\r
-    //@Test\r
-    public void runMaster() throws Exception {\r
-        XmlReplay replay = createXmlReplayUsingIntegrationTestsModule("../../");\r
-        List<List<ServiceResult>> list = replay.runMaster("dimension-master.xml");\r
-        logTestForGroup(list, "runMaster");\r
-    }\r
-\r
-    //@Test\r
-    public void runOneTest() throws Exception {\r
-        XmlReplay replay = createXmlReplayForModule();\r
-        replay.readOptionsFromMasterConfigFile("dimension-master.xml");\r
-        replay.setControlFileName("dimension.xml");\r
-\r
-        ServiceResult res = replay.runTest("dimensionTestGroup", "dimension1");\r
-        logTest(res, "runOneTest");\r
-    }\r
-    */\r
-\r
-}\r
+package org.collectionspace.services.client.test;
+
+/*
+ * XMLReplay test classes shoud ***NOT*** be part of the IntegrationTests module.  Move them out into the org.collectionspace.services.client (src/main.test) module ASAP!
+ */
+
+/*
+import org.collectionspace.services.IntegrationTests.xmlreplay.ServiceResult;
+import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplay;
+import org.collectionspace.services.IntegrationTests.xmlreplay.XmlReplayTest;
+import org.testng.annotations.Test;
+
+import java.util.List;
+*/
+
+/**
+ * User: laramie
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class DimensionXmlReplayTest /*extends XmlReplayTest*/ { 
+
+       /*
+    //@Test
+    public void runMaster() throws Exception {
+        XmlReplay replay = createXmlReplayUsingIntegrationTestsModule("../../");
+        List<List<ServiceResult>> list = replay.runMaster("dimension-master.xml");
+        logTestForGroup(list, "runMaster");
+    }
+
+    //@Test
+    public void runOneTest() throws Exception {
+        XmlReplay replay = createXmlReplayForModule();
+        replay.readOptionsFromMasterConfigFile("dimension-master.xml");
+        replay.setControlFileName("dimension.xml");
+
+        ServiceResult res = replay.runTest("dimensionTestGroup", "dimension1");
+        logTest(res, "runOneTest");
+    }
+    */
+
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index fcca1b534c8a9ca42683b654a49b25d7d2d1535f..a6f160f7f7adac74e9de7ec07067c54a86533290 100644 (file)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplayMaster>\r
-    <protoHostPort>http://localhost:8280</protoHostPort>\r
-    \r
-    <!-- legal values for dumpServiceResult=[minimal,detailed,full] -->\r
-    <dump payloads="false" dumpServiceResult="minimal" />\r
-    \r
-    <auths default="test">\r
-       <auth ID="test">dGVzdDp0ZXN0</auth>\r
-    </auths>\r
-\r
-    \r
-    <!-- run controlFile="./dimension.xml" testGroup="dimensionTestGroup" / -->\r
-    \r
-</xmlReplayMaster>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xmlReplayMaster>
+    <protoHostPort>http://localhost:8280</protoHostPort>
+    
+    <!-- legal values for dumpServiceResult=[minimal,detailed,full] -->
+    <dump payloads="false" dumpServiceResult="minimal" />
+    
+    <auths default="test">
+       <auth ID="test">dGVzdDp0ZXN0</auth>
+    </auths>
+
+    
+    <!-- run controlFile="./dimension.xml" testGroup="dimensionTestGroup" / -->
+    
+</xmlReplayMaster>
+
index 26064e96ba1ac24f8d1afbf4da8d006c67997b22..62f53bd31ab4fbc3c43af68cffdccdc832b34c18 100644 (file)
@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xmlReplay>\r
-    <auths>\r
-        <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->\r
-        <auth ID="test">dGVzdDp0ZXN0</auth>\r
-        <auth ID="bigbird2010">YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=</auth>\r
-    </auths>\r
-    \r
-   <!-- ================================================================================ -->\r
-    \r
-   <testGroup ID="dimensionTestGroup" autoDeletePOSTS="false">\r
-        <!-- should fail on auth="bigbird2010" since bigbird2010 is not defined on back end. -->\r
-        <test ID="dimension1"  auth="bigbird2010">\r
-            <expectedCodes>401,403</expectedCodes>\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <part>\r
-                <label>dimensions_common</label>\r
-                <filename>dimension/1.xml</filename>\r
-            </part>\r
-        </test>\r
-\r
-        <!-- should succeed on auth="test" since test is admin user. -->\r
-        <test ID="dimension2"  auth="test">\r
-            <method>POST</method>\r
-            <uri>/cspace-services/dimensions/</uri>\r
-            <part>\r
-                <label>dimensions_common</label>\r
-                <filename>dimension/1.xml</filename>\r
-            </part>\r
-        </test>\r
-\r
-        \r
-    </testGroup>\r
-</xmlReplay>\r
-        \r
+<?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="test">dGVzdDp0ZXN0</auth>
+        <auth ID="bigbird2010">YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=</auth>
+    </auths>
+    
+   <!-- ================================================================================ -->
+    
+   <testGroup ID="dimensionTestGroup" autoDeletePOSTS="false">
+        <!-- should fail on auth="bigbird2010" since bigbird2010 is not defined on back end. -->
+        <test ID="dimension1"  auth="bigbird2010">
+            <expectedCodes>401,403</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <part>
+                <label>dimensions_common</label>
+                <filename>dimension/1.xml</filename>
+            </part>
+        </test>
+
+        <!-- should succeed on auth="test" since test is admin user. -->
+        <test ID="dimension2"  auth="test">
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <part>
+                <label>dimensions_common</label>
+                <filename>dimension/1.xml</filename>
+            </part>
+        </test>
+
+        
+    </testGroup>
+</xmlReplay>
+        
         
\ No newline at end of file
index 6867ddfaf3b8dc1ae6c0cef25369ed3cd26537bc..205f35b108e9b03ff8d5120a1338c173acae1370 100644 (file)
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:dimensions_common\r
-xmlns:ns2="http://collectionspace.org/services/dimension"\r
-xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-  <dimension>dimensionType-1288727556164</dimension>\r
-  <value>entryNumber-1288727556164</value>\r
-  <valueDate>entryDate-1288727556164</valueDate>\r
-</ns2:dimensions_common>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:dimensions_common
+xmlns:ns2="http://collectionspace.org/services/dimension"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+  <dimension>dimensionType-1288727556164</dimension>
+  <value>entryNumber-1288727556164</value>
+  <valueDate>entryDate-1288727556164</valueDate>
+</ns2:dimensions_common>
+
index 5007b71d1e421016f50b156e1d250ecc5fd8b41d..60b2d8bc26dfe3a03b2fbc483ddd52883fc0f955 100644 (file)
@@ -1,19 +1,19 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services.dimension;\r
-\r
-/**\r
- * @author remillet\r
- *\r
- */\r
-public interface DimensionJAXBSchema {\r
-       final static String DIMENSION = "dimension";\r
-       final static String MEASURED_PART = "measuredPart";\r
-       final static String MEASUREMENT_UNIT = "measurementUnit";\r
-       final static String VALUE = "value";\r
-       final static String VALUE_DATE = "valueDate";\r
-       final static String VALUE_QUALIFIER = "valueQualifier";\r
-}\r
-\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services.dimension;
+
+/**
+ * @author remillet
+ *
+ */
+public interface DimensionJAXBSchema {
+       final static String DIMENSION = "dimension";
+       final static String MEASURED_PART = "measuredPart";
+       final static String MEASUREMENT_UNIT = "measurementUnit";
+       final static String VALUE = "value";
+       final static String VALUE_DATE = "valueDate";
+       final static String VALUE_QUALIFIER = "valueQualifier";
+}
+
+
index c159899c8b3b9e2658e71c0735e9970405a55346..79aad1616700d81011aff96911273ab86740814d 100644 (file)
@@ -1,7 +1,7 @@
-package org.collectionspace.services.dimension;\r
-\r
-public interface DimensionListItemJAXBSchema {\r
-       final static String DIMENSION = "dimension";\r
-       final static String CSID = "csid";\r
-       final static String URI = "url";\r
-}\r
+package org.collectionspace.services.dimension;
+
+public interface DimensionListItemJAXBSchema {
+       final static String DIMENSION = "dimension";
+       final static String CSID = "csid";
+       final static String URI = "url";
+}
index b40bd2e134097ee821918d23d740a71b20491e70..b61fa38cd2784e27ee71f493f915f2795721312e 100644 (file)
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- A comment. -->\r
-<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">\r
-\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.dimension</artifactId>\r
-    <name>services.dimension</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-    \r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A comment. -->
+<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>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.dimension</artifactId>
+    <name>services.dimension</name>
+    <packaging>pom</packaging>
+
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+    </dependencies>
+    
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+    
+</project>
+
index 8a878cb317008d6e55afc15adf594dcc13431f6c..fb23d933fd22a7b46244f7bda749cb3d9037d8d1 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.dimension</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.dimension.service</artifactId>\r
-    <name>services.dimension.service</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <dependencies>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.dimension.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.dimension.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-      <!-- javax -->\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-        \r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-dimension</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.dimension</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.dimension.service</artifactId>
+    <name>services.dimension.service</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.dimension.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.dimension.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+      <!-- javax -->
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+        
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <version>${nuxeo.core.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-dimension</finalName>
+    </build>
+</project>
+
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index dbf1fa394fbbcb36b64884aef05f3085c57376ad..b95b1b5dbe01b01df2a044e902e21c46ebf44cd6 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.group</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.group</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index fd57793827c4be179a963095c696543a87ee2590..8bf2ac7b9e9cd26a395e0449126effee74168383 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.group.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.group.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 3465e8712321bf4eb25f5043be801ae50f44a6ef..55059d4bfe02b667064e397afec8fbca922f48ae 100644 (file)
@@ -1,79 +1,79 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-\r
-<!--\r
- pom.xml\r
\r
- A Maven 2 project file for the 'jaxb' module of the ID Service project.\r
-\r
- This document is a part of the source code and related artifacts\r
- for CollectionSpace, an open source collections management system\r
- for museums and related institutions:\r
\r
- http://www.collectionspace.org\r
- http://wiki.collectionspace.org\r
\r
- Based on work by Sanjay Dalal and Richard Millet.\r
-\r
- $LastChangedBy: aron $\r
- $LastChangedRevision: 302 $\r
- $LastChangedDate: 2009-06-29 15:36:29 -0700 (Mon, 29 Jun 2009) $\r
--->\r
-\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-\r
-  <parent>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.main</artifactId>\r
-    <version>4.2-SNAPSHOT</version>\r
-  </parent>\r
-  \r
-  <modelVersion>4.0.0</modelVersion>\r
-  <artifactId>org.collectionspace.services.hyperjaxb</artifactId>\r
-  <name>services.hyperjaxb</name>\r
-  \r
-  <dependencies>\r
-  <!-- \r
-               <dependency>\r
-                 <groupId>com.sun.xml.bind</groupId>\r
-                 <artifactId>jaxb-impl</artifactId>\r
-               </dependency>    \r
-               <dependency>\r
-                 <groupId>org.jvnet.jaxb2-commons</groupId>\r
-                 <artifactId>property-listener-injector</artifactId>\r
-               </dependency>   \r
-               <dependency>\r
-                       <groupId>org.jvnet.jaxb2_commons</groupId>\r
-                       <artifactId>jaxb2-basics-runtime</artifactId>\r
-               </dependency>\r
-                -->\r
-    <!-- Dependencies for HyperJaxB -->\r
-               <dependency>\r
-                   <groupId>javax.persistence</groupId>\r
-                   <artifactId>persistence-api</artifactId>\r
-               </dependency>\r
-               <dependency>\r
-                   <groupId>org.hibernate</groupId>\r
-                   <artifactId>hibernate-entitymanager</artifactId>\r
-               </dependency>\r
-               <dependency>\r
-                   <groupId>org.jvnet.hyperjaxb3</groupId>\r
-                   <artifactId>hyperjaxb3-ejb-runtime</artifactId>\r
-               </dependency>    \r
-  </dependencies>\r
-  \r
-  <build>\r
-    <finalName>collectionspace-services-hyperjaxb</finalName>\r
-    <defaultGoal>install</defaultGoal>\r
-\r
-    <plugins>\r
-               <plugin>\r
-                   <groupId>org.jvnet.hyperjaxb3</groupId>\r
-                   <artifactId>maven-hyperjaxb3-plugin</artifactId>\r
-               </plugin>\r
-    </plugins>\r
-  </build>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ pom.xml
+ A Maven 2 project file for the 'jaxb' module of the ID Service project.
+
+ This document is a part of the source code and related artifacts
+ for CollectionSpace, an open source collections management system
+ for museums and related institutions:
+ http://www.collectionspace.org
+ http://wiki.collectionspace.org
+ Based on work by Sanjay Dalal and Richard Millet.
+
+ $LastChangedBy: aron $
+ $LastChangedRevision: 302 $
+ $LastChangedDate: 2009-06-29 15:36:29 -0700 (Mon, 29 Jun 2009) $
+-->
+
+<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.main</artifactId>
+    <version>4.2-SNAPSHOT</version>
+  </parent>
+  
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>org.collectionspace.services.hyperjaxb</artifactId>
+  <name>services.hyperjaxb</name>
+  
+  <dependencies>
+  <!-- 
+               <dependency>
+                 <groupId>com.sun.xml.bind</groupId>
+                 <artifactId>jaxb-impl</artifactId>
+               </dependency>    
+               <dependency>
+                 <groupId>org.jvnet.jaxb2-commons</groupId>
+                 <artifactId>property-listener-injector</artifactId>
+               </dependency>   
+               <dependency>
+                       <groupId>org.jvnet.jaxb2_commons</groupId>
+                       <artifactId>jaxb2-basics-runtime</artifactId>
+               </dependency>
+                -->
+    <!-- Dependencies for HyperJaxB -->
+               <dependency>
+                   <groupId>javax.persistence</groupId>
+                   <artifactId>persistence-api</artifactId>
+               </dependency>
+               <dependency>
+                   <groupId>org.hibernate</groupId>
+                   <artifactId>hibernate-entitymanager</artifactId>
+               </dependency>
+               <dependency>
+                   <groupId>org.jvnet.hyperjaxb3</groupId>
+                   <artifactId>hyperjaxb3-ejb-runtime</artifactId>
+               </dependency>    
+  </dependencies>
+  
+  <build>
+    <finalName>collectionspace-services-hyperjaxb</finalName>
+    <defaultGoal>install</defaultGoal>
+
+    <plugins>
+               <plugin>
+                   <groupId>org.jvnet.hyperjaxb3</groupId>
+                   <artifactId>maven-hyperjaxb3-plugin</artifactId>
+               </plugin>
+    </plugins>
+  </build>
+
+</project>
+
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index b8cd682eabde130c425482fd052a7ebd7167c64a..bff7eeff766f89059cab200295eef4621e7ac0f4 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.id</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.id</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 2b6bb65c8235e13906a56ec02004e581ed7a72c3..4d6dcbf5019568d04020c56ae53e44b110dea88f 100644 (file)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 1837be17fbcf10a54253510c0791a8ba37255630..dae8cf04f379fb8a8dcb85e6b3cae01661514d40 100644 (file)
-\r
-<project name="id" default="package" basedir=".">\r
-    <description>\r
-        id service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="service/src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="create_nuxeo_db"\r
-    description="create tables(s), indices for id service">\r
-        <ant antfile="service/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy id service">\r
-        <ant antfile="service/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy id service">\r
-        <ant antfile="service/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-    description="generate distribution for id service}">\r
-        <ant antfile="service/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist_installer"\r
-       description="generate distribution for id" depends="package">        \r
-        <!-- copy install scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.installer.services}/id">\r
-            <fileset dir="${basedir}/installer/"/>\r
-        </copy>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="id" default="package" basedir=".">
+    <description>
+        id service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="service/src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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="create_nuxeo_db"
+    description="create tables(s), indices for id service">
+        <ant antfile="service/build.xml" target="create_nuxeo_db" inheritAll="false"/>
+    </target>
+
+    <target name="deploy" depends="install"
+    description="deploy id service">
+        <ant antfile="service/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy id service">
+        <ant antfile="service/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+    description="generate distribution for id service}">
+        <ant antfile="service/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+    <target name="dist_installer"
+       description="generate distribution for id" depends="package">        
+        <!-- copy install scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.installer.services}/id">
+            <fileset dir="${basedir}/installer/"/>
+        </copy>
+    </target>
+
+</project>
index 557f8a4e07f9616882b7ea73418b64a2bb068cb6..4c4656ce5a8ebc5ffac88c74779a6b613ea97c9c 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
-       <classpathentry kind="src" output="target/classes" path="target/generated-sources/xjc"/>\r
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
-       <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+       <classpathentry kind="src" output="target/classes" path="target/generated-sources/xjc"/>
+       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+       <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 0ffebd6f0178c9bdbb108df32e7dbeb37ea5303b..7804fcf9b7531698ef0ca05755244f9299650f02 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.imports</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.imports</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 7e106358fb775ed730b262f5beafc3270f248db6..a2f5cb49f4fd83234904f93b15e9bd6c76085566 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.imports.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.imports.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 3185c7c037e9265542827900806ebe2020b1f495..524a8f74495645b0cba3062928057b5620a3b497 100644 (file)
@@ -1,22 +1,22 @@
-Manifest-Version: 1.0 \r
-Bundle-ManifestVersion: 1 \r
-Bundle-Name: NuxeoCS\r
-Bundle-SymbolicName: org.collectionspace.imports;singleton:=true \r
-Bundle-Version: 1.0.0\r
-Bundle-Localization: plugin\r
-Bundle-Vendor: Nuxeo \r
-Require-Bundle: org.nuxeo.runtime, \r
- org.nuxeo.ecm.core.api, \r
- org.nuxeo.ecm.core,\r
- org.nuxeo.ecm.core.api,\r
- org.nuxeo.ecm.platform.types.api,\r
- org.nuxeo.ecm.platform.versioning.api,\r
- org.nuxeo.ecm.platform.ui,\r
- org.nuxeo.ecm.platform.forms.layout.client,\r
- org.nuxeo.ecm.platform.ws,\r
- org.collectionspace.collectionspace_core\r
-Provide-Package: org.collectionspace.imports\r
-Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
- OSGI-INF/ecm-types-contrib.xml,\r
- OSGI-INF/layouts-contrib.xml\r
-\r
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: NuxeoCS
+Bundle-SymbolicName: org.collectionspace.imports;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.imports
+Nuxeo-Component: OSGI-INF/core-types-contrib.xml,
+ OSGI-INF/ecm-types-contrib.xml,
+ OSGI-INF/layouts-contrib.xml
+
index c6299df02fa5185daccc8da16dd45307c6f56903..7ff0f5ae3b395cb52149a94d7b362fc59b8bc2a3 100644 (file)
@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<xs:schema \r
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-    xmlns:ns="http://collectionspace.org/imports/"\r
-    xmlns="http://collectionspace.org/imports/"\r
-    targetNamespace="http://collectionspace.org/imports/"\r
-    version="0.1">\r
-\r
-    <xs:element name="importsField" type="xs:string"/>\r
-    <xs:element name="params">\r
-        <xs:complexType>\r
-            <xs:sequence>\r
-                <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
-            </xs:sequence>\r
-        </xs:complexType>\r
-    </xs:element>   \r
-</xs:schema>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/imports/"
+    xmlns="http://collectionspace.org/imports/"
+    targetNamespace="http://collectionspace.org/imports/"
+    version="0.1">
+
+    <xs:element name="importsField" type="xs:string"/>
+    <xs:element name="params">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>   
+</xs:schema>
index 32d6dc5c3e3d57af47fa05e47e5b566c9c829b6f..2d943836dc990ac150b78651a53351a432dbae48 100644 (file)
-package org.collectionspace.services.imports.nuxeo;\r
-\r
-import java.io.File;\r
-import java.util.Calendar;\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-import java.util.TreeSet;\r
-\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.nuxeo.client.java.NuxeoClientEmbedded;\r
-import org.collectionspace.services.nuxeo.client.java.NuxeoConnectorEmbedded;\r
-import org.collectionspace.services.nuxeo.client.java.RepositoryInstanceInterface;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import org.nuxeo.ecm.core.api.DocumentRef;\r
-import org.nuxeo.ecm.core.api.repository.RepositoryInstance;\r
-import org.nuxeo.ecm.core.io.DocumentPipe;\r
-import org.nuxeo.ecm.core.io.DocumentReader;\r
-import org.nuxeo.ecm.core.io.DocumentTranslationMap;\r
-import org.nuxeo.ecm.core.io.DocumentWriter;\r
-import org.nuxeo.ecm.core.io.impl.DocumentPipeImpl;\r
-import org.nuxeo.ecm.core.io.impl.plugins.DocumentModelWriter;\r
-// we use our own override of this: import org.nuxeo.ecm.core.io.impl.plugins.XMLDirectoryReader;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-// based loosely on package org.nuxeo.ecm.shell.commands.io.ImportCommand;\r
-public class ImportCommand {\r
-\r
-    private final Logger logger = LoggerFactory.getLogger(ImportCommand.class);\r
-\r
-    public String run(String src, String repoName, String workspacesPath, int timeOut) throws Exception {\r
-        File file = new File(src);\r
-        ///cspace way of configuring client and auth:\r
-        NuxeoClientEmbedded client = NuxeoConnectorEmbedded.getInstance().getClient();\r
-        RepositoryInstanceInterface repoSession = null;\r
-        try {\r
-            repoSession = client.openRepository(repoName, timeOut);\r
-            if (logger.isDebugEnabled()) {\r
-                String msg = String.format("Start of import is Local time: %tT", Calendar.getInstance());\r
-                logger.debug(msg);\r
-            }\r
-            return importTree(repoSession, file, workspacesPath);\r
-        } catch (Exception e) {\r
-            throw e;\r
-        } finally {\r
-            if (logger.isDebugEnabled()) {\r
-                String msg = String.format("End of import is Local time: %tT", Calendar.getInstance());\r
-                logger.debug(msg);\r
-            }\r
-            client.releaseRepository(repoSession);\r
-        }\r
-    }\r
-\r
-    String importTree(RepositoryInstanceInterface repoSession, File file, String toPath) throws Exception {\r
-        Exception failed = null;\r
-        DocumentReader reader = null;\r
-        DocumentWriter writer = null;\r
-        DocumentModel docModel = null;\r
-        DocumentRef keyDocRef, valueDocRef;\r
-        String docType;\r
-        StringBuffer dump = new StringBuffer();\r
-        Map<String, Integer> recordsImportedForDocType = new HashMap<String, Integer>();\r
-        Integer numRecordsImportedForDocType = new Integer(0);\r
-        int totalRecordsImported = 0;\r
-        try {\r
-            if (logger.isInfoEnabled()) {\r
-                logger.info("importTree reading file: " + file + (file != null ? " exists? " + file.exists() : " file param is null"));\r
-            }\r
-            reader = new LoggedXMLDirectoryReader(file);  //our overload of XMLDirectoryReader.\r
-            writer = new DocumentModelWriter(repoSession.getRepositoryInstance(), toPath, 10);\r
-            DocumentPipe pipe = new DocumentPipeImpl(10);\r
-            // pipe.addTransformer(transformer);\r
-            pipe.setReader(reader);\r
-            pipe.setWriter(writer);\r
-            DocumentTranslationMap dtm = pipe.run();\r
-            Map<DocumentRef, DocumentRef> documentRefs = dtm.getDocRefMap(); // FIXME: Should be checking for null here!\r
-            dump.append("<importedRecords>");\r
-            for (Map.Entry entry : documentRefs.entrySet()) {\r
-                keyDocRef = (DocumentRef) entry.getKey();\r
-                valueDocRef = (DocumentRef) entry.getValue();\r
-                if (keyDocRef == null || valueDocRef == null) {\r
-                    continue;\r
-                }\r
-                dump.append("<importedRecord>");\r
-                docModel = repoSession.getDocument(valueDocRef);\r
-                docType = docModel.getDocumentType().getName();\r
-                dump.append("<doctype>" + docType + "</doctype>");\r
-                dump.append("<csid>" + keyDocRef.toString() + "</csid>");\r
-                dump.append("</importedRecord>");\r
-                if (recordsImportedForDocType.containsKey(docType)) {\r
-                    numRecordsImportedForDocType = (Integer) recordsImportedForDocType.get(docType);\r
-                    numRecordsImportedForDocType = Integer.valueOf(numRecordsImportedForDocType.intValue() + 1);\r
-                    recordsImportedForDocType.put(docType, numRecordsImportedForDocType);\r
-                } else {\r
-                    recordsImportedForDocType.put(docType, 1);\r
-                }\r
-                totalRecordsImported++;\r
-            }\r
-            dump.append("</importedRecords>");\r
-        } catch (Exception e) {\r
-            failed = e;\r
-            throw failed;\r
-        } finally {\r
-            String status = failed == null ? "Success" : "Failed";\r
-            dump.append("<status>" + status + "</status>");\r
-            dump.append("<totalRecordsImported>" + totalRecordsImported + "</totalRecordsImported>");\r
-            dump.append("<numRecordsImportedByDocType>");\r
-            TreeSet<String> keys = new TreeSet<String>(recordsImportedForDocType.keySet());\r
-            for (String key : keys) {\r
-                dump.append("<numRecordsImported>");\r
-                dump.append("<docType>" + key + "</docType>");\r
-                dump.append("<numRecords>" + recordsImportedForDocType.get(key).intValue() + "</numRecords>");\r
-                dump.append("</numRecordsImported>");\r
-            }\r
-            dump.append("</numRecordsImportedByDocType>");\r
-            if (reader != null) {\r
-                dump.append("<report>" + (((LoggedXMLDirectoryReader) reader).report()) + "</report>");\r
-                reader.close();\r
-            }\r
-            if (writer != null) {\r
-                writer.close();\r
-            }\r
-\r
-            if (failed != null) {\r
-                String msg = "The Import service encountered an exception: " + failed.getLocalizedMessage();\r
-                logger.error(msg, failed);\r
-            }\r
-        }\r
-        return dump.toString();\r
-    }\r
+package org.collectionspace.services.imports.nuxeo;
+
+import java.io.File;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeSet;
+
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.nuxeo.client.java.NuxeoClientEmbedded;
+import org.collectionspace.services.nuxeo.client.java.NuxeoConnectorEmbedded;
+import org.collectionspace.services.nuxeo.client.java.RepositoryInstanceInterface;
+import org.nuxeo.ecm.core.api.DocumentModel;
+import org.nuxeo.ecm.core.api.DocumentRef;
+import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
+import org.nuxeo.ecm.core.io.DocumentPipe;
+import org.nuxeo.ecm.core.io.DocumentReader;
+import org.nuxeo.ecm.core.io.DocumentTranslationMap;
+import org.nuxeo.ecm.core.io.DocumentWriter;
+import org.nuxeo.ecm.core.io.impl.DocumentPipeImpl;
+import org.nuxeo.ecm.core.io.impl.plugins.DocumentModelWriter;
+// we use our own override of this: import org.nuxeo.ecm.core.io.impl.plugins.XMLDirectoryReader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// based loosely on package org.nuxeo.ecm.shell.commands.io.ImportCommand;
+public class ImportCommand {
+
+    private final Logger logger = LoggerFactory.getLogger(ImportCommand.class);
+
+    public String run(String src, String repoName, String workspacesPath, int timeOut) throws Exception {
+        File file = new File(src);
+        ///cspace way of configuring client and auth:
+        NuxeoClientEmbedded client = NuxeoConnectorEmbedded.getInstance().getClient();
+        RepositoryInstanceInterface repoSession = null;
+        try {
+            repoSession = client.openRepository(repoName, timeOut);
+            if (logger.isDebugEnabled()) {
+                String msg = String.format("Start of import is Local time: %tT", Calendar.getInstance());
+                logger.debug(msg);
+            }
+            return importTree(repoSession, file, workspacesPath);
+        } catch (Exception e) {
+            throw e;
+        } finally {
+            if (logger.isDebugEnabled()) {
+                String msg = String.format("End of import is Local time: %tT", Calendar.getInstance());
+                logger.debug(msg);
+            }
+            client.releaseRepository(repoSession);
+        }
+    }
+
+    String importTree(RepositoryInstanceInterface repoSession, File file, String toPath) throws Exception {
+        Exception failed = null;
+        DocumentReader reader = null;
+        DocumentWriter writer = null;
+        DocumentModel docModel = null;
+        DocumentRef keyDocRef, valueDocRef;
+        String docType;
+        StringBuffer dump = new StringBuffer();
+        Map<String, Integer> recordsImportedForDocType = new HashMap<String, Integer>();
+        Integer numRecordsImportedForDocType = new Integer(0);
+        int totalRecordsImported = 0;
+        try {
+            if (logger.isInfoEnabled()) {
+                logger.info("importTree reading file: " + file + (file != null ? " exists? " + file.exists() : " file param is null"));
+            }
+            reader = new LoggedXMLDirectoryReader(file);  //our overload of XMLDirectoryReader.
+            writer = new DocumentModelWriter(repoSession.getRepositoryInstance(), toPath, 10);
+            DocumentPipe pipe = new DocumentPipeImpl(10);
+            // pipe.addTransformer(transformer);
+            pipe.setReader(reader);
+            pipe.setWriter(writer);
+            DocumentTranslationMap dtm = pipe.run();
+            Map<DocumentRef, DocumentRef> documentRefs = dtm.getDocRefMap(); // FIXME: Should be checking for null here!
+            dump.append("<importedRecords>");
+            for (Map.Entry entry : documentRefs.entrySet()) {
+                keyDocRef = (DocumentRef) entry.getKey();
+                valueDocRef = (DocumentRef) entry.getValue();
+                if (keyDocRef == null || valueDocRef == null) {
+                    continue;
+                }
+                dump.append("<importedRecord>");
+                docModel = repoSession.getDocument(valueDocRef);
+                docType = docModel.getDocumentType().getName();
+                dump.append("<doctype>" + docType + "</doctype>");
+                dump.append("<csid>" + keyDocRef.toString() + "</csid>");
+                dump.append("</importedRecord>");
+                if (recordsImportedForDocType.containsKey(docType)) {
+                    numRecordsImportedForDocType = (Integer) recordsImportedForDocType.get(docType);
+                    numRecordsImportedForDocType = Integer.valueOf(numRecordsImportedForDocType.intValue() + 1);
+                    recordsImportedForDocType.put(docType, numRecordsImportedForDocType);
+                } else {
+                    recordsImportedForDocType.put(docType, 1);
+                }
+                totalRecordsImported++;
+            }
+            dump.append("</importedRecords>");
+        } catch (Exception e) {
+            failed = e;
+            throw failed;
+        } finally {
+            String status = failed == null ? "Success" : "Failed";
+            dump.append("<status>" + status + "</status>");
+            dump.append("<totalRecordsImported>" + totalRecordsImported + "</totalRecordsImported>");
+            dump.append("<numRecordsImportedByDocType>");
+            TreeSet<String> keys = new TreeSet<String>(recordsImportedForDocType.keySet());
+            for (String key : keys) {
+                dump.append("<numRecordsImported>");
+                dump.append("<docType>" + key + "</docType>");
+                dump.append("<numRecords>" + recordsImportedForDocType.get(key).intValue() + "</numRecords>");
+                dump.append("</numRecordsImported>");
+            }
+            dump.append("</numRecordsImportedByDocType>");
+            if (reader != null) {
+                dump.append("<report>" + (((LoggedXMLDirectoryReader) reader).report()) + "</report>");
+                reader.close();
+            }
+            if (writer != null) {
+                writer.close();
+            }
+
+            if (failed != null) {
+                String msg = "The Import service encountered an exception: " + failed.getLocalizedMessage();
+                logger.error(msg, failed);
+            }
+        }
+        return dump.toString();
+    }
 }
\ No newline at end of file
index 5c64196817513be0823bc1df73eeeb41f1f367bb..6aeb2622463014078b7f19f208541c2e5293fabf 100644 (file)
@@ -1,49 +1,49 @@
-<document repository="default" id="${docID}">\r
-  <system>\r
-    <type>${ServiceType}</type>\r
-    <path>${ServiceName}/${docID}</path>\r
-    <lifecycle-state>project</lifecycle-state>\r
-    <lifecycle-policy>default</lifecycle-policy>\r
-    <access-control>\r
-      <acl name="inherited">\r
-        <entry principal="Administrator" permission="Everything" grant="true"/>\r
-        <entry principal="members" permission="Read" grant="true"/>\r
-      </acl>\r
-    </access-control>\r
-  </system>\r
-  <schema xmlns:dc="http://www.nuxeo.org/ecm/schemas/dublincore/" name="dublincore">\r
-    <dc:creator>Administrator</dc:creator>\r
-    <dc:contributors>\r
-      <item>Administrator</item>\r
-    </dc:contributors>\r
-    <dc:source/>\r
-    <dc:created>2011-03-05T00:06:17Z</dc:created>\r
-    <dc:description/>\r
-    <dc:rights/>\r
-    <dc:subjects/>\r
-    <dc:valid/>\r
-    <dc:format/>\r
-    <dc:issued/>\r
-    <dc:modified>2011-03-05T00:06:17Z</dc:modified>\r
-    <dc:language/>\r
-    <dc:expired/>\r
-    <dc:coverage/>\r
-    <dc:title/>\r
-  </schema>\r
-  <schema xmlns="http://www.nuxeo.org/ecm/schemas/common/" name="common">\r
-    <icon/>\r
-    <icon-expanded/>\r
-    <size/>\r
-  </schema>\r
-  <schema xmlns:collectionspace_core="http://collectionspace.org/collectionspace_core/" name="collectionspace_core">\r
-    <collectionspace_core:createdAt>${createdAt}</collectionspace_core:createdAt>\r
-    <collectionspace_core:createdBy>${createdBy}</collectionspace_core:createdBy>\r
-    <collectionspace_core:updatedAt>${updatedAt}</collectionspace_core:updatedAt>\r
-    <collectionspace_core:updatedBy>${updatedBy}</collectionspace_core:updatedBy>\r
-    <collectionspace_core:tenantId>${tenantID}</collectionspace_core:tenantId>\r
-    <collectionspace_core:uri>${uri}</collectionspace_core:uri>\r
-    <collectionspace_core:refName>${refName}</collectionspace_core:refName>\r
-  </schema>\r
-  ${Schema}\r
-</document>\r
-\r
+<document repository="default" id="${docID}">
+  <system>
+    <type>${ServiceType}</type>
+    <path>${ServiceName}/${docID}</path>
+    <lifecycle-state>project</lifecycle-state>
+    <lifecycle-policy>default</lifecycle-policy>
+    <access-control>
+      <acl name="inherited">
+        <entry principal="Administrator" permission="Everything" grant="true"/>
+        <entry principal="members" permission="Read" grant="true"/>
+      </acl>
+    </access-control>
+  </system>
+  <schema xmlns:dc="http://www.nuxeo.org/ecm/schemas/dublincore/" name="dublincore">
+    <dc:creator>Administrator</dc:creator>
+    <dc:contributors>
+      <item>Administrator</item>
+    </dc:contributors>
+    <dc:source/>
+    <dc:created>2011-03-05T00:06:17Z</dc:created>
+    <dc:description/>
+    <dc:rights/>
+    <dc:subjects/>
+    <dc:valid/>
+    <dc:format/>
+    <dc:issued/>
+    <dc:modified>2011-03-05T00:06:17Z</dc:modified>
+    <dc:language/>
+    <dc:expired/>
+    <dc:coverage/>
+    <dc:title/>
+  </schema>
+  <schema xmlns="http://www.nuxeo.org/ecm/schemas/common/" name="common">
+    <icon/>
+    <icon-expanded/>
+    <size/>
+  </schema>
+  <schema xmlns:collectionspace_core="http://collectionspace.org/collectionspace_core/" name="collectionspace_core">
+    <collectionspace_core:createdAt>${createdAt}</collectionspace_core:createdAt>
+    <collectionspace_core:createdBy>${createdBy}</collectionspace_core:createdBy>
+    <collectionspace_core:updatedAt>${updatedAt}</collectionspace_core:updatedAt>
+    <collectionspace_core:updatedBy>${updatedBy}</collectionspace_core:updatedBy>
+    <collectionspace_core:tenantId>${tenantID}</collectionspace_core:tenantId>
+    <collectionspace_core:uri>${uri}</collectionspace_core:uri>
+    <collectionspace_core:refName>${refName}</collectionspace_core:refName>
+  </schema>
+  ${Schema}
+</document>
+
index 800e073e80484f99a1d54040fdef525cc4327f3e..c15587e923add15ba1c5aa4105a0e58e99442b42 100644 (file)
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<imports>\r
-    <import seq="1" service="Personauthorities" type="Personauthority">\r
-        <schema xmlns:personauthorities_common="http://collectionspace.org/services/person" name="personauthorities_common">\r
-            <personauthorities_common:displayName>Perf Test Person Auth ${docID}</personauthorities_common:displayName>\r
-            <personauthorities_common:shortIdentifier>perfTestPersons-${docID}</personauthorities_common:shortIdentifier>\r
-            <personauthorities_common:vocabType>PersonAuthority</personauthorities_common:vocabType>\r
-            <personauthorities_common:refName>urn:cspace:collectionspace.org:Personauthorities(perfTestPersons)'Perf Test Person Auth'</personauthorities_common:refName>\r
-        </schema>\r
-    </import>\r
-    <import seq="2" service="Personauthorities" type="Personauthority" CSID="11111111-2222-3333-4444-123456789012">\r
-        <schema xmlns:personauthorities_common="http://collectionspace.org/services/person" name="personauthorities_common">\r
-            <personauthorities_common:displayName>Perf Test Person Auth ${docID}</personauthorities_common:displayName>\r
-            <personauthorities_common:shortIdentifier>perfTestPersons-${docID}</personauthorities_common:shortIdentifier>\r
-            <personauthorities_common:vocabType>PersonAuthority</personauthorities_common:vocabType>\r
-            <personauthorities_common:refName>urn:cspace:collectionspace.org:Personauthorities(perfTestPersons)'Perf Test Person Auth'</personauthorities_common:refName>\r
-        </schema>\r
-    </import>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<imports>
+    <import seq="1" service="Personauthorities" type="Personauthority">
+        <schema xmlns:personauthorities_common="http://collectionspace.org/services/person" name="personauthorities_common">
+            <personauthorities_common:displayName>Perf Test Person Auth ${docID}</personauthorities_common:displayName>
+            <personauthorities_common:shortIdentifier>perfTestPersons-${docID}</personauthorities_common:shortIdentifier>
+            <personauthorities_common:vocabType>PersonAuthority</personauthorities_common:vocabType>
+            <personauthorities_common:refName>urn:cspace:collectionspace.org:Personauthorities(perfTestPersons)'Perf Test Person Auth'</personauthorities_common:refName>
+        </schema>
+    </import>
+    <import seq="2" service="Personauthorities" type="Personauthority" CSID="11111111-2222-3333-4444-123456789012">
+        <schema xmlns:personauthorities_common="http://collectionspace.org/services/person" name="personauthorities_common">
+            <personauthorities_common:displayName>Perf Test Person Auth ${docID}</personauthorities_common:displayName>
+            <personauthorities_common:shortIdentifier>perfTestPersons-${docID}</personauthorities_common:shortIdentifier>
+            <personauthorities_common:vocabType>PersonAuthority</personauthorities_common:vocabType>
+            <personauthorities_common:refName>urn:cspace:collectionspace.org:Personauthorities(perfTestPersons)'Perf Test Person Auth'</personauthorities_common:refName>
+        </schema>
+    </import>
 </imports>
\ No newline at end of file
index f336e91ac63794a88025a61c84acf51d5c0465db..1d229a32de0fac0e372165dfedfe0b908471dc91 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<imports>\r
-    <import seq="1" service="CollectionObjects" type="CollectionObject">\r
-         <schema xmlns:collectionobjects_common="http://collectionspace.org/collectionobject/" name="collectionobjects_common">\r
-            <collectionobjects_common:assocCulturalContextGroupList/>\r
-            <collectionobjects_common:assocCulturalContextGroupList/>\r
-            <collectionobjects_common:assocObjectGroupList/>\r
-            <collectionobjects_common:assocEventNameType></collectionobjects_common:assocEventNameType>\r
-            <collectionobjects_common:ownershipCategory>public</collectionobjects_common:ownershipCategory>\r
-            <collectionobjects_common:objectProductionReasons/>\r
-            <textualInscriptionGroupList>\r
-                <textualInscriptionGroup>\r
-                    <collectionobjects_common:inscriptionContentScript>gothic-script</collectionobjects_common:inscriptionContentScript>\r
-                    <collectionobjects_common:inscriptionContentInscriber>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(screenmagicinc.)'Screen+Magic+Inc.'</collectionobjects_common:inscriptionContentInscriber>\r
-                    <collectionobjects_common:inscriptionContentTranslation>No, it's true, I'm not a baguette</collectionobjects_common:inscriptionContentTranslation>\r
-                    <collectionobjects_common:inscriptionContentType>label</collectionobjects_common:inscriptionContentType>\r
-                    <collectionobjects_common:inscriptionContentTransliteration>I'm a vegetarian</collectionobjects_common:inscriptionContentTransliteration>\r
-                    <collectionobjects_common:inscriptionContentDate></collectionobjects_common:inscriptionContentDate>\r
-                    <collectionobjects_common:inscriptionContent>Non, c'est vrai! Je ne suis pas une baguette</collectionobjects_common:inscriptionContent>\r
-                    <inscriptionContentInterpretation>It could mean a lot of things, but oddly no connection to ogres</inscriptionContentInterpretation>\r
-                    <collectionobjects_common:inscriptionContentLanguage>arabic</collectionobjects_common:inscriptionContentLanguage>\r
-                    <collectionobjects_common:inscriptionContentPosition>base</collectionobjects_common:inscriptionContentPosition>\r
-                    <collectionobjects_common:inscriptionContentMethod></collectionobjects_common:inscriptionContentMethod>\r
-               </textualInscriptionGroup>\r
-            </textualInscriptionGroupList>\r
-            <nonTextualInscriptionGroupList>\r
-                <nonTextualInscriptionGroup>\r
-                    <collectionobjects_common:inscriptionDescriptionDate></collectionobjects_common:inscriptionDescriptionDate>\r
-                    <collectionobjects_common:inscriptionDescriptionType>decoration</collectionobjects_common:inscriptionDescriptionType>\r
-                    <collectionobjects_common:inscriptionDescriptionPosition>bottom</collectionobjects_common:inscriptionDescriptionPosition>\r
-                    <collectionobjects_common:inscriptionDescriptionInscriber>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(reginabadet)'Regina+Badet'</collectionobjects_common:inscriptionDescriptionInscriber>\r
-                    <inscriptionDescriptionMethod></inscriptionDescriptionMethod>\r
-                    <inscriptionDescriptionInterpretation>No Idea</inscriptionDescriptionInterpretation>\r
-                    <inscriptionDescription>Big symbol at the base</inscriptionDescription>\r
-                </nonTextualInscriptionGroup>\r
-            </nonTextualInscriptionGroupList>\r
-            <collectionobjects_common:fieldCollectionNote></collectionobjects_common:fieldCollectionNote>\r
-            <collectionobjects_common:contentObjectGroupList>\r
-              <contentObjectGroup>\r
-                <contentObjectType></contentObjectType>\r
-                <contentObject>The Ogres hand</contentObject>\r
-              </contentObjectGroup>\r
-            </collectionobjects_common:contentObjectGroupList>\r
-            <collectionobjects_common:assocEventPersons>\r
-              <assocEventPerson>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(maryannecasseta)'Mary+Anne+Cassata'</assocEventPerson>\r
-            </collectionobjects_common:assocEventPersons>\r
-            <collectionobjects_common:dateEarliestSingleQualifier/>\r
-            <collectionobjects_common:technicalAttributeGroupList>\r
-              <technicalAttributeGroup>\r
-                <technicalAttributeMeasurement>78</technicalAttributeMeasurement>\r
-                <technicalAttribute>record-speed</technicalAttribute>\r
-                <technicalAttributeMeasurementUnit>rpm</technicalAttributeMeasurementUnit>\r
-              </technicalAttributeGroup>\r
-            </collectionobjects_common:technicalAttributeGroupList>\r
-            <collectionobjects_common:dateText/>\r
-            <collectionobjects_common:ownershipDates></collectionobjects_common:ownershipDates>\r
-            <collectionobjects_common:dimensionSummary/>\r
-            <collectionobjects_common:objectProductionOrganizationGroupList>\r
-              <objectProductionOrganizationGroup>\r
-                <objectProductionOrganizationRole></objectProductionOrganizationRole>\r
-                <objectProductionOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(boardwalkrecords)'Boardwalk+Records'</objectProductionOrganization>\r
-              </objectProductionOrganizationGroup>\r
-            </collectionobjects_common:objectProductionOrganizationGroupList>\r
-            <collectionobjects_common:objectComponentGroupList>\r
-              <objectComponentGroup>\r
-                <objectComponentInformation></objectComponentInformation>\r
-                <objectComponentName>sleeve</objectComponentName>\r
-              </objectComponentGroup>\r
-            </collectionobjects_common:objectComponentGroupList>\r
-            <collectionobjects_common:ownershipPlace></collectionobjects_common:ownershipPlace>\r
-            <collectionobjects_common:fieldCollectionDate></collectionobjects_common:fieldCollectionDate>\r
-            <collectionobjects_common:contentActivities>\r
-              <contentActivity></contentActivity>\r
-            </collectionobjects_common:contentActivities>\r
-            <collectionobjects_common:contentPlaces>\r
-              <contentPlace></contentPlace>\r
-            </collectionobjects_common:contentPlaces>\r
-            <collectionobjects_common:dateEarliestSingleCertainty/>\r
-            <collectionobjects_common:objectProductionDateGroupList/>\r
-            <collectionobjects_common:contentConcepts>\r
-              <contentConcept></contentConcept>\r
-            </collectionobjects_common:contentConcepts>\r
-            <collectionobjects_common:numberOfObjects>1</collectionobjects_common:numberOfObjects>\r
-            <collectionobjects_common:ownershipExchangePriceCurrency>poundsterling</collectionobjects_common:ownershipExchangePriceCurrency>\r
-            <collectionobjects_common:contentOtherGroupList>\r
-              <contentOtherGroup>\r
-                <contentOther></contentOther>\r
-                <contentOtherType></contentOtherType>\r
-              </contentOtherGroup>\r
-            </collectionobjects_common:contentOtherGroupList>\r
-            <collectionobjects_common:editionNumber>123-bg-192</collectionobjects_common:editionNumber>\r
-            <collectionobjects_common:dimensionMeasuredPart/>\r
-            <collectionobjects_common:styles>\r
-              <style></style>\r
-            </collectionobjects_common:styles>\r
-            <collectionobjects_common:briefDescriptions>\r
-              <briefDescription>A petrified Ogre found in the woods of Neverland</briefDescription>\r
-              <briefDescription>Or it could be a petrified tree looking slightly like an ogre</briefDescription>\r
-              <briefDescription>Or just a rock, looking a lot like a petrified tree</briefDescription>\r
-            </collectionobjects_common:briefDescriptions>\r
-            <collectionobjects_common:colors>\r
-              <color></color>\r
-            </collectionobjects_common:colors>\r
-            <collectionobjects_common:fieldCollectors>\r
-              <fieldCollector></fieldCollector>\r
-            </collectionobjects_common:fieldCollectors>\r
-            <collectionobjects_common:ownersPersonalExperience>These object records are tedious to fill out</collectionobjects_common:ownersPersonalExperience>\r
-            <collectionobjects_common:contentDescription>Content of a piece of rock?! .. well there might be diamonds and petrified fish in it</collectionobjects_common:contentDescription>\r
-            <collectionobjects_common:objectProductionPeopleGroupList>\r
-              <objectProductionPeopleGroup>\r
-                <objectProductionPeople></objectProductionPeople>\r
-                <objectProductionPeopleRole></objectProductionPeopleRole>\r
-              </objectProductionPeopleGroup>\r
-            </collectionobjects_common:objectProductionPeopleGroupList>\r
-            <collectionobjects_common:objectProductionPlaceGroupList>\r
-              <objectProductionPlaceGroup>\r
-                <objectProductionPlace></objectProductionPlace>\r
-                <objectProductionPlaceRole></objectProductionPlaceRole>\r
-              </objectProductionPlaceGroup>\r
-            </collectionobjects_common:objectProductionPlaceGroupList>\r
-            <collectionobjects_common:contentDateGroup/>\r
-            <collectionobjects_common:assocPlaceGroupList/>\r
-            <collectionobjects_common:physicalDescription>It's pretty big - the size of an ogre.. Three arms and a hump-back</collectionobjects_common:physicalDescription>\r
-            <collectionobjects_common:dimensionValue/>\r
-            <collectionobjects_common:fieldCollectionNumber></collectionobjects_common:fieldCollectionNumber>\r
-            <collectionobjects_common:ageUnit>years</collectionobjects_common:ageUnit>\r
-            <collectionobjects_common:dimension/>\r
-            <collectionobjects_common:dateLatestQualifier/>\r
-            <collectionobjects_common:contentEventNameGroupList>\r
-              <contentEventNameGroup>\r
-                <contentEventNameType></contentEventNameType>\r
-                <contentEventName></contentEventName>\r
-              </contentEventNameGroup>\r
-            </collectionobjects_common:contentEventNameGroupList>\r
-            <collectionobjects_common:contentNote>pst., it's not a real ogre</collectionobjects_common:contentNote>\r
-            <collectionobjects_common:forms>\r
-              <form></form>\r
-            </collectionobjects_common:forms>\r
-            <collectionobjects_common:assocPeopleGroupList/>\r
-            <collectionobjects_common:dateEarliestSingle/>\r
-            <collectionobjects_common:ownershipExchangeNote>none</collectionobjects_common:ownershipExchangeNote>\r
-            <collectionobjects_common:dateLatest/>\r
-            <collectionobjects_common:assocEventOrganizations>\r
-              <assocEventOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(7-eleven)'7-Eleven'</assocEventOrganization>\r
-            </collectionobjects_common:assocEventOrganizations>\r
-            <collectionobjects_common:objectNumber>CompleteObject001</collectionobjects_common:objectNumber>\r
-            <collectionobjects_common:dateAssociation/>\r
-            <collectionobjects_common:dimensionMeasurementUnit/>\r
-            <collectionobjects_common:contentScripts>\r
-              <contentScript></contentScript>\r
-            </collectionobjects_common:contentScripts>\r
-            <collectionobjects_common:usageGroupList/>\r
-            <collectionobjects_common:contentOrganizations>\r
-              <contentOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(wolperorganization)'Wolper+Organization'</contentOrganization>\r
-            </collectionobjects_common:contentOrganizations>\r
-            <collectionobjects_common:ownershipExchangeMethod>exchange</collectionobjects_common:ownershipExchangeMethod>\r
-            <collectionobjects_common:assocDateGroupList/>\r
-            <collectionobjects_common:dimensionValueQualifier/>\r
-            <collectionobjects_common:objectProductionNote>.. But it wasn't</collectionobjects_common:objectProductionNote>\r
-            <collectionobjects_common:age>10223</collectionobjects_common:age>\r
-            <collectionobjects_common:collection>study-collection</collectionobjects_common:collection>\r
-            <collectionobjects_common:distinguishingFeatures>Made out of rock, pretty big</collectionobjects_common:distinguishingFeatures>\r
-            <collectionobjects_common:fieldColEventNames>\r
-              <fieldColEventName>fieldCollectionEventName</fieldColEventName>\r
-            </collectionobjects_common:fieldColEventNames>\r
-            <collectionobjects_common:contentPersons>\r
-              <contentPerson>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(gingerrogers)'Ginger+Rogers'</contentPerson>\r
-            </collectionobjects_common:contentPersons>\r
-            <collectionobjects_common:objectProductionPersonGroupList>\r
-              <objectProductionPersonGroup>\r
-                <objectProductionPersonRole></objectProductionPersonRole>\r
-                <objectProductionPerson>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(virginiaboardman)'Virginia+Boardman'</objectProductionPerson>\r
-              </objectProductionPersonGroup>\r
-            </collectionobjects_common:objectProductionPersonGroupList>\r
-            <collectionobjects_common:ownersContributionNote>Haven't really contributed with much</collectionobjects_common:ownersContributionNote>\r
-            <collectionobjects_common:ownersPersonalResponse>Should have gone with an automagic solution</collectionobjects_common:ownersPersonalResponse>\r
-            <collectionobjects_common:objectHistoryNote>Someone found it, then gave it to a museum, duh!</collectionobjects_common:objectHistoryNote>\r
-            <collectionobjects_common:copyNumber>1</collectionobjects_common:copyNumber>\r
-            <collectionobjects_common:titleGroupList>\r
-              <titleGroup>\r
-                <title>Petrified Ogre</title>\r
-                <titleTranslationLanguage>klingon</titleTranslationLanguage>\r
-                <titleTranslation>waka waka</titleTranslation>\r
-                <titleType>generic</titleType>\r
-                <titleLanguage>swahili</titleLanguage>\r
-              </titleGroup>\r
-            </collectionobjects_common:titleGroupList>\r
-            <collectionobjects_common:assocPersonGroupList/>\r
-            <collectionobjects_common:assocOrganizationGroupList/>\r
-            <collectionobjects_common:viewersPersonalExperience>Probably a horrible one, considering how uninteresting this object is</collectionobjects_common:viewersPersonalExperience>\r
-            <collectionobjects_common:comments>\r
-              <comment>Seriously guys, it's just a piece of rock</comment>\r
-            </collectionobjects_common:comments>\r
-            <collectionobjects_common:viewersReferences/>\r
-            <collectionobjects_common:phase>adult</collectionobjects_common:phase>\r
-            <collectionobjects_common:objectNameList>\r
-              <objectNameGroup>\r
-                <objectNameCurrency>current</objectNameCurrency>\r
-                <objectNameLanguage>french</objectNameLanguage>\r
-                <objectName></objectName>\r
-                <objectNameSystem>nomenclature</objectNameSystem>\r
-                <objectNameType>simple</objectNameType>\r
-                <objectNameNote>Je ne suis pas une baguette</objectNameNote>\r
-                <objectNameLevel>subgroup</objectNameLevel>\r
-              </objectNameGroup>\r
-            </collectionobjects_common:objectNameList>\r
-            <collectionobjects_common:dimensions/>\r
-            <collectionobjects_common:dimensionValueDate/>\r
-            <collectionobjects_common:ownersReferences/>\r
-            <collectionobjects_common:otherNumberList/>\r
-            <collectionobjects_common:fieldCollectionPlace></collectionobjects_common:fieldCollectionPlace>\r
-            <collectionobjects_common:viewersContributionNote>You got the basic details down - it was horrible, what else can I say</collectionobjects_common:viewersContributionNote>\r
-            <collectionobjects_common:fieldCollectionMethods>\r
-              <fieldCollectionMethod></fieldCollectionMethod>\r
-            </collectionobjects_common:fieldCollectionMethods>\r
-            <collectionobjects_common:contentPositions/>\r
-            <collectionobjects_common:owners>\r
-              <owner></owner>\r
-            </collectionobjects_common:owners>\r
-            <collectionobjects_common:assocEventName></collectionobjects_common:assocEventName>\r
-            <collectionobjects_common:dateLatestCertainty/>\r
-            <collectionobjects_common:assocEventPlaces>\r
-              <assocEventPlace></assocEventPlace>\r
-            </collectionobjects_common:assocEventPlaces>\r
-            <collectionobjects_common:assocActivityGroupList>\r
-              <assocActivityGroup>\r
-                <assocActivityNote>associated act. note</assocActivityNote>\r
-                <assocActivity></assocActivity>\r
-                <assocActivityType></assocActivityType>\r
-              </assocActivityGroup>\r
-            </collectionobjects_common:assocActivityGroupList>\r
-            <collectionobjects_common:viewersPersonalResponse>\"yeah, that was pretty horrible\", viewer, 1982</collectionobjects_common:viewersPersonalResponse>\r
-            <collectionobjects_common:assocEventNote/>\r
-            <collectionobjects_common:assocEventPeoples>\r
-              <assocEventPeople></assocEventPeople>\r
-            </collectionobjects_common:assocEventPeoples>\r
-            <collectionobjects_common:viewersRole>Dont know what viewers role is</collectionobjects_common:viewersRole>\r
-            <collectionobjects_common:recordStatus>in-process</collectionobjects_common:recordStatus>\r
-            <collectionobjects_common:ageQualifier>Document</collectionobjects_common:ageQualifier>\r
-            <collectionobjects_common:techniqueGroupList>\r
-              <techniqueGroup>\r
-                <technique></technique>\r
-                <techniqueType></techniqueType>\r
-              </techniqueGroup>\r
-            </collectionobjects_common:techniqueGroupList>\r
-            <collectionobjects_common:assocConceptGroupList/>\r
-            <collectionobjects_common:contentPeoples>\r
-              <contentPeople></contentPeople>\r
-            </collectionobjects_common:contentPeoples>\r
-            <collectionobjects_common:ownershipAccess>open</collectionobjects_common:ownershipAccess>\r
-            <collectionobjects_common:datePeriod/>\r
-            <collectionobjects_common:ownershipExchangePriceValue>189</collectionobjects_common:ownershipExchangePriceValue>\r
-            <collectionobjects_common:contentLanguages>\r
-              <contentLanguage></contentLanguage>\r
-            </collectionobjects_common:contentLanguages>\r
-            <collectionobjects_common:fieldCollectionSources>\r
-              <fieldCollectionSource></fieldCollectionSource>\r
-            </collectionobjects_common:fieldCollectionSources>\r
-            <collectionobjects_common:sex>female</collectionobjects_common:sex>\r
-            <collectionobjects_common:materialGroupList>\r
-              <materialGroup>\r
-                <materialSource></materialSource>\r
-                <materialName>rocky balboa rocks</materialName>\r
-                <materialComponent>It is not gold</materialComponent>\r
-                <material></material>\r
-                <materialComponentNote></materialComponentNote>\r
-              </materialGroup>\r
-            </collectionobjects_common:materialGroupList>\r
-            <collectionobjects_common:responsibleDepartments>\r
-              <responsibleDepartment>antiquities</responsibleDepartment>\r
-              <responsibleDepartment>decorative-arts</responsibleDepartment>\r
-              <responsibleDepartment>ethnography</responsibleDepartment>\r
-            </collectionobjects_common:responsibleDepartments>\r
-       </schema>\r
-  </import>\r
-</imports>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<imports>
+    <import seq="1" service="CollectionObjects" type="CollectionObject">
+         <schema xmlns:collectionobjects_common="http://collectionspace.org/collectionobject/" name="collectionobjects_common">
+            <collectionobjects_common:assocCulturalContextGroupList/>
+            <collectionobjects_common:assocCulturalContextGroupList/>
+            <collectionobjects_common:assocObjectGroupList/>
+            <collectionobjects_common:assocEventNameType></collectionobjects_common:assocEventNameType>
+            <collectionobjects_common:ownershipCategory>public</collectionobjects_common:ownershipCategory>
+            <collectionobjects_common:objectProductionReasons/>
+            <textualInscriptionGroupList>
+                <textualInscriptionGroup>
+                    <collectionobjects_common:inscriptionContentScript>gothic-script</collectionobjects_common:inscriptionContentScript>
+                    <collectionobjects_common:inscriptionContentInscriber>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(screenmagicinc.)'Screen+Magic+Inc.'</collectionobjects_common:inscriptionContentInscriber>
+                    <collectionobjects_common:inscriptionContentTranslation>No, it's true, I'm not a baguette</collectionobjects_common:inscriptionContentTranslation>
+                    <collectionobjects_common:inscriptionContentType>label</collectionobjects_common:inscriptionContentType>
+                    <collectionobjects_common:inscriptionContentTransliteration>I'm a vegetarian</collectionobjects_common:inscriptionContentTransliteration>
+                    <collectionobjects_common:inscriptionContentDate></collectionobjects_common:inscriptionContentDate>
+                    <collectionobjects_common:inscriptionContent>Non, c'est vrai! Je ne suis pas une baguette</collectionobjects_common:inscriptionContent>
+                    <inscriptionContentInterpretation>It could mean a lot of things, but oddly no connection to ogres</inscriptionContentInterpretation>
+                    <collectionobjects_common:inscriptionContentLanguage>arabic</collectionobjects_common:inscriptionContentLanguage>
+                    <collectionobjects_common:inscriptionContentPosition>base</collectionobjects_common:inscriptionContentPosition>
+                    <collectionobjects_common:inscriptionContentMethod></collectionobjects_common:inscriptionContentMethod>
+               </textualInscriptionGroup>
+            </textualInscriptionGroupList>
+            <nonTextualInscriptionGroupList>
+                <nonTextualInscriptionGroup>
+                    <collectionobjects_common:inscriptionDescriptionDate></collectionobjects_common:inscriptionDescriptionDate>
+                    <collectionobjects_common:inscriptionDescriptionType>decoration</collectionobjects_common:inscriptionDescriptionType>
+                    <collectionobjects_common:inscriptionDescriptionPosition>bottom</collectionobjects_common:inscriptionDescriptionPosition>
+                    <collectionobjects_common:inscriptionDescriptionInscriber>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(reginabadet)'Regina+Badet'</collectionobjects_common:inscriptionDescriptionInscriber>
+                    <inscriptionDescriptionMethod></inscriptionDescriptionMethod>
+                    <inscriptionDescriptionInterpretation>No Idea</inscriptionDescriptionInterpretation>
+                    <inscriptionDescription>Big symbol at the base</inscriptionDescription>
+                </nonTextualInscriptionGroup>
+            </nonTextualInscriptionGroupList>
+            <collectionobjects_common:fieldCollectionNote></collectionobjects_common:fieldCollectionNote>
+            <collectionobjects_common:contentObjectGroupList>
+              <contentObjectGroup>
+                <contentObjectType></contentObjectType>
+                <contentObject>The Ogres hand</contentObject>
+              </contentObjectGroup>
+            </collectionobjects_common:contentObjectGroupList>
+            <collectionobjects_common:assocEventPersons>
+              <assocEventPerson>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(maryannecasseta)'Mary+Anne+Cassata'</assocEventPerson>
+            </collectionobjects_common:assocEventPersons>
+            <collectionobjects_common:dateEarliestSingleQualifier/>
+            <collectionobjects_common:technicalAttributeGroupList>
+              <technicalAttributeGroup>
+                <technicalAttributeMeasurement>78</technicalAttributeMeasurement>
+                <technicalAttribute>record-speed</technicalAttribute>
+                <technicalAttributeMeasurementUnit>rpm</technicalAttributeMeasurementUnit>
+              </technicalAttributeGroup>
+            </collectionobjects_common:technicalAttributeGroupList>
+            <collectionobjects_common:dateText/>
+            <collectionobjects_common:ownershipDates></collectionobjects_common:ownershipDates>
+            <collectionobjects_common:dimensionSummary/>
+            <collectionobjects_common:objectProductionOrganizationGroupList>
+              <objectProductionOrganizationGroup>
+                <objectProductionOrganizationRole></objectProductionOrganizationRole>
+                <objectProductionOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(boardwalkrecords)'Boardwalk+Records'</objectProductionOrganization>
+              </objectProductionOrganizationGroup>
+            </collectionobjects_common:objectProductionOrganizationGroupList>
+            <collectionobjects_common:objectComponentGroupList>
+              <objectComponentGroup>
+                <objectComponentInformation></objectComponentInformation>
+                <objectComponentName>sleeve</objectComponentName>
+              </objectComponentGroup>
+            </collectionobjects_common:objectComponentGroupList>
+            <collectionobjects_common:ownershipPlace></collectionobjects_common:ownershipPlace>
+            <collectionobjects_common:fieldCollectionDate></collectionobjects_common:fieldCollectionDate>
+            <collectionobjects_common:contentActivities>
+              <contentActivity></contentActivity>
+            </collectionobjects_common:contentActivities>
+            <collectionobjects_common:contentPlaces>
+              <contentPlace></contentPlace>
+            </collectionobjects_common:contentPlaces>
+            <collectionobjects_common:dateEarliestSingleCertainty/>
+            <collectionobjects_common:objectProductionDateGroupList/>
+            <collectionobjects_common:contentConcepts>
+              <contentConcept></contentConcept>
+            </collectionobjects_common:contentConcepts>
+            <collectionobjects_common:numberOfObjects>1</collectionobjects_common:numberOfObjects>
+            <collectionobjects_common:ownershipExchangePriceCurrency>poundsterling</collectionobjects_common:ownershipExchangePriceCurrency>
+            <collectionobjects_common:contentOtherGroupList>
+              <contentOtherGroup>
+                <contentOther></contentOther>
+                <contentOtherType></contentOtherType>
+              </contentOtherGroup>
+            </collectionobjects_common:contentOtherGroupList>
+            <collectionobjects_common:editionNumber>123-bg-192</collectionobjects_common:editionNumber>
+            <collectionobjects_common:dimensionMeasuredPart/>
+            <collectionobjects_common:styles>
+              <style></style>
+            </collectionobjects_common:styles>
+            <collectionobjects_common:briefDescriptions>
+              <briefDescription>A petrified Ogre found in the woods of Neverland</briefDescription>
+              <briefDescription>Or it could be a petrified tree looking slightly like an ogre</briefDescription>
+              <briefDescription>Or just a rock, looking a lot like a petrified tree</briefDescription>
+            </collectionobjects_common:briefDescriptions>
+            <collectionobjects_common:colors>
+              <color></color>
+            </collectionobjects_common:colors>
+            <collectionobjects_common:fieldCollectors>
+              <fieldCollector></fieldCollector>
+            </collectionobjects_common:fieldCollectors>
+            <collectionobjects_common:ownersPersonalExperience>These object records are tedious to fill out</collectionobjects_common:ownersPersonalExperience>
+            <collectionobjects_common:contentDescription>Content of a piece of rock?! .. well there might be diamonds and petrified fish in it</collectionobjects_common:contentDescription>
+            <collectionobjects_common:objectProductionPeopleGroupList>
+              <objectProductionPeopleGroup>
+                <objectProductionPeople></objectProductionPeople>
+                <objectProductionPeopleRole></objectProductionPeopleRole>
+              </objectProductionPeopleGroup>
+            </collectionobjects_common:objectProductionPeopleGroupList>
+            <collectionobjects_common:objectProductionPlaceGroupList>
+              <objectProductionPlaceGroup>
+                <objectProductionPlace></objectProductionPlace>
+                <objectProductionPlaceRole></objectProductionPlaceRole>
+              </objectProductionPlaceGroup>
+            </collectionobjects_common:objectProductionPlaceGroupList>
+            <collectionobjects_common:contentDateGroup/>
+            <collectionobjects_common:assocPlaceGroupList/>
+            <collectionobjects_common:physicalDescription>It's pretty big - the size of an ogre.. Three arms and a hump-back</collectionobjects_common:physicalDescription>
+            <collectionobjects_common:dimensionValue/>
+            <collectionobjects_common:fieldCollectionNumber></collectionobjects_common:fieldCollectionNumber>
+            <collectionobjects_common:ageUnit>years</collectionobjects_common:ageUnit>
+            <collectionobjects_common:dimension/>
+            <collectionobjects_common:dateLatestQualifier/>
+            <collectionobjects_common:contentEventNameGroupList>
+              <contentEventNameGroup>
+                <contentEventNameType></contentEventNameType>
+                <contentEventName></contentEventName>
+              </contentEventNameGroup>
+            </collectionobjects_common:contentEventNameGroupList>
+            <collectionobjects_common:contentNote>pst., it's not a real ogre</collectionobjects_common:contentNote>
+            <collectionobjects_common:forms>
+              <form></form>
+            </collectionobjects_common:forms>
+            <collectionobjects_common:assocPeopleGroupList/>
+            <collectionobjects_common:dateEarliestSingle/>
+            <collectionobjects_common:ownershipExchangeNote>none</collectionobjects_common:ownershipExchangeNote>
+            <collectionobjects_common:dateLatest/>
+            <collectionobjects_common:assocEventOrganizations>
+              <assocEventOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(7-eleven)'7-Eleven'</assocEventOrganization>
+            </collectionobjects_common:assocEventOrganizations>
+            <collectionobjects_common:objectNumber>CompleteObject001</collectionobjects_common:objectNumber>
+            <collectionobjects_common:dateAssociation/>
+            <collectionobjects_common:dimensionMeasurementUnit/>
+            <collectionobjects_common:contentScripts>
+              <contentScript></contentScript>
+            </collectionobjects_common:contentScripts>
+            <collectionobjects_common:usageGroupList/>
+            <collectionobjects_common:contentOrganizations>
+              <contentOrganization>urn:cspace:org.collectionspace.demo:orgauthority:name(organization):organization:name(wolperorganization)'Wolper+Organization'</contentOrganization>
+            </collectionobjects_common:contentOrganizations>
+            <collectionobjects_common:ownershipExchangeMethod>exchange</collectionobjects_common:ownershipExchangeMethod>
+            <collectionobjects_common:assocDateGroupList/>
+            <collectionobjects_common:dimensionValueQualifier/>
+            <collectionobjects_common:objectProductionNote>.. But it wasn't</collectionobjects_common:objectProductionNote>
+            <collectionobjects_common:age>10223</collectionobjects_common:age>
+            <collectionobjects_common:collection>study-collection</collectionobjects_common:collection>
+            <collectionobjects_common:distinguishingFeatures>Made out of rock, pretty big</collectionobjects_common:distinguishingFeatures>
+            <collectionobjects_common:fieldColEventNames>
+              <fieldColEventName>fieldCollectionEventName</fieldColEventName>
+            </collectionobjects_common:fieldColEventNames>
+            <collectionobjects_common:contentPersons>
+              <contentPerson>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(gingerrogers)'Ginger+Rogers'</contentPerson>
+            </collectionobjects_common:contentPersons>
+            <collectionobjects_common:objectProductionPersonGroupList>
+              <objectProductionPersonGroup>
+                <objectProductionPersonRole></objectProductionPersonRole>
+                <objectProductionPerson>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(virginiaboardman)'Virginia+Boardman'</objectProductionPerson>
+              </objectProductionPersonGroup>
+            </collectionobjects_common:objectProductionPersonGroupList>
+            <collectionobjects_common:ownersContributionNote>Haven't really contributed with much</collectionobjects_common:ownersContributionNote>
+            <collectionobjects_common:ownersPersonalResponse>Should have gone with an automagic solution</collectionobjects_common:ownersPersonalResponse>
+            <collectionobjects_common:objectHistoryNote>Someone found it, then gave it to a museum, duh!</collectionobjects_common:objectHistoryNote>
+            <collectionobjects_common:copyNumber>1</collectionobjects_common:copyNumber>
+            <collectionobjects_common:titleGroupList>
+              <titleGroup>
+                <title>Petrified Ogre</title>
+                <titleTranslationLanguage>klingon</titleTranslationLanguage>
+                <titleTranslation>waka waka</titleTranslation>
+                <titleType>generic</titleType>
+                <titleLanguage>swahili</titleLanguage>
+              </titleGroup>
+            </collectionobjects_common:titleGroupList>
+            <collectionobjects_common:assocPersonGroupList/>
+            <collectionobjects_common:assocOrganizationGroupList/>
+            <collectionobjects_common:viewersPersonalExperience>Probably a horrible one, considering how uninteresting this object is</collectionobjects_common:viewersPersonalExperience>
+            <collectionobjects_common:comments>
+              <comment>Seriously guys, it's just a piece of rock</comment>
+            </collectionobjects_common:comments>
+            <collectionobjects_common:viewersReferences/>
+            <collectionobjects_common:phase>adult</collectionobjects_common:phase>
+            <collectionobjects_common:objectNameList>
+              <objectNameGroup>
+                <objectNameCurrency>current</objectNameCurrency>
+                <objectNameLanguage>french</objectNameLanguage>
+                <objectName></objectName>
+                <objectNameSystem>nomenclature</objectNameSystem>
+                <objectNameType>simple</objectNameType>
+                <objectNameNote>Je ne suis pas une baguette</objectNameNote>
+                <objectNameLevel>subgroup</objectNameLevel>
+              </objectNameGroup>
+            </collectionobjects_common:objectNameList>
+            <collectionobjects_common:dimensions/>
+            <collectionobjects_common:dimensionValueDate/>
+            <collectionobjects_common:ownersReferences/>
+            <collectionobjects_common:otherNumberList/>
+            <collectionobjects_common:fieldCollectionPlace></collectionobjects_common:fieldCollectionPlace>
+            <collectionobjects_common:viewersContributionNote>You got the basic details down - it was horrible, what else can I say</collectionobjects_common:viewersContributionNote>
+            <collectionobjects_common:fieldCollectionMethods>
+              <fieldCollectionMethod></fieldCollectionMethod>
+            </collectionobjects_common:fieldCollectionMethods>
+            <collectionobjects_common:contentPositions/>
+            <collectionobjects_common:owners>
+              <owner></owner>
+            </collectionobjects_common:owners>
+            <collectionobjects_common:assocEventName></collectionobjects_common:assocEventName>
+            <collectionobjects_common:dateLatestCertainty/>
+            <collectionobjects_common:assocEventPlaces>
+              <assocEventPlace></assocEventPlace>
+            </collectionobjects_common:assocEventPlaces>
+            <collectionobjects_common:assocActivityGroupList>
+              <assocActivityGroup>
+                <assocActivityNote>associated act. note</assocActivityNote>
+                <assocActivity></assocActivity>
+                <assocActivityType></assocActivityType>
+              </assocActivityGroup>
+            </collectionobjects_common:assocActivityGroupList>
+            <collectionobjects_common:viewersPersonalResponse>\"yeah, that was pretty horrible\", viewer, 1982</collectionobjects_common:viewersPersonalResponse>
+            <collectionobjects_common:assocEventNote/>
+            <collectionobjects_common:assocEventPeoples>
+              <assocEventPeople></assocEventPeople>
+            </collectionobjects_common:assocEventPeoples>
+            <collectionobjects_common:viewersRole>Dont know what viewers role is</collectionobjects_common:viewersRole>
+            <collectionobjects_common:recordStatus>in-process</collectionobjects_common:recordStatus>
+            <collectionobjects_common:ageQualifier>Document</collectionobjects_common:ageQualifier>
+            <collectionobjects_common:techniqueGroupList>
+              <techniqueGroup>
+                <technique></technique>
+                <techniqueType></techniqueType>
+              </techniqueGroup>
+            </collectionobjects_common:techniqueGroupList>
+            <collectionobjects_common:assocConceptGroupList/>
+            <collectionobjects_common:contentPeoples>
+              <contentPeople></contentPeople>
+            </collectionobjects_common:contentPeoples>
+            <collectionobjects_common:ownershipAccess>open</collectionobjects_common:ownershipAccess>
+            <collectionobjects_common:datePeriod/>
+            <collectionobjects_common:ownershipExchangePriceValue>189</collectionobjects_common:ownershipExchangePriceValue>
+            <collectionobjects_common:contentLanguages>
+              <contentLanguage></contentLanguage>
+            </collectionobjects_common:contentLanguages>
+            <collectionobjects_common:fieldCollectionSources>
+              <fieldCollectionSource></fieldCollectionSource>
+            </collectionobjects_common:fieldCollectionSources>
+            <collectionobjects_common:sex>female</collectionobjects_common:sex>
+            <collectionobjects_common:materialGroupList>
+              <materialGroup>
+                <materialSource></materialSource>
+                <materialName>rocky balboa rocks</materialName>
+                <materialComponent>It is not gold</materialComponent>
+                <material></material>
+                <materialComponentNote></materialComponentNote>
+              </materialGroup>
+            </collectionobjects_common:materialGroupList>
+            <collectionobjects_common:responsibleDepartments>
+              <responsibleDepartment>antiquities</responsibleDepartment>
+              <responsibleDepartment>decorative-arts</responsibleDepartment>
+              <responsibleDepartment>ethnography</responsibleDepartment>
+            </collectionobjects_common:responsibleDepartments>
+       </schema>
+  </import>
+</imports>
index ad9a4d19a0447b136bc78d23a5e30d797534a5ed..97db7952d02cf209cf61504c0a0c522ab8154268 100644 (file)
@@ -1,79 +1,79 @@
-\r
-<project name="main-install" basedir=".">\r
-    <description>\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="installer.trunk" value=".."/>\r
-    <property name="services.trunk" value="../../.."/>\r
-    <property file="${installer.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-    \r
-    <target name="install"\r
-       description="Copy artifacts for CollectionSpace Nuxeo doctypes">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing CollectionSpace Service's &apos;install&apos; target." />\r
-                               </exec>\r
-        <ant antfile="id/build.xml" target="install" inheritAll="false"/>\r
-        <ant antfile="collectionobject/build.xml" target="install" inheritAll="false"/>\r
-        <ant antfile="vocabulary/build.xml" target="install" inheritAll="false"/>\r
-    </target>\r
-    \r
-    <target name="config" description="" depends="install">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing CollectionSpace Service's &apos;config&apos; target." />\r
-                               </exec>\r
-    </target>    \r
-\r
-    <!-- this target is called in order based on the dependencies between the services -->\r
-    <target name="predeploy" description="" depends="config">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing services &apos;predeploy&apos; target." />\r
-                               </exec>         \r
-<!--\r
-        <ant antfile="common/build.xml" target="setup" inheritAll="false"/>\r
-        <ant antfile="authentication/build.xml" target="setup" inheritAll="false"/>\r
-        <ant antfile="relation/build.xml" target="setup" inheritAll="false"/>\r
--->        \r
-        <ant antfile="id/build.xml" target="predeploy" inheritAll="false"/>\r
-        <ant antfile="collectionobject/build.xml" target="predeploy" inheritAll="false"/>\r
-        <ant antfile="vocabulary/build.xml" target="predeploy" inheritAll="false"/>\r
-<!--        \r
-        <ant antfile="intake/build.xml" target="setup" inheritAll="false"/>\r
-        <ant antfile="acquisition/build.xml" target="setup" inheritAll="false"/>\r
-        <ant antfile="JaxRsServiceProvider/build.xml" target="setup" inheritAll="false"/>\r
--->        \r
-    </target>\r
-\r
-    <target name="deploy" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing CollectionSpace Service's &apos;deploy&apos; target." />\r
-                               </exec>\r
-    </target>\r
-\r
-    <target name="postdeploy" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Executing CollectionSpace Service's &apos;postdeploy&apos; target." />\r
-                               </exec>         \r
-<!--\r
-        <ant antfile="common/build.xml" target="setup" inheritAll="false"/>\r
-        <ant antfile="authentication/build.xml" target="setup" inheritAll="false"/>\r
-        <ant antfile="relation/build.xml" target="setup" inheritAll="false"/>\r
--->        \r
-        <ant antfile="id/build.xml" target="postdeploy" inheritAll="false"/>\r
-        <ant antfile="collectionobject/build.xml" target="postdeploy" inheritAll="false"/>\r
-        <ant antfile="vocabulary/build.xml" target="postdeploy" inheritAll="false"/>\r
-<!--        \r
-        <ant antfile="intake/build.xml" target="setup" inheritAll="false"/>\r
-        <ant antfile="acquisition/build.xml" target="setup" inheritAll="false"/>\r
-        <ant antfile="JaxRsServiceProvider/build.xml" target="setup" inheritAll="false"/>\r
--->        \r
-    </target>    \r
-</project>\r
+
+<project name="main-install" basedir=".">
+    <description>
+    </description>
+  <!-- set global properties for this build -->
+    <property name="installer.trunk" value=".."/>
+    <property name="services.trunk" value="../../.."/>
+    <property file="${installer.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+    
+    <target name="install"
+       description="Copy artifacts for CollectionSpace Nuxeo doctypes">
+        <exec executable="echo">
+                       <arg value="Installer: Executing CollectionSpace Service's &apos;install&apos; target." />
+                               </exec>
+        <ant antfile="id/build.xml" target="install" inheritAll="false"/>
+        <ant antfile="collectionobject/build.xml" target="install" inheritAll="false"/>
+        <ant antfile="vocabulary/build.xml" target="install" inheritAll="false"/>
+    </target>
+    
+    <target name="config" description="" depends="install">
+        <exec executable="echo">
+                       <arg value="Installer: Executing CollectionSpace Service's &apos;config&apos; target." />
+                               </exec>
+    </target>    
+
+    <!-- this target is called in order based on the dependencies between the services -->
+    <target name="predeploy" description="" depends="config">
+        <exec executable="echo">
+                       <arg value="Installer: Executing services &apos;predeploy&apos; target." />
+                               </exec>         
+<!--
+        <ant antfile="common/build.xml" target="setup" inheritAll="false"/>
+        <ant antfile="authentication/build.xml" target="setup" inheritAll="false"/>
+        <ant antfile="relation/build.xml" target="setup" inheritAll="false"/>
+-->        
+        <ant antfile="id/build.xml" target="predeploy" inheritAll="false"/>
+        <ant antfile="collectionobject/build.xml" target="predeploy" inheritAll="false"/>
+        <ant antfile="vocabulary/build.xml" target="predeploy" inheritAll="false"/>
+<!--        
+        <ant antfile="intake/build.xml" target="setup" inheritAll="false"/>
+        <ant antfile="acquisition/build.xml" target="setup" inheritAll="false"/>
+        <ant antfile="JaxRsServiceProvider/build.xml" target="setup" inheritAll="false"/>
+-->        
+    </target>
+
+    <target name="deploy" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing CollectionSpace Service's &apos;deploy&apos; target." />
+                               </exec>
+    </target>
+
+    <target name="postdeploy" description="">
+        <exec executable="echo">
+                       <arg value="Executing CollectionSpace Service's &apos;postdeploy&apos; target." />
+                               </exec>         
+<!--
+        <ant antfile="common/build.xml" target="setup" inheritAll="false"/>
+        <ant antfile="authentication/build.xml" target="setup" inheritAll="false"/>
+        <ant antfile="relation/build.xml" target="setup" inheritAll="false"/>
+-->        
+        <ant antfile="id/build.xml" target="postdeploy" inheritAll="false"/>
+        <ant antfile="collectionobject/build.xml" target="postdeploy" inheritAll="false"/>
+        <ant antfile="vocabulary/build.xml" target="postdeploy" inheritAll="false"/>
+<!--        
+        <ant antfile="intake/build.xml" target="setup" inheritAll="false"/>
+        <ant antfile="acquisition/build.xml" target="setup" inheritAll="false"/>
+        <ant antfile="JaxRsServiceProvider/build.xml" target="setup" inheritAll="false"/>
+-->        
+    </target>    
+</project>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 7f4c7ed6962e8da9336509981f18564a3a38ab41..00de592f3f998378a24fd27e8a0eab351e088c91 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.intake</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.intake</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 3b8c16a8a3d19dfd25ad6f5470eac05f2f1c0658..1d1c7467bf2ba2f56ffbfa3a124bfff805260f07 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.intake.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.intake.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 5c30ec72940627ee8e4d4527516f9851c4604901..3e7a517d6998662243d0fc9e9f4c86dcf03e61b0 100644 (file)
-\r
-<project name="intake.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        intake service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy intake in ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <ant antfile="nuxeo-platform-cs-intake/build.xml" target="deploy" inheritall="false"/>\r
-        -->\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy intake from ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-       leaving this only for backwards compatibility reasons. -->\r
-        <ant antfile="nuxeo-platform-cs-intake/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for intake" depends="package">\r
-        <ant antfile="nuxeo-platform-cs-intake/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-</project>\r
+
+<project name="intake.3rdparty" default="package" basedir=".">
+    <description>
+        intake service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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 intake in ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <ant antfile="nuxeo-platform-cs-intake/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+    description="undeploy intake from ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       leaving this only for backwards compatibility reasons. -->
+        <ant antfile="nuxeo-platform-cs-intake/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for intake" depends="package">
+        <ant antfile="nuxeo-platform-cs-intake/build.xml" target="dist" inheritall="false"/>
+    </target>
+</project>
index 246cb4a17bf4b19a473fa38690758c63c50f71f3..2604842399bc2fcecf3284aab670d7bc60dcd7ad 100644 (file)
@@ -1,25 +1,25 @@
-\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.intake</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.intake.3rdparty</artifactId>\r
-    <name>services.intake.3rdparty</name>\r
-    <packaging>pom</packaging>\r
-    \r
-    <description>\r
-        3rd party build for intake service\r
-    </description>\r
-\r
-    <modules>\r
-        <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <module>nuxeo-platform-cs-intake</module>\r
-        -->\r
-    </modules>\r
-</project>\r
+
+<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>
+        <artifactId>org.collectionspace.services.intake</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.intake.3rdparty</artifactId>
+    <name>services.intake.3rdparty</name>
+    <packaging>pom</packaging>
+    
+    <description>
+        3rd party build for intake service
+    </description>
+
+    <modules>
+        <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <module>nuxeo-platform-cs-intake</module>
+        -->
+    </modules>
+</project>
index fa973a6f0325945ff70e48c7af62013f782a9d25..ba68283e12755a66893e1f161f5ac5c538f37ad1 100644 (file)
-\r
-<project name="intake" default="package" basedir=".">\r
-    <description>\r
-        intake service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy intake service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy intake service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-    description="distribute intake service">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="intake" default="package" basedir=".">
+    <description>
+        intake service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 intake service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy intake service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+    description="distribute intake service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index 5f231b2965e4d35dd5685b951d240d39d25f4fa5..04ce160e7c2f4b9bdc98ac01d02dac31b62e2f24 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.intake</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.intake.client</artifactId>\r
-    <name>services.intake.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-<!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-<!-- External dependencies -->        \r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-intake-client</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.intake</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.intake.client</artifactId>
+    <name>services.intake.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+<!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+<!-- External dependencies -->        
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-intake-client</finalName>
+    </build>
+</project>
+
index 95f4d90566c0b8eb9b486d577502bfff9b8d895e..be59cc2522ef4d805bed565043469a97d46e6de5 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.collectionspace.services.client.test;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.OrganizationJAXBSchema;\r
-import org.collectionspace.services.client.CollectionSpaceClient;\r
-import org.collectionspace.services.client.IntakeClient;\r
-import org.collectionspace.services.client.OrgAuthorityClient;\r
-import org.collectionspace.services.client.OrgAuthorityClientUtils;\r
-import org.collectionspace.services.client.PayloadOutputPart;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;\r
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
-import org.collectionspace.services.intake.ConditionCheckerOrAssessorList;\r
-import org.collectionspace.services.intake.IntakesCommon;\r
-import org.collectionspace.services.intake.InsurerList;\r
-import org.collectionspace.services.jaxb.AbstractCommonList;\r
-import org.collectionspace.services.organization.OrgTermGroup;\r
-\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;\r
-//import org.jboss.resteasy.plugins.providers.multipart.OutputPart;\r
-import org.testng.Assert;\r
-import org.testng.annotations.AfterClass;\r
-import org.testng.annotations.Test;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * OrganizationAuthRefDocsTest, carries out tests against a\r
- * deployed and running Organization Service.\r
- *\r
- * $LastChangedRevision: 1327 $\r
- * $LastChangedDate: 2010-02-12 10:35:11 -0800 (Fri, 12 Feb 2010) $\r
- */\r
-public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {\r
-\r
-    private final String CLASS_NAME = OrganizationAuthRefDocsTest.class.getName();\r
-    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);\r
-\r
-    // Instance variables specific to this test.\r
-    final String SERVICE_PATH_COMPONENT = "intakes";\r
-    final String ORGANIZATION_AUTHORITY_NAME = "TestOrganizationAuth";\r
-    private String knownIntakeId = null;\r
-    private List<String> intakeIdsCreated = new ArrayList<String>();\r
-    private List<String> orgIdsCreated = new ArrayList<String>();\r
-    private String orgAuthCSID = null; \r
-    //private String orgAuthRefName = null; \r
-    private String currentOwnerOrgCSID = null; \r
-    private String currentOwnerRefName = null;\r
-    private String depositorRefName = null;\r
-    private String conditionCheckerAssessorRefName = null;\r
-    private String insurerRefName = null;\r
-    private String valuerRefName = null;\r
-    private final int NUM_AUTH_REF_DOCS_EXPECTED = 1;\r
-    private final static String CURRENT_DATE_UTC =\r
-            GregorianCalendarDateTimeUtils.currentDateUTC();\r
-\r
-       @Override\r
-       protected String getServiceName() {\r
-               throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498\r
-       }\r
-    \r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()\r
-     */\r
-    @Override\r
-    protected CollectionSpaceClient getClientInstance() {\r
-       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class\r
-    }\r
-    \r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)\r
-     */\r
-    @Override\r
-       protected AbstractCommonList getCommonList(\r
-                       ClientResponse<AbstractCommonList> response) {\r
-       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class\r
-    }\r
-\r
-    // ---------------------------------------------------------------\r
-    // CRUD tests : CREATE tests\r
-    // ---------------------------------------------------------------\r
-    // Success outcomes\r
-    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)\r
-    public void createIntakeWithAuthRefs(String testName) throws Exception {\r
-        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);\r
-\r
-        // Submit the request to the service and store the response.\r
-        String identifier = createIdentifier();\r
-        \r
-        // Create all the organization refs and entities\r
-        createOrgRefs();\r
-\r
-        IntakeClient intakeClient = new IntakeClient();\r
-        PoxPayloadOut multipart = createIntakeInstance(\r
-                "entryNumber-" + identifier,\r
-                CURRENT_DATE_UTC,\r
-                currentOwnerRefName,\r
-                // Use currentOwnerRefName twice to test fix for CSPACE-2863\r
-                currentOwnerRefName,    //depositorRefName,\r
-                conditionCheckerAssessorRefName,\r
-                insurerRefName,\r
-                valuerRefName );\r
-\r
-        ClientResponse<Response> res = intakeClient.create(multipart);\r
-        try {\r
-               int statusCode = res.getStatus();\r
-       \r
-               // Check the status code of the response: does it match\r
-               // the expected response(s)?\r
-               //\r
-               // Specifically:\r
-               // Does it fall within the set of valid status codes?\r
-               // Does it exactly match the expected status code?\r
-               if(logger.isDebugEnabled()){\r
-                   logger.debug(testName + ": status = " + statusCode);\r
-               }\r
-               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                       invalidStatusCodeMessage(testRequestType, statusCode));\r
-               Assert.assertEquals(statusCode, testExpectedStatusCode);\r
-        } finally {\r
-               res.releaseConnection();\r
-        }\r
-\r
-        // Store the ID returned from the first resource created\r
-        // for additional tests below.\r
-        if (knownIntakeId == null){\r
-            knownIntakeId = extractId(res);\r
-            if (logger.isDebugEnabled()) {\r
-                logger.debug(testName + ": knownIntakeId=" + knownIntakeId);\r
-            }\r
-        }\r
-        \r
-        // Store the IDs from every resource created by tests,\r
-        // so they can be deleted after tests have been run.\r
-        intakeIdsCreated.add(extractId(res));\r
-    }\r
-    \r
-    /**\r
-     * Creates the organization refs.\r
-     */\r
-    protected void createOrgRefs(){\r
-        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();\r
-        //orgAuthRefName = \r
-       //      OrgAuthorityClientUtils.createOrgAuthRefName(ORGANIZATION_AUTHORITY_NAME, null);\r
-        PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(\r
-                       ORGANIZATION_AUTHORITY_NAME, ORGANIZATION_AUTHORITY_NAME, orgAuthClient.getCommonPartName());\r
-        ClientResponse<Response> res = orgAuthClient.create(multipart);\r
-        int statusCode = res.getStatus();\r
-\r
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                invalidStatusCodeMessage(testRequestType, statusCode));\r
-        Assert.assertEquals(statusCode, STATUS_CREATED);\r
-        orgAuthCSID = extractId(res);\r
-        \r
-               currentOwnerOrgCSID = createOrganization("olivierOwnerCompany", "Olivier Owner Company", "Olivier Owner Company");\r
-        orgIdsCreated.add(currentOwnerOrgCSID);\r
-        currentOwnerRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, currentOwnerOrgCSID, orgAuthClient);\r
-        \r
-               String newOrgCSID =\r
-                        createOrganization("debbieDepositorAssocs", "Debbie Depositor & Associates", "Debbie Depositor & Associates");\r
-        depositorRefName = \r
-               OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);\r
-        orgIdsCreated.add(newOrgCSID);\r
-        \r
-               newOrgCSID = createOrganization("andrewCheckerAssessorLtd", "Andrew Checker-Assessor Ltd.", "Andrew Checker-Assessor Ltd.");\r
-               conditionCheckerAssessorRefName = \r
-               OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);\r
-        orgIdsCreated.add(newOrgCSID);\r
-        \r
-               newOrgCSID = createOrganization("ingridInsurerBureau", "Ingrid Insurer Bureau", "Ingrid Insurer Bureau");\r
-               insurerRefName = \r
-               OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);\r
-        orgIdsCreated.add(newOrgCSID);\r
-        \r
-               newOrgCSID = createOrganization("vinceValuerLLC", "Vince Valuer LLC", "Vince Valuer LLC");\r
-               valuerRefName = \r
-               OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);\r
-        orgIdsCreated.add(newOrgCSID);\r
-    }\r
-\r
-    protected String createOrganization(String shortId, String shortName, String longName) {\r
-        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();\r
-        Map<String, String> orgInfo = new HashMap<String,String>();\r
-        orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortId);\r
-        \r
-        List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();\r
-        OrgTermGroup term = new OrgTermGroup();\r
-        term.setTermDisplayName(shortName);\r
-        term.setTermName(shortName);\r
-        term.setMainBodyName(longName);\r
-        orgTerms.add(term);\r
-        PoxPayloadOut multipart =\r
-                OrgAuthorityClientUtils.createOrganizationInstance(null, //orgAuthRefName\r
-                orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());\r
-\r
-        ClientResponse<Response> res = orgAuthClient.createItem(orgAuthCSID, multipart);\r
-        int statusCode = res.getStatus();\r
-\r
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),\r
-                invalidStatusCodeMessage(testRequestType, statusCode));\r
-        Assert.assertEquals(statusCode, STATUS_CREATED);\r
-       return extractId(res);\r
-    }\r
-\r
-    // Success outcomes\r
-    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,\r
-        dependsOnMethods = {"createIntakeWithAuthRefs"})\r
-    public void readAndCheckAuthRefDocs(String testName) throws Exception {\r
-        // Perform setup.\r
-        testSetup(STATUS_OK, ServiceRequestType.READ);\r
-        \r
-        // Get the auth ref docs and check them\r
-       OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();\r
-       ClientResponse<AuthorityRefDocList> refDocListResp =\r
-               orgAuthClient.getReferencingObjects(orgAuthCSID, currentOwnerOrgCSID);\r
-       AuthorityRefDocList list = null;\r
-       try {\r
-          assertStatusCode(refDocListResp, testName);\r
-          list = refDocListResp.getEntity();\r
-          Assert.assertNotNull(list);\r
-       } finally {\r
-          if (refDocListResp != null) {\r
-                  refDocListResp.releaseConnection();\r
-           }\r
-       }\r
-\r
-        // Optionally output additional data about list members for debugging.\r
-        boolean iterateThroughList = true;\r
-        int nIntakesFound = 0;\r
-        if(iterateThroughList && logger.isDebugEnabled()){\r
-            List<AuthorityRefDocList.AuthorityRefDocItem> items =\r
-                    list.getAuthorityRefDocItem();\r
-            int i = 0;\r
-            logger.debug(testName + ": Docs that use: " + currentOwnerRefName);\r
-            for(AuthorityRefDocList.AuthorityRefDocItem item : items){\r
-                logger.debug(testName + ": list-item[" + i + "] " +\r
-                               item.getDocType() + "(" +\r
-                               item.getDocId() + ") Name:[" +\r
-                               item.getDocName() + "] Number:[" +\r
-                               item.getDocNumber() + "] in field:[" +\r
-                               item.getSourceField() + "]");\r
-                if(knownIntakeId.equalsIgnoreCase(item.getDocId())) {\r
-                       nIntakesFound++;\r
-                }\r
-                i++;\r
-            }\r
-            //\r
-            Assert.assertTrue((nIntakesFound==2), "Did not find Intake (twice) with authref!");\r
-        }\r
-    }\r
-\r
-\r
-    // ---------------------------------------------------------------\r
-    // Cleanup of resources created during testing\r
-    // ---------------------------------------------------------------\r
-\r
-    /**\r
-     * Deletes all resources created by tests, after all tests have been run.\r
-     *\r
-     * This cleanup method will always be run, even if one or more tests fail.\r
-     * For this reason, it attempts to remove all resources created\r
-     * at any point during testing, even if some of those resources\r
-     * may be expected to be deleted by certain tests.\r
-     */\r
-    @AfterClass(alwaysRun=true)\r
-    public void cleanUp() {\r
-        String noTest = System.getProperty("noTestCleanup");\r
-       if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {\r
-            if (logger.isDebugEnabled()) {\r
-                logger.debug("Skipping Cleanup phase ...");\r
-            }\r
-            return;\r
-       }\r
-        if (logger.isDebugEnabled()) {\r
-            logger.debug("Cleaning up temporary resources created for testing ...");\r
-        }\r
-        IntakeClient intakeClient = new IntakeClient();\r
-        // Note: Any non-success responses are ignored and not reported.\r
-        for (String resourceId : intakeIdsCreated) {\r
-            ClientResponse<Response> res = intakeClient.delete(resourceId);\r
-            res.releaseConnection();\r
-        }\r
-        // Delete persons before PersonAuth\r
-        OrgAuthorityClient personAuthClient = new OrgAuthorityClient();\r
-        for (String resourceId : orgIdsCreated) {\r
-            ClientResponse<Response> res = personAuthClient.deleteItem(orgAuthCSID, resourceId);\r
-            res.releaseConnection();\r
-        }\r
-        if (orgAuthCSID != null) {\r
-               personAuthClient.delete(orgAuthCSID).releaseConnection();\r
-        }\r
-    }\r
-\r
-    // ---------------------------------------------------------------\r
-    // Utility methods used by tests above\r
-    // ---------------------------------------------------------------\r
-    @Override\r
-    public String getServicePathComponent() {\r
-        return SERVICE_PATH_COMPONENT;\r
-    }\r
-\r
-   private PoxPayloadOut createIntakeInstance(String entryNumber,\r
-               String entryDate,\r
-                               String currentOwner,\r
-                               String depositor,\r
-                               String conditionCheckerAssessor,\r
-                               String insurer,\r
-                               String Valuer ) {\r
-        IntakesCommon intake = new IntakesCommon();\r
-        intake.setEntryNumber(entryNumber);\r
-        intake.setEntryDate(entryDate);\r
-        intake.setCurrentOwner(currentOwner);\r
-        intake.setDepositor(depositor);\r
-        intake.setValuer(Valuer);\r
-\r
-        ConditionCheckerOrAssessorList checkerOrAssessorList = new ConditionCheckerOrAssessorList();\r
-        List<String> checkersOrAssessors = checkerOrAssessorList.getConditionCheckerOrAssessor();\r
-        checkersOrAssessors.add(conditionCheckerAssessor);\r
-        intake.setConditionCheckersOrAssessors(checkerOrAssessorList);\r
-\r
-        InsurerList insurerList = new InsurerList();\r
-        List<String> insurers = insurerList.getInsurer();\r
-        insurers.add(insurer);\r
-        intake.setInsurers(insurerList);\r
-\r
-        PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());\r
-        PayloadOutputPart commonPart =\r
-            multipart.addPart(new IntakeClient().getCommonPartName(), intake);\r
-\r
-        if(logger.isDebugEnabled()){\r
-            logger.debug("to be created, intake common");\r
-            logger.debug(objectAsXmlString(intake, IntakesCommon.class));\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.collectionspace.services.client.test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.OrganizationJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.IntakeClient;
+import org.collectionspace.services.client.OrgAuthorityClient;
+import org.collectionspace.services.client.OrgAuthorityClientUtils;
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
+import org.collectionspace.services.intake.ConditionCheckerOrAssessorList;
+import org.collectionspace.services.intake.IntakesCommon;
+import org.collectionspace.services.intake.InsurerList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.organization.OrgTermGroup;
+
+import org.jboss.resteasy.client.ClientResponse;
+
+//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
+//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
+//import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * OrganizationAuthRefDocsTest, carries out tests against a
+ * deployed and running Organization Service.
+ *
+ * $LastChangedRevision: 1327 $
+ * $LastChangedDate: 2010-02-12 10:35:11 -0800 (Fri, 12 Feb 2010) $
+ */
+public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
+
+    private final String CLASS_NAME = OrganizationAuthRefDocsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+
+    // Instance variables specific to this test.
+    final String SERVICE_PATH_COMPONENT = "intakes";
+    final String ORGANIZATION_AUTHORITY_NAME = "TestOrganizationAuth";
+    private String knownIntakeId = null;
+    private List<String> intakeIdsCreated = new ArrayList<String>();
+    private List<String> orgIdsCreated = new ArrayList<String>();
+    private String orgAuthCSID = null; 
+    //private String orgAuthRefName = null; 
+    private String currentOwnerOrgCSID = null; 
+    private String currentOwnerRefName = null;
+    private String depositorRefName = null;
+    private String conditionCheckerAssessorRefName = null;
+    private String insurerRefName = null;
+    private String valuerRefName = null;
+    private final int NUM_AUTH_REF_DOCS_EXPECTED = 1;
+    private final static String CURRENT_DATE_UTC =
+            GregorianCalendarDateTimeUtils.currentDateUTC();
+
+       @Override
+       protected String getServiceName() {
+               throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
+       }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+
+    // ---------------------------------------------------------------
+    // CRUD tests : CREATE tests
+    // ---------------------------------------------------------------
+    // Success outcomes
+    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
+    public void createIntakeWithAuthRefs(String testName) throws Exception {
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
+
+        // Submit the request to the service and store the response.
+        String identifier = createIdentifier();
+        
+        // Create all the organization refs and entities
+        createOrgRefs();
+
+        IntakeClient intakeClient = new IntakeClient();
+        PoxPayloadOut multipart = createIntakeInstance(
+                "entryNumber-" + identifier,
+                CURRENT_DATE_UTC,
+                currentOwnerRefName,
+                // Use currentOwnerRefName twice to test fix for CSPACE-2863
+                currentOwnerRefName,    //depositorRefName,
+                conditionCheckerAssessorRefName,
+                insurerRefName,
+                valuerRefName );
+
+        ClientResponse<Response> res = intakeClient.create(multipart);
+        try {
+               int statusCode = res.getStatus();
+       
+               // Check the status code of the response: does it match
+               // the expected response(s)?
+               //
+               // Specifically:
+               // Does it fall within the set of valid status codes?
+               // Does it exactly match the expected status code?
+               if(logger.isDebugEnabled()){
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+               res.releaseConnection();
+        }
+
+        // Store the ID returned from the first resource created
+        // for additional tests below.
+        if (knownIntakeId == null){
+            knownIntakeId = extractId(res);
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": knownIntakeId=" + knownIntakeId);
+            }
+        }
+        
+        // Store the IDs from every resource created by tests,
+        // so they can be deleted after tests have been run.
+        intakeIdsCreated.add(extractId(res));
+    }
+    
+    /**
+     * Creates the organization refs.
+     */
+    protected void createOrgRefs(){
+        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+        //orgAuthRefName = 
+       //      OrgAuthorityClientUtils.createOrgAuthRefName(ORGANIZATION_AUTHORITY_NAME, null);
+        PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
+                       ORGANIZATION_AUTHORITY_NAME, ORGANIZATION_AUTHORITY_NAME, orgAuthClient.getCommonPartName());
+        ClientResponse<Response> res = orgAuthClient.create(multipart);
+        int statusCode = res.getStatus();
+
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, STATUS_CREATED);
+        orgAuthCSID = extractId(res);
+        
+               currentOwnerOrgCSID = createOrganization("olivierOwnerCompany", "Olivier Owner Company", "Olivier Owner Company");
+        orgIdsCreated.add(currentOwnerOrgCSID);
+        currentOwnerRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, currentOwnerOrgCSID, orgAuthClient);
+        
+               String newOrgCSID =
+                        createOrganization("debbieDepositorAssocs", "Debbie Depositor & Associates", "Debbie Depositor & Associates");
+        depositorRefName = 
+               OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
+        orgIdsCreated.add(newOrgCSID);
+        
+               newOrgCSID = createOrganization("andrewCheckerAssessorLtd", "Andrew Checker-Assessor Ltd.", "Andrew Checker-Assessor Ltd.");
+               conditionCheckerAssessorRefName = 
+               OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
+        orgIdsCreated.add(newOrgCSID);
+        
+               newOrgCSID = createOrganization("ingridInsurerBureau", "Ingrid Insurer Bureau", "Ingrid Insurer Bureau");
+               insurerRefName = 
+               OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
+        orgIdsCreated.add(newOrgCSID);
+        
+               newOrgCSID = createOrganization("vinceValuerLLC", "Vince Valuer LLC", "Vince Valuer LLC");
+               valuerRefName = 
+               OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
+        orgIdsCreated.add(newOrgCSID);
+    }
+
+    protected String createOrganization(String shortId, String shortName, String longName) {
+        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+        Map<String, String> orgInfo = new HashMap<String,String>();
+        orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortId);
+        
+        List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();
+        OrgTermGroup term = new OrgTermGroup();
+        term.setTermDisplayName(shortName);
+        term.setTermName(shortName);
+        term.setMainBodyName(longName);
+        orgTerms.add(term);
+        PoxPayloadOut multipart =
+                OrgAuthorityClientUtils.createOrganizationInstance(null, //orgAuthRefName
+                orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
+
+        ClientResponse<Response> res = orgAuthClient.createItem(orgAuthCSID, multipart);
+        int statusCode = res.getStatus();
+
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, STATUS_CREATED);
+       return extractId(res);
+    }
+
+    // Success outcomes
+    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
+        dependsOnMethods = {"createIntakeWithAuthRefs"})
+    public void readAndCheckAuthRefDocs(String testName) throws Exception {
+        // Perform setup.
+        testSetup(STATUS_OK, ServiceRequestType.READ);
+        
+        // Get the auth ref docs and check them
+       OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+       ClientResponse<AuthorityRefDocList> refDocListResp =
+               orgAuthClient.getReferencingObjects(orgAuthCSID, currentOwnerOrgCSID);
+       AuthorityRefDocList list = null;
+       try {
+          assertStatusCode(refDocListResp, testName);
+          list = refDocListResp.getEntity();
+          Assert.assertNotNull(list);
+       } finally {
+          if (refDocListResp != null) {
+                  refDocListResp.releaseConnection();
+           }
+       }
+
+        // Optionally output additional data about list members for debugging.
+        boolean iterateThroughList = true;
+        int nIntakesFound = 0;
+        if(iterateThroughList && logger.isDebugEnabled()){
+            List<AuthorityRefDocList.AuthorityRefDocItem> items =
+                    list.getAuthorityRefDocItem();
+            int i = 0;
+            logger.debug(testName + ": Docs that use: " + currentOwnerRefName);
+            for(AuthorityRefDocList.AuthorityRefDocItem item : items){
+                logger.debug(testName + ": list-item[" + i + "] " +
+                               item.getDocType() + "(" +
+                               item.getDocId() + ") Name:[" +
+                               item.getDocName() + "] Number:[" +
+                               item.getDocNumber() + "] in field:[" +
+                               item.getSourceField() + "]");
+                if(knownIntakeId.equalsIgnoreCase(item.getDocId())) {
+                       nIntakesFound++;
+                }
+                i++;
+            }
+            //
+            Assert.assertTrue((nIntakesFound==2), "Did not find Intake (twice) with authref!");
+        }
+    }
+
+
+    // ---------------------------------------------------------------
+    // Cleanup of resources created during testing
+    // ---------------------------------------------------------------
+
+    /**
+     * Deletes all resources created by tests, after all tests have been run.
+     *
+     * This cleanup method will always be run, even if one or more tests fail.
+     * For this reason, it attempts to remove all resources created
+     * at any point during testing, even if some of those resources
+     * may be expected to be deleted by certain tests.
+     */
+    @AfterClass(alwaysRun=true)
+    public void cleanUp() {
+        String noTest = System.getProperty("noTestCleanup");
+       if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("Skipping Cleanup phase ...");
+            }
+            return;
+       }
+        if (logger.isDebugEnabled()) {
+            logger.debug("Cleaning up temporary resources created for testing ...");
+        }
+        IntakeClient intakeClient = new IntakeClient();
+        // Note: Any non-success responses are ignored and not reported.
+        for (String resourceId : intakeIdsCreated) {
+            ClientResponse<Response> res = intakeClient.delete(resourceId);
+            res.releaseConnection();
+        }
+        // Delete persons before PersonAuth
+        OrgAuthorityClient personAuthClient = new OrgAuthorityClient();
+        for (String resourceId : orgIdsCreated) {
+            ClientResponse<Response> res = personAuthClient.deleteItem(orgAuthCSID, resourceId);
+            res.releaseConnection();
+        }
+        if (orgAuthCSID != null) {
+               personAuthClient.delete(orgAuthCSID).releaseConnection();
+        }
+    }
+
+    // ---------------------------------------------------------------
+    // Utility methods used by tests above
+    // ---------------------------------------------------------------
+    @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+
+   private PoxPayloadOut createIntakeInstance(String entryNumber,
+               String entryDate,
+                               String currentOwner,
+                               String depositor,
+                               String conditionCheckerAssessor,
+                               String insurer,
+                               String Valuer ) {
+        IntakesCommon intake = new IntakesCommon();
+        intake.setEntryNumber(entryNumber);
+        intake.setEntryDate(entryDate);
+        intake.setCurrentOwner(currentOwner);
+        intake.setDepositor(depositor);
+        intake.setValuer(Valuer);
+
+        ConditionCheckerOrAssessorList checkerOrAssessorList = new ConditionCheckerOrAssessorList();
+        List<String> checkersOrAssessors = checkerOrAssessorList.getConditionCheckerOrAssessor();
+        checkersOrAssessors.add(conditionCheckerAssessor);
+        intake.setConditionCheckersOrAssessors(checkerOrAssessorList);
+
+        InsurerList insurerList = new InsurerList();
+        List<String> insurers = insurerList.getInsurer();
+        insurers.add(insurer);
+        intake.setInsurers(insurerList);
+
+        PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
+        PayloadOutputPart commonPart =
+            multipart.addPart(new IntakeClient().getCommonPartName(), intake);
+
+        if(logger.isDebugEnabled()){
+            logger.debug("to be created, intake common");
+            logger.debug(objectAsXmlString(intake, IntakesCommon.class));
+        }
+
+        return multipart;
+    }
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index def5f25edb79cc8c2491e5422b82476c78560fcd..45583ae4984b3df798136f67b78de2e41cf76366 100644 (file)
@@ -1,23 +1,23 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services;\r
-\r
-/**\r
- * @author remillet\r
- *\r
- */\r
-public interface IntakeJAXBSchema {\r
-       final static String CURRENT_OWNER = "currentOwner";\r
-       final static String DEPOSITOR = "depositor";\r
-       final static String DEPOSITORS_REQUIREMENTS = "depositorsRequirements";\r
-       final static String ENTRY_DATE = "entryDate";\r
-       final static String ENTRY_METHOD = "entryMethod";\r
-       final static String ENTRY_NOTE = "entryNote";\r
-       final static String ENTRY_NUMBER = "entryNumber";\r
-       final static String ENTRY_REASON = "entryReason";\r
-       final static String PACKING_NOTE = "packingNote";\r
-       final static String RETURN_DATE = "returnDate";\r
-}\r
-\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services;
+
+/**
+ * @author remillet
+ *
+ */
+public interface IntakeJAXBSchema {
+       final static String CURRENT_OWNER = "currentOwner";
+       final static String DEPOSITOR = "depositor";
+       final static String DEPOSITORS_REQUIREMENTS = "depositorsRequirements";
+       final static String ENTRY_DATE = "entryDate";
+       final static String ENTRY_METHOD = "entryMethod";
+       final static String ENTRY_NOTE = "entryNote";
+       final static String ENTRY_NUMBER = "entryNumber";
+       final static String ENTRY_REASON = "entryReason";
+       final static String PACKING_NOTE = "packingNote";
+       final static String RETURN_DATE = "returnDate";
+}
+
+
index 5d225097601fec5aefd2b6b1cf5e1eb2e053dd71..fa62544302e1918c03f6e11a60ad0204d9c200c0 100644 (file)
@@ -1,8 +1,8 @@
-package org.collectionspace.services;\r
-\r
-public interface IntakeListItemJAXBSchema {\r
-       final static String ENTRY_NUMBER = "entryNumber";\r
-       final static String DEPOSITOR="depositor";\r
-       final static String CSID = "csid";\r
-       final static String URI = "url";\r
-}\r
+package org.collectionspace.services;
+
+public interface IntakeListItemJAXBSchema {
+       final static String ENTRY_NUMBER = "entryNumber";
+       final static String DEPOSITOR="depositor";
+       final static String CSID = "csid";
+       final static String URI = "url";
+}
index 5a7bff2e86a67468c66618043db8c1fde4209de1..b98e309e561deeecc3bfba09b7ebce5c48afb6bc 100644 (file)
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- A comment. -->\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.intake</artifactId>\r
-    <name>services.intake</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A comment. -->
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.intake</artifactId>
+    <name>services.intake</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+
+</project>
+
index d8a06909b22ecca82d5e86b1c56aabdff43a9d84..9ad87dab6d79353c40219353f1f5cc591542fd46 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.intake</artifactId>        \r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.intake.service</artifactId>\r
-    <name>services.intake.service</name>\r
-    <packaging>jar</packaging>       \r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->        \r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-      <!-- javax -->\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <version>${nuxeo.core.version}</version>       \r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-intake</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.intake</artifactId>        
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.intake.service</artifactId>
+    <name>services.intake.service</name>
+    <packaging>jar</packaging>       
+
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+      <!-- javax -->
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <version>${nuxeo.core.version}</version>       
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-intake</finalName>
+    </build>
+</project>
+
index fffe25e93de208a695af885701ec2cc9698b522e..7e4123d660b714a168a7ae6eadabf00dcf7e98c5 100644 (file)
@@ -1,66 +1,66 @@
-package org.collectionspace.services.intake.nuxeo;\r
-\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.common.document.InvalidDocumentException;\r
-import org.collectionspace.services.common.document.ValidatorHandlerImpl;\r
-import org.collectionspace.services.intake.IntakesCommon;\r
-\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class IntakeValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut> {\r
-\r
-    /** The logger. */\r
-    private final Logger logger = LoggerFactory.getLogger(IntakeValidatorHandler.class);\r
-    \r
-    /** Error Messages **/\r
-    private static final String VALIDATION_ERROR = "The intake record payload was invalid. See log file for more details.";\r
-    \r
-       \r
-    @Override\r
-    protected Class<?> getCommonPartClass() {\r
-       return IntakesCommon.class;\r
-    }\r
-       \r
-       @Override\r
-       protected void handleCreate() throws InvalidDocumentException {\r
-               try {\r
-                       IntakesCommon intakesCommon = (IntakesCommon)getCommonPart();\r
-                       assert(intakesCommon != null);\r
-       } catch (AssertionError e) {\r
-               if (logger.isErrorEnabled() == true) {\r
-                       logger.error(e.getMessage(), e);\r
-               }\r
-               throw new InvalidDocumentException(VALIDATION_ERROR, e);\r
-       }\r
-       }\r
-\r
-       @Override\r
-       protected void handleGet() throws InvalidDocumentException {\r
-               // TODO Auto-generated method stub\r
-               \r
-       }\r
-\r
-       @Override\r
-       protected void handleGetAll() throws InvalidDocumentException {\r
-               // TODO Auto-generated method stub\r
-               \r
-       }\r
-\r
-       @Override\r
-       protected void handleUpdate() throws InvalidDocumentException {\r
-               // TODO Auto-generated method stub\r
-               \r
-       }\r
-\r
-       @Override\r
-       protected void handleDelete() throws InvalidDocumentException {\r
-               // TODO Auto-generated method stub\r
-               \r
-       }\r
-\r
-}\r
+package org.collectionspace.services.intake.nuxeo;
+
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandlerImpl;
+import org.collectionspace.services.intake.IntakesCommon;
+
+import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IntakeValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut> {
+
+    /** The logger. */
+    private final Logger logger = LoggerFactory.getLogger(IntakeValidatorHandler.class);
+    
+    /** Error Messages **/
+    private static final String VALIDATION_ERROR = "The intake record payload was invalid. See log file for more details.";
+    
+       
+    @Override
+    protected Class<?> getCommonPartClass() {
+       return IntakesCommon.class;
+    }
+       
+       @Override
+       protected void handleCreate() throws InvalidDocumentException {
+               try {
+                       IntakesCommon intakesCommon = (IntakesCommon)getCommonPart();
+                       assert(intakesCommon != null);
+       } catch (AssertionError e) {
+               if (logger.isErrorEnabled() == true) {
+                       logger.error(e.getMessage(), e);
+               }
+               throw new InvalidDocumentException(VALIDATION_ERROR, e);
+       }
+       }
+
+       @Override
+       protected void handleGet() throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               
+       }
+
+       @Override
+       protected void handleGetAll() throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               
+       }
+
+       @Override
+       protected void handleUpdate() throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               
+       }
+
+       @Override
+       protected void handleDelete() throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               
+       }
+
+}
index eeda2c4ba6ead1d65f3d435bc86a588df3e76100..02f91247ba457608e85a6920803df7418763392f 100644 (file)
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-\r
-<!-- pom.xml A Maven 2 project file for the 'jaxb' module of the ID Service \r
-       project. This document is a part of the source code and related artifacts \r
-       for CollectionSpace, an open source collections management system for museums \r
-       and related institutions: http://www.collectionspace.org http://wiki.collectionspace.org \r
-       Based on work by Sanjay Dalal and Richard Millet. $LastChangedBy: aron $ \r
-       $LastChangedRevision: 302 $ $LastChangedDate: 2009-06-29 15:36:29 -0700 (Mon, \r
-       29 Jun 2009) $ -->\r
-\r
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-\r
-       <parent>\r
-               <groupId>org.collectionspace.services</groupId>\r
-               <artifactId>org.collectionspace.services.main</artifactId>\r
-               <version>4.2-SNAPSHOT</version>\r
-       </parent>\r
-\r
-       <modelVersion>4.0.0</modelVersion>\r
-       <groupId>org.collectionspace.services</groupId>\r
-       <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-       <name>services.jaxb</name>\r
-\r
-       <dependencies>\r
-               <dependency>\r
-                       <groupId>com.sun.xml.bind</groupId>\r
-                       <artifactId>jaxb-impl</artifactId>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.jvnet.jaxb2_commons</groupId>\r
-                       <artifactId>jaxb2-basics</artifactId>\r
-                       <version>${jaxb2-basics.version}</version>\r
-               </dependency>\r
-       </dependencies>\r
-\r
-       <build>\r
-               <finalName>collectionspace-services-jaxb</finalName>\r
-               <defaultGoal>install</defaultGoal>\r
-               <plugins>\r
-                       <plugin>\r
-                               <groupId>org.jvnet.jaxb2.maven2</groupId>\r
-                               <artifactId>maven-jaxb2-plugin</artifactId>\r
-                       </plugin>\r
-               </plugins>\r
-       </build>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- pom.xml A Maven 2 project file for the 'jaxb' module of the ID Service 
+       project. This document is a part of the source code and related artifacts 
+       for CollectionSpace, an open source collections management system for museums 
+       and related institutions: http://www.collectionspace.org http://wiki.collectionspace.org 
+       Based on work by Sanjay Dalal and Richard Millet. $LastChangedBy: aron $ 
+       $LastChangedRevision: 302 $ $LastChangedDate: 2009-06-29 15:36:29 -0700 (Mon, 
+       29 Jun 2009) $ -->
+
+<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.main</artifactId>
+               <version>4.2-SNAPSHOT</version>
+       </parent>
+
+       <modelVersion>4.0.0</modelVersion>
+       <groupId>org.collectionspace.services</groupId>
+       <artifactId>org.collectionspace.services.jaxb</artifactId>
+       <name>services.jaxb</name>
+
+       <dependencies>
+               <dependency>
+                       <groupId>com.sun.xml.bind</groupId>
+                       <artifactId>jaxb-impl</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.jvnet.jaxb2_commons</groupId>
+                       <artifactId>jaxb2-basics</artifactId>
+                       <version>${jaxb2-basics.version}</version>
+               </dependency>
+       </dependencies>
+
+       <build>
+               <finalName>collectionspace-services-jaxb</finalName>
+               <defaultGoal>install</defaultGoal>
+               <plugins>
+                       <plugin>
+                               <groupId>org.jvnet.jaxb2.maven2</groupId>
+                               <artifactId>maven-jaxb2-plugin</artifactId>
+                       </plugin>
+               </plugins>
+       </build>
+
+</project>
+
index bc6aef7c9fa65c9925e1d9f88c19cff55770ae4e..95981887240b213d0e7f623f48710668bd1c0179 100644 (file)
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
-    Relation schema (XSD)\r
-    \r
-    Entity  : Relation\r
-    Part    : Common\r
-    Used for: JAXB binding between XML and Java objects\r
-            \r
-    $LastChangedRevision$\r
-    $LastChangedDate$\r
--->\r
-\r
-<xs:schema\r
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"\r
-    jaxb:version="1.0" elementFormDefault="unqualified"\r
-    xmlns="http://collectionspace.org/services/relation"\r
-    xmlns:rel="http://collectionspace.org/services/relation"\r
-    targetNamespace="http://collectionspace.org/services/relation">\r
-\r
-    <!-- Relation -->\r
-    <xs:element name="relations_common">\r
-        <xs:complexType>\r
-            <xs:sequence>\r
-               <xs:element name="csid" type="xs:string" />\r
-                        \r
-                <xs:element name="subjectCsid" type="xs:string"  minOccurs="1" maxOccurs="1"/>     <!-- new name for documentId1 -->\r
-                <xs:element name="subjectDocumentType" type="xs:string"  minOccurs="1" maxOccurs="1"/>     <!-- new name for documentType1 -->\r
-                <xs:element name="subjectUri" type="xs:string" minOccurs="1"/>\r
-                <xs:element name="subjectRefName" type="xs:string"  minOccurs="1" maxOccurs="1"/>\r
-\r
-                <!-- type of relationship between two entities -->\r
-                <xs:element name="relationshipType" type="xs:string" minOccurs="1"/>\r
-                <xs:element name="relationshipMetaType" type="xs:string" minOccurs="0"/>\r
-                <xs:element name="predicate" type="rel:RelationshipType" minOccurs="1" maxOccurs="1"/>   <!-- new name for relationshipType -->\r
-                <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
-                \r
-                <xs:element name="objectCsid" type="xs:string"  minOccurs="1" maxOccurs="1"/>        <!-- new name for documentId2 -->\r
-                <xs:element name="objectDocumentType" type="xs:string"  minOccurs="1" maxOccurs="1"/>        <!-- new name for documentType2 -->\r
-                <xs:element name="objectUri" type="xs:string" minOccurs="1"/>\r
-                <xs:element name="objectRefName" type="xs:string"  minOccurs="1" maxOccurs="1"/>\r
-            </xs:sequence>\r
-        </xs:complexType>\r
-    </xs:element>\r
-\r
-    <!-- enumeration defining the type of relationship between two entities -->\r
-    <!-- REM: Deprecating this type as it is too restrictive for the "relations_common:relationshipType" field  and will be replaced with "xs:string" -->\r
-    <xs:simpleType name="RelationshipType">\r
-        <xs:restriction base="xs:string">\r
-            <!-- Added for compatibility with current default value -->\r
-            <!-- in the Application Layer; see CSPACE-1815 -->\r
-            <xs:enumeration value="affects"/>\r
-            <!-- document with id as document-id-1 is associated with document with id as document-id-2 -->\r
-            <xs:enumeration value="association"/>\r
-            <!-- document with id as document-id-1 contains one or more document with id as document-id-2 -->\r
-            <xs:enumeration value="contains"/>\r
-            <!-- document with id as document-id-1 contains one or more document with id as document-id-2 -->\r
-            <xs:enumeration value="collectionobject-intake"/>\r
-            <!-- document with id as document-id-1 has parent document with id as document-id-2 -->\r
-            <xs:enumeration value="hasBroader" />\r
-        </xs:restriction>\r
-    </xs:simpleType>\r
-\r
-    <!-- This is the base class for paginated lists -->\r
-    <xs:complexType name="abstractCommonList">\r
-        <xs:annotation>\r
-            <xs:appinfo>\r
-                <jaxb:class ref="org.collectionspace.services.jaxb.AbstractCommonList"/>\r
-            </xs:appinfo>\r
-        </xs:annotation>\r
-    </xs:complexType>\r
-\r
-\r
-    <xs:complexType name="relationsDocListItem">\r
-        <xs:sequence>\r
-            <xs:element name="uri" type="xs:anyURI" minOccurs="1"/>\r
-            <xs:element name="csid" type="xs:string" minOccurs="1"/>\r
-            <xs:element name="refName" type="xs:string" minOccurs="1"/>\r
-            <xs:element name="name" type="xs:string" minOccurs="1"/>\r
-            <xs:element name="number" type="xs:string" minOccurs="1"/>\r
-            <xs:element name="documentType" type="xs:string" minOccurs="1"/>\r
-            <!-- order is for potential use by app/gui.  services won't do anything with it.-->\r
-            <xs:element name="order" type="xs:string" minOccurs="0"/>\r
-            <!-- key is for things like -which predicate type search did this list come from-->\r
-            <xs:element name="key" type="xs:string" minOccurs="0"/>\r
-            <!-- error is filled in and present only when sercices has crawled this record, and found that the related item was not in DB.-->\r
-            <xs:element name="error" type="xs:string" minOccurs="0"/>\r
-        </xs:sequence>\r
-    </xs:complexType>\r
-\r
-\r
-    <!-- collection objects as in nuxeo repository -->\r
-    <xs:element name="relations-common-list">\r
-        <xs:complexType>\r
-            <xs:complexContent>\r
-                <xs:extension base="abstractCommonList">                    \r
-                    <xs:sequence>\r
-                        <xs:element name="relation-list-item" maxOccurs="unbounded">\r
-                            <xs:complexType>\r
-                                <xs:sequence>\r
-                                    <xs:element name="uri" type="xs:anyURI" minOccurs="1"/>\r
-                                    <xs:element name="csid" type="xs:string" minOccurs="1"/>\r
-                                    <xs:element name="subjectCsid" type="xs:string" minOccurs="1"/>\r
-                                    <xs:element name="relationshipType" type="xs:string" minOccurs="1"/>\r
-                                    <xs:element name="predicate" type="xs:string" minOccurs="1"/>\r
-                                    <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>\r
-                                    <xs:element name="relationshipMetaType" type="xs:string" minOccurs="1"/>\r
-                                    <xs:element name="objectCsid" type="xs:string" minOccurs="1"/>\r
-                                    <xs:element name="subject" type="relationsDocListItem" minOccurs="1"/>\r
-                                    <xs:element name="object" type="relationsDocListItem" minOccurs="1"/>\r
-                                </xs:sequence>\r
-                            </xs:complexType>\r
-                        </xs:element>\r
-                    </xs:sequence>\r
-                </xs:extension>\r
-            </xs:complexContent>                    \r
-        </xs:complexType>\r
-    </xs:element>\r
-    \r
-</xs:schema>\r
-\r
-\r
-\r
-\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Relation schema (XSD)
+    
+    Entity  : Relation
+    Part    : Common
+    Used for: JAXB binding between XML and Java objects
+            
+    $LastChangedRevision$
+    $LastChangedDate$
+-->
+
+<xs:schema
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+    jaxb:version="1.0" elementFormDefault="unqualified"
+    xmlns="http://collectionspace.org/services/relation"
+    xmlns:rel="http://collectionspace.org/services/relation"
+    targetNamespace="http://collectionspace.org/services/relation">
+
+    <!-- Relation -->
+    <xs:element name="relations_common">
+        <xs:complexType>
+            <xs:sequence>
+               <xs:element name="csid" type="xs:string" />
+                        
+                <xs:element name="subjectCsid" type="xs:string"  minOccurs="1" maxOccurs="1"/>     <!-- new name for documentId1 -->
+                <xs:element name="subjectDocumentType" type="xs:string"  minOccurs="1" maxOccurs="1"/>     <!-- new name for documentType1 -->
+                <xs:element name="subjectUri" type="xs:string" minOccurs="1"/>
+                <xs:element name="subjectRefName" type="xs:string"  minOccurs="1" maxOccurs="1"/>
+
+                <!-- type of relationship between two entities -->
+                <xs:element name="relationshipType" type="xs:string" minOccurs="1"/>
+                <xs:element name="relationshipMetaType" type="xs:string" minOccurs="0"/>
+                <xs:element name="predicate" type="rel:RelationshipType" minOccurs="1" maxOccurs="1"/>   <!-- new name for relationshipType -->
+                <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>
+                
+                <xs:element name="objectCsid" type="xs:string"  minOccurs="1" maxOccurs="1"/>        <!-- new name for documentId2 -->
+                <xs:element name="objectDocumentType" type="xs:string"  minOccurs="1" maxOccurs="1"/>        <!-- new name for documentType2 -->
+                <xs:element name="objectUri" type="xs:string" minOccurs="1"/>
+                <xs:element name="objectRefName" type="xs:string"  minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+
+    <!-- enumeration defining the type of relationship between two entities -->
+    <!-- REM: Deprecating this type as it is too restrictive for the "relations_common:relationshipType" field  and will be replaced with "xs:string" -->
+    <xs:simpleType name="RelationshipType">
+        <xs:restriction base="xs:string">
+            <!-- Added for compatibility with current default value -->
+            <!-- in the Application Layer; see CSPACE-1815 -->
+            <xs:enumeration value="affects"/>
+            <!-- document with id as document-id-1 is associated with document with id as document-id-2 -->
+            <xs:enumeration value="association"/>
+            <!-- document with id as document-id-1 contains one or more document with id as document-id-2 -->
+            <xs:enumeration value="contains"/>
+            <!-- document with id as document-id-1 contains one or more document with id as document-id-2 -->
+            <xs:enumeration value="collectionobject-intake"/>
+            <!-- document with id as document-id-1 has parent document with id as document-id-2 -->
+            <xs:enumeration value="hasBroader" />
+        </xs:restriction>
+    </xs:simpleType>
+
+    <!-- This is the base class for paginated lists -->
+    <xs:complexType name="abstractCommonList">
+        <xs:annotation>
+            <xs:appinfo>
+                <jaxb:class ref="org.collectionspace.services.jaxb.AbstractCommonList"/>
+            </xs:appinfo>
+        </xs:annotation>
+    </xs:complexType>
+
+
+    <xs:complexType name="relationsDocListItem">
+        <xs:sequence>
+            <xs:element name="uri" type="xs:anyURI" minOccurs="1"/>
+            <xs:element name="csid" type="xs:string" minOccurs="1"/>
+            <xs:element name="refName" type="xs:string" minOccurs="1"/>
+            <xs:element name="name" type="xs:string" minOccurs="1"/>
+            <xs:element name="number" type="xs:string" minOccurs="1"/>
+            <xs:element name="documentType" type="xs:string" minOccurs="1"/>
+            <!-- order is for potential use by app/gui.  services won't do anything with it.-->
+            <xs:element name="order" type="xs:string" minOccurs="0"/>
+            <!-- key is for things like -which predicate type search did this list come from-->
+            <xs:element name="key" type="xs:string" minOccurs="0"/>
+            <!-- error is filled in and present only when sercices has crawled this record, and found that the related item was not in DB.-->
+            <xs:element name="error" type="xs:string" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+
+
+    <!-- collection objects as in nuxeo repository -->
+    <xs:element name="relations-common-list">
+        <xs:complexType>
+            <xs:complexContent>
+                <xs:extension base="abstractCommonList">                    
+                    <xs:sequence>
+                        <xs:element name="relation-list-item" maxOccurs="unbounded">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:element name="uri" type="xs:anyURI" minOccurs="1"/>
+                                    <xs:element name="csid" type="xs:string" minOccurs="1"/>
+                                    <xs:element name="subjectCsid" type="xs:string" minOccurs="1"/>
+                                    <xs:element name="relationshipType" type="xs:string" minOccurs="1"/>
+                                    <xs:element name="predicate" type="xs:string" minOccurs="1"/>
+                                    <xs:element name="predicateDisplayName" type="xs:string" minOccurs="1"/>
+                                    <xs:element name="relationshipMetaType" type="xs:string" minOccurs="1"/>
+                                    <xs:element name="objectCsid" type="xs:string" minOccurs="1"/>
+                                    <xs:element name="subject" type="relationsDocListItem" minOccurs="1"/>
+                                    <xs:element name="object" type="relationsDocListItem" minOccurs="1"/>
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
+                    </xs:sequence>
+                </xs:extension>
+            </xs:complexContent>                    
+        </xs:complexType>
+    </xs:element>
+    
+</xs:schema>
+
+
+
+
+
+
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 62877a5f951fa4332353cae0d3748128c8e91128..6e2025c07dec07d8367c2d4341b6b6f359212225 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.loanin</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.loanin</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 059aa39769511f47a94e9894605a34863e66400a..9b51d5ec50fe86f00100a632a62e6f9ddb22d99e 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.loanin.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.loanin.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 5d279352a2a0b949d2c69ece74748c3f27429431..fb5f09dd94673cc615a499b892cfbd7fca2d9908 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.loanout</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.loanout</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index e1dd95864caeb91cb9706565e5a866b6e7276c68..c0993a5fa353b4b56996a513aa8248883395bd38 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.loanout.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.loanout.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 7e663eb30633584aeb9cff8aa5d95aa703f05839..ec329482256005de3202dd79a08c1bf1c0570581 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.location</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.location</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index a2270c68b2c8f63e88899db1827bf8540254e71f..2950ff81f9f389d9e089434a0ff5a1ecd7ee6363 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.location.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.location.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d795bfef54a431f47d0678f777b3467a6f95227d..3436086ba1f3871735373923a2acb154da1d7c08 100644 (file)
-\r
-<project name="location.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        location service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy location in ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <ant antfile="nuxeo-platform-cs-location/build.xml" target="deploy" inheritall="false"/>\r
-        -->\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy location from ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-       leaving this only for backwards compatibility reasons. -->\r
-        <ant antfile="nuxeo-platform-cs-location/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for location" depends="package">\r
-        <ant antfile="nuxeo-platform-cs-location/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-location/build.xml" target="dist_installer" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="location.3rdparty" default="package" basedir=".">
+    <description>
+        location service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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 location in ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <ant antfile="nuxeo-platform-cs-location/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+    description="undeploy location from ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       leaving this only for backwards compatibility reasons. -->
+        <ant antfile="nuxeo-platform-cs-location/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for location" depends="package">
+        <ant antfile="nuxeo-platform-cs-location/build.xml" target="dist" inheritall="false"/>
+    </target>
+    
+    <target name="dist_installer"
+    description="generate distribution for collectionobject" depends="package">
+        <ant antfile="nuxeo-platform-cs-location/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index 9de3555f86c692142f3936aff88456dc1f56b656..20ed9e5b7c25f326db71575b6445dbfe782b933c 100644 (file)
@@ -1,23 +1,23 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.location</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.location.3rdparty</artifactId>\r
-    <name>services.location.3rdparty</name>\r
-    <packaging>pom</packaging>\r
-    <description>\r
-        3rd party build for location service\r
-    </description>\r
-\r
-    <modules>\r
-        <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-            <module>nuxeo-platform-cs-location</module>\r
-        -->\r
-    </modules>\r
-</project>\r
+<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.location</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.location.3rdparty</artifactId>
+    <name>services.location.3rdparty</name>
+    <packaging>pom</packaging>
+    <description>
+        3rd party build for location service
+    </description>
+
+    <modules>
+        <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+            <module>nuxeo-platform-cs-location</module>
+        -->
+    </modules>
+</project>
index 943a8a0c800d6bf8678dde20f291b0ffa768cde3..a1840238d6ffd42ed9bc366441575bfc763ee090 100644 (file)
-\r
-<project name="location" default="package" basedir=".">\r
-    <description>\r
-        Location Authority service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-        <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy location service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="undeploy location service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-        description="distribute location service">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist_installer" depends="package"\r
-        description="distribute location service">        \r
-        <!-- copy install scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.installer.services}/location">\r
-            <fileset dir="${basedir}/installer/"/>\r
-        </copy>\r
-        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="location" default="package" basedir=".">
+    <description>
+        Location Authority service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+        <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 location service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy location service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+        description="distribute location service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+    <target name="dist_installer" depends="package"
+        description="distribute location service">        
+        <!-- copy install scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.installer.services}/location">
+            <fileset dir="${basedir}/installer/"/>
+        </copy>
+        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index b3e358bd226f2f0ccd4311d3b5737b92838db6b5..0f2fd2dd3d62276ad6c23dff1ef129698b4d6334 100644 (file)
@@ -1,93 +1,93 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.location</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.location.client</artifactId>\r
-    <name>services.location.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.location.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.contact.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-location-client</finalName>\r
-        <plugins>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.location</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.location.client</artifactId>
+    <name>services.location.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.location.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-location-client</finalName>
+        <plugins>
+        </plugins>
+    </build>
+</project>
+
index e8ae69ad01207ad654bbfbda7d8e8111457d2217..d1355888896bd9a88a01df828aea0f6bdcb4b8e4 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import java.io.File;\r
-import java.util.ArrayList;\r
-import java.util.Date;\r
-import java.util.List;\r
-import java.util.Map;\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-import org.apache.commons.io.FileUtils;\r
-import org.collectionspace.services.LocationJAXBSchema;\r
-import org.collectionspace.services.client.test.ServiceRequestType;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.location.*;\r
-import org.dom4j.DocumentException;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class LocationAuthorityClientUtils {\r
-    private static final Logger logger =\r
-        LoggerFactory.getLogger(LocationAuthorityClientUtils.class);\r
-\r
-    /**\r
-     * Creates a new Location Authority\r
-     * @param displayName      The displayName used in UI, etc.\r
-     * @param refName          The proper refName for this authority\r
-     * @param headerLabel      The common part label\r
-     * @return The PoxPayloadOut payload for the create call\r
-     */\r
-    public static PoxPayloadOut createLocationAuthorityInstance(\r
-               String displayName, String shortIdentifier, String headerLabel ) {\r
-       \r
-        LocationauthoritiesCommon locationAuthority = new LocationauthoritiesCommon();\r
-        locationAuthority.setDisplayName(displayName);\r
-        locationAuthority.setShortIdentifier(shortIdentifier);\r
-        // String refName = createLocationAuthRefName(shortIdentifier, displayName);\r
-        // locationAuthority.setRefName(refName);\r
-        locationAuthority.setVocabType("LocationAuthority"); //FIXME: REM - Should this really be hard-coded?\r
-        \r
-        PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_PAYLOAD_NAME);\r
-        PayloadOutputPart commonPart = multipart.addPart(headerLabel, locationAuthority);\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, locationAuthority common ", \r
-                                       locationAuthority, LocationauthoritiesCommon.class);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-\r
-    /**\r
-     * @param locationRefName  The proper refName for this authority\r
-     * @param locationInfo the properties for the new Location. Can pass in one condition\r
-     *                                                 note and date string.\r
-     * @param headerLabel      The common part label\r
-     * @return The PoxPayloadOut payload for the create call\r
-     */\r
-    public static PoxPayloadOut createLocationInstance( \r
-               String locationAuthRefName, Map<String, String> locationInfo, \r
-                               List<LocTermGroup> terms, String headerLabel){\r
-        LocationsCommon location = new LocationsCommon();\r
-       String shortId = locationInfo.get(LocationJAXBSchema.SHORT_IDENTIFIER);\r
-       String displayName = locationInfo.get(LocationJAXBSchema.DISPLAY_NAME);\r
-       location.setShortIdentifier(shortId);\r
-       // String locationRefName = createLocationRefName(locationAuthRefName, shortId, displayName);\r
-               // location.setRefName(locationRefName);\r
-               String value = null;\r
-       value = locationInfo.get(LocationJAXBSchema.DISPLAY_NAME_COMPUTED);\r
-       boolean displayNameComputed = (value==null) || value.equalsIgnoreCase("true");\r
-        \r
-        // Set values in the Term Information Group\r
-        LocTermGroupList termList = new LocTermGroupList();\r
-        if (terms == null || terms.isEmpty()) {\r
-            terms = getTermGroupInstance(getGeneratedIdentifier());\r
-        }\r
-        termList.getLocTermGroup().addAll(terms); \r
-        location.setLocTermGroupList(termList);\r
-        \r
-        if((value = (String)locationInfo.get(LocationJAXBSchema.CONDITION_NOTE))!=null) {\r
-            ConditionGroupList conditionGroupList = new ConditionGroupList();\r
-            List<ConditionGroup> conditionGroups = conditionGroupList.getConditionGroup();\r
-            ConditionGroup conditionGroup = new ConditionGroup();\r
-            conditionGroup.setConditionNote(value);\r
-            if((value = (String)locationInfo.get(LocationJAXBSchema.CONDITION_NOTE_DATE))!=null)\r
-               conditionGroup.setConditionNoteDate(value);\r
-            conditionGroups.add(conditionGroup);\r
-            location.setConditionGroupList(conditionGroupList);\r
-        }\r
-        if((value = (String)locationInfo.get(LocationJAXBSchema.SECURITY_NOTE))!=null)\r
-               location.setSecurityNote(value);\r
-        if((value = (String)locationInfo.get(LocationJAXBSchema.ACCESS_NOTE))!=null)\r
-               location.setAccessNote(value);\r
-        if((value = (String)locationInfo.get(LocationJAXBSchema.LOCATION_TYPE))!=null)\r
-               location.setLocationType(value);\r
-        if((value = (String)locationInfo.get(LocationJAXBSchema.ADDRESS))!=null)\r
-               location.setAddress(value);\r
-\r
-        PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);\r
-        PayloadOutputPart commonPart = multipart.addPart(location,\r
-            MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.setLabel(headerLabel);\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, location common ", location, LocationsCommon.class);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-    \r
-    /**\r
-     * @param vcsid CSID of the authority to create a new location in\r
-     * @param locationAuthorityRefName The refName for the authority\r
-     * @param locationMap the properties for the new Location\r
-     * @param client the service client\r
-     * @return the CSID of the new item\r
-     */\r
-    public static String createItemInAuthority(String vcsid, \r
-               String locationAuthorityRefName, Map<String,String> locationMap,\r
-               List<LocTermGroup> terms, LocationAuthorityClient client ) {\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-        \r
-        String displayName = "";\r
-        if ((terms !=null) && (! terms.isEmpty())) {\r
-            displayName = terms.get(0).getTermDisplayName();\r
-        }\r
-       \r
-       if(logger.isDebugEnabled()){\r
-               logger.debug("Creating item with display name: \"" + displayName\r
-                               +"\" in locationAuthority: \"" + vcsid +"\"");\r
-       }\r
-        \r
-       PoxPayloadOut multipart = \r
-               createLocationInstance( locationAuthorityRefName,\r
-                       locationMap, terms, client.getItemCommonPartName() );\r
-       String newID = null;\r
-       ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
-        try {\r
-               int statusCode = res.getStatus();\r
-       \r
-               if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-                       throw new RuntimeException("Could not create Item: \""\r
-                                       +locationMap.get(LocationJAXBSchema.SHORT_IDENTIFIER)\r
-                                       +"\" in locationAuthority: \"" + locationAuthorityRefName\r
-                                       +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-               }\r
-               if(statusCode != EXPECTED_STATUS_CODE) {\r
-                       throw new RuntimeException("Unexpected Status when creating Item: \""\r
-                                       +locationMap.get(LocationJAXBSchema.SHORT_IDENTIFIER)\r
-                                       +"\" in locationAuthority: \"" + locationAuthorityRefName +"\", Status:"+ statusCode);\r
-               }\r
-               newID = extractId(res);\r
-        } finally {\r
-               res.releaseConnection();\r
-        }\r
-\r
-       return newID;\r
-    }\r
-\r
-    public static PoxPayloadOut createLocationInstance(\r
-               String commonPartXML, String headerLabel)  throws DocumentException {\r
-        PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);\r
-        PayloadOutputPart commonPart = multipart.addPart(commonPartXML,\r
-            MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.setLabel(headerLabel);\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, location common ", commonPartXML);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-    \r
-    public static String createItemInAuthority(String vcsid,\r
-               String commonPartXML,\r
-               LocationAuthorityClient client ) throws DocumentException {\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-       \r
-       PoxPayloadOut multipart = \r
-               createLocationInstance(commonPartXML, client.getItemCommonPartName());\r
-       String newID = null;\r
-       ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
-        try {\r
-               int statusCode = res.getStatus();\r
-       \r
-               if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-                       throw new RuntimeException("Could not create Item: \""+commonPartXML\r
-                                       +"\" in locationAuthority: \"" + vcsid\r
-                                       +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-               }\r
-               if(statusCode != EXPECTED_STATUS_CODE) {\r
-                       throw new RuntimeException("Unexpected Status when creating Item: \""+commonPartXML\r
-                                       +"\" in locationAuthority: \"" + vcsid +"\", Status:"+ statusCode);\r
-               }\r
-               newID = extractId(res);\r
-        } finally {\r
-               res.releaseConnection();\r
-        }\r
-\r
-       return newID;\r
-    }\r
-    \r
-    /**\r
-     * Creates the from xml file.\r
-     *\r
-     * @param fileName the file name\r
-     * @return new CSID as string\r
-     * @throws Exception the exception\r
-     */\r
-    private String createItemInAuthorityFromXmlFile(String vcsid, String commonPartFileName, \r
-               LocationAuthorityClient client) throws Exception {\r
-        byte[] b = FileUtils.readFileToByteArray(new File(commonPartFileName));\r
-        String commonPartXML = new String(b);\r
-       return createItemInAuthority(vcsid, commonPartXML, client );\r
-    }    \r
-\r
-    /**\r
-     * Creates the locationAuthority ref name.\r
-     *\r
-     * @param shortId the locationAuthority shortIdentifier\r
-     * @param displaySuffix displayName to be appended, if non-null\r
-     * @return the string\r
-     */\r
-    public static String createLocationAuthRefName(String shortId, String displaySuffix) {\r
-       String refName = "urn:cspace:org.collectionspace.demo:locationauthority:name("\r
-                       +shortId+")";\r
-               if(displaySuffix!=null&&!displaySuffix.isEmpty())\r
-                       refName += "'"+displaySuffix+"'";\r
-       return refName;\r
-    }\r
-\r
-    /**\r
-     * Creates the location ref name.\r
-     *\r
-     * @param locationAuthRefName the locationAuthority ref name\r
-     * @param shortId the location shortIdentifier\r
-     * @param displaySuffix displayName to be appended, if non-null\r
-     * @return the string\r
-     */\r
-    public static String createLocationRefName(\r
-                                               String locationAuthRefName, String shortId, String displaySuffix) {\r
-       String refName = locationAuthRefName+":location:name("+shortId+")";\r
-               if(displaySuffix!=null&&!displaySuffix.isEmpty())\r
-                       refName += "'"+displaySuffix+"'";\r
-       return refName;\r
-    }\r
-\r
-    public static String extractId(ClientResponse<Response> res) {\r
-        MultivaluedMap<String, Object> mvm = res.getMetadata();\r
-        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("extractId:uri=" + uri);\r
-        }\r
-        String[] segments = uri.split("/");\r
-        String id = segments[segments.length - 1];\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("id=" + id);\r
-        }\r
-        return id;\r
-    }\r
-    \r
-    /**\r
-     * Returns an error message indicating that the status code returned by a\r
-     * specific call to a service does not fall within a set of valid status\r
-     * codes for that service.\r
-     *\r
-     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).\r
-     *\r
-     * @param statusCode  The invalid status code that was returned in the response,\r
-     *                    from submitting that type of request to the service.\r
-     *\r
-     * @return An error message.\r
-     */\r
-    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {\r
-        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +\r
-                requestType.validStatusCodesAsString();\r
-    }\r
-\r
-\r
-    \r
-    /**\r
-     * Produces a default displayName from the basic name and dates fields.\r
-     * @see LocationDocumentModelHandler.prepareDefaultDisplayName() which\r
-     * duplicates this logic, until we define a service-general utils package\r
-     * that is neither client nor service specific.\r
-     * @param name     \r
-     * @return\r
-     */\r
-    public static String prepareDefaultDisplayName(\r
-               String name ) {\r
-       StringBuilder newStr = new StringBuilder();\r
-                       newStr.append(name);\r
-               return newStr.toString();\r
-    }\r
-    \r
-    public static List<LocTermGroup> getTermGroupInstance(String identifier) {\r
-        if (Tools.isBlank(identifier)) {\r
-            identifier = getGeneratedIdentifier();\r
-        }\r
-        List<LocTermGroup> terms = new ArrayList<LocTermGroup>();\r
-        LocTermGroup term = new LocTermGroup();\r
-        term.setTermDisplayName(identifier);\r
-        term.setTermName(identifier);\r
-        terms.add(term);\r
-        return terms;\r
-    }\r
-    \r
-    private static String getGeneratedIdentifier() {\r
-        return "id" + new Date().getTime(); \r
-   }\r
-\r
-}\r
+package org.collectionspace.services.client;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.FileUtils;
+import org.collectionspace.services.LocationJAXBSchema;
+import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.location.*;
+import org.dom4j.DocumentException;
+import org.jboss.resteasy.client.ClientResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class LocationAuthorityClientUtils {
+    private static final Logger logger =
+        LoggerFactory.getLogger(LocationAuthorityClientUtils.class);
+
+    /**
+     * Creates a new Location Authority
+     * @param displayName      The displayName used in UI, etc.
+     * @param refName          The proper refName for this authority
+     * @param headerLabel      The common part label
+     * @return The PoxPayloadOut payload for the create call
+     */
+    public static PoxPayloadOut createLocationAuthorityInstance(
+               String displayName, String shortIdentifier, String headerLabel ) {
+       
+        LocationauthoritiesCommon locationAuthority = new LocationauthoritiesCommon();
+        locationAuthority.setDisplayName(displayName);
+        locationAuthority.setShortIdentifier(shortIdentifier);
+        // String refName = createLocationAuthRefName(shortIdentifier, displayName);
+        // locationAuthority.setRefName(refName);
+        locationAuthority.setVocabType("LocationAuthority"); //FIXME: REM - Should this really be hard-coded?
+        
+        PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(headerLabel, locationAuthority);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, locationAuthority common ", 
+                                       locationAuthority, LocationauthoritiesCommon.class);
+        }
+
+        return multipart;
+    }
+
+    /**
+     * @param locationRefName  The proper refName for this authority
+     * @param locationInfo the properties for the new Location. Can pass in one condition
+     *                                                 note and date string.
+     * @param headerLabel      The common part label
+     * @return The PoxPayloadOut payload for the create call
+     */
+    public static PoxPayloadOut createLocationInstance( 
+               String locationAuthRefName, Map<String, String> locationInfo, 
+                               List<LocTermGroup> terms, String headerLabel){
+        LocationsCommon location = new LocationsCommon();
+       String shortId = locationInfo.get(LocationJAXBSchema.SHORT_IDENTIFIER);
+       String displayName = locationInfo.get(LocationJAXBSchema.DISPLAY_NAME);
+       location.setShortIdentifier(shortId);
+       // String locationRefName = createLocationRefName(locationAuthRefName, shortId, displayName);
+               // location.setRefName(locationRefName);
+               String value = null;
+       value = locationInfo.get(LocationJAXBSchema.DISPLAY_NAME_COMPUTED);
+       boolean displayNameComputed = (value==null) || value.equalsIgnoreCase("true");
+        
+        // Set values in the Term Information Group
+        LocTermGroupList termList = new LocTermGroupList();
+        if (terms == null || terms.isEmpty()) {
+            terms = getTermGroupInstance(getGeneratedIdentifier());
+        }
+        termList.getLocTermGroup().addAll(terms); 
+        location.setLocTermGroupList(termList);
+        
+        if((value = (String)locationInfo.get(LocationJAXBSchema.CONDITION_NOTE))!=null) {
+            ConditionGroupList conditionGroupList = new ConditionGroupList();
+            List<ConditionGroup> conditionGroups = conditionGroupList.getConditionGroup();
+            ConditionGroup conditionGroup = new ConditionGroup();
+            conditionGroup.setConditionNote(value);
+            if((value = (String)locationInfo.get(LocationJAXBSchema.CONDITION_NOTE_DATE))!=null)
+               conditionGroup.setConditionNoteDate(value);
+            conditionGroups.add(conditionGroup);
+            location.setConditionGroupList(conditionGroupList);
+        }
+        if((value = (String)locationInfo.get(LocationJAXBSchema.SECURITY_NOTE))!=null)
+               location.setSecurityNote(value);
+        if((value = (String)locationInfo.get(LocationJAXBSchema.ACCESS_NOTE))!=null)
+               location.setAccessNote(value);
+        if((value = (String)locationInfo.get(LocationJAXBSchema.LOCATION_TYPE))!=null)
+               location.setLocationType(value);
+        if((value = (String)locationInfo.get(LocationJAXBSchema.ADDRESS))!=null)
+               location.setAddress(value);
+
+        PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(location,
+            MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, location common ", location, LocationsCommon.class);
+        }
+
+        return multipart;
+    }
+    
+    /**
+     * @param vcsid CSID of the authority to create a new location in
+     * @param locationAuthorityRefName The refName for the authority
+     * @param locationMap the properties for the new Location
+     * @param client the service client
+     * @return the CSID of the new item
+     */
+    public static String createItemInAuthority(String vcsid, 
+               String locationAuthorityRefName, Map<String,String> locationMap,
+               List<LocTermGroup> terms, LocationAuthorityClient client ) {
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+        
+        String displayName = "";
+        if ((terms !=null) && (! terms.isEmpty())) {
+            displayName = terms.get(0).getTermDisplayName();
+        }
+       
+       if(logger.isDebugEnabled()){
+               logger.debug("Creating item with display name: \"" + displayName
+                               +"\" in locationAuthority: \"" + vcsid +"\"");
+       }
+        
+       PoxPayloadOut multipart = 
+               createLocationInstance( locationAuthorityRefName,
+                       locationMap, terms, client.getItemCommonPartName() );
+       String newID = null;
+       ClientResponse<Response> res = client.createItem(vcsid, multipart);
+        try {
+               int statusCode = res.getStatus();
+       
+               if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                       throw new RuntimeException("Could not create Item: \""
+                                       +locationMap.get(LocationJAXBSchema.SHORT_IDENTIFIER)
+                                       +"\" in locationAuthority: \"" + locationAuthorityRefName
+                                       +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+               }
+               if(statusCode != EXPECTED_STATUS_CODE) {
+                       throw new RuntimeException("Unexpected Status when creating Item: \""
+                                       +locationMap.get(LocationJAXBSchema.SHORT_IDENTIFIER)
+                                       +"\" in locationAuthority: \"" + locationAuthorityRefName +"\", Status:"+ statusCode);
+               }
+               newID = extractId(res);
+        } finally {
+               res.releaseConnection();
+        }
+
+       return newID;
+    }
+
+    public static PoxPayloadOut createLocationInstance(
+               String commonPartXML, String headerLabel)  throws DocumentException {
+        PoxPayloadOut multipart = new PoxPayloadOut(LocationAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(commonPartXML,
+            MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, location common ", commonPartXML);
+        }
+
+        return multipart;
+    }
+    
+    public static String createItemInAuthority(String vcsid,
+               String commonPartXML,
+               LocationAuthorityClient client ) throws DocumentException {
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+       
+       PoxPayloadOut multipart = 
+               createLocationInstance(commonPartXML, client.getItemCommonPartName());
+       String newID = null;
+       ClientResponse<Response> res = client.createItem(vcsid, multipart);
+        try {
+               int statusCode = res.getStatus();
+       
+               if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                       throw new RuntimeException("Could not create Item: \""+commonPartXML
+                                       +"\" in locationAuthority: \"" + vcsid
+                                       +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+               }
+               if(statusCode != EXPECTED_STATUS_CODE) {
+                       throw new RuntimeException("Unexpected Status when creating Item: \""+commonPartXML
+                                       +"\" in locationAuthority: \"" + vcsid +"\", Status:"+ statusCode);
+               }
+               newID = extractId(res);
+        } finally {
+               res.releaseConnection();
+        }
+
+       return newID;
+    }
+    
+    /**
+     * Creates the from xml file.
+     *
+     * @param fileName the file name
+     * @return new CSID as string
+     * @throws Exception the exception
+     */
+    private String createItemInAuthorityFromXmlFile(String vcsid, String commonPartFileName, 
+               LocationAuthorityClient client) throws Exception {
+        byte[] b = FileUtils.readFileToByteArray(new File(commonPartFileName));
+        String commonPartXML = new String(b);
+       return createItemInAuthority(vcsid, commonPartXML, client );
+    }    
+
+    /**
+     * Creates the locationAuthority ref name.
+     *
+     * @param shortId the locationAuthority shortIdentifier
+     * @param displaySuffix displayName to be appended, if non-null
+     * @return the string
+     */
+    public static String createLocationAuthRefName(String shortId, String displaySuffix) {
+       String refName = "urn:cspace:org.collectionspace.demo:locationauthority:name("
+                       +shortId+")";
+               if(displaySuffix!=null&&!displaySuffix.isEmpty())
+                       refName += "'"+displaySuffix+"'";
+       return refName;
+    }
+
+    /**
+     * Creates the location ref name.
+     *
+     * @param locationAuthRefName the locationAuthority ref name
+     * @param shortId the location shortIdentifier
+     * @param displaySuffix displayName to be appended, if non-null
+     * @return the string
+     */
+    public static String createLocationRefName(
+                                               String locationAuthRefName, String shortId, String displaySuffix) {
+       String refName = locationAuthRefName+":location:name("+shortId+")";
+               if(displaySuffix!=null&&!displaySuffix.isEmpty())
+                       refName += "'"+displaySuffix+"'";
+       return refName;
+    }
+
+    public static String extractId(ClientResponse<Response> res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);
+        if(logger.isDebugEnabled()){
+               logger.debug("extractId:uri=" + uri);
+        }
+        String[] segments = uri.split("/");
+        String id = segments[segments.length - 1];
+        if(logger.isDebugEnabled()){
+               logger.debug("id=" + id);
+        }
+        return id;
+    }
+    
+    /**
+     * Returns an error message indicating that the status code returned by a
+     * specific call to a service does not fall within a set of valid status
+     * codes for that service.
+     *
+     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).
+     *
+     * @param statusCode  The invalid status code that was returned in the response,
+     *                    from submitting that type of request to the service.
+     *
+     * @return An error message.
+     */
+    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {
+        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +
+                requestType.validStatusCodesAsString();
+    }
+
+
+    
+    /**
+     * Produces a default displayName from the basic name and dates fields.
+     * @see LocationDocumentModelHandler.prepareDefaultDisplayName() which
+     * duplicates this logic, until we define a service-general utils package
+     * that is neither client nor service specific.
+     * @param name     
+     * @return
+     */
+    public static String prepareDefaultDisplayName(
+               String name ) {
+       StringBuilder newStr = new StringBuilder();
+                       newStr.append(name);
+               return newStr.toString();
+    }
+    
+    public static List<LocTermGroup> getTermGroupInstance(String identifier) {
+        if (Tools.isBlank(identifier)) {
+            identifier = getGeneratedIdentifier();
+        }
+        List<LocTermGroup> terms = new ArrayList<LocTermGroup>();
+        LocTermGroup term = new LocTermGroup();
+        term.setTermDisplayName(identifier);
+        term.setTermName(identifier);
+        terms.add(term);
+        return terms;
+    }
+    
+    private static String getGeneratedIdentifier() {
+        return "id" + new Date().getTime(); 
+   }
+
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 9c62d3eab8ef0a3931c7550922db57e2b2835155..eafb2dfc27503ef924882bfb6e73b257decec97f 100644 (file)
@@ -1,61 +1,61 @@
-\r
-<project name="location" default="package" basedir=".">\r
-    <description>\r
-        location service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-    \r
-    <target name="install" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing location Service's &apos;install&apos; target." />\r
-                               </exec>\r
-                               <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->\r
-        <copy todir="${jee.deploy.nuxeo.plugins}">\r
-            <fileset file="nuxeo/*.jar"/>\r
-        </copy>                                \r
-    </target>    \r
-\r
-    <target name="config" description="" depends="install">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Location Service's &apos;config&apos; target." />\r
-                               </exec>\r
-    </target>\r
-    \r
-    <target name="predeploy" description="" depends="config">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Location Service's &apos;predeploy&apos; target." />\r
-                               </exec>\r
-    </target>    \r
-    \r
-    <target name="deploy" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Location Service's &apos;deploy&apos; target." />\r
-                               </exec>\r
-    </target>\r
-    \r
-    <target name="postdeploy">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Location Service." />\r
-                               </exec>         \r
-        <exec executable="echo">\r
-                       <arg value="Importing necessary locationauthorities." />\r
-                               </exec>                         \r
-        <java jar="./postdeploy/collectionspace-services-location-importer-jar-with-dependencies.jar"\r
-               fork="true"\r
-               failonerror="true">\r
-                               </java> \r
-    </target>\r
-    \r
-\r
-</project>\r
+
+<project name="location" default="package" basedir=".">
+    <description>
+        location service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+    
+    <target name="install" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing location Service's &apos;install&apos; target." />
+                               </exec>
+                               <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->
+        <copy todir="${jee.deploy.nuxeo.plugins}">
+            <fileset file="nuxeo/*.jar"/>
+        </copy>                                
+    </target>    
+
+    <target name="config" description="" depends="install">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Location Service's &apos;config&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="predeploy" description="" depends="config">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Location Service's &apos;predeploy&apos; target." />
+                               </exec>
+    </target>    
+    
+    <target name="deploy" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Location Service's &apos;deploy&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="postdeploy">
+        <exec executable="echo">
+                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Location Service." />
+                               </exec>         
+        <exec executable="echo">
+                       <arg value="Importing necessary locationauthorities." />
+                               </exec>                         
+        <java jar="./postdeploy/collectionspace-services-location-importer-jar-with-dependencies.jar"
+               fork="true"
+               failonerror="true">
+                               </java> 
+    </target>
+    
+
+</project>
index 65ad36ae981b16b41ca9359c205bea73b93862d7..92097fc2d987e76f9d1cf2f435506d1d471011d6 100644 (file)
@@ -1,23 +1,23 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services;\r
-import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;\r
-\r
-/**\r
- * @author pschmitz\r
- *\r
- */\r
-public interface LocationJAXBSchema extends AuthorityItemJAXBSchema {\r
-       final static String LOCATIONS_COMMON = "locations_common";\r
-       final static String NAME = "name";\r
-       final static String CONDITION_GROUP_LIST = "conditionGroupList";\r
-       final static String CONDITION_GROUP = "conditionGroup";\r
-       final static String CONDITION_NOTE = "conditionNote";\r
-       final static String CONDITION_NOTE_DATE = "conditionNoteDate";\r
-       final static String SECURITY_NOTE = "securityNote";\r
-       final static String ACCESS_NOTE = "accessNote";\r
-       final static String ADDRESS = "address";\r
-       final static String LOCATION_TYPE = "locationType";\r
-}\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services;
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
+
+/**
+ * @author pschmitz
+ *
+ */
+public interface LocationJAXBSchema extends AuthorityItemJAXBSchema {
+       final static String LOCATIONS_COMMON = "locations_common";
+       final static String NAME = "name";
+       final static String CONDITION_GROUP_LIST = "conditionGroupList";
+       final static String CONDITION_GROUP = "conditionGroup";
+       final static String CONDITION_NOTE = "conditionNote";
+       final static String CONDITION_NOTE_DATE = "conditionNoteDate";
+       final static String SECURITY_NOTE = "securityNote";
+       final static String ACCESS_NOTE = "accessNote";
+       final static String ADDRESS = "address";
+       final static String LOCATION_TYPE = "locationType";
+}
+
index 94f75b90b13701a21bdcfae56f24bc8b79edc6ba..2f512df129a07d23fb4eb4cc6b55aac5b50324ee 100644 (file)
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.location</artifactId>\r
-    <name>services.location</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <dependencies>\r
-    </dependencies>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-    \r
-    <profiles>\r
-        <profile>\r
-            <id>samples</id>\r
-           <modules>\r
-               <!-- <module>sample</module> -->\r
-           </modules>\r
-        </profile>\r
-    </profiles>\r
-    \r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.location</artifactId>
+    <name>services.location</name>
+    <packaging>pom</packaging>
+
+    <dependencies>
+    </dependencies>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+    
+    <profiles>
+        <profile>
+            <id>samples</id>
+           <modules>
+               <!-- <module>sample</module> -->
+           </modules>
+        </profile>
+    </profiles>
+    
+</project>
+
index ae57eec587439290322515974c3164521774af30..9c9419a195f6186682b559922e134f250168bfbe 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.location</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.location.service</artifactId>\r
-    <name>services.location.service</name>\r
-    <packaging>jar</packaging>\r
-    \r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-<!-- CollectionSpace dependencies -->        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.location.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.location.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.contact.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->        \r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- apache -->\r
-        <dependency>\r
-            <groupId>commons-beanutils</groupId>\r
-            <artifactId>commons-beanutils</artifactId>\r
-            <version>1.6.1</version>\r
-        </dependency>\r
-        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->\r
-        <dependency>\r
-            <groupId>commons-logging</groupId>\r
-            <artifactId>commons-logging</artifactId>\r
-            <version>1.1</version>\r
-        </dependency>\r
-      <!-- javax -->\r
-\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-location</finalName>\r
-        <plugins>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.location</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.location.service</artifactId>
+    <name>services.location.service</name>
+    <packaging>jar</packaging>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+<!-- CollectionSpace dependencies -->        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.location.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.location.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+        <!-- apache -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+        </dependency>
+      <!-- javax -->
+
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-location</finalName>
+        <plugins>
+        </plugins>
+    </build>
+</project>
+
index 222db5666470069b4f1f4ce716a93035fab2bf6a..024ee2a314a90def2224a04ca574c631536e34fa 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.media</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.media</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 4b250fa94a935061cc0be7bfba19eb1d7a3bb996..9df5c138cb9ac75f01d5a836844bd0ab262c4dbc 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.media.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.media.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 66bef70e624dfef65b8612e3fe95c4eda058e092..2a4e1058aae420d8ecad688ee0706579dfa4d46a 100644 (file)
@@ -1,26 +1,26 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace.services.client.PoxPayloadIn=DEBUG\r
-log4j.logger.org.collectionspace.services.client.PoxPayloadOut=DEBUG\r
-\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace.services.client.PoxPayloadIn=DEBUG
+log4j.logger.org.collectionspace.services.client.PoxPayloadOut=DEBUG
+
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 62a0e9800cd80a2230e95f781bcffd929dc621eb..64ee714bc78fe904b7a82b85061a6363363072d1 100644 (file)
@@ -1,27 +1,27 @@
-package org.collectionspace.services.media;\r
-\r
-import java.io.File;\r
-\r
-public class MediaBlobInput {\r
-       private String mediaCsid;\r
-       private File blobFile;\r
-       private String blobUri;\r
-       \r
-       MediaBlobInput(String mediaCsid, File blobFile, String blobUri) {\r
-               this.mediaCsid = mediaCsid;\r
-               this.blobFile = blobFile;\r
-               this.blobUri = blobUri;\r
-       }\r
-       \r
-       String getMediaCsid() {\r
-               return mediaCsid;\r
-       }\r
-       \r
-       File getBlobFile() {\r
-               return blobFile;\r
-       }\r
-       \r
-       String getBlobUri() {\r
-               return blobUri;\r
-       }\r
-}\r
+package org.collectionspace.services.media;
+
+import java.io.File;
+
+public class MediaBlobInput {
+       private String mediaCsid;
+       private File blobFile;
+       private String blobUri;
+       
+       MediaBlobInput(String mediaCsid, File blobFile, String blobUri) {
+               this.mediaCsid = mediaCsid;
+               this.blobFile = blobFile;
+               this.blobUri = blobUri;
+       }
+       
+       String getMediaCsid() {
+               return mediaCsid;
+       }
+       
+       File getBlobFile() {
+               return blobFile;
+       }
+       
+       String getBlobUri() {
+               return blobUri;
+       }
+}
index 43c50797b0b2dd7ecefa247e08d73573b7189f70..be03195c20b3c596701ff0a6d822454dfe314fbe 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.movement</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.movement</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 9e1e11858336421478e73501ee3cbca4d7e52f34..7d048e95be033c990ddf8c2765d9c32a5c2fee1d 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.movement.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.movement.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index eff807f25bfbe2e6fd6266fc8bf52489eea4c0eb..e32d89ede46c7c8d18bc10ae06695cdaf733a0ff 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.note</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.note</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index b592d9d94ef89624873e1a9cdf9a57e06bcccae2..0dadf56594f36106d0c160d880086003e878ae51 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.note.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.note.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 1662eadcd944145a6f807e2433ea0e040f03b1cd..c9ace8efa9276f042bdd46a752bd5ea3e722bcbf 100644 (file)
-\r
-<project name="note.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        note service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy note in ${jee.server.nuxeo}">\r
-       <!-- This is an unused and deprecated artifact from an unused Service\r
-        <ant antfile="nuxeo-platform-cs-note/build.xml" target="deploy" inheritall="false"/>\r
-        -->\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy note from ${jee.server.nuxeo}">\r
-       <!-- This is an unused and deprecated artifact from an unused Service.  Leave this undeploy\r
-       target active only for backwards compatibility. -->\r
-        <ant antfile="nuxeo-platform-cs-note/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for note" depends="package">\r
-        <ant antfile="nuxeo-platform-cs-note/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-\r
-</project>\r
+
+<project name="note.3rdparty" default="package" basedir=".">
+    <description>
+        note service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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 note in ${jee.server.nuxeo}">
+       <!-- This is an unused and deprecated artifact from an unused Service
+        <ant antfile="nuxeo-platform-cs-note/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+    description="undeploy note from ${jee.server.nuxeo}">
+       <!-- This is an unused and deprecated artifact from an unused Service.  Leave this undeploy
+       target active only for backwards compatibility. -->
+        <ant antfile="nuxeo-platform-cs-note/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for note" depends="package">
+        <ant antfile="nuxeo-platform-cs-note/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+
+</project>
index 543ceb225a64e9b81e6f4e30a0fadcfcdf0e0784..756bccf25b30d1d325ebf60fce8d75499c724f03 100644 (file)
-\r
-<project name="nuxeo-platform-cs-note" default="package" basedir=".">\r
-    <description>\r
-        note nuxeo document type\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../../.."/>\r
-    <!-- environment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-    <property name="dist"  location="dist"/>\r
-    <property name="nuxeo.note.jar"\r
-        value="org.collectionspace.services.note.3rdparty.nuxeo-${cspace.release}.jar"/>\r
-    <property name="nuxeo.note.jars.all"\r
-        value="org.collectionspace.services.note.3rdparty.nuxeo-*.jar"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-        description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-        description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-        description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy note doctype in ${jee.server.nuxeo}">\r
-        <copy file="${basedir}/target/${nuxeo.note.jar}"\r
-        todir="${jee.deploy.nuxeo.plugins}"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="undeploy note doctype from ${jee.server.nuxeo}">\r
-        <delete>\r
-            <fileset dir="${jee.deploy.nuxeo.plugins}">\r
-                <include name="${nuxeo.note.jars.all}"/>\r
-            </fileset>\r
-        </delete>\r
-    </target>\r
-\r
-    <target name="dist"\r
-        description="generate distribution for note doctype" depends="package">\r
-        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">\r
-            <fileset file="${basedir}/target/${nuxeo.note.jar}"/>\r
-        </copy>\r
-    </target>\r
-\r
-</project>\r
-\r
+
+<project name="nuxeo-platform-cs-note" default="package" basedir=".">
+    <description>
+        note nuxeo document type
+    </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="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+    <property name="dist"  location="dist"/>
+    <property name="nuxeo.note.jar"
+        value="org.collectionspace.services.note.3rdparty.nuxeo-${cspace.release}.jar"/>
+    <property name="nuxeo.note.jars.all"
+        value="org.collectionspace.services.note.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/>
+    </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 note doctype in ${jee.server.nuxeo}">
+        <copy file="${basedir}/target/${nuxeo.note.jar}"
+        todir="${jee.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy note doctype from ${jee.server.nuxeo}">
+        <delete>
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.note.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+    <target name="dist"
+        description="generate distribution for note doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.note.jar}"/>
+        </copy>
+    </target>
+
+</project>
+
index bc11def3464a795fdbf5eb22c02d2314728497fd..daab513d249a8bf02e9a64b59a0b12f57728a13e 100644 (file)
@@ -1,43 +1,43 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.note.3rdparty</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.note.3rdparty.nuxeo</artifactId>\r
-    <name>services.note.3rdparty.nuxeo</name>\r
-    <packaging>jar</packaging>\r
-    <description>\r
-        note Nuxeo Document Type\r
-    </description>\r
-    \r
-    <build>\r
-               <resources>\r
-            <resource>\r
-                <directory>src/main/resources</directory>\r
-                <filtering>true</filtering>\r
-            </resource>\r
-               </resources>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-jar-plugin</artifactId>\r
-                <configuration>\r
-                    <archive>\r
-                        <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>\r
-                        <manifestEntries>\r
-                            <Bundle-Version>${eclipseVersion}</Bundle-Version>\r
-                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>\r
-                        </manifestEntries>\r
-                    </archive>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-    \r
-</project>\r
+<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.note.3rdparty</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.note.3rdparty.nuxeo</artifactId>
+    <name>services.note.3rdparty.nuxeo</name>
+    <packaging>jar</packaging>
+    <description>
+        note Nuxeo Document Type
+    </description>
+    
+    <build>
+               <resources>
+            <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> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
+                        <manifestEntries>
+                            <Bundle-Version>${eclipseVersion}</Bundle-Version>
+                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+</project>
index 3ce672f4b0a5698180267324f5048b6cea03d5af..7766b29f0888e289cf3c526cd6227ac103b2ff07 100644 (file)
@@ -1,23 +1,23 @@
-Manifest-Version: 1.0 \r
-Bundle-ManifestVersion: 1 \r
-Bundle-Name: NuxeoCS\r
-Bundle-SymbolicName: org.collectionspace.note;singleton:=true \r
-Bundle-Version: 1.0.0\r
-Bundle-Localization: plugin\r
-Bundle-Vendor: Nuxeo \r
-Require-Bundle: org.nuxeo.runtime, \r
- org.nuxeo.ecm.core.api, \r
- org.nuxeo.ecm.core,\r
- org.nuxeo.ecm.core.api,\r
- org.nuxeo.ecm.platform.types.api,\r
- org.nuxeo.ecm.platform.versioning.api,\r
- org.nuxeo.ecm.platform.ui,\r
- org.nuxeo.ecm.platform.forms.layout.client,\r
- org.nuxeo.ecm.platform.ws,\r
- org.collectionspace.collectionspace_core\r
-Provide-Package: org.collectionspace.note\r
-Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
- OSGI-INF/life-cycle-contrib.xml,\r
- OSGI-INF/ecm-types-contrib.xml,\r
- OSGI-INF/layouts-contrib.xml\r
-\r
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: NuxeoCS
+Bundle-SymbolicName: org.collectionspace.note;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.note
+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
+
index e82f5f6c4efe1fba802fc44caa5c7abffed9719b..f2b21c1f4660d4e00c42982d19565fee65b4238c 100644 (file)
@@ -1,15 +1,15 @@
-<?xml version="1.0"?>\r
-<component name="org.collectionspace.note.coreTypes">\r
-  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">\r
-    <schema name="notes_common" prefix="notes_common" src="schemas/notes_common.xsd"/>\r
-  </extension>\r
-  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">\r
-    <doctype name="CSNote" extends="Document">\r
-      <schema name="common"/>\r
-      <schema name="dublincore"/>\r
-      <schema name="collectionspace_core"/>\r
-      <schema name="subitem"/>\r
-      <schema name="notes_common"/>\r
-    </doctype>\r
-  </extension>\r
-</component>\r
+<?xml version="1.0"?>
+<component name="org.collectionspace.note.coreTypes">
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
+    <schema name="notes_common" prefix="notes_common" src="schemas/notes_common.xsd"/>
+  </extension>
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
+    <doctype name="CSNote" extends="Document">
+      <schema name="common"/>
+      <schema name="dublincore"/>
+      <schema name="collectionspace_core"/>
+      <schema name="subitem"/>
+      <schema name="notes_common"/>
+    </doctype>
+  </extension>
+</component>
index 226075b98d5cc6418a9ce5ee3688ac7e83fc4b2c..270abbd5f94b6ef70ed7b24956b6ef7701815222 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0"?>\r
-<fragment>\r
-\r
-  <extension target="application#MODULE">\r
-    <module>\r
-      <java>${bundle.fileName}</java>\r
-    </module>\r
-  </extension>\r
-  \r
-</fragment>\r
+<?xml version="1.0"?>
+<fragment>
+
+  <extension target="application#MODULE">
+    <module>
+      <java>${bundle.fileName}</java>
+    </module>
+  </extension>
+  
+</fragment>
index c175ecc30de69bd1217cb60e9b30306d50c7f165..1f67636e84f69beeb8bcab7b68f9c92c27b466df 100644 (file)
@@ -1,30 +1,30 @@
-<?xml version="1.0"?>\r
-<component name="org.collectionspace.note.ecm.types">\r
-  <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">\r
-    <type id="CSNote" coretype="CSNote">\r
-      <label>org.collectionspace.note</label>\r
-      <!--icon>/icons/file.gif</icon-->\r
-      <default-view>view_documents</default-view>\r
-\r
-      <layouts mode="any">\r
-        <layout>heading</layout>\r
-        <layout>collectionspace_core</layout>\r
-        <layout>subitem</layout>\r
-        <layout>cs_note</layout>\r
-      </layouts>        \r
-    </type>\r
-\r
-    <type id="Folder" coretype="Folder">\r
-      <subtypes>\r
-        <type>Note</type>\r
-      </subtypes>\r
-    </type>\r
-    \r
-    <type id="Workspace" coretype="Workspace">\r
-      <subtypes>\r
-        <type>Note</type>\r
-      </subtypes>\r
-    </type>\r
-\r
-  </extension>\r
-</component>\r
+<?xml version="1.0"?>
+<component name="org.collectionspace.note.ecm.types">
+  <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
+    <type id="CSNote" coretype="CSNote">
+      <label>org.collectionspace.note</label>
+      <!--icon>/icons/file.gif</icon-->
+      <default-view>view_documents</default-view>
+
+      <layouts mode="any">
+        <layout>heading</layout>
+        <layout>collectionspace_core</layout>
+        <layout>subitem</layout>
+        <layout>cs_note</layout>
+      </layouts>        
+    </type>
+
+    <type id="Folder" coretype="Folder">
+      <subtypes>
+        <type>Note</type>
+      </subtypes>
+    </type>
+    
+    <type id="Workspace" coretype="Workspace">
+      <subtypes>
+        <type>Note</type>
+      </subtypes>
+    </type>
+
+  </extension>
+</component>
index fba0576742640f987a7770cffc25e4084532d2aa..8882243e52a02e5a69975352cfb47c1dffc37db4 100644 (file)
@@ -1,61 +1,61 @@
-<?xml version="1.0"?>\r
-\r
-<component name="org.collectionspace.note.layouts.webapp">\r
-\r
-  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"\r
-    point="layouts">\r
-\r
-    <layout name="cs_note">\r
-\r
-      <templates>\r
-        <template mode="any">/layouts/layout_default_template.xhtml</template>\r
-      </templates>\r
-      <rows>\r
-        <row><widget>content</widget></row>\r
-        <row><widget>author</widget></row>\r
-        <row><widget>date</widget></row>\r
-      </rows>\r
-\r
-      <widget name="content" type="text">\r
-        <labels>\r
-          <label mode="any">content</label>\r
-        </labels>\r
-        <translated>true</translated>\r
-        <fields>\r
-          <field schema="notes_common">content</field>\r
-        </fields>\r
-        <properties widgetMode="edit">\r
-          <property name="styleClass">dataInputText</property>\r
-        </properties>\r
-      </widget>\r
-\r
-      <widget name="author" type="text">\r
-        <labels>\r
-          <label mode="any">author</label>\r
-        </labels>\r
-        <translated>true</translated>\r
-        <fields>\r
-          <field schema="notes_common">author</field>\r
-        </fields>\r
-        <properties widgetMode="edit">\r
-          <property name="styleClass">dataInputText</property>\r
-        </properties>\r
-      </widget>\r
-\r
-      <widget name="date" type="text">\r
-        <labels>\r
-          <label mode="any">date</label>\r
-        </labels>\r
-        <translated>true</translated>\r
-        <fields>\r
-          <field schema="notes_common">date</field>\r
-        </fields>\r
-        <properties widgetMode="edit">\r
-          <property name="styleClass">dataInputText</property>\r
-        </properties>\r
-      </widget>\r
-\r
-     \r
-    </layout>\r
-  </extension>\r
-</component>\r
+<?xml version="1.0"?>
+
+<component name="org.collectionspace.note.layouts.webapp">
+
+  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
+    point="layouts">
+
+    <layout name="cs_note">
+
+      <templates>
+        <template mode="any">/layouts/layout_default_template.xhtml</template>
+      </templates>
+      <rows>
+        <row><widget>content</widget></row>
+        <row><widget>author</widget></row>
+        <row><widget>date</widget></row>
+      </rows>
+
+      <widget name="content" type="text">
+        <labels>
+          <label mode="any">content</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="notes_common">content</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+
+      <widget name="author" type="text">
+        <labels>
+          <label mode="any">author</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="notes_common">author</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+
+      <widget name="date" type="text">
+        <labels>
+          <label mode="any">date</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="notes_common">date</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+
+     
+    </layout>
+  </extension>
+</component>
index f12eed3eb23762f8de6a67947a968a0eaa2f0cad..6ee4515ae03af4f63e9036485f2a8f0a8f76c827 100644 (file)
@@ -1,26 +1,26 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
-    Contact schema (XSD)\r
-    \r
-    Entity  : Note\r
-    Part    : Common\r
-    Used for: Nuxeo EP core document type\r
-\r
-    $LastChangedRevision: 1409 $\r
-    $LastChangedDate: 2010-02-22 21:34:53 -0800 (Mon, 22 Feb 2010) $\r
--->\r
-\r
-<xs:schema \r
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-    xmlns:ns="http://collectionspace.org/note/"\r
-    xmlns="http://collectionspace.org/note/"\r
-    targetNamespace="http://collectionspace.org/note/"\r
-    version="0.1">\r
-\r
-               <!-- Subitem info is in a general schema -->\r
-    <xs:element name="content" type="xs:string" />\r
-    <xs:element name="author" type="xs:string" />\r
-    <xs:element name="date" type="xs:string" />\r
-    \r
-</xs:schema>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Contact schema (XSD)
+    
+    Entity  : Note
+    Part    : Common
+    Used for: Nuxeo EP core document type
+
+    $LastChangedRevision: 1409 $
+    $LastChangedDate: 2010-02-22 21:34:53 -0800 (Mon, 22 Feb 2010) $
+-->
+
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/note/"
+    xmlns="http://collectionspace.org/note/"
+    targetNamespace="http://collectionspace.org/note/"
+    version="0.1">
+
+               <!-- Subitem info is in a general schema -->
+    <xs:element name="content" type="xs:string" />
+    <xs:element name="author" type="xs:string" />
+    <xs:element name="date" type="xs:string" />
+    
+</xs:schema>
index e77ce625c565686c7391dc25d5dbf24cd933b711..767527e4b93fa2f15c05f2437786440d3f9176d7 100644 (file)
@@ -1,24 +1,24 @@
-\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.note</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.note.3rdparty</artifactId>\r
-    <name>services.note.3rdparty</name>\r
-    <packaging>pom</packaging>\r
-    <description>\r
-        3rd party build for note service\r
-    </description>\r
-\r
-    <modules>\r
-    <!--  This is an unused module from an unused and deprecated Service.\r
-        <module>nuxeo-platform-cs-note</module>\r
-        -->\r
-    </modules>\r
-</project>\r
+
+<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.note</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.note.3rdparty</artifactId>
+    <name>services.note.3rdparty</name>
+    <packaging>pom</packaging>
+    <description>
+        3rd party build for note service
+    </description>
+
+    <modules>
+    <!--  This is an unused module from an unused and deprecated Service.
+        <module>nuxeo-platform-cs-note</module>
+        -->
+    </modules>
+</project>
index b1d725104713897ce5a32aeb337376dd27bdb575..382b1c7fafb2a5efb5a04c34aafa3df2d2f00474 100644 (file)
-\r
-<project name="note" default="package" basedir=".">\r
-    <description>\r
-        note service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy note service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy note service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-    description="distribute note service">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="note" default="package" basedir=".">
+    <description>
+        note service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 note service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy note service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+    description="distribute note service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index a8b8cb40049271bf0cebca9e4d7baee386253e84..58073f2034ec25e90f5a2c9c8370a290012c0c19 100644 (file)
@@ -1,87 +1,87 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.note</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.note.client</artifactId>\r
-    <name>services.note.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.note.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-\r
-        <!-- External dependencies -->\r
-        \r
-        <!-- \r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-         --> \r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-note-client</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.note</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.note.client</artifactId>
+    <name>services.note.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.note.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- External dependencies -->
+        
+        <!-- 
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+         --> 
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-note-client</finalName>
+    </build>
+</project>
+
index f38dae4ef5a0cb7817cb366b47111805f0c0095d..c361264af145430eab885f260519dbb6e9fecbf9 100644 (file)
@@ -1,68 +1,68 @@
-/**    \r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.note.NotesCommonList;\r
-\r
-import org.jboss.resteasy.client.ProxyFactory;\r
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;\r
-import org.jboss.resteasy.spi.ResteasyProviderFactory;\r
-\r
-/**\r
- * NoteClient.java\r
- *\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- */\r
\r
-public class NoteClient extends AbstractPoxServiceClientImpl<NotesCommonList, NoteProxy> {\r
-\r
-    public static final String SERVICE_NAME = "notes";\r
-    public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;\r
-    public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;\r
-\r
-    @Override\r
-    public String getServiceName() {\r
-            return SERVICE_NAME;\r
-    }\r
-\r
-    @Override\r
-    public String getServicePathComponent() {\r
-            return SERVICE_PATH_COMPONENT;\r
-    }\r
-\r
-       @Override\r
-       public Class<NoteProxy> getProxyClass() {\r
-               return NoteProxy.class;\r
-       }\r
-\r
-       /*\r
-        * Proxied service calls\r
-        */\r
-       \r
-    /**\r
-     * @return\r
-     * @see org.collectionspace.services.client.Note#getNote()\r
-     */\r
-    public ClientResponse<NotesCommonList> readList() {\r
-        return getProxy().readList();\r
-    }\r
-}\r
+/**    
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.client;
+
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.note.NotesCommonList;
+
+import org.jboss.resteasy.client.ProxyFactory;
+import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+
+/**
+ * NoteClient.java
+ *
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ */
+public class NoteClient extends AbstractPoxServiceClientImpl<NotesCommonList, NoteProxy> {
+
+    public static final String SERVICE_NAME = "notes";
+    public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
+    public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
+
+    @Override
+    public String getServiceName() {
+            return SERVICE_NAME;
+    }
+
+    @Override
+    public String getServicePathComponent() {
+            return SERVICE_PATH_COMPONENT;
+    }
+
+       @Override
+       public Class<NoteProxy> getProxyClass() {
+               return NoteProxy.class;
+       }
+
+       /*
+        * Proxied service calls
+        */
+       
+    /**
+     * @return
+     * @see org.collectionspace.services.client.Note#getNote()
+     */
+    public ClientResponse<NotesCommonList> readList() {
+        return getProxy().readList();
+    }
+}
index 8d08dd4528ffd75a722e035d4a802d070d67aeb2..18c946788f55f899bd35095a321ef009d380b0c6 100644 (file)
@@ -1,56 +1,56 @@
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-\r
-import org.collectionspace.services.note.NotesCommon;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class NoteClientUtils {\r
-\r
-    private static final Logger logger =\r
-        LoggerFactory.getLogger(NoteClientUtils.class);\r
-\r
-    private static final String SERVICE_PATH_COMPONENT = "notes";\r
-  \r
-    public static PoxPayloadOut createNoteInstance (\r
-        String owner, String identifier, String headerLabel) {\r
-        return createNoteInstance(\r
-            owner,\r
-                                               false, 0,\r
-            "content-" + identifier,\r
-            "author-" + identifier,\r
-            "date-" + identifier,\r
-            headerLabel);\r
-    }\r
-\r
-    public static PoxPayloadOut createNoteInstance(\r
-        String owner, boolean isPrimary, int order,\r
-        String content, String author, String date, String headerLabel) {\r
-        NotesCommon noteCommon = new NotesCommon();\r
-        noteCommon.setOwner(owner);\r
-        noteCommon.setIsPrimary(isPrimary);\r
-        noteCommon.setOrder(order);\r
-        noteCommon.setContent(content);\r
-        noteCommon.setAuthor(author);\r
-        noteCommon.setDate(date);\r
-\r
-        PoxPayloadOut multipart = new PoxPayloadOut(getServicePathComponent());\r
-        PayloadOutputPart commonPart =\r
-                multipart.addPart(noteCommon, MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.setLabel(new NoteClient().getCommonPartName());\r
-\r
-        if(logger.isDebugEnabled()){\r
-            logger.debug("to be created, note common");\r
-            // logger.debug(objectAsXmlString(note, NotesCommon.class));\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-\r
-    public static String getServicePathComponent() {\r
-        return SERVICE_PATH_COMPONENT;\r
-    }\r
-\r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.core.MediaType;
+
+import org.collectionspace.services.note.NotesCommon;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NoteClientUtils {
+
+    private static final Logger logger =
+        LoggerFactory.getLogger(NoteClientUtils.class);
+
+    private static final String SERVICE_PATH_COMPONENT = "notes";
+  
+    public static PoxPayloadOut createNoteInstance (
+        String owner, String identifier, String headerLabel) {
+        return createNoteInstance(
+            owner,
+                                               false, 0,
+            "content-" + identifier,
+            "author-" + identifier,
+            "date-" + identifier,
+            headerLabel);
+    }
+
+    public static PoxPayloadOut createNoteInstance(
+        String owner, boolean isPrimary, int order,
+        String content, String author, String date, String headerLabel) {
+        NotesCommon noteCommon = new NotesCommon();
+        noteCommon.setOwner(owner);
+        noteCommon.setIsPrimary(isPrimary);
+        noteCommon.setOrder(order);
+        noteCommon.setContent(content);
+        noteCommon.setAuthor(author);
+        noteCommon.setDate(date);
+
+        PoxPayloadOut multipart = new PoxPayloadOut(getServicePathComponent());
+        PayloadOutputPart commonPart =
+                multipart.addPart(noteCommon, MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(new NoteClient().getCommonPartName());
+
+        if(logger.isDebugEnabled()){
+            logger.debug("to be created, note common");
+            // logger.debug(objectAsXmlString(note, NotesCommon.class));
+        }
+
+        return multipart;
+    }
+
+    public static String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+
+}
index d0669f1e85e8ad501fa382fef3e1cb1d4eb4abd4..3544b882cad87d428022fa07bea45697946e6632 100644 (file)
@@ -1,63 +1,63 @@
-package org.collectionspace.services.client;\r
-\r
-import javax.ws.rs.Consumes;\r
-import javax.ws.rs.DELETE;\r
-import javax.ws.rs.GET;\r
-import javax.ws.rs.POST;\r
-import javax.ws.rs.PUT;\r
-import javax.ws.rs.Path;\r
-import javax.ws.rs.PathParam;\r
-import javax.ws.rs.Produces;\r
-import javax.ws.rs.QueryParam;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.note.NotesCommonList;\r
-import org.collectionspace.services.client.workflow.WorkflowClient;\r
-\r
-import org.jboss.resteasy.client.ClientResponse;\r
-\r
-/**\r
- * @version $Revision:$\r
- */\r
-@Path("/notes/")\r
-@Produces({"application/xml;charset=UTF-8"})\r
-@Consumes({"application/xml"})\r
-public interface NoteProxy extends CollectionSpacePoxProxy<NotesCommonList> {\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    ClientResponse<NotesCommonList> readList();\r
-    \r
-       @Override\r
-       @GET\r
-    @Produces({"application/xml"})\r
-    ClientResponse<NotesCommonList> readIncludeDeleted(\r
-            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);    \r
-\r
-    @Override\r
-    @GET\r
-    @Produces({"application/xml"})\r
-    ClientResponse<NotesCommonList> keywordSearchIncludeDeleted(\r
-               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,\r
-            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);\r
-    \r
-    /*\r
-    //(C)reate\r
-    @POST\r
-    ClientResponse<Response> create(String payload);\r
-\r
-    //(R)ead\r
-    @GET\r
-    @Path("/{csid}")\r
-    ClientResponse<String> read(@PathParam("csid") String csid);\r
-\r
-    //(U)pdate\r
-    @PUT\r
-    @Path("/{csid}")\r
-    ClientResponse<String> update(@PathParam("csid") String csid, String payload);\r
-\r
-    //(D)elete\r
-    @DELETE\r
-    @Path("/{csid}")\r
-    ClientResponse<Response> delete(@PathParam("csid") String csid);\r
-    */\r
-}\r
+package org.collectionspace.services.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.note.NotesCommonList;
+import org.collectionspace.services.client.workflow.WorkflowClient;
+
+import org.jboss.resteasy.client.ClientResponse;
+
+/**
+ * @version $Revision:$
+ */
+@Path("/notes/")
+@Produces({"application/xml;charset=UTF-8"})
+@Consumes({"application/xml"})
+public interface NoteProxy extends CollectionSpacePoxProxy<NotesCommonList> {
+    @GET
+    @Produces({"application/xml"})
+    ClientResponse<NotesCommonList> readList();
+    
+       @Override
+       @GET
+    @Produces({"application/xml"})
+    ClientResponse<NotesCommonList> readIncludeDeleted(
+            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);    
+
+    @Override
+    @GET
+    @Produces({"application/xml"})
+    ClientResponse<NotesCommonList> keywordSearchIncludeDeleted(
+               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
+            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+    
+    /*
+    //(C)reate
+    @POST
+    ClientResponse<Response> create(String payload);
+
+    //(R)ead
+    @GET
+    @Path("/{csid}")
+    ClientResponse<String> read(@PathParam("csid") String csid);
+
+    //(U)pdate
+    @PUT
+    @Path("/{csid}")
+    ClientResponse<String> update(@PathParam("csid") String csid, String payload);
+
+    //(D)elete
+    @DELETE
+    @Path("/{csid}")
+    ClientResponse<Response> delete(@PathParam("csid") String csid);
+    */
+}
index d2e2a232d18c3c5bb8c72adaace8c9c26f3a9292..fb8e9539dca0c75c3ed1688136408143d50d63f0 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.collectionspace.services.client.test;\r
-\r
-import org.collectionspace.services.client.CollectionSpaceClient;\r
-import org.collectionspace.services.client.NoteClient;\r
-import org.collectionspace.services.client.NoteClientUtils;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.note.NotesCommon;\r
-import org.collectionspace.services.note.NotesCommonList;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.testng.Assert;\r
-\r
-/**\r
- * NoteServiceTest, carries out tests against a\r
- * deployed and running Note Service.\r
- *\r
- * $LastChangedRevision: 917 $\r
- * $LastChangedDate: 2009-11-06 12:20:28 -0800 (Fri, 06 Nov 2009) $\r
- */\r
-public class NoteServiceTest extends AbstractPoxServiceTestImpl<NotesCommonList, NotesCommon> {\r
-\r
-    private final String CLASS_NAME = NoteServiceTest.class.getName();\r
-    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);\r
-\r
-    private final String SERVICE_PATH_COMPONENT = "notes";\r
-    private final String SERVICE_NAME = "notes";\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()\r
-     */\r
-    @Override\r
-    protected CollectionSpaceClient getClientInstance() {\r
-       return new NoteClient();\r
-    }\r
-    \r
-       @Override\r
-       protected PoxPayloadOut createInstance(String commonPartName,\r
-                       String identifier) {\r
-        PoxPayloadOut result =\r
-                NoteClientUtils.createNoteInstance("owner"+identifier, identifier, \r
-                                                               commonPartName);\r
-        return result;\r
-       }\r
-    \r
-    // ---------------------------------------------------------------\r
-    // Utility tests : tests of code used in tests above\r
-    // ---------------------------------------------------------------\r
-\r
-    @Override\r
-    public String getServiceName() {\r
-        return SERVICE_NAME;\r
-    }\r
-\r
-    // ---------------------------------------------------------------\r
-    // Utility methods used by tests above\r
-    // ---------------------------------------------------------------\r
-    @Override\r
-    public String getServicePathComponent() {\r
-        return SERVICE_PATH_COMPONENT;\r
-    }\r
-    \r
-    @Override\r
-    protected Class<NotesCommonList> getCommonListType() {\r
-       return NotesCommonList.class;\r
-    }\r
-\r
-       @Override\r
-       protected NotesCommon updateInstance(NotesCommon notesCommon) {\r
-               NotesCommon result = new NotesCommon();\r
-               \r
-        // Update the common part, both the subitem, and the content\r
-        result.setContent("updated-" + notesCommon.getContent());\r
-        result.setOrder(notesCommon.getOrder() + 10);\r
-               \r
-               return result;\r
-       }\r
-\r
-       @Override\r
-       protected void compareUpdatedInstances(NotesCommon original,\r
-                       NotesCommon updated) throws Exception {\r
-        // Check selected fields in the updated common part.\r
-        Assert.assertEquals(updated.getContent(), original.getContent(),\r
-                "Content in updated object did not match submitted data.");\r
-        Assert.assertEquals(updated.getOrder(), original.getOrder(),\r
-                "Order in updated object (subitem) did not match submitted data.");\r
-       }\r
-       \r
-       @Override\r
-       public void CRUDTests(String testName) {\r
-               // TODO Auto-generated method stub\r
-               \r
-       }\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.collectionspace.services.client.test;
+
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.NoteClient;
+import org.collectionspace.services.client.NoteClientUtils;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.note.NotesCommon;
+import org.collectionspace.services.note.NotesCommonList;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+
+/**
+ * NoteServiceTest, carries out tests against a
+ * deployed and running Note Service.
+ *
+ * $LastChangedRevision: 917 $
+ * $LastChangedDate: 2009-11-06 12:20:28 -0800 (Fri, 06 Nov 2009) $
+ */
+public class NoteServiceTest extends AbstractPoxServiceTestImpl<NotesCommonList, NotesCommon> {
+
+    private final String CLASS_NAME = NoteServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+
+    private final String SERVICE_PATH_COMPONENT = "notes";
+    private final String SERVICE_NAME = "notes";
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new NoteClient();
+    }
+    
+       @Override
+       protected PoxPayloadOut createInstance(String commonPartName,
+                       String identifier) {
+        PoxPayloadOut result =
+                NoteClientUtils.createNoteInstance("owner"+identifier, identifier, 
+                                                               commonPartName);
+        return result;
+       }
+    
+    // ---------------------------------------------------------------
+    // Utility tests : tests of code used in tests above
+    // ---------------------------------------------------------------
+
+    @Override
+    public String getServiceName() {
+        return SERVICE_NAME;
+    }
+
+    // ---------------------------------------------------------------
+    // Utility methods used by tests above
+    // ---------------------------------------------------------------
+    @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+    
+    @Override
+    protected Class<NotesCommonList> getCommonListType() {
+       return NotesCommonList.class;
+    }
+
+       @Override
+       protected NotesCommon updateInstance(NotesCommon notesCommon) {
+               NotesCommon result = new NotesCommon();
+               
+        // Update the common part, both the subitem, and the content
+        result.setContent("updated-" + notesCommon.getContent());
+        result.setOrder(notesCommon.getOrder() + 10);
+               
+               return result;
+       }
+
+       @Override
+       protected void compareUpdatedInstances(NotesCommon original,
+                       NotesCommon updated) throws Exception {
+        // Check selected fields in the updated common part.
+        Assert.assertEquals(updated.getContent(), original.getContent(),
+                "Content in updated object did not match submitted data.");
+        Assert.assertEquals(updated.getOrder(), original.getOrder(),
+                "Order in updated object (subitem) did not match submitted data.");
+       }
+       
+       @Override
+       public void CRUDTests(String testName) {
+               // TODO Auto-generated method stub
+               
+       }
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 9db1081aefa67d9f69ea689156b45644c4d6720b..03636cfdcdcd5cdf3d76103d7888099ba321acfd 100644 (file)
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.note</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.note.jaxb</artifactId>\r
-    <name>services.note.jaxb</name>\r
-    \r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.hyperjaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-note-jaxb</finalName>\r
-        <defaultGoal>install</defaultGoal>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.jvnet.jaxb2.maven2</groupId>\r
-                <artifactId>maven-jaxb2-plugin</artifactId>               \r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.note</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.note.jaxb</artifactId>
+    <name>services.note.jaxb</name>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.hyperjaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-note-jaxb</finalName>
+        <defaultGoal>install</defaultGoal>
+        <plugins>
+            <plugin>
+                <groupId>org.jvnet.jaxb2.maven2</groupId>
+                <artifactId>maven-jaxb2-plugin</artifactId>               
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index 5d0d6d7a4b682bd536e96b02a1db31f08641d698..6576fe3bf9182d3ae7f1d5b68814320035384ec2 100644 (file)
@@ -1,20 +1,20 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services.note;\r
-\r
-/**\r
- *\r
- */\r
-public interface NoteJAXBSchema {\r
-       final static String NOTES_COMMON = "notes_common";\r
-       final static String CSID = "csid";\r
-       final static String OWNER = "owner";\r
-       final static String IS_PRIMARY ="isPrimary";\r
-       final static String ORDER = "order";\r
-       final static String CONTENT = "content";\r
-       final static String AUTHOR = "author";\r
-       final static String DATE = "date";\r
-}\r
-\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services.note;
+
+/**
+ *
+ */
+public interface NoteJAXBSchema {
+       final static String NOTES_COMMON = "notes_common";
+       final static String CSID = "csid";
+       final static String OWNER = "owner";
+       final static String IS_PRIMARY ="isPrimary";
+       final static String ORDER = "order";
+       final static String CONTENT = "content";
+       final static String AUTHOR = "author";
+       final static String DATE = "date";
+}
+
+
index 58b82133d571dd9cf304246b26d08d6c0350a884..ac929f0fd105998f82242cd1e4080fd3be48d3b1 100644 (file)
@@ -1,7 +1,7 @@
-package org.collectionspace.services.note;\r
-\r
-public interface NoteListItemJAXBSchema {\r
-       final static String CONTENT = "content";\r
-       final static String CSID = "csid";\r
-       final static String URI = "url";\r
-}\r
+package org.collectionspace.services.note;
+
+public interface NoteListItemJAXBSchema {
+       final static String CONTENT = "content";
+       final static String CSID = "csid";
+       final static String URI = "url";
+}
index aa01369f25b1b34e9a5cbfdbf912369d000023c8..5a0f38a4698ac916f973f6ece2439bd0518eaf79 100644 (file)
@@ -1,74 +1,74 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!-- Contact schema (XSD) Entity : Contact Part : Common Used for: JAXB binding \r
-       between XML and Java objects $LastChangedRevision: 1929 $ $LastChangedDate: \r
-       2010-04-28 01:50:27 -0700 (Wed, 28 Apr 2010) $ -->\r
-\r
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-       xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"\r
-       elementFormDefault="unqualified"\r
-       xmlns:ns="http://collectionspace.org/services/note"\r
-       xmlns="http://collectionspace.org/services/note"\r
-       targetNamespace="http://collectionspace.org/services/note"\r
-       version="0.1">\r
-\r
-       <!-- Avoid XmlRootElement nightmare: See http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html -->\r
-       <!-- See http://wiki.collectionspace.org/display/collectionspace/Contact+Schema -->\r
-\r
-       <!-- This is the base class for subitems -->\r
-       <xs:complexType name="subitem">\r
-               <xs:annotation>\r
-                       <xs:appinfo>\r
-                               <jaxb:class ref="org.collectionspace.services.common.subitem.Subitem" />\r
-                       </xs:appinfo>\r
-               </xs:annotation>\r
-       </xs:complexType>\r
-\r
-       <xs:element name="notes_common">\r
-               <xs:complexType>\r
-                       <xs:complexContent>\r
-                               <xs:extension base="subitem">\r
-                                       <xs:sequence>\r
-                                               <xs:element name="content" type="xs:string" />\r
-                                               <xs:element name="author" type="xs:string" />\r
-                                               <xs:element name="date" type="xs:string" />\r
-                                       </xs:sequence>\r
-                               </xs:extension>\r
-                       </xs:complexContent>\r
-               </xs:complexType>\r
-       </xs:element>\r
-\r
-       <!-- This is the base class for subitems -->\r
-       <xs:complexType name="abstractCommonList">\r
-               <xs:annotation>\r
-                       <xs:appinfo>\r
-                               <jaxb:class ref="org.collectionspace.services.jaxb.AbstractCommonList" />\r
-                       </xs:appinfo>\r
-               </xs:annotation>\r
-       </xs:complexType>\r
-\r
-       <!-- note records, as in Nuxeo repository -->\r
-       <xs:element name="notes-common-list">\r
-               <xs:complexType>\r
-                       <xs:complexContent>\r
-                               <xs:extension base="abstractCommonList">\r
-                                       <xs:sequence>\r
-                                               <xs:element name="note-list-item" maxOccurs="unbounded">\r
-                                                       <xs:complexType>\r
-                                                               <xs:sequence>\r
-                                                                       <xs:element name="content" type="xs:string"\r
-                                                                               minOccurs="1" />\r
-                                                                       <!-- uri to retrive note details -->\r
-                                                                       <xs:element name="uri" type="xs:anyURI" minOccurs="1" />\r
-                                                                       <xs:element name="csid" type="xs:string" minOccurs="1" />\r
-                                                               </xs:sequence>\r
-                                                       </xs:complexType>\r
-                                               </xs:element>\r
-                                       </xs:sequence>\r
-                               </xs:extension>\r
-                       </xs:complexContent>\r
-               </xs:complexType>\r
-       </xs:element>\r
-\r
-</xs:schema>\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!-- Contact schema (XSD) Entity : Contact Part : Common Used for: JAXB binding 
+       between XML and Java objects $LastChangedRevision: 1929 $ $LastChangedDate: 
+       2010-04-28 01:50:27 -0700 (Wed, 28 Apr 2010) $ -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+       xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
+       elementFormDefault="unqualified"
+       xmlns:ns="http://collectionspace.org/services/note"
+       xmlns="http://collectionspace.org/services/note"
+       targetNamespace="http://collectionspace.org/services/note"
+       version="0.1">
+
+       <!-- Avoid XmlRootElement nightmare: See http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html -->
+       <!-- See http://wiki.collectionspace.org/display/collectionspace/Contact+Schema -->
+
+       <!-- This is the base class for subitems -->
+       <xs:complexType name="subitem">
+               <xs:annotation>
+                       <xs:appinfo>
+                               <jaxb:class ref="org.collectionspace.services.common.subitem.Subitem" />
+                       </xs:appinfo>
+               </xs:annotation>
+       </xs:complexType>
+
+       <xs:element name="notes_common">
+               <xs:complexType>
+                       <xs:complexContent>
+                               <xs:extension base="subitem">
+                                       <xs:sequence>
+                                               <xs:element name="content" type="xs:string" />
+                                               <xs:element name="author" type="xs:string" />
+                                               <xs:element name="date" type="xs:string" />
+                                       </xs:sequence>
+                               </xs:extension>
+                       </xs:complexContent>
+               </xs:complexType>
+       </xs:element>
+
+       <!-- This is the base class for subitems -->
+       <xs:complexType name="abstractCommonList">
+               <xs:annotation>
+                       <xs:appinfo>
+                               <jaxb:class ref="org.collectionspace.services.jaxb.AbstractCommonList" />
+                       </xs:appinfo>
+               </xs:annotation>
+       </xs:complexType>
+
+       <!-- note records, as in Nuxeo repository -->
+       <xs:element name="notes-common-list">
+               <xs:complexType>
+                       <xs:complexContent>
+                               <xs:extension base="abstractCommonList">
+                                       <xs:sequence>
+                                               <xs:element name="note-list-item" maxOccurs="unbounded">
+                                                       <xs:complexType>
+                                                               <xs:sequence>
+                                                                       <xs:element name="content" type="xs:string"
+                                                                               minOccurs="1" />
+                                                                       <!-- uri to retrive note details -->
+                                                                       <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>
+
index 8618bae824a0c09f502ce81a6f2cfa9065390b05..379e02e0373abd53eeb63fd7c6a08f4212eec861 100644 (file)
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- A comment. -->\r
-<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">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.note</artifactId>\r
-    <name>services.note</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A comment. -->
+<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>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.note</artifactId>
+    <name>services.note</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+
+</project>
+
index ceb4bcb368d20aa60f528e307ed7857b67d121df..87147fb00ba8ce0809e3e90ff985422c659d657d 100644 (file)
@@ -1,93 +1,93 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.note</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.note.service</artifactId>\r
-    <name>services.note.service</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.note.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.note.client</artifactId>\r
-            <version>${project.version}</version>\r
-         </dependency>\r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>        \r
-\r
-      <!-- javax -->\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-note</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.note</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.note.service</artifactId>
+    <name>services.note.service</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.note.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.note.client</artifactId>
+            <version>${project.version}</version>
+         </dependency>
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>        
+
+      <!-- javax -->
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-note</finalName>
+    </build>
+</project>
+
index 12051b851b9a0521fad7a0c55669fe466c0e0b56..347b9df223866e0bcf34560fceb9bd15d2338dfd 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<profilesXml xmlns="http://maven.apache.org/PROFILES/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">\r
+<?xml version="1.0" encoding="UTF-8"?>
+<profilesXml xmlns="http://maven.apache.org/PROFILES/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
 </profilesXml>
\ No newline at end of file
index 368b7663f3fa7f2d6f4f30acbb81efe7b34e304c..f1081cc3b9b8a368f12a522c8a94ca55ef83c3ae 100644 (file)
@@ -1,58 +1,58 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 Regents of the University of California\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.note;\r
-\r
-import org.collectionspace.services.client.NoteClient;\r
-import org.collectionspace.services.common.ResourceBase;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import javax.ws.rs.Consumes;\r
-import javax.ws.rs.Path;\r
-import javax.ws.rs.Produces;\r
-\r
-@Path(NoteClient.SERVICE_PATH)\r
-@Consumes("application/xml")\r
-@Produces("application/xml")\r
-//@Produces("application/xml;charset=UTF-8")\r
-public class NoteResource extends ResourceBase {\r
-    final Logger logger = LoggerFactory.getLogger(NoteResource.class);\r
-\r
-    @Override\r
-    protected String getVersionString() {\r
-       final String lastChangeRevision = "$LastChangedRevision: 1982 $";\r
-       return lastChangeRevision;\r
-    }\r
-    \r
-     @Override\r
-    public String getServiceName() {\r
-        return NoteClient.SERVICE_PATH_COMPONENT;\r
-    }\r
-\r
-    @Override\r
-    public Class<NotesCommon> getCommonPartClass() {\r
-       return NotesCommon.class;\r
-    }\r
-\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 Regents of the University of California
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.note;
+
+import org.collectionspace.services.client.NoteClient;
+import org.collectionspace.services.common.ResourceBase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+@Path(NoteClient.SERVICE_PATH)
+@Consumes("application/xml")
+@Produces("application/xml")
+//@Produces("application/xml;charset=UTF-8")
+public class NoteResource extends ResourceBase {
+    final Logger logger = LoggerFactory.getLogger(NoteResource.class);
+
+    @Override
+    protected String getVersionString() {
+       final String lastChangeRevision = "$LastChangedRevision: 1982 $";
+       return lastChangeRevision;
+    }
+    
+     @Override
+    public String getServiceName() {
+        return NoteClient.SERVICE_PATH_COMPONENT;
+    }
+
+    @Override
+    public Class<NotesCommon> getCommonPartClass() {
+       return NotesCommon.class;
+    }
+
+}
index d1bf29ed282972f5faa0e382e0ac0f14f3c7abb3..917d61705b4b141ca131bb2c1d5a7fd109da01c5 100644 (file)
@@ -1,35 +1,35 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.note.nuxeo;\r
-\r
-/**\r
- * NoteConstants, stores constants related to Note documents \r
- *\r
- */\r
-public class NoteConstants {\r
-\r
-    public final static String NUXEO_DOCTYPE = "Note";\r
-    public final static String NUXEO_SCHEMA_NAME = "note";\r
-    public final static String NUXEO_DC_TITLE = "CollectionSpace-Note";\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.note.nuxeo;
+
+/**
+ * NoteConstants, stores constants related to Note documents 
+ *
+ */
+public class NoteConstants {
+
+    public final static String NUXEO_DOCTYPE = "Note";
+    public final static String NUXEO_SCHEMA_NAME = "note";
+    public final static String NUXEO_DC_TITLE = "CollectionSpace-Note";
+}
index df5dd994ee378d93cc34bb183a5e9b117dd2bd95..f2321cd3e9da5b50dd53a5eb9eeb568b34655041 100644 (file)
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 Regents of the University of California\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
-\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-package org.collectionspace.services.note.nuxeo;\r
-\r
-import java.util.Iterator;\r
-import java.util.List;\r
-\r
-import org.collectionspace.services.note.NoteJAXBSchema;\r
-import org.collectionspace.services.common.document.DocumentHandler.Action;\r
-import org.collectionspace.services.common.document.DocumentWrapper;\r
-import org.collectionspace.services.note.NotesCommon;\r
-import org.collectionspace.services.note.NotesCommonList;\r
-import org.collectionspace.services.note.NotesCommonList.NoteListItem;\r
-\r
-import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;\r
-import org.collectionspace.services.nuxeo.client.java.RemoteSubItemDocumentModelHandlerImpl;\r
-import org.collectionspace.services.nuxeo.util.NuxeoUtils;\r
-import org.nuxeo.ecm.core.api.DocumentModel;\r
-import org.nuxeo.ecm.core.api.DocumentModelList;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * The Class NoteDocumentModelHandler.\r
- */\r
-public class NoteDocumentModelHandler\r
-        extends RemoteSubItemDocumentModelHandlerImpl<NotesCommon, NotesCommonList> {\r
-\r
-    /** The logger. */\r
-    private final Logger logger = LoggerFactory.getLogger(NoteDocumentModelHandler.class);\r
-    \r
-    /** The note. */\r
-    private NotesCommon note;\r
-    \r
-    /** The note list. */\r
-    private NotesCommonList noteList;\r
-\r
-    /** The owner. */\r
-    private String owner;\r
-    \r
-    private final String commonSchemaName = "notes_common";\r
-    \r
-       public boolean schemaHasSubItem(String schema) {\r
-               return commonSchemaName.equals(schema);\r
-       }\r
-\r
-\r
-    /**\r
-     * Gets the owner.\r
-     *\r
-     * @return the owner\r
-     */\r
-    public String getOwner() {\r
-        return owner;\r
-    }\r
-\r
-    /**\r
-     * Sets the owner.\r
-     *\r
-     * @param owner the new owner\r
-     */\r
-    public void setInAuthority(String owner) {\r
-        this.owner = owner;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#getCommonPart()\r
-     */\r
-    @Override\r
-    public NotesCommon getCommonPart() {\r
-        return note;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#setCommonPart(java.lang.Object)\r
-     */\r
-    @Override\r
-    public void setCommonPart(NotesCommon note) {\r
-        this.note = note;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#getCommonPartList()\r
-     */\r
-    @Override\r
-    public NotesCommonList getCommonPartList() {\r
-        return noteList;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#setCommonPartList(java.lang.Object)\r
-     */\r
-    @Override\r
-    public void setCommonPartList(NotesCommonList noteList) {\r
-        this.noteList = noteList;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#extractCommonPart(org.collectionspace.services.common.document.DocumentWrapper)\r
-     */\r
-    @Override\r
-    public NotesCommon extractCommonPart(DocumentWrapper<DocumentModel> wrapDoc)\r
-            throws Exception {\r
-        throw new UnsupportedOperationException();\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#fillCommonPart(java.lang.Object, org.collectionspace.services.common.document.DocumentWrapper)\r
-     */\r
-    @Override\r
-    public void fillCommonPart(NotesCommon noteObject, DocumentWrapper<DocumentModel> wrapDoc) throws Exception {\r
-        throw new UnsupportedOperationException();\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#extractCommonPartList(org.collectionspace.services.common.document.DocumentWrapper)\r
-     */\r
-    @Override\r
-    public NotesCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {\r
-        NotesCommonList coList = extractPagingInfo(new NotesCommonList(), wrapDoc);\r
-        List<NotesCommonList.NoteListItem> list = coList.getNoteListItem();\r
-        Iterator<DocumentModel> iter = wrapDoc.getWrappedObject().iterator();\r
-        while(iter.hasNext()){\r
-            DocumentModel docModel = iter.next();\r
-            NoteListItem clistItem = new NoteListItem();\r
-            clistItem.setContent((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),\r
-                    NoteJAXBSchema.CONTENT));\r
-            String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString());\r
-            clistItem.setUri(getServiceContextPath() + id);\r
-            clistItem.setCsid(id);\r
-            list.add(clistItem);\r
-        }\r
-\r
-        return coList;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.common.document.AbstractMultipartDocumentHandlerImpl#getQProperty(java.lang.String)\r
-     */\r
-    @Override\r
-    public String getQProperty(String prop) {\r
-        return NoteConstants.NUXEO_SCHEMA_NAME + ":" + prop;\r
-    }\r
-}\r
-\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 Regents of the University of California
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.note.nuxeo;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.collectionspace.services.note.NoteJAXBSchema;
+import org.collectionspace.services.common.document.DocumentHandler.Action;
+import org.collectionspace.services.common.document.DocumentWrapper;
+import org.collectionspace.services.note.NotesCommon;
+import org.collectionspace.services.note.NotesCommonList;
+import org.collectionspace.services.note.NotesCommonList.NoteListItem;
+
+import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
+import org.collectionspace.services.nuxeo.client.java.RemoteSubItemDocumentModelHandlerImpl;
+import org.collectionspace.services.nuxeo.util.NuxeoUtils;
+import org.nuxeo.ecm.core.api.DocumentModel;
+import org.nuxeo.ecm.core.api.DocumentModelList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class NoteDocumentModelHandler.
+ */
+public class NoteDocumentModelHandler
+        extends RemoteSubItemDocumentModelHandlerImpl<NotesCommon, NotesCommonList> {
+
+    /** The logger. */
+    private final Logger logger = LoggerFactory.getLogger(NoteDocumentModelHandler.class);
+    
+    /** The note. */
+    private NotesCommon note;
+    
+    /** The note list. */
+    private NotesCommonList noteList;
+
+    /** The owner. */
+    private String owner;
+    
+    private final String commonSchemaName = "notes_common";
+    
+       public boolean schemaHasSubItem(String schema) {
+               return commonSchemaName.equals(schema);
+       }
+
+
+    /**
+     * Gets the owner.
+     *
+     * @return the owner
+     */
+    public String getOwner() {
+        return owner;
+    }
+
+    /**
+     * Sets the owner.
+     *
+     * @param owner the new owner
+     */
+    public void setInAuthority(String owner) {
+        this.owner = owner;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#getCommonPart()
+     */
+    @Override
+    public NotesCommon getCommonPart() {
+        return note;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#setCommonPart(java.lang.Object)
+     */
+    @Override
+    public void setCommonPart(NotesCommon note) {
+        this.note = note;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#getCommonPartList()
+     */
+    @Override
+    public NotesCommonList getCommonPartList() {
+        return noteList;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#setCommonPartList(java.lang.Object)
+     */
+    @Override
+    public void setCommonPartList(NotesCommonList noteList) {
+        this.noteList = noteList;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#extractCommonPart(org.collectionspace.services.common.document.DocumentWrapper)
+     */
+    @Override
+    public NotesCommon extractCommonPart(DocumentWrapper<DocumentModel> wrapDoc)
+            throws Exception {
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#fillCommonPart(java.lang.Object, org.collectionspace.services.common.document.DocumentWrapper)
+     */
+    @Override
+    public void fillCommonPart(NotesCommon noteObject, DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#extractCommonPartList(org.collectionspace.services.common.document.DocumentWrapper)
+     */
+    @Override
+    public NotesCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {
+        NotesCommonList coList = extractPagingInfo(new NotesCommonList(), wrapDoc);
+        List<NotesCommonList.NoteListItem> list = coList.getNoteListItem();
+        Iterator<DocumentModel> iter = wrapDoc.getWrappedObject().iterator();
+        while(iter.hasNext()){
+            DocumentModel docModel = iter.next();
+            NoteListItem clistItem = new NoteListItem();
+            clistItem.setContent((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
+                    NoteJAXBSchema.CONTENT));
+            String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString());
+            clistItem.setUri(getServiceContextPath() + id);
+            clistItem.setCsid(id);
+            list.add(clistItem);
+        }
+
+        return coList;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.document.AbstractMultipartDocumentHandlerImpl#getQProperty(java.lang.String)
+     */
+    @Override
+    public String getQProperty(String prop) {
+        return NoteConstants.NUXEO_SCHEMA_NAME + ":" + prop;
+    }
+}
+
index a8393860e9867020bc19f75fd05896b47c2ddd90..f841a19c67cd63ae3417e7e3a376703d9144ab26 100644 (file)
@@ -1,11 +1,11 @@
-package org.collectionspace.services.test;\r
-\r
-\r
-/**\r
- * NoteServiceTest\r
- * \r
- * @version $Revision:$\r
- */\r
-public class NoteServiceTest {\r
-       //empty\r
-}\r
+package org.collectionspace.services.test;
+
+
+/**
+ * NoteServiceTest
+ * 
+ * @version $Revision:$
+ */
+public class NoteServiceTest {
+       //empty
+}
index 6881ae6ddb9d72a7052c6baef3e316c2a3017cf9..52121cb83cedeb64cfa7485e530e05508d28a259 100644 (file)
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8" ?>\r
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">\r
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">\r
-\r
-       <appender name="console" class="org.apache.log4j.ConsoleAppender">\r
-               <param name="Target" value="System.out" />\r
-               <layout class="org.apache.log4j.TTCCLayout">\r
-                       <param name="DateFormat" value="ISO8601" />\r
-               </layout>\r
-       </appender>\r
-\r
-\r
-       <appender name="unit-tests"\r
-               class="org.apache.log4j.RollingFileAppender">\r
-               <param name="File" value="./target/unit-tests.log" />\r
-               <param name="MaxFileSize" value="10240KB" />\r
-               <param name="MaxBackupIndex" value="6" />\r
-               <layout class="org.apache.log4j.TTCCLayout">\r
-                       <param name="DateFormat" value="ISO8601" />\r
-               </layout>\r
-       </appender>\r
-\r
-       <logger name="org.apache.commons.httpclient" additivity="false">\r
-               <level value="warn" />\r
-               <appender-ref ref="console" />\r
-               <appender-ref ref="unit-tests" />\r
-       </logger>\r
-\r
-       <logger name="httpclient.wire" additivity="false">\r
-               <level value="info" />\r
-               <appender-ref ref="console" />\r
-               <appender-ref ref="unit-tests" />\r
-       </logger>\r
-\r
-       <root>\r
-               <priority value="debug" />\r
-               <appender-ref ref="console" />\r
-               <appender-ref ref="unit-tests" />\r
-       </root>\r
-\r
-</log4j:configuration>\r
-\r
-\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+       <appender name="console" class="org.apache.log4j.ConsoleAppender">
+               <param name="Target" value="System.out" />
+               <layout class="org.apache.log4j.TTCCLayout">
+                       <param name="DateFormat" value="ISO8601" />
+               </layout>
+       </appender>
+
+
+       <appender name="unit-tests"
+               class="org.apache.log4j.RollingFileAppender">
+               <param name="File" value="./target/unit-tests.log" />
+               <param name="MaxFileSize" value="10240KB" />
+               <param name="MaxBackupIndex" value="6" />
+               <layout class="org.apache.log4j.TTCCLayout">
+                       <param name="DateFormat" value="ISO8601" />
+               </layout>
+       </appender>
+
+       <logger name="org.apache.commons.httpclient" additivity="false">
+               <level value="warn" />
+               <appender-ref ref="console" />
+               <appender-ref ref="unit-tests" />
+       </logger>
+
+       <logger name="httpclient.wire" additivity="false">
+               <level value="info" />
+               <appender-ref ref="console" />
+               <appender-ref ref="unit-tests" />
+       </logger>
+
+       <root>
+               <priority value="debug" />
+               <appender-ref ref="console" />
+               <appender-ref ref="unit-tests" />
+       </root>
+
+</log4j:configuration>
+
+
+
+
index 221909388ecf405cd7a965f2c68a31e39d15ea00..70d12f9597665623726164c903b459c68407e93a 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.objectexit</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.objectexit</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 9ffbbb0bcdb8385a73e20d12fa7c5b85781509c3..ca5b178fbc161008c40ae4d2a6fca8a620006579 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.objectexit.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.objectexit.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index d18316afc439864cbba0150febce32e2e724ffba..2068e34f3ee13d634f8514b5c61eb9ef3f88dd6b 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index 5985f1b66d45fb714ed791021f7217960cb0d7fd..d3d10aaa142d77e2785e454f5ff6fdbbc3f2e8a9 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.organization</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.organization</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d18316afc439864cbba0150febce32e2e724ffba..2068e34f3ee13d634f8514b5c61eb9ef3f88dd6b 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index ac15649ed44c30ee649b8b3842965a10f2534977..831bc16665bef17fd23d22a6f5eefecf0b88c1e1 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.organization.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.organization.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index c1727ddce909e770b1a3bdefbd5c70201c161e28..e4b2520231524e74bcfbf6c15b494981ce47983b 100644 (file)
-\r
-<project name="organization.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        organization service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy organization in ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <ant antfile="nuxeo-platform-cs-organization/build.xml" target="deploy" inheritall="false"/>\r
-        -->\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy organization from ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-       leaving this only for backwards compatibility reasons. -->\r
-        <ant antfile="nuxeo-platform-cs-organization/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for organization" depends="package">\r
-        <ant antfile="nuxeo-platform-cs-organization/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-organization/build.xml" target="dist_installer" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="organization.3rdparty" default="package" basedir=".">
+    <description>
+        organization service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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 organization in ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <ant antfile="nuxeo-platform-cs-organization/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+    description="undeploy organization from ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       leaving this only for backwards compatibility reasons. -->
+        <ant antfile="nuxeo-platform-cs-organization/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for organization" depends="package">
+        <ant antfile="nuxeo-platform-cs-organization/build.xml" target="dist" inheritall="false"/>
+    </target>
+    
+    <target name="dist_installer"
+    description="generate distribution for collectionobject" depends="package">
+        <ant antfile="nuxeo-platform-cs-organization/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index 8aec1961f82e324a51985e97614aeb0ddbc84792..e99aedf0d00a75bbeef0223229fb8888ae463f0f 100644 (file)
@@ -1,23 +1,23 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.organization</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.organization.3rdparty</artifactId>\r
-    <name>services.organization.3rdparty</name>\r
-    <packaging>pom</packaging>\r
-    <description>\r
-    3rd party build for organization service\r
-    </description>\r
-\r
-    <modules>\r
-    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <module>nuxeo-platform-cs-organization</module>\r
-        -->\r
-    </modules>\r
-</project>\r
+<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.organization</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.organization.3rdparty</artifactId>
+    <name>services.organization.3rdparty</name>
+    <packaging>pom</packaging>
+    <description>
+    3rd party build for organization service
+    </description>
+
+    <modules>
+    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <module>nuxeo-platform-cs-organization</module>
+        -->
+    </modules>
+</project>
index 85c3189a01915cced9b0c13e06f3fd6a8790005b..332535624b1e26f950bd0f21301555a69b8b2536 100644 (file)
-\r
-<project name="organization" default="package" basedir=".">\r
-    <description>\r
-        organization service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-        <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy organization service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="undeploy organization service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-        description="distribute organization service">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist_installer" depends="package"\r
-        description="distribute organization service">        \r
-        <!-- copy install scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.installer.services}/organization">\r
-            <fileset dir="${basedir}/installer/"/>\r
-        </copy>\r
-        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="organization" default="package" basedir=".">
+    <description>
+        organization service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+        <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 organization service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy organization service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+        description="distribute organization service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+    <target name="dist_installer" depends="package"
+        description="distribute organization service">        
+        <!-- copy install scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.installer.services}/organization">
+            <fileset dir="${basedir}/installer/"/>
+        </copy>
+        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index b07cfadd752ed9fe5767579c9df633035cdccbeb..5b3c2e32b3c0624c3357357ef53a0afdfe3db951 100644 (file)
@@ -1,90 +1,90 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.organization</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.organization.client</artifactId>\r
-    <name>services.organization.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.contact.client</artifactId>            \r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-organization-client</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.organization</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.organization.client</artifactId>
+    <name>services.organization.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.client</artifactId>            
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-organization-client</finalName>
+    </build>
+</project>
+
index 4d6b203e4e5429ee194aa4bdbb649c266548ea68..e07bbed734a4eafc6ce96d1a7e59db6837a45d76 100644 (file)
-/**    \r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 University of California, Berkeley\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.client;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Date;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-import org.collectionspace.services.OrganizationJAXBSchema;\r
-import org.collectionspace.services.client.test.ServiceRequestType;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.organization.ContactNameList;\r
-import org.collectionspace.services.organization.FunctionList;\r
-import org.collectionspace.services.organization.GroupList;\r
-import org.collectionspace.services.organization.HistoryNoteList;\r
-import org.collectionspace.services.organization.OrganizationsCommon;\r
-import org.collectionspace.services.organization.OrgauthoritiesCommon;\r
-import org.collectionspace.services.organization.OrgTermGroup;\r
-import org.collectionspace.services.organization.OrgTermGroupList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-import org.collectionspace.services.organization.StructuredDateGroup;\r
-\r
-/**\r
- * OrgAuthorityClientUtils.\r
- */\r
-public class OrgAuthorityClientUtils {\r
-    \r
-    /** The Constant logger. */\r
-    private static final Logger logger =\r
-        LoggerFactory.getLogger(OrgAuthorityClientUtils.class);\r
-       private static final ServiceRequestType READ_REQ = ServiceRequestType.READ;\r
-\r
-    /**\r
-     * @param csid the id of the OrgAuthority\r
-     * @param client if null, creates a new client\r
-     * @return\r
-     */\r
-    public static String getAuthorityRefName(String csid, OrgAuthorityClient client){\r
-       if(client==null)\r
-               client = new OrgAuthorityClient();\r
-        ClientResponse<String> res = client.read(csid);\r
-        try {\r
-               int statusCode = res.getStatus();\r
-               if(!READ_REQ.isValidStatusCode(statusCode)\r
-                       ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {\r
-                       throw new RuntimeException("Invalid status code returned: "+statusCode);\r
-               }\r
-               //FIXME: remove the following try catch once Aron fixes signatures\r
-               try {\r
-                   PoxPayloadIn input = new PoxPayloadIn(res.getEntity());\r
-                   OrgauthoritiesCommon orgAuthority = \r
-                       (OrgauthoritiesCommon) CollectionSpaceClientUtils.extractPart(input,\r
-                           client.getCommonPartName(), OrgauthoritiesCommon.class);\r
-                       if(orgAuthority==null) {\r
-                               throw new RuntimeException("Null orgAuthority returned from service.");\r
-                       }\r
-                   return orgAuthority.getRefName();\r
-               } catch (Exception e) {\r
-                   throw new RuntimeException(e);\r
-               }\r
-        } finally {\r
-               res.releaseConnection();\r
-        }\r
-    }\r
-\r
-    /**\r
-     * @param inAuthority the ID of the parent OrgAuthority\r
-     * @param csid the ID of the Organization\r
-     * @param client if null, creates a new client\r
-     * @return\r
-     */\r
-    public static String getOrgRefName(String inAuthority, String csid, OrgAuthorityClient client){\r
-       if(client==null)\r
-               client = new OrgAuthorityClient();\r
-        ClientResponse<String> res = client.readItem(inAuthority, csid);\r
-        try {\r
-               int statusCode = res.getStatus();\r
-               if(!READ_REQ.isValidStatusCode(statusCode)\r
-                               ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {\r
-                       throw new RuntimeException("Invalid status code returned: "+statusCode);\r
-               }\r
-               //FIXME: remove the following try catch once Aron fixes signatures\r
-               try {\r
-                   PoxPayloadIn input = new PoxPayloadIn(res.getEntity());\r
-                   OrganizationsCommon org = \r
-                       (OrganizationsCommon) CollectionSpaceClientUtils.extractPart(input,\r
-                           client.getItemCommonPartName(), OrganizationsCommon.class);\r
-                       if(org==null) {\r
-                               throw new RuntimeException("Null Organization returned from service.");\r
-                       }\r
-                   return org.getRefName();\r
-               } catch (Exception e) {\r
-                   throw new RuntimeException(e);\r
-               }\r
-        } finally {\r
-               res.releaseConnection();\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Creates the org authority instance.\r
-     *\r
-     * @param displayName the display name\r
-     * @param shortIdentifier the short Id \r
-     * @param headerLabel the header label\r
-     * @return the multipart output\r
-     */\r
-    public static PoxPayloadOut createOrgAuthorityInstance(\r
-               String displayName, String shortIdentifier, String headerLabel ) {\r
-        OrgauthoritiesCommon orgAuthority = new OrgauthoritiesCommon();\r
-        orgAuthority.setDisplayName(displayName);\r
-        orgAuthority.setShortIdentifier(shortIdentifier);\r
-        //String refName = createOrgAuthRefName(shortIdentifier, displayName);\r
-        //orgAuthority.setRefName(refName);\r
-        orgAuthority.setVocabType("OrgAuthority");\r
-        PoxPayloadOut multipart = new PoxPayloadOut(OrgAuthorityClient.SERVICE_PAYLOAD_NAME);\r
-        PayloadOutputPart commonPart = multipart.addPart(orgAuthority, MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.setLabel(headerLabel);\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, orgAuthority common ",\r
-                        orgAuthority, OrgauthoritiesCommon.class);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-\r
-    /**\r
-     * Creates the item in authority.\r
-     *\r
-     * @param inAuthority the owning authority\r
-     * @param orgAuthorityRefName the owning Authority ref name\r
-     * @param orgInfo the org info. OrganizationJAXBSchema.SHORT_IDENTIFIER is REQUIRED.\r
-     * @param client the client\r
-     * @return the string\r
-     */\r
-    public static String createItemInAuthority( String inAuthority,\r
-               String orgAuthorityRefName, Map<String, String> orgInfo, List<OrgTermGroup> terms,\r
-                Map<String, List<String>> orgRepeatablesInfo, OrgAuthorityClient client) {\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-\r
-        String displayName = "";\r
-        if ((terms !=null) && (! terms.isEmpty())) {\r
-            displayName = terms.get(0).getTermDisplayName();\r
-        }\r
-\r
-       if(logger.isDebugEnabled()){\r
-               logger.debug("Import: Create Item: \""+displayName\r
-                               +"\" in orgAuthority: \"" + orgAuthorityRefName +"\"");\r
-       }\r
-       PoxPayloadOut multipart =\r
-               createOrganizationInstance(orgAuthorityRefName, \r
-                               orgInfo, terms, orgRepeatablesInfo, client.getItemCommonPartName());\r
-\r
-       ClientResponse<Response> res = client.createItem(inAuthority, multipart);\r
-       String result;\r
-       try {   \r
-               int statusCode = res.getStatus();\r
-       \r
-               if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-                       throw new RuntimeException("Could not create Item: \""+orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER)\r
-                                       +"\" in orgAuthority: \"" + orgAuthorityRefName\r
-                                       +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-               }\r
-               if(statusCode != EXPECTED_STATUS_CODE) {\r
-                       throw new RuntimeException("Unexpected Status when creating Item: \""+ orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER)\r
-                                       +"\" in orgAuthority: \"" + orgAuthorityRefName +"\", Status:"+ statusCode);\r
-               }\r
-       \r
-               result = extractId(res);\r
-       } finally {\r
-               res.releaseConnection();\r
-       }\r
-       \r
-       return result;\r
-    }\r
-\r
-    /**\r
-     * Creates the organization instance.\r
-     *\r
-     * @param orgAuthRefName the owning Authority ref name\r
-     * @param orgInfo the org info\r
-     * @param headerLabel the header label\r
-     * @return the multipart output\r
-     */\r
-       public static PoxPayloadOut createOrganizationInstance(\r
-                       String orgAuthRefName,\r
-                       Map<String,     String> orgInfo,\r
-                       List<OrgTermGroup> terms,\r
-                       String headerLabel) {\r
-               final Map<String, List<String>> EMPTY_ORG_REPEATABLES_INFO = new HashMap<String, List<String>>();\r
-               return createOrganizationInstance(orgAuthRefName, orgInfo, terms,\r
-                               EMPTY_ORG_REPEATABLES_INFO, headerLabel);\r
-       }\r
-\r
-    /**\r
-     * Creates the organization instance.\r
-     *\r
-     * @param orgAuthRefName the owning Authority ref name\r
-     * @param orgInfo the org info\r
-     * @param orgRepeatablesInfo names and values of repeatable scalar\r
-     *        fields in the Organization record\r
-     * @param headerLabel the header label\r
-     * @return the multipart output\r
-     */\r
-    public static PoxPayloadOut createOrganizationInstance( \r
-               String orgAuthRefName, Map<String, String> orgInfo, List<OrgTermGroup> terms,\r
-                Map<String, List<String>> orgRepeatablesInfo, String headerLabel){\r
-        OrganizationsCommon organization = new OrganizationsCommon();\r
-       String shortId = orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER);\r
-       if (shortId == null || shortId.isEmpty()) {\r
-               throw new IllegalArgumentException("shortIdentifier cannot be null or empty");\r
-       }       \r
-       organization.setShortIdentifier(shortId);\r
-               String value = null;\r
-        List<String> values = null;\r
-        \r
-        // Set values in the Term Information Group\r
-        OrgTermGroupList termList = new OrgTermGroupList();\r
-        if (terms == null || terms.isEmpty()) {\r
-            terms = getTermGroupInstance(getGeneratedIdentifier());\r
-        }\r
-        termList.getOrgTermGroup().addAll(terms); \r
-        organization.setOrgTermGroupList(termList);\r
-        \r
-        if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.CONTACT_NAMES))!=null) {\r
-                ContactNameList contactsList = new ContactNameList();\r
-                List<String> contactNames = contactsList.getContactName();\r
-               contactNames.addAll(values);\r
-                organization.setContactNames(contactsList);\r
-        }\r
-        if((value = (String)orgInfo.get(OrganizationJAXBSchema.FOUNDING_DATE))!=null) {\r
-            StructuredDateGroup foundingDate = new StructuredDateGroup();\r
-            foundingDate.setDateDisplayDate(value);\r
-            organization.setFoundingDateGroup(foundingDate);\r
-        }\r
-        if((value = (String)orgInfo.get(OrganizationJAXBSchema.DISSOLUTION_DATE))!=null) {\r
-            StructuredDateGroup dissolutionDate = new StructuredDateGroup();\r
-            dissolutionDate.setDateDisplayDate(value);\r
-            organization.setDissolutionDateGroup(dissolutionDate);\r
-        }\r
-        if((value = (String)orgInfo.get(OrganizationJAXBSchema.FOUNDING_PLACE))!=null)\r
-               organization.setFoundingPlace(value);\r
-        if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.GROUPS))!=null) {\r
-                GroupList groupsList = new GroupList();\r
-                List<String> groups = groupsList.getGroup();\r
-               groups.addAll(values);\r
-                organization.setGroups(groupsList);\r
-        }\r
-        if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.FUNCTIONS))!=null) {\r
-                FunctionList functionsList = new FunctionList();\r
-                List<String> functions = functionsList.getFunction();\r
-               functions.addAll(values);\r
-                organization.setFunctions(functionsList);\r
-        }\r
-        if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.HISTORY_NOTES))!=null) {\r
-                HistoryNoteList historyNotesList = new HistoryNoteList();\r
-                List<String> historyNotes = historyNotesList.getHistoryNote();\r
-               historyNotes.addAll(values);\r
-                organization.setHistoryNotes(historyNotesList);\r
-        }\r
-\r
-        PoxPayloadOut multipart = new PoxPayloadOut(OrgAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);\r
-        PayloadOutputPart commonPart = multipart.addPart(organization,\r
-            MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.setLabel(headerLabel);\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, organization common ", organization, OrganizationsCommon.class);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-\r
-    /**\r
-     * Returns an error message indicating that the status code returned by a\r
-     * specific call to a service does not fall within a set of valid status\r
-     * codes for that service.\r
-     *\r
-     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).\r
-     *\r
-     * @param statusCode  The invalid status code that was returned in the response,\r
-     *                    from submitting that type of request to the service.\r
-     *\r
-     * @return An error message.\r
-     */\r
-    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {\r
-        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +\r
-                requestType.validStatusCodesAsString();\r
-    }\r
-\r
-    /**\r
-     * Extract id.\r
-     *\r
-     * @param res the res\r
-     * @return the string\r
-     */\r
-    public static String extractId(ClientResponse<Response> res) {\r
-        MultivaluedMap<String, Object> mvm = res.getMetadata();\r
-        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);\r
-        if(logger.isDebugEnabled()){\r
-               logger.info("extractId:uri=" + uri);\r
-        }\r
-        String[] segments = uri.split("/");\r
-        String id = segments[segments.length - 1];\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("id=" + id);\r
-        }\r
-        return id;\r
-    }\r
-    \r
-    /**\r
-     * Creates the org auth ref name.\r
-     *\r
-     * @param shortId the orgAuthority shortIdentifier\r
-     * @param displaySuffix displayName to be appended, if non-null\r
-     * @return the string\r
-     */\r
-    /*\r
-    public static String createOrgAuthRefName(String shortId, String displaySuffix) {\r
-       String refName = "urn:cspace:org.collectionspace.demo:orgauthority:name("\r
-                       +shortId+")";\r
-       if(displaySuffix!=null&&!displaySuffix.isEmpty())\r
-               refName += "'"+displaySuffix+"'";\r
-       return refName;\r
-    }\r
-    */\r
-\r
-    /**\r
-     * Creates the organization ref name.\r
-     *\r
-     * @param orgAuthRefName the org auth ref name\r
-     * @param shortId the person shortIdentifier\r
-     * @param displaySuffix displayName to be appended, if non-null\r
-     * @return the string\r
-     */\r
-    /*\r
-    public static String createOrganizationRefName(\r
-                       String orgAuthRefName, String shortId, String displaySuffix) {\r
-       String refName = orgAuthRefName+":organization:name("+shortId+")";\r
-       if(displaySuffix!=null&&!displaySuffix.isEmpty())\r
-               refName += "'"+displaySuffix+"'";\r
-       return refName;\r
-    }\r
-    */\r
-\r
-    /**\r
-     * Produces a default displayName from the basic name and foundingPlace fields.\r
-     * @see OrgAuthorityDocumentModelHandler.prepareDefaultDisplayName() which\r
-     * duplicates this logic, until we define a service-general utils package\r
-     * that is neither client nor service specific.\r
-     * @param shortName\r
-     * @param foundingPlace\r
-     * @return\r
-     * @throws Exception\r
-     */\r
-    public static String prepareDefaultDisplayName(\r
-               String shortName, String foundingPlace ) {\r
-       StringBuilder newStr = new StringBuilder();\r
-               final String sep = " ";\r
-               boolean firstAdded = false;\r
-               if(null != shortName ) {\r
-                       newStr.append(shortName);\r
-                       firstAdded = true;\r
-               }\r
-       // Now we add the place\r
-               if(null != foundingPlace ) {\r
-                       if(firstAdded) {\r
-                               newStr.append(sep);\r
-                       }\r
-                       newStr.append(foundingPlace);\r
-               }\r
-               return newStr.toString();\r
-    }\r
-\r
-    public static List<OrgTermGroup> getTermGroupInstance(String identifier) {\r
-        if (Tools.isBlank(identifier)) {\r
-            identifier = getGeneratedIdentifier();\r
-        }\r
-        List<OrgTermGroup> terms = new ArrayList<OrgTermGroup>();\r
-        OrgTermGroup term = new OrgTermGroup();\r
-        term.setTermDisplayName(identifier);\r
-        term.setTermName(identifier);\r
-        terms.add(term);\r
-        return terms;\r
-    }\r
-    \r
-    private static String getGeneratedIdentifier() {\r
-        return "id" + new Date().getTime(); \r
-   }\r
-    \r
-}\r
+/**    
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 University of California, Berkeley
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.client;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import org.collectionspace.services.OrganizationJAXBSchema;
+import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.organization.ContactNameList;
+import org.collectionspace.services.organization.FunctionList;
+import org.collectionspace.services.organization.GroupList;
+import org.collectionspace.services.organization.HistoryNoteList;
+import org.collectionspace.services.organization.OrganizationsCommon;
+import org.collectionspace.services.organization.OrgauthoritiesCommon;
+import org.collectionspace.services.organization.OrgTermGroup;
+import org.collectionspace.services.organization.OrgTermGroupList;
+import org.jboss.resteasy.client.ClientResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.collectionspace.services.organization.StructuredDateGroup;
+
+/**
+ * OrgAuthorityClientUtils.
+ */
+public class OrgAuthorityClientUtils {
+    
+    /** The Constant logger. */
+    private static final Logger logger =
+        LoggerFactory.getLogger(OrgAuthorityClientUtils.class);
+       private static final ServiceRequestType READ_REQ = ServiceRequestType.READ;
+
+    /**
+     * @param csid the id of the OrgAuthority
+     * @param client if null, creates a new client
+     * @return
+     */
+    public static String getAuthorityRefName(String csid, OrgAuthorityClient client){
+       if(client==null)
+               client = new OrgAuthorityClient();
+        ClientResponse<String> res = client.read(csid);
+        try {
+               int statusCode = res.getStatus();
+               if(!READ_REQ.isValidStatusCode(statusCode)
+                       ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {
+                       throw new RuntimeException("Invalid status code returned: "+statusCode);
+               }
+               //FIXME: remove the following try catch once Aron fixes signatures
+               try {
+                   PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+                   OrgauthoritiesCommon orgAuthority = 
+                       (OrgauthoritiesCommon) CollectionSpaceClientUtils.extractPart(input,
+                           client.getCommonPartName(), OrgauthoritiesCommon.class);
+                       if(orgAuthority==null) {
+                               throw new RuntimeException("Null orgAuthority returned from service.");
+                       }
+                   return orgAuthority.getRefName();
+               } catch (Exception e) {
+                   throw new RuntimeException(e);
+               }
+        } finally {
+               res.releaseConnection();
+        }
+    }
+
+    /**
+     * @param inAuthority the ID of the parent OrgAuthority
+     * @param csid the ID of the Organization
+     * @param client if null, creates a new client
+     * @return
+     */
+    public static String getOrgRefName(String inAuthority, String csid, OrgAuthorityClient client){
+       if(client==null)
+               client = new OrgAuthorityClient();
+        ClientResponse<String> res = client.readItem(inAuthority, csid);
+        try {
+               int statusCode = res.getStatus();
+               if(!READ_REQ.isValidStatusCode(statusCode)
+                               ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {
+                       throw new RuntimeException("Invalid status code returned: "+statusCode);
+               }
+               //FIXME: remove the following try catch once Aron fixes signatures
+               try {
+                   PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+                   OrganizationsCommon org = 
+                       (OrganizationsCommon) CollectionSpaceClientUtils.extractPart(input,
+                           client.getItemCommonPartName(), OrganizationsCommon.class);
+                       if(org==null) {
+                               throw new RuntimeException("Null Organization returned from service.");
+                       }
+                   return org.getRefName();
+               } catch (Exception e) {
+                   throw new RuntimeException(e);
+               }
+        } finally {
+               res.releaseConnection();
+        }
+    }
+
+    /**
+     * Creates the org authority instance.
+     *
+     * @param displayName the display name
+     * @param shortIdentifier the short Id 
+     * @param headerLabel the header label
+     * @return the multipart output
+     */
+    public static PoxPayloadOut createOrgAuthorityInstance(
+               String displayName, String shortIdentifier, String headerLabel ) {
+        OrgauthoritiesCommon orgAuthority = new OrgauthoritiesCommon();
+        orgAuthority.setDisplayName(displayName);
+        orgAuthority.setShortIdentifier(shortIdentifier);
+        //String refName = createOrgAuthRefName(shortIdentifier, displayName);
+        //orgAuthority.setRefName(refName);
+        orgAuthority.setVocabType("OrgAuthority");
+        PoxPayloadOut multipart = new PoxPayloadOut(OrgAuthorityClient.SERVICE_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(orgAuthority, MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, orgAuthority common ",
+                        orgAuthority, OrgauthoritiesCommon.class);
+        }
+
+        return multipart;
+    }
+
+    /**
+     * Creates the item in authority.
+     *
+     * @param inAuthority the owning authority
+     * @param orgAuthorityRefName the owning Authority ref name
+     * @param orgInfo the org info. OrganizationJAXBSchema.SHORT_IDENTIFIER is REQUIRED.
+     * @param client the client
+     * @return the string
+     */
+    public static String createItemInAuthority( String inAuthority,
+               String orgAuthorityRefName, Map<String, String> orgInfo, List<OrgTermGroup> terms,
+                Map<String, List<String>> orgRepeatablesInfo, OrgAuthorityClient client) {
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+
+        String displayName = "";
+        if ((terms !=null) && (! terms.isEmpty())) {
+            displayName = terms.get(0).getTermDisplayName();
+        }
+
+       if(logger.isDebugEnabled()){
+               logger.debug("Import: Create Item: \""+displayName
+                               +"\" in orgAuthority: \"" + orgAuthorityRefName +"\"");
+       }
+       PoxPayloadOut multipart =
+               createOrganizationInstance(orgAuthorityRefName, 
+                               orgInfo, terms, orgRepeatablesInfo, client.getItemCommonPartName());
+
+       ClientResponse<Response> res = client.createItem(inAuthority, multipart);
+       String result;
+       try {   
+               int statusCode = res.getStatus();
+       
+               if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                       throw new RuntimeException("Could not create Item: \""+orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER)
+                                       +"\" in orgAuthority: \"" + orgAuthorityRefName
+                                       +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+               }
+               if(statusCode != EXPECTED_STATUS_CODE) {
+                       throw new RuntimeException("Unexpected Status when creating Item: \""+ orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER)
+                                       +"\" in orgAuthority: \"" + orgAuthorityRefName +"\", Status:"+ statusCode);
+               }
+       
+               result = extractId(res);
+       } finally {
+               res.releaseConnection();
+       }
+       
+       return result;
+    }
+
+    /**
+     * Creates the organization instance.
+     *
+     * @param orgAuthRefName the owning Authority ref name
+     * @param orgInfo the org info
+     * @param headerLabel the header label
+     * @return the multipart output
+     */
+       public static PoxPayloadOut createOrganizationInstance(
+                       String orgAuthRefName,
+                       Map<String,     String> orgInfo,
+                       List<OrgTermGroup> terms,
+                       String headerLabel) {
+               final Map<String, List<String>> EMPTY_ORG_REPEATABLES_INFO = new HashMap<String, List<String>>();
+               return createOrganizationInstance(orgAuthRefName, orgInfo, terms,
+                               EMPTY_ORG_REPEATABLES_INFO, headerLabel);
+       }
+
+    /**
+     * Creates the organization instance.
+     *
+     * @param orgAuthRefName the owning Authority ref name
+     * @param orgInfo the org info
+     * @param orgRepeatablesInfo names and values of repeatable scalar
+     *        fields in the Organization record
+     * @param headerLabel the header label
+     * @return the multipart output
+     */
+    public static PoxPayloadOut createOrganizationInstance( 
+               String orgAuthRefName, Map<String, String> orgInfo, List<OrgTermGroup> terms,
+                Map<String, List<String>> orgRepeatablesInfo, String headerLabel){
+        OrganizationsCommon organization = new OrganizationsCommon();
+       String shortId = orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER);
+       if (shortId == null || shortId.isEmpty()) {
+               throw new IllegalArgumentException("shortIdentifier cannot be null or empty");
+       }       
+       organization.setShortIdentifier(shortId);
+               String value = null;
+        List<String> values = null;
+        
+        // Set values in the Term Information Group
+        OrgTermGroupList termList = new OrgTermGroupList();
+        if (terms == null || terms.isEmpty()) {
+            terms = getTermGroupInstance(getGeneratedIdentifier());
+        }
+        termList.getOrgTermGroup().addAll(terms); 
+        organization.setOrgTermGroupList(termList);
+        
+        if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.CONTACT_NAMES))!=null) {
+                ContactNameList contactsList = new ContactNameList();
+                List<String> contactNames = contactsList.getContactName();
+               contactNames.addAll(values);
+                organization.setContactNames(contactsList);
+        }
+        if((value = (String)orgInfo.get(OrganizationJAXBSchema.FOUNDING_DATE))!=null) {
+            StructuredDateGroup foundingDate = new StructuredDateGroup();
+            foundingDate.setDateDisplayDate(value);
+            organization.setFoundingDateGroup(foundingDate);
+        }
+        if((value = (String)orgInfo.get(OrganizationJAXBSchema.DISSOLUTION_DATE))!=null) {
+            StructuredDateGroup dissolutionDate = new StructuredDateGroup();
+            dissolutionDate.setDateDisplayDate(value);
+            organization.setDissolutionDateGroup(dissolutionDate);
+        }
+        if((value = (String)orgInfo.get(OrganizationJAXBSchema.FOUNDING_PLACE))!=null)
+               organization.setFoundingPlace(value);
+        if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.GROUPS))!=null) {
+                GroupList groupsList = new GroupList();
+                List<String> groups = groupsList.getGroup();
+               groups.addAll(values);
+                organization.setGroups(groupsList);
+        }
+        if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.FUNCTIONS))!=null) {
+                FunctionList functionsList = new FunctionList();
+                List<String> functions = functionsList.getFunction();
+               functions.addAll(values);
+                organization.setFunctions(functionsList);
+        }
+        if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.HISTORY_NOTES))!=null) {
+                HistoryNoteList historyNotesList = new HistoryNoteList();
+                List<String> historyNotes = historyNotesList.getHistoryNote();
+               historyNotes.addAll(values);
+                organization.setHistoryNotes(historyNotesList);
+        }
+
+        PoxPayloadOut multipart = new PoxPayloadOut(OrgAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(organization,
+            MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, organization common ", organization, OrganizationsCommon.class);
+        }
+
+        return multipart;
+    }
+
+    /**
+     * Returns an error message indicating that the status code returned by a
+     * specific call to a service does not fall within a set of valid status
+     * codes for that service.
+     *
+     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).
+     *
+     * @param statusCode  The invalid status code that was returned in the response,
+     *                    from submitting that type of request to the service.
+     *
+     * @return An error message.
+     */
+    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {
+        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +
+                requestType.validStatusCodesAsString();
+    }
+
+    /**
+     * Extract id.
+     *
+     * @param res the res
+     * @return the string
+     */
+    public static String extractId(ClientResponse<Response> res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);
+        if(logger.isDebugEnabled()){
+               logger.info("extractId:uri=" + uri);
+        }
+        String[] segments = uri.split("/");
+        String id = segments[segments.length - 1];
+        if(logger.isDebugEnabled()){
+               logger.debug("id=" + id);
+        }
+        return id;
+    }
+    
+    /**
+     * Creates the org auth ref name.
+     *
+     * @param shortId the orgAuthority shortIdentifier
+     * @param displaySuffix displayName to be appended, if non-null
+     * @return the string
+     */
+    /*
+    public static String createOrgAuthRefName(String shortId, String displaySuffix) {
+       String refName = "urn:cspace:org.collectionspace.demo:orgauthority:name("
+                       +shortId+")";
+       if(displaySuffix!=null&&!displaySuffix.isEmpty())
+               refName += "'"+displaySuffix+"'";
+       return refName;
+    }
+    */
+
+    /**
+     * Creates the organization ref name.
+     *
+     * @param orgAuthRefName the org auth ref name
+     * @param shortId the person shortIdentifier
+     * @param displaySuffix displayName to be appended, if non-null
+     * @return the string
+     */
+    /*
+    public static String createOrganizationRefName(
+                       String orgAuthRefName, String shortId, String displaySuffix) {
+       String refName = orgAuthRefName+":organization:name("+shortId+")";
+       if(displaySuffix!=null&&!displaySuffix.isEmpty())
+               refName += "'"+displaySuffix+"'";
+       return refName;
+    }
+    */
+
+    /**
+     * Produces a default displayName from the basic name and foundingPlace fields.
+     * @see OrgAuthorityDocumentModelHandler.prepareDefaultDisplayName() which
+     * duplicates this logic, until we define a service-general utils package
+     * that is neither client nor service specific.
+     * @param shortName
+     * @param foundingPlace
+     * @return
+     * @throws Exception
+     */
+    public static String prepareDefaultDisplayName(
+               String shortName, String foundingPlace ) {
+       StringBuilder newStr = new StringBuilder();
+               final String sep = " ";
+               boolean firstAdded = false;
+               if(null != shortName ) {
+                       newStr.append(shortName);
+                       firstAdded = true;
+               }
+       // Now we add the place
+               if(null != foundingPlace ) {
+                       if(firstAdded) {
+                               newStr.append(sep);
+                       }
+                       newStr.append(foundingPlace);
+               }
+               return newStr.toString();
+    }
+
+    public static List<OrgTermGroup> getTermGroupInstance(String identifier) {
+        if (Tools.isBlank(identifier)) {
+            identifier = getGeneratedIdentifier();
+        }
+        List<OrgTermGroup> terms = new ArrayList<OrgTermGroup>();
+        OrgTermGroup term = new OrgTermGroup();
+        term.setTermDisplayName(identifier);
+        term.setTermName(identifier);
+        terms.add(term);
+        return terms;
+    }
+    
+    private static String getGeneratedIdentifier() {
+        return "id" + new Date().getTime(); 
+   }
+    
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index fbd862e93b5fd289c54fadbb769ac4968db3e062..ee115a6b0ac8583de5ace3bf31dd621384fd4467 100644 (file)
@@ -1,61 +1,61 @@
-\r
-<project name="organization" default="package" basedir=".">\r
-    <description>\r
-        organization service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-    \r
-    <target name="install" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Organization Service's &apos;install&apos; target." />\r
-                               </exec>\r
-                               <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->\r
-        <copy todir="${jee.deploy.nuxeo.plugins}">\r
-            <fileset file="nuxeo/*.jar"/>\r
-        </copy>                                \r
-    </target>    \r
-\r
-    <target name="config" description="" depends="install">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Organization Service's &apos;config&apos; target." />\r
-                               </exec>\r
-    </target>\r
-    \r
-    <target name="predeploy" description="" depends="config">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Organization Service's &apos;predeploy&apos; target." />\r
-                               </exec>\r
-    </target>    \r
-    \r
-    <target name="deploy" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Organization Service's &apos;deploy&apos; target." />\r
-                               </exec>\r
-    </target>\r
-    \r
-    <target name="postdeploy">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Organization Service." />\r
-                               </exec>         \r
-        <exec executable="echo">\r
-                       <arg value="Importing necessary orgauthorities." />\r
-                               </exec>                         \r
-        <java jar="./postdeploy/collectionspace-services-organization-importer-jar-with-dependencies.jar"\r
-               fork="true"\r
-               failonerror="true">\r
-                               </java> \r
-    </target>\r
-    \r
-\r
-</project>\r
+
+<project name="organization" default="package" basedir=".">
+    <description>
+        organization service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+    
+    <target name="install" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Organization Service's &apos;install&apos; target." />
+                               </exec>
+                               <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->
+        <copy todir="${jee.deploy.nuxeo.plugins}">
+            <fileset file="nuxeo/*.jar"/>
+        </copy>                                
+    </target>    
+
+    <target name="config" description="" depends="install">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Organization Service's &apos;config&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="predeploy" description="" depends="config">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Organization Service's &apos;predeploy&apos; target." />
+                               </exec>
+    </target>    
+    
+    <target name="deploy" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Organization Service's &apos;deploy&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="postdeploy">
+        <exec executable="echo">
+                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Organization Service." />
+                               </exec>         
+        <exec executable="echo">
+                       <arg value="Importing necessary orgauthorities." />
+                               </exec>                         
+        <java jar="./postdeploy/collectionspace-services-organization-importer-jar-with-dependencies.jar"
+               fork="true"
+               failonerror="true">
+                               </java> 
+    </target>
+    
+
+</project>
index 80e070aa6f28daf01c30581855c7754e737855e4..2607d9d303a267764ad9977462f7bd97d04c1103 100644 (file)
@@ -1,26 +1,26 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services;\r
-\r
-import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;\r
-\r
-/**\r
- * @author pschmitz\r
- *\r
- */\r
-public interface OrganizationJAXBSchema extends AuthorityItemJAXBSchema {\r
-\r
-    final static String ORGANIZATIONS_COMMON = "organizations_common";\r
-    final static String TERM_NAME = "shortName";\r
-    final static String NAME_ADDITIONS = "nameAdditions";\r
-    final static String CONTACT_NAMES = "contactNames";\r
-    final static String FOUNDING_DATE = "foundingDate";\r
-    final static String DISSOLUTION_DATE = "dissolutionDate";\r
-    final static String FOUNDING_PLACE = "foundingPlace";\r
-    final static String GROUPS = "groups";\r
-    final static String FUNCTIONS = "functions";\r
-    final static String HISTORY_NOTES = "historyNotes";\r
-}\r
-\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services;
+
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
+
+/**
+ * @author pschmitz
+ *
+ */
+public interface OrganizationJAXBSchema extends AuthorityItemJAXBSchema {
+
+    final static String ORGANIZATIONS_COMMON = "organizations_common";
+    final static String TERM_NAME = "shortName";
+    final static String NAME_ADDITIONS = "nameAdditions";
+    final static String CONTACT_NAMES = "contactNames";
+    final static String FOUNDING_DATE = "foundingDate";
+    final static String DISSOLUTION_DATE = "dissolutionDate";
+    final static String FOUNDING_PLACE = "foundingPlace";
+    final static String GROUPS = "groups";
+    final static String FUNCTIONS = "functions";
+    final static String HISTORY_NOTES = "historyNotes";
+}
+
+
index 3c47e61262b471901010486775be5951f52f4ba5..46e47c30615d19741d4bfb1d4873329dad9d97e4 100644 (file)
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.organization</artifactId>\r
-    <name>services.organization</name>\r
-    <packaging>pom</packaging>\r
-    \r
-    <dependencies>\r
-                       <!--\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>    \r
-                               -->\r
-    </dependencies>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-\r
-    <profiles>\r
-        <profile>\r
-            <id>samples</id>\r
-           <modules>\r
-                <module>sample</module>\r
-            </modules>\r
-        </profile>\r
-    </profiles>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.organization</artifactId>
+    <name>services.organization</name>
+    <packaging>pom</packaging>
+    
+    <dependencies>
+                       <!--
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>    
+                               -->
+    </dependencies>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+
+    <profiles>
+        <profile>
+            <id>samples</id>
+           <modules>
+                <module>sample</module>
+            </modules>
+        </profile>
+    </profiles>
+
+</project>
+
index ad5c57cd53d9532302f088bc1c1dc181d1953141..e526a471229e1318a3fc30268ce460a1dcf76690 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index a04f35d0c5c8b220cb865f15d40759c2aad0ddf0..cc557058c7fa3a477c77720dd7a53d3b915c2f7d 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.organization.client.samples</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.organization.client.samples</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index de701bc095eb455422fe398ed8714b975f746b02..1f0c71fd063713b3554c59b28239bd0893e5500b 100644 (file)
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.organization.client.samples</artifactId>\r
-    <packaging>pom</packaging>\r
-    <version>4.2-SNAPSHOT</version>\r
-    <name>organization.client.samples</name>\r
-\r
-    <modules>\r
-        <module>sample</module>\r
-    </modules>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.organization.client.samples</artifactId>
+    <packaging>pom</packaging>
+    <version>4.2-SNAPSHOT</version>
+    <name>organization.client.samples</name>
+
+    <modules>
+        <module>sample</module>
+    </modules>
+</project>
+
index d6d4cf76ebc786101dac177b75dcb4cd2f4b6a02..b7fd28fa824126e0e217520d4a4b1201e01718f8 100644 (file)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.organization.client.sample</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.jdt.core.javabuilder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.jdt.core.javanature</nature>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.organization.client.sample</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 8d378f3f1c0dc931f2cb2ef40963dbf99bac8658..7e0553ca547849b4a42dc0b7a1baeb2259ed5994 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.organization.client.sample</artifactId>\r
-    <packaging>jar</packaging>\r
-    <version>4.2-SNAPSHOT</version>\r
-    <name>organization.client.sample</name>\r
-    \r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <repositories>\r
-        <repository>\r
-            <id>libs-releases-local</id>\r
-            <name>libs-releases-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>\r
-            <releases>\r
-                <enabled>true</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>false</enabled>\r
-            </snapshots>            \r
-        </repository>\r
-        \r
-        <repository>\r
-            <id>libs-snapshots-local</id>\r
-            <name>libs-snapshots-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>\r
-            <releases>\r
-                <enabled>false</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>true</enabled>\r
-            </snapshots>            \r
-        </repository>\r
-        <repository>\r
-            <id>collectionspace-releases</id>\r
-            <name>collectionspace-releases</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public</url>            \r
-            <releases>\r
-                <enabled>true</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>false</enabled>\r
-            </snapshots>            \r
-        </repository>\r
-        <repository>\r
-            <id>nuxeo-public-snapshot</id>\r
-            <name>nuxeo-public-snapshot</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public-snapshot</url>\r
-            <releases>\r
-                <enabled>false</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>true</enabled>\r
-            </snapshots>\r
-        </repository>\r
-    </repositories>    \r
-    \r
-    <build>\r
-        <finalName>organization-client-sample</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-assembly-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <goals>\r
-                            <goal>attached</goal>\r
-                        </goals>\r
-                        <phase>package</phase>\r
-                        <configuration>\r
-                            <descriptorRefs>\r
-                                <descriptorRef>jar-with-dependencies</descriptorRef>\r
-                            </descriptorRefs>\r
-                            <archive>\r
-                                <manifest>\r
-                                    <mainClass>org.collectionspace.services.organization.client.sample.Sample</mainClass>\r
-                                </manifest>\r
-                            </archive>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-compiler-plugin</artifactId>\r
-                <configuration>\r
-                    <source>1.7</source>\r
-                    <target>1.7</target>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.organization.client.sample</artifactId>
+    <packaging>jar</packaging>
+    <version>4.2-SNAPSHOT</version>
+    <name>organization.client.sample</name>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    
+    <repositories>
+        <repository>
+            <id>libs-releases-local</id>
+            <name>libs-releases-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>            
+        </repository>
+        
+        <repository>
+            <id>libs-snapshots-local</id>
+            <name>libs-snapshots-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>            
+        </repository>
+        <repository>
+            <id>collectionspace-releases</id>
+            <name>collectionspace-releases</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public</url>            
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>            
+        </repository>
+        <repository>
+            <id>nuxeo-public-snapshot</id>
+            <name>nuxeo-public-snapshot</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public-snapshot</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+    </repositories>    
+    
+    <build>
+        <finalName>organization-client-sample</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>attached</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <descriptorRefs>
+                                <descriptorRef>jar-with-dependencies</descriptorRef>
+                            </descriptorRefs>
+                            <archive>
+                                <manifest>
+                                    <mainClass>org.collectionspace.services.organization.client.sample.Sample</mainClass>
+                                </manifest>
+                            </archive>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index 8667b5b53731602fbf41efaba19e67a619e1532e..5e52df1d923cb2ecd46c2c90bfb40a70f916fbd1 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c)) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.organization.client.sample;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Arrays;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.apache.log4j.BasicConfigurator;\r
-import org.collectionspace.services.OrganizationJAXBSchema;\r
-import org.collectionspace.services.client.OrgAuthorityClient;\r
-import org.collectionspace.services.client.OrgAuthorityClientUtils;\r
-import org.collectionspace.services.client.PayloadInputPart;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.client.test.ServiceRequestType;\r
-import org.collectionspace.services.organization.OrgauthoritiesCommon;\r
-import org.collectionspace.services.organization.OrgauthoritiesCommonList;\r
-import org.collectionspace.services.organization.OrganizationsCommon;\r
-import org.collectionspace.services.organization.OrganizationsCommonList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;\r
-import org.jboss.resteasy.plugins.providers.multipart.OutputPart;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * OrgAuthority Sample, carries out tests against a\r
- * deployed and running OrgAuthority Service.\r
- *\r
- * $LastChangedRevision: 1055 $\r
- * $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $\r
- */\r
-public class Sample {\r
-    private static final Logger logger =\r
-        LoggerFactory.getLogger(Sample.class);\r
-\r
-    // Instance variables specific to this test.\r
-    private OrgAuthorityClient client = new OrgAuthorityClient();\r
-    final String SERVICE_PATH_COMPONENT = "organizations";\r
-    final String ITEM_SERVICE_PATH_COMPONENT = "items";\r
-\r
-\r
-    // ---------------------------------------------------------------\r
-    // Create\r
-    // ---------------------------------------------------------------\r
-    protected String createOrgAuthRefName(String orgAuthorityName) {\r
-       return "urn:cspace:org.collectionspace.demo:orgauthority:name("\r
-                       +orgAuthorityName+")";\r
-    }\r
-\r
-    protected String createOrganizationRefName(\r
-                                               String orgAuthRefName, String orgName) {\r
-       return orgAuthRefName+":organization:name("+orgName+")";\r
-    }\r
-\r
-    \r
-\r
-    public void createOrgAuthority(String orgAuthName, List<Map<String,String>> orgInfos ) {\r
-\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-\r
-       logger.info("Import: Create orgAuthority: \"" + orgAuthName +"\"");\r
-       String baseOrgAuthRefName = createOrgAuthRefName(orgAuthName);\r
-       String fullOrgAuthRefName = baseOrgAuthRefName+"'"+orgAuthName+"'";\r
-       PoxPayloadOut multipart = \r
-               OrgAuthorityClientUtils.createOrgAuthorityInstance(\r
-                               orgAuthName, fullOrgAuthRefName, \r
-                               client.getCommonPartName());\r
-       ClientResponse<Response> res = client.create(multipart);\r
-\r
-       int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not create enumeration: \""+orgAuthName\r
-                               +"\" "+ OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when creating enumeration: \""\r
-                               +orgAuthName +"\", Status:"+ statusCode);\r
-       }\r
-\r
-       // Store the ID returned from this create operation\r
-       // for additional tests below.\r
-       String newOrgAuthId = OrgAuthorityClientUtils.extractId(res);\r
-        logger.info("Import: Created orgAuthority: \"" + orgAuthName +"\" ID:"\r
-                               +newOrgAuthId );\r
-        \r
-        // Add items to the orgAuthority\r
-               for(Map<String,String> orgInfo : orgInfos){\r
-               createItemInOrgAuth(newOrgAuthId, baseOrgAuthRefName, orgInfo);\r
-       }\r
-        \r
-    }\r
-    \r
-    private String createItemInOrgAuth(String vcsid, \r
-               String orgAuthorityRefName, Map<String,String> orgInfo) {\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-       String shortName = orgInfo.get(OrganizationJAXBSchema.SHORT_NAME);\r
-       String refName = createOrganizationRefName(\r
-                                               orgAuthorityRefName, shortName)+"'"+shortName+"'";\r
-\r
-\r
-       logger.info("Import: Create Item: \""+shortName+\r
-                       "\" in orgAuthority: \"" + orgAuthorityRefName +"\"");\r
-        PoxPayloadOut multipart = \r
-               OrgAuthorityClientUtils.createOrganizationInstance(refName, orgInfo, client.getItemCommonPartName() );\r
-\r
-       ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
-\r
-       int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not create Item: \""+shortName\r
-                               +"\" in orgAuthority: \"" + orgAuthorityRefName\r
-                               +"\" "+ OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when creating Item: \""+shortName\r
-                               +"\" in orgAuthority: \"" + orgAuthorityRefName +\r
-                               "\", Status:"+ statusCode);\r
-       }\r
-\r
-       return OrgAuthorityClientUtils.extractId(res);\r
-    }\r
-\r
-\r
-   // ---------------------------------------------------------------\r
-   // Read\r
-   // ---------------------------------------------------------------\r
-\r
-   private OrgauthoritiesCommonList readOrgAuthorities() {\r
-\r
-        // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
-\r
-        // Submit the request to the service and store the response.\r
-        ClientResponse<OrgauthoritiesCommonList> res = client.readList();\r
-        OrgauthoritiesCommonList list = res.getEntity();\r
-\r
-        int statusCode = res.getStatus();\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not read list of orgAuthorities: "\r
-                + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when reading " +\r
-                "list of orgAuthorities, Status:"+ statusCode);\r
-       }\r
-\r
-        return list;\r
-   }\r
-\r
-    private List<String> readOrgAuthorityIds(OrgauthoritiesCommonList list) {\r
-\r
-        List<String> ids = new ArrayList<String>();\r
-        List<OrgauthoritiesCommonList.OrgauthorityListItem> orgAuthorities =\r
-            list.getOrgauthorityListItem();\r
-        for (OrgauthoritiesCommonList.OrgauthorityListItem orgAuthority : orgAuthorities) {\r
-            ids.add(orgAuthority.getCsid());\r
-        }\r
-        return ids;\r
-   }\r
-    \r
-   private OrgauthoritiesCommon readOrgAuthority(String orgAuthId) {\r
-\r
-        // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
-\r
-        // Submit the request to the service and store the response.\r
-        OrgauthoritiesCommon orgAuthority = null;\r
-        try {\r
-            ClientResponse<String> res = client.read(orgAuthId);\r
-            int statusCode = res.getStatus();\r
-            if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-                throw new RuntimeException("Could not read orgAuthority"\r
-                    + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-            }\r
-            if(statusCode != EXPECTED_STATUS_CODE) {\r
-                throw new RuntimeException("Unexpected Status when reading " +\r
-                    "orgAuthority, Status:"+ statusCode);\r
-            }\r
-            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());\r
-            PayloadInputPart orgAuthorityPart = input.getPart(client.getCommonPartName());\r
-            orgAuthority = (OrgauthoritiesCommon) orgAuthorityPart.getBody();\r
-        } catch (Exception e) {\r
-            throw new RuntimeException("Could not read orgAuthority: ", e);\r
-        }\r
-\r
-        return orgAuthority;\r
-    }\r
-\r
-    private OrganizationsCommonList readItemsInOrgAuth(String orgAuthId) {\r
-\r
-        // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
-\r
-        // Submit the request to the service and store the response.\r
-\r
-        //was: ClientResponse<OrganizationsCommonList> res = client.readItemList(orgAuthId);\r
-        //new API: readItemList(String inAuthority, String partialTerm, String keywords)\r
-        ClientResponse<OrganizationsCommonList> res = client.readItemList(orgAuthId, "", "");//TODO:   .New call, most certainly wrong.  Just trying to get this to compile. Laramie20100728\r
-\r
-        OrganizationsCommonList list = res.getEntity();\r
-\r
-        int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not read items in orgAuthority: "\r
-                + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when reading " +\r
-                "items in orgAuthority, Status:"+ statusCode);\r
-       }\r
-\r
-        return list;\r
-    }\r
-\r
-    private List<String> readOrganizationIds(OrganizationsCommonList list) {\r
-\r
-        List<String> ids = new ArrayList<String>();\r
-        List<OrganizationsCommonList.OrganizationListItem> items =\r
-            list.getOrganizationListItem();\r
-        for (OrganizationsCommonList.OrganizationListItem item : items) {\r
-            ids.add(item.getCsid());\r
-        }\r
-        return ids;\r
-   }\r
-\r
-    // ---------------------------------------------------------------\r
-    // Delete\r
-    // ---------------------------------------------------------------\r
-\r
-    private void deleteOrgAuthority(String vcsid) {\r
-         // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
-\r
-        ClientResponse<Response> res = client.delete(vcsid);\r
-        int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not delete orgAuthority: "\r
-                + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when deleting " +\r
-                "orgAuthority, Status:"+ statusCode);\r
-       }\r
-    }\r
-\r
-    private void deleteAllOrgAuthorities() {\r
-        List<String> ids = readOrgAuthorityIds(readOrgAuthorities());\r
-        for (String id : ids) {\r
-            deleteOrgAuthority(id);\r
-        }\r
-    }\r
-\r
-        private void deleteOrganization(String vcsid, String itemcsid) {\r
-         // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
-\r
-        ClientResponse<Response> res = client.deleteItem(vcsid, itemcsid);\r
-        int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not delete orgAuthority item: "\r
-                + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when deleting " +\r
-                "orgAuthority item, Status:"+ statusCode);\r
-       }\r
-    }\r
-\r
-    private void deleteAllItemsForOrgAuth(String orgAuthId) {\r
-        List<String> itemIds = readOrganizationIds(readItemsInOrgAuth(orgAuthId));\r
-        for (String itemId : itemIds) {\r
-            deleteOrganization(orgAuthId, itemId);\r
-        }\r
-    }\r
-\r
-    // ---------------------------------------------------------------\r
-    // Utility methods used by tests above\r
-    // ---------------------------------------------------------------\r
-\r
-\r
-    // Retrieve individual fields of orgAuthority records.\r
-\r
-    private String displayAllOrgAuthorities(OrgauthoritiesCommonList list) {\r
-        StringBuffer sb = new StringBuffer();\r
-            List<OrgauthoritiesCommonList.OrgauthorityListItem> orgAuthorities =\r
-                    list.getOrgauthorityListItem();\r
-            int i = 0;\r
-        for (OrgauthoritiesCommonList.OrgauthorityListItem orgAuthority : orgAuthorities) {\r
-            sb.append("orgAuthority [" + i + "]" + "\n");\r
-            sb.append(displayOrgAuthorityDetails(orgAuthority));\r
-            i++;\r
-        }\r
-        return sb.toString();\r
-    }\r
-\r
-    private String displayOrgAuthorityDetails(\r
-        OrgauthoritiesCommonList.OrgauthorityListItem orgAuthority) {\r
-            StringBuffer sb = new StringBuffer();\r
-            sb.append("displayName=" + orgAuthority.getDisplayName() + "\n");\r
-            sb.append("vocabType=" + orgAuthority.getVocabType() + "\n");\r
-            // sb.append("csid=" + orgAuthority.getCsid() + "\n");\r
-            sb.append("URI=" + orgAuthority.getUri() + "\n");\r
-        return sb.toString();\r
-    }\r
-\r
-    // Retrieve individual fields of organization records.\r
-\r
-    private String displayAllOrganizations(OrganizationsCommonList list) {\r
-        StringBuffer sb = new StringBuffer();\r
-        List<OrganizationsCommonList.OrganizationListItem> items =\r
-                list.getOrganizationListItem();\r
-        int i = 0;\r
-        for (OrganizationsCommonList.OrganizationListItem item : items) {\r
-            sb.append("organization [" + i + "]" + "\n");\r
-            sb.append(displayOrganizationDetails(item));\r
-            i++;\r
-        }\r
-        return sb.toString();\r
-    }\r
-\r
-    private String displayOrganizationDetails(\r
-        OrganizationsCommonList.OrganizationListItem item) {\r
-            StringBuffer sb = new StringBuffer();\r
-            sb.append("csid=" + item.getCsid() + "\n");\r
-            sb.append("displayName=" + item.getDisplayName() + "\n");\r
-            // sb.append("URI=" + item.getUri() + "\n");\r
-        return sb.toString();\r
-    }\r
-\r
-//    private Object extractPart(PoxPayloadIn input, String label,\r
-//        Class clazz) throws Exception {\r
-//        Object obj = null;\r
-//        for(PayloadInputPart part : input.getParts()){\r
-//            String partLabel = part.getHeaders().getFirst("label");\r
-//            if(label.equalsIgnoreCase(partLabel)){\r
-//                String partStr = part.getBodyAsString();\r
-//                if(logger.isDebugEnabled()){\r
-//                    logger.debug("extracted part str=\n" + partStr);\r
-//                }\r
-//                obj = part.getBody(clazz, null);\r
-//                if(logger.isDebugEnabled()){\r
-//                    logger.debug("extracted part obj=\n", obj, clazz);\r
-//                }\r
-//                break;\r
-//            }\r
-//        }\r
-//        return obj;\r
-//    }\r
-\r
-       public static void main(String[] args) {\r
-\r
-        // Configure logging.\r
-               BasicConfigurator.configure();\r
-\r
-        logger.info("OrgAuthority Sample starting...");\r
-\r
-               Sample sample = new Sample();\r
-        OrgauthoritiesCommonList orgAuthorities;\r
-        List<String> orgAuthIds;\r
-        String details = "";\r
-\r
-        // Optionally delete all orgAuthorities and organizations.\r
-\r
-        boolean ENABLE_DELETE_ALL = false;\r
-        if (ENABLE_DELETE_ALL) {\r
-\r
-            logger.info("Deleting all organizations and orgAuthorities ...");\r
-\r
-            // For each orgAuthority ...\r
-            orgAuthorities = sample.readOrgAuthorities();\r
-            orgAuthIds = sample.readOrgAuthorityIds(orgAuthorities);\r
-            for (String orgAuthId : orgAuthIds) {\r
-                logger.info("Deleting all organizations for orgAuthority ...");\r
-                sample.deleteAllItemsForOrgAuth(orgAuthId);\r
-                logger.info("Deleting orgAuthority ...");\r
-                sample.deleteOrgAuthority(orgAuthId);\r
-            }\r
-\r
-            logger.info("Reading orgAuthorities after deletion ...");\r
-            orgAuthorities = sample.readOrgAuthorities();\r
-            details = sample.displayAllOrgAuthorities(orgAuthorities);\r
-            logger.info(details);\r
-\r
-            logger.info("Reading items in each orgAuthority after deletion ...");\r
-            orgAuthIds = sample.readOrgAuthorityIds(orgAuthorities);\r
-            for (String orgAuthId : orgAuthIds) {\r
-                OrganizationsCommonList items = sample.readItemsInOrgAuth(orgAuthId);\r
-                details = sample.displayAllOrganizations(items);\r
-                logger.info(details);\r
-            }\r
-\r
-        }\r
-\r
-        // Create new authorities, each populated with organizations.\r
-        Map<String, String> mmiOrgMap = new HashMap<String,String>();\r
-        mmiOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "MMI");\r
-        mmiOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Museum of the Moving Image");\r
-        //mmiOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Megan Forbes");\r
-        mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1984");\r
-        mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Astoria, NY");\r
-        Map<String, String> pahmaOrgMap = new HashMap<String,String>();\r
-        pahmaOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "PAHMA");\r
-        pahmaOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Phoebe A. Hearst Museum of Anthropology");\r
-        pahmaOrgMap.put(OrganizationJAXBSchema.NAME_ADDITIONS, "University of California, Berkeley");\r
-        //pahmaOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Michael Black");\r
-        pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1901");\r
-        pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Berkeley, CA");\r
-        Map<String, String> savoyOrgMap = new HashMap<String,String>();\r
-        savoyOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "Savoy Theatre");\r
-        savoyOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1900");\r
-        savoyOrgMap.put(OrganizationJAXBSchema.DISSOLUTION_DATE, "1952");\r
-        savoyOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "New York, NY");\r
-        List<Map<String, String>> orgMaps = \r
-               Arrays.asList(mmiOrgMap, pahmaOrgMap, savoyOrgMap );\r
-        \r
-               sample.createOrgAuthority("Sample Org Authority", orgMaps);\r
-\r
-               logger.info("OrgAuthority Sample complete.");\r
-\r
-        logger.info("Reading orgAuthorities and items ...");\r
-        // Get a list of orgAuthorities.\r
-        orgAuthorities = sample.readOrgAuthorities();\r
-        // For each orgAuthority ...\r
-        for (OrgauthoritiesCommonList.OrgauthorityListItem\r
-            orgAuthority : orgAuthorities.getOrgauthorityListItem()) {\r
-            // Get its display name.\r
-            logger.info(orgAuthority.getDisplayName());\r
-            // Get a list of the organizations in this orgAuthority.\r
-            OrganizationsCommonList items =\r
-                sample.readItemsInOrgAuth(orgAuthority.getCsid());\r
-            // For each organization ...\r
-            for (OrganizationsCommonList.OrganizationListItem\r
-                item : items.getOrganizationListItem()) {\r
-                // Get its display name.\r
-                logger.info(" " + item.getDisplayName());\r
-            }\r
-        }\r
-\r
-        // Sample alternate methods of reading all orgAuthorities and\r
-        // organizations separately.\r
-        boolean RUN_ADDITIONAL_SAMPLES = false;\r
-        if (RUN_ADDITIONAL_SAMPLES) {\r
-\r
-            logger.info("Reading all orgAuthorities ...");\r
-            details = sample.displayAllOrgAuthorities(orgAuthorities);\r
-            logger.info(details);\r
-\r
-            logger.info("Reading all organizations ...");\r
-            orgAuthIds = sample.readOrgAuthorityIds(orgAuthorities);\r
-            for (String orgAuthId : orgAuthIds) {\r
-                OrganizationsCommonList items = sample.readItemsInOrgAuth(orgAuthId);\r
-                details = sample.displayAllOrganizations(items);\r
-                logger.info(details);\r
-            }\r
-\r
-        }\r
-\r
-       }\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c)) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.collectionspace.services.organization.client.sample;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+
+import org.apache.log4j.BasicConfigurator;
+import org.collectionspace.services.OrganizationJAXBSchema;
+import org.collectionspace.services.client.OrgAuthorityClient;
+import org.collectionspace.services.client.OrgAuthorityClientUtils;
+import org.collectionspace.services.client.PayloadInputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.organization.OrgauthoritiesCommon;
+import org.collectionspace.services.organization.OrgauthoritiesCommonList;
+import org.collectionspace.services.organization.OrganizationsCommon;
+import org.collectionspace.services.organization.OrganizationsCommonList;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.multipart.InputPart;
+import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * OrgAuthority Sample, carries out tests against a
+ * deployed and running OrgAuthority Service.
+ *
+ * $LastChangedRevision: 1055 $
+ * $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $
+ */
+public class Sample {
+    private static final Logger logger =
+        LoggerFactory.getLogger(Sample.class);
+
+    // Instance variables specific to this test.
+    private OrgAuthorityClient client = new OrgAuthorityClient();
+    final String SERVICE_PATH_COMPONENT = "organizations";
+    final String ITEM_SERVICE_PATH_COMPONENT = "items";
+
+
+    // ---------------------------------------------------------------
+    // Create
+    // ---------------------------------------------------------------
+    protected String createOrgAuthRefName(String orgAuthorityName) {
+       return "urn:cspace:org.collectionspace.demo:orgauthority:name("
+                       +orgAuthorityName+")";
+    }
+
+    protected String createOrganizationRefName(
+                                               String orgAuthRefName, String orgName) {
+       return orgAuthRefName+":organization:name("+orgName+")";
+    }
+
+    
+
+    public void createOrgAuthority(String orgAuthName, List<Map<String,String>> orgInfos ) {
+
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+
+       logger.info("Import: Create orgAuthority: \"" + orgAuthName +"\"");
+       String baseOrgAuthRefName = createOrgAuthRefName(orgAuthName);
+       String fullOrgAuthRefName = baseOrgAuthRefName+"'"+orgAuthName+"'";
+       PoxPayloadOut multipart = 
+               OrgAuthorityClientUtils.createOrgAuthorityInstance(
+                               orgAuthName, fullOrgAuthRefName, 
+                               client.getCommonPartName());
+       ClientResponse<Response> res = client.create(multipart);
+
+       int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not create enumeration: \""+orgAuthName
+                               +"\" "+ OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when creating enumeration: \""
+                               +orgAuthName +"\", Status:"+ statusCode);
+       }
+
+       // Store the ID returned from this create operation
+       // for additional tests below.
+       String newOrgAuthId = OrgAuthorityClientUtils.extractId(res);
+        logger.info("Import: Created orgAuthority: \"" + orgAuthName +"\" ID:"
+                               +newOrgAuthId );
+        
+        // Add items to the orgAuthority
+               for(Map<String,String> orgInfo : orgInfos){
+               createItemInOrgAuth(newOrgAuthId, baseOrgAuthRefName, orgInfo);
+       }
+        
+    }
+    
+    private String createItemInOrgAuth(String vcsid, 
+               String orgAuthorityRefName, Map<String,String> orgInfo) {
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+       String shortName = orgInfo.get(OrganizationJAXBSchema.SHORT_NAME);
+       String refName = createOrganizationRefName(
+                                               orgAuthorityRefName, shortName)+"'"+shortName+"'";
+
+
+       logger.info("Import: Create Item: \""+shortName+
+                       "\" in orgAuthority: \"" + orgAuthorityRefName +"\"");
+        PoxPayloadOut multipart = 
+               OrgAuthorityClientUtils.createOrganizationInstance(refName, orgInfo, client.getItemCommonPartName() );
+
+       ClientResponse<Response> res = client.createItem(vcsid, multipart);
+
+       int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not create Item: \""+shortName
+                               +"\" in orgAuthority: \"" + orgAuthorityRefName
+                               +"\" "+ OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when creating Item: \""+shortName
+                               +"\" in orgAuthority: \"" + orgAuthorityRefName +
+                               "\", Status:"+ statusCode);
+       }
+
+       return OrgAuthorityClientUtils.extractId(res);
+    }
+
+
+   // ---------------------------------------------------------------
+   // Read
+   // ---------------------------------------------------------------
+
+   private OrgauthoritiesCommonList readOrgAuthorities() {
+
+        // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;
+
+        // Submit the request to the service and store the response.
+        ClientResponse<OrgauthoritiesCommonList> res = client.readList();
+        OrgauthoritiesCommonList list = res.getEntity();
+
+        int statusCode = res.getStatus();
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not read list of orgAuthorities: "
+                + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when reading " +
+                "list of orgAuthorities, Status:"+ statusCode);
+       }
+
+        return list;
+   }
+
+    private List<String> readOrgAuthorityIds(OrgauthoritiesCommonList list) {
+
+        List<String> ids = new ArrayList<String>();
+        List<OrgauthoritiesCommonList.OrgauthorityListItem> orgAuthorities =
+            list.getOrgauthorityListItem();
+        for (OrgauthoritiesCommonList.OrgauthorityListItem orgAuthority : orgAuthorities) {
+            ids.add(orgAuthority.getCsid());
+        }
+        return ids;
+   }
+    
+   private OrgauthoritiesCommon readOrgAuthority(String orgAuthId) {
+
+        // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;
+
+        // Submit the request to the service and store the response.
+        OrgauthoritiesCommon orgAuthority = null;
+        try {
+            ClientResponse<String> res = client.read(orgAuthId);
+            int statusCode = res.getStatus();
+            if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                throw new RuntimeException("Could not read orgAuthority"
+                    + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+            }
+            if(statusCode != EXPECTED_STATUS_CODE) {
+                throw new RuntimeException("Unexpected Status when reading " +
+                    "orgAuthority, Status:"+ statusCode);
+            }
+            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+            PayloadInputPart orgAuthorityPart = input.getPart(client.getCommonPartName());
+            orgAuthority = (OrgauthoritiesCommon) orgAuthorityPart.getBody();
+        } catch (Exception e) {
+            throw new RuntimeException("Could not read orgAuthority: ", e);
+        }
+
+        return orgAuthority;
+    }
+
+    private OrganizationsCommonList readItemsInOrgAuth(String orgAuthId) {
+
+        // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;
+
+        // Submit the request to the service and store the response.
+
+        //was: ClientResponse<OrganizationsCommonList> res = client.readItemList(orgAuthId);
+        //new API: readItemList(String inAuthority, String partialTerm, String keywords)
+        ClientResponse<OrganizationsCommonList> res = client.readItemList(orgAuthId, "", "");//TODO:   .New call, most certainly wrong.  Just trying to get this to compile. Laramie20100728
+
+        OrganizationsCommonList list = res.getEntity();
+
+        int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not read items in orgAuthority: "
+                + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when reading " +
+                "items in orgAuthority, Status:"+ statusCode);
+       }
+
+        return list;
+    }
+
+    private List<String> readOrganizationIds(OrganizationsCommonList list) {
+
+        List<String> ids = new ArrayList<String>();
+        List<OrganizationsCommonList.OrganizationListItem> items =
+            list.getOrganizationListItem();
+        for (OrganizationsCommonList.OrganizationListItem item : items) {
+            ids.add(item.getCsid());
+        }
+        return ids;
+   }
+
+    // ---------------------------------------------------------------
+    // Delete
+    // ---------------------------------------------------------------
+
+    private void deleteOrgAuthority(String vcsid) {
+         // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;
+
+        ClientResponse<Response> res = client.delete(vcsid);
+        int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not delete orgAuthority: "
+                + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when deleting " +
+                "orgAuthority, Status:"+ statusCode);
+       }
+    }
+
+    private void deleteAllOrgAuthorities() {
+        List<String> ids = readOrgAuthorityIds(readOrgAuthorities());
+        for (String id : ids) {
+            deleteOrgAuthority(id);
+        }
+    }
+
+        private void deleteOrganization(String vcsid, String itemcsid) {
+         // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;
+
+        ClientResponse<Response> res = client.deleteItem(vcsid, itemcsid);
+        int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not delete orgAuthority item: "
+                + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when deleting " +
+                "orgAuthority item, Status:"+ statusCode);
+       }
+    }
+
+    private void deleteAllItemsForOrgAuth(String orgAuthId) {
+        List<String> itemIds = readOrganizationIds(readItemsInOrgAuth(orgAuthId));
+        for (String itemId : itemIds) {
+            deleteOrganization(orgAuthId, itemId);
+        }
+    }
+
+    // ---------------------------------------------------------------
+    // Utility methods used by tests above
+    // ---------------------------------------------------------------
+
+
+    // Retrieve individual fields of orgAuthority records.
+
+    private String displayAllOrgAuthorities(OrgauthoritiesCommonList list) {
+        StringBuffer sb = new StringBuffer();
+            List<OrgauthoritiesCommonList.OrgauthorityListItem> orgAuthorities =
+                    list.getOrgauthorityListItem();
+            int i = 0;
+        for (OrgauthoritiesCommonList.OrgauthorityListItem orgAuthority : orgAuthorities) {
+            sb.append("orgAuthority [" + i + "]" + "\n");
+            sb.append(displayOrgAuthorityDetails(orgAuthority));
+            i++;
+        }
+        return sb.toString();
+    }
+
+    private String displayOrgAuthorityDetails(
+        OrgauthoritiesCommonList.OrgauthorityListItem orgAuthority) {
+            StringBuffer sb = new StringBuffer();
+            sb.append("displayName=" + orgAuthority.getDisplayName() + "\n");
+            sb.append("vocabType=" + orgAuthority.getVocabType() + "\n");
+            // sb.append("csid=" + orgAuthority.getCsid() + "\n");
+            sb.append("URI=" + orgAuthority.getUri() + "\n");
+        return sb.toString();
+    }
+
+    // Retrieve individual fields of organization records.
+
+    private String displayAllOrganizations(OrganizationsCommonList list) {
+        StringBuffer sb = new StringBuffer();
+        List<OrganizationsCommonList.OrganizationListItem> items =
+                list.getOrganizationListItem();
+        int i = 0;
+        for (OrganizationsCommonList.OrganizationListItem item : items) {
+            sb.append("organization [" + i + "]" + "\n");
+            sb.append(displayOrganizationDetails(item));
+            i++;
+        }
+        return sb.toString();
+    }
+
+    private String displayOrganizationDetails(
+        OrganizationsCommonList.OrganizationListItem item) {
+            StringBuffer sb = new StringBuffer();
+            sb.append("csid=" + item.getCsid() + "\n");
+            sb.append("displayName=" + item.getDisplayName() + "\n");
+            // sb.append("URI=" + item.getUri() + "\n");
+        return sb.toString();
+    }
+
+//    private Object extractPart(PoxPayloadIn input, String label,
+//        Class clazz) throws Exception {
+//        Object obj = null;
+//        for(PayloadInputPart part : input.getParts()){
+//            String partLabel = part.getHeaders().getFirst("label");
+//            if(label.equalsIgnoreCase(partLabel)){
+//                String partStr = part.getBodyAsString();
+//                if(logger.isDebugEnabled()){
+//                    logger.debug("extracted part str=\n" + partStr);
+//                }
+//                obj = part.getBody(clazz, null);
+//                if(logger.isDebugEnabled()){
+//                    logger.debug("extracted part obj=\n", obj, clazz);
+//                }
+//                break;
+//            }
+//        }
+//        return obj;
+//    }
+
+       public static void main(String[] args) {
+
+        // Configure logging.
+               BasicConfigurator.configure();
+
+        logger.info("OrgAuthority Sample starting...");
+
+               Sample sample = new Sample();
+        OrgauthoritiesCommonList orgAuthorities;
+        List<String> orgAuthIds;
+        String details = "";
+
+        // Optionally delete all orgAuthorities and organizations.
+
+        boolean ENABLE_DELETE_ALL = false;
+        if (ENABLE_DELETE_ALL) {
+
+            logger.info("Deleting all organizations and orgAuthorities ...");
+
+            // For each orgAuthority ...
+            orgAuthorities = sample.readOrgAuthorities();
+            orgAuthIds = sample.readOrgAuthorityIds(orgAuthorities);
+            for (String orgAuthId : orgAuthIds) {
+                logger.info("Deleting all organizations for orgAuthority ...");
+                sample.deleteAllItemsForOrgAuth(orgAuthId);
+                logger.info("Deleting orgAuthority ...");
+                sample.deleteOrgAuthority(orgAuthId);
+            }
+
+            logger.info("Reading orgAuthorities after deletion ...");
+            orgAuthorities = sample.readOrgAuthorities();
+            details = sample.displayAllOrgAuthorities(orgAuthorities);
+            logger.info(details);
+
+            logger.info("Reading items in each orgAuthority after deletion ...");
+            orgAuthIds = sample.readOrgAuthorityIds(orgAuthorities);
+            for (String orgAuthId : orgAuthIds) {
+                OrganizationsCommonList items = sample.readItemsInOrgAuth(orgAuthId);
+                details = sample.displayAllOrganizations(items);
+                logger.info(details);
+            }
+
+        }
+
+        // Create new authorities, each populated with organizations.
+        Map<String, String> mmiOrgMap = new HashMap<String,String>();
+        mmiOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "MMI");
+        mmiOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Museum of the Moving Image");
+        //mmiOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Megan Forbes");
+        mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1984");
+        mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Astoria, NY");
+        Map<String, String> pahmaOrgMap = new HashMap<String,String>();
+        pahmaOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "PAHMA");
+        pahmaOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Phoebe A. Hearst Museum of Anthropology");
+        pahmaOrgMap.put(OrganizationJAXBSchema.NAME_ADDITIONS, "University of California, Berkeley");
+        //pahmaOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Michael Black");
+        pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1901");
+        pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Berkeley, CA");
+        Map<String, String> savoyOrgMap = new HashMap<String,String>();
+        savoyOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "Savoy Theatre");
+        savoyOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1900");
+        savoyOrgMap.put(OrganizationJAXBSchema.DISSOLUTION_DATE, "1952");
+        savoyOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "New York, NY");
+        List<Map<String, String>> orgMaps = 
+               Arrays.asList(mmiOrgMap, pahmaOrgMap, savoyOrgMap );
+        
+               sample.createOrgAuthority("Sample Org Authority", orgMaps);
+
+               logger.info("OrgAuthority Sample complete.");
+
+        logger.info("Reading orgAuthorities and items ...");
+        // Get a list of orgAuthorities.
+        orgAuthorities = sample.readOrgAuthorities();
+        // For each orgAuthority ...
+        for (OrgauthoritiesCommonList.OrgauthorityListItem
+            orgAuthority : orgAuthorities.getOrgauthorityListItem()) {
+            // Get its display name.
+            logger.info(orgAuthority.getDisplayName());
+            // Get a list of the organizations in this orgAuthority.
+            OrganizationsCommonList items =
+                sample.readItemsInOrgAuth(orgAuthority.getCsid());
+            // For each organization ...
+            for (OrganizationsCommonList.OrganizationListItem
+                item : items.getOrganizationListItem()) {
+                // Get its display name.
+                logger.info(" " + item.getDisplayName());
+            }
+        }
+
+        // Sample alternate methods of reading all orgAuthorities and
+        // organizations separately.
+        boolean RUN_ADDITIONAL_SAMPLES = false;
+        if (RUN_ADDITIONAL_SAMPLES) {
+
+            logger.info("Reading all orgAuthorities ...");
+            details = sample.displayAllOrgAuthorities(orgAuthorities);
+            logger.info(details);
+
+            logger.info("Reading all organizations ...");
+            orgAuthIds = sample.readOrgAuthorityIds(orgAuthorities);
+            for (String orgAuthId : orgAuthIds) {
+                OrganizationsCommonList items = sample.readItemsInOrgAuth(orgAuthId);
+                details = sample.displayAllOrganizations(items);
+                logger.info(details);
+            }
+
+        }
+
+       }
+
+}
index 429b9f6fe2fb8a87a0dab86aabfdc482b881a740..9270810347f6e81eea603c15eb9699e1cffd2881 100644 (file)
@@ -1,6 +1,6 @@
-#url of the collectionspace server\r
-cspace.url=http://localhost:8180/cspace-services/\r
-cspace.ssl=false\r
-cspace.auth=false\r
-cspace.user=test\r
+#url of the collectionspace server
+cspace.url=http://localhost:8180/cspace-services/
+cspace.ssl=false
+cspace.auth=false
+cspace.user=test
 cspace.password=test
\ No newline at end of file
index 2e9dd00c1303151173e913666530bb154f91309b..af20cb489d2616fb41e80db8e997b700f8b1bb40 100644 (file)
@@ -1,38 +1,38 @@
-<?xml version="1.0" encoding="UTF-8" ?>\r
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">\r
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">\r
-\r
-       <appender name="console" class="org.apache.log4j.ConsoleAppender">\r
-               <param name="Target" value="System.out" />\r
-               <layout class="org.apache.log4j.TTCCLayout">\r
-                       <param name="DateFormat" value="ISO8601" />\r
-               </layout>\r
-       </appender>\r
-\r
-       <logger name="org.apache.commons.httpclient" additivity="false">\r
-               <level value="warn" />\r
-               <appender-ref ref="console" />\r
-       </logger>\r
-\r
-       <logger name="httpclient.wire" additivity="false">\r
-               <level value="info" />\r
-               <appender-ref ref="console" />\r
-       </logger>\r
-\r
-<!--\r
-       <logger name="org.collectionspace.services.organization.client.sample.Sample" additivity="false">\r
-               <level value="debug" />\r
-               <appender-ref ref="console" />\r
-       </logger>\r
--->\r
-\r
-       <root>\r
-               <priority value="debug" />\r
-               <appender-ref ref="console" />\r
-       </root>\r
-\r
-</log4j:configuration>\r
-\r
-\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+       <appender name="console" class="org.apache.log4j.ConsoleAppender">
+               <param name="Target" value="System.out" />
+               <layout class="org.apache.log4j.TTCCLayout">
+                       <param name="DateFormat" value="ISO8601" />
+               </layout>
+       </appender>
+
+       <logger name="org.apache.commons.httpclient" additivity="false">
+               <level value="warn" />
+               <appender-ref ref="console" />
+       </logger>
+
+       <logger name="httpclient.wire" additivity="false">
+               <level value="info" />
+               <appender-ref ref="console" />
+       </logger>
+
+<!--
+       <logger name="org.collectionspace.services.organization.client.sample.Sample" additivity="false">
+               <level value="debug" />
+               <appender-ref ref="console" />
+       </logger>
+-->
+
+       <root>
+               <priority value="debug" />
+               <appender-ref ref="console" />
+       </root>
+
+</log4j:configuration>
+
+
+
+
index 98f05533e2881edb93d603793563bc9aca6a166b..6594fdfcadd07eb15af3e6af01e894c42056f447 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.organization</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.organization.service</artifactId>\r
-    <name>services.organization.service</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.contact.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->        \r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- apache -->\r
-        <dependency>\r
-            <groupId>commons-beanutils</groupId>\r
-            <artifactId>commons-beanutils</artifactId>\r
-            <version>1.6.1</version>\r
-        </dependency>\r
-        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->\r
-        <dependency>\r
-            <groupId>commons-logging</groupId>\r
-            <artifactId>commons-logging</artifactId>\r
-            <version>1.1</version>\r
-        </dependency>\r
-      <!-- javax -->\r
-\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-organization</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.organization</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.organization.service</artifactId>
+    <name>services.organization.service</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+        <!-- apache -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+        </dependency>
+      <!-- javax -->
+
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-organization</finalName>
+    </build>
+</project>
+
index d18316afc439864cbba0150febce32e2e724ffba..2068e34f3ee13d634f8514b5c61eb9ef3f88dd6b 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index bcf39ab3425485c4686740cab247753ceb217bb6..5ab91c75d315d2228cd1e243c5de7a28d6e2c5bd 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.person</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.person</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d18316afc439864cbba0150febce32e2e724ffba..2068e34f3ee13d634f8514b5c61eb9ef3f88dd6b 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index 6eca3a3f9b411185243716736602f957385bc486..9be7359864bfa31597799a2d78d4a345ac8ac91e 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.person.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.person.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 0affac9d8f56edbf9f9ae6856c0dc20e19f49b76..f54ea8aabc650add6555cbb3fe662f6d55401b92 100644 (file)
-\r
-<project name="person.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        person service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy person in ${jee.server.nuxeo}">\r
-       <!-- These targets are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\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
-        -->\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy person from ${jee.server.nuxeo}">\r
-       <!-- These targets are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-       leaving this only for backwards compatibility reasons. -->\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
+
+<project name="person.3rdparty" default="package" basedir=".">
+    <description>
+        person service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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 in ${jee.server.nuxeo}">
+       <!-- These targets are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <ant antfile="nuxeo-platform-cs-person/build.xml" target="deploy" inheritall="false"/>
+        <ant antfile="nuxeo-platform-person-lifesci/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+    description="undeploy person from ${jee.server.nuxeo}">
+       <!-- These targets are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       leaving this only for backwards compatibility reasons. -->
+        <ant antfile="nuxeo-platform-cs-person/build.xml" target="undeploy" inheritall="false"/>
+        <ant antfile="nuxeo-platform-person-lifesci/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for person" depends="package">
+        <ant antfile="nuxeo-platform-cs-person/build.xml" target="dist" inheritall="false"/>
+        <ant antfile="nuxeo-platform-person-lifesci/build.xml" target="dist" inheritall="false"/>
+    </target>
+    
+    <target name="dist_installer"
+    description="generate distribution for collectionobject" depends="package">
+        <ant antfile="nuxeo-platform-cs-person/build.xml" target="dist_installer" inheritall="false"/>
+        <ant antfile="nuxeo-platform-person-lifesci/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index b0efcd3e03dc6e68664dfe7ae06b39dd4c9ab7b3..3c052ad17ef169cad37f8e23bdbe5ebd58e9ce16 100644 (file)
@@ -1,25 +1,25 @@
-\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.person</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.person.3rdparty</artifactId>\r
-    <name>services.person.3rdparty</name>\r
-    <packaging>pom</packaging>\r
-    <description>\r
-        3rd party build for person service\r
-    </description>\r
-\r
-    <modules>\r
-    <!-- These modules are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <module>nuxeo-platform-cs-person</module>\r
-        <module>nuxeo-platform-person-lifesci</module>\r
-        -->\r
-    </modules>\r
-</project>\r
+
+<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</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.person.3rdparty</artifactId>
+    <name>services.person.3rdparty</name>
+    <packaging>pom</packaging>
+    <description>
+        3rd party build for person service
+    </description>
+
+    <modules>
+    <!-- These modules are obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <module>nuxeo-platform-cs-person</module>
+        <module>nuxeo-platform-person-lifesci</module>
+        -->
+    </modules>
+</project>
index 7d14120f27367b4159205015fdbe810a2d13c7f1..2efc3528206597f2edfc2d7466b5416032d363c3 100644 (file)
-\r
-<project name="person" default="package" basedir=".">\r
-    <description>\r
-        person service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-        <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy person service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="undeploy person service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-        description="distribute person service">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist_installer" depends="package"\r
-        description="distribute person service">        \r
-        <!-- copy install scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.installer.services}/person">\r
-            <fileset dir="${basedir}/installer/"/>\r
-        </copy>\r
-        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="person" default="package" basedir=".">
+    <description>
+        person service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+        <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy person service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+        description="distribute person service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+    <target name="dist_installer" depends="package"
+        description="distribute person service">        
+        <!-- copy install scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.installer.services}/person">
+            <fileset dir="${basedir}/installer/"/>
+        </copy>
+        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index d4b5765d1290f01f908f612867a4ba0e7406108d..1a5fabb87b7b4c260f1ed81bfd878a4e713fd5ec 100644 (file)
@@ -1,91 +1,91 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.person</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.person.client</artifactId>\r
-    <name>services.person.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>                \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.contact.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <!-- RESTEasy -->\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-person-client</finalName>\r
-        <plugins>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.person.client</artifactId>
+    <name>services.person.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>                
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <!-- RESTEasy -->
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-person-client</finalName>
+        <plugins>
+        </plugins>
+    </build>
+</project>
+
index 7e15847660da41f84cb6cd25de5590fb3cd56321..bfe8ff3bfd566daa4dc933828ad8f05067b88048 100644 (file)
-/**    \r
- * PersonAuthorityClientUtils.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.client;\r
-\r
-import java.util.*;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.PersonJAXBSchema;\r
-import org.collectionspace.services.client.test.ServiceRequestType;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.person.GroupList;\r
-import org.collectionspace.services.person.NationalityList;\r
-import org.collectionspace.services.person.OccupationList;\r
-import org.collectionspace.services.person.PersonTermGroup;\r
-import org.collectionspace.services.person.PersonTermGroupList;\r
-import org.collectionspace.services.person.PersonsCommon;\r
-import org.collectionspace.services.person.PersonauthoritiesCommon;\r
-import org.collectionspace.services.person.SchoolOrStyleList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-//import org.jboss.resteasy.plugins.providers.multipart.OutputPart;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-import org.collectionspace.services.person.StructuredDateGroup;\r
-\r
-/**\r
- * The Class PersonAuthorityClientUtils.\r
- */\r
-public class PersonAuthorityClientUtils {\r
-    \r
-    /** The Constant logger. */\r
-    private static final Logger logger =\r
-        LoggerFactory.getLogger(PersonAuthorityClientUtils.class);\r
-       private static final ServiceRequestType READ_REQ = ServiceRequestType.READ;\r
-\r
-    /**\r
-     * @param csid the id of the PersonAuthority\r
-     * @param client if null, creates a new client\r
-     * @return\r
-     */\r
-    public static String getAuthorityRefName(String csid, PersonAuthorityClient client){\r
-       if (client == null) {\r
-               client = new PersonAuthorityClient();\r
-       }\r
-        ClientResponse<String> res = client.read(csid);\r
-        try {\r
-               int statusCode = res.getStatus();\r
-               if(!READ_REQ.isValidStatusCode(statusCode)\r
-                       ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {\r
-                       throw new RuntimeException("Invalid status code returned: "+statusCode);\r
-               }\r
-               //FIXME: remove the following try catch once Aron fixes signatures\r
-               try {\r
-                   PoxPayloadIn input = new PoxPayloadIn(res.getEntity());\r
-                   PersonauthoritiesCommon personAuthority = \r
-                       (PersonauthoritiesCommon) CollectionSpaceClientUtils.extractPart(input,\r
-                           client.getCommonPartName(), PersonauthoritiesCommon.class);\r
-                       if(personAuthority == null) {\r
-                               throw new RuntimeException("Null personAuthority returned from service.");\r
-                       }\r
-                   return personAuthority.getRefName();\r
-               } catch (Exception e) {\r
-                   throw new RuntimeException(e);\r
-               }\r
-        } finally {\r
-               res.releaseConnection();\r
-        }\r
-    }\r
-\r
-    /**\r
-     * @param csid the id of the PersonAuthority\r
-     * @param client if null, creates a new client\r
-     * @return\r
-     */\r
-    public static String getPersonRefName(String inAuthority, String csid, PersonAuthorityClient client){\r
-       if ( client == null) {\r
-               client = new PersonAuthorityClient();\r
-       }\r
-        ClientResponse<String> res = client.readItem(inAuthority, csid);\r
-        try {\r
-               int statusCode = res.getStatus();\r
-               if(!READ_REQ.isValidStatusCode(statusCode)\r
-                               ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {\r
-                       throw new RuntimeException("Invalid status code returned: "+statusCode);\r
-               }\r
-               //FIXME: remove the following try catch once Aron fixes signatures\r
-               try {\r
-                   PoxPayloadIn input = new PoxPayloadIn(res.getEntity());\r
-                   PersonsCommon person = \r
-                       (PersonsCommon) CollectionSpaceClientUtils.extractPart(input,\r
-                           client.getItemCommonPartName(), PersonsCommon.class);\r
-                       if (person == null) {\r
-                               throw new RuntimeException("Null person returned from service.");\r
-                       }\r
-                   return person.getRefName();\r
-               } catch (Exception e) {\r
-                   throw new RuntimeException(e);\r
-               }\r
-        } finally {\r
-               res.releaseConnection();\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Creates the person authority instance.\r
-     *\r
-     * @param displayName the display name\r
-     * @param shortIdentifier the short Id \r
-     * @param headerLabel the header label\r
-     * @return the multipart output\r
-     */\r
-    public static PoxPayloadOut createPersonAuthorityInstance(\r
-               String displayName, String shortIdentifier, String headerLabel ) {\r
-        PersonauthoritiesCommon personAuthority = new PersonauthoritiesCommon();\r
-        personAuthority.setDisplayName(displayName);\r
-        personAuthority.setShortIdentifier(shortIdentifier);\r
-        //String refName = createPersonAuthRefName(shortIdentifier, displayName);\r
-        //personAuthority.setRefName(refName);\r
-        personAuthority.setVocabType("PersonAuthority");\r
-        PoxPayloadOut multipart = new PoxPayloadOut(PersonAuthorityClient.SERVICE_PAYLOAD_NAME);\r
-        PayloadOutputPart commonPart = multipart.addPart(personAuthority, MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.setLabel(headerLabel);\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, personAuthority common ", \r
-                                       personAuthority, PersonauthoritiesCommon.class);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-\r
-    /**\r
-     * Creates a person instance.\r
-     *\r
-     * @param inAuthority the owning authority\r
-     * @param personAuthRefName the owning Authority ref name\r
-     * @param personInfo the person info\r
-     * @param headerLabel the header label\r
-     * @return the multipart output\r
-     */\r
-    public static PoxPayloadOut createPersonInstance(String inAuthority,\r
-               String personAuthRefName,\r
-               Map<String, String> personInfo,\r
-                List<PersonTermGroup> terms,\r
-               String headerLabel){\r
-        if (terms == null || terms.isEmpty()) {\r
-            terms = getTermGroupInstance(getGeneratedIdentifier());\r
-        }\r
-        final Map<String, List<String>> EMPTY_PERSON_REPEATABLES_INFO =\r
-                new HashMap<String, List<String>>();\r
-        return createPersonInstance(inAuthority, null /*personAuthRefName*/,\r
-                personInfo, terms, EMPTY_PERSON_REPEATABLES_INFO, headerLabel);\r
-    }\r
-\r
-    /**\r
-     * Creates a person instance.\r
-     *\r
-     * @param inAuthority the owning authority\r
-     * @param personAuthRefName the owning Authority ref name\r
-     * @param personInfo the person info\r
-     * @param terms a list of Person terms\r
-     * @param personRepeatablesInfo names and values of repeatable scalar fields in the Person record\r
-     * @param headerLabel the header label\r
-     * @return the multipart output\r
-     */\r
-    public static PoxPayloadOut createPersonInstance(String inAuthority, \r
-               String personAuthRefName, Map<String, String> personInfo,\r
-                List<PersonTermGroup> terms,\r
-                Map<String, List<String>> personRepeatablesInfo, String headerLabel){\r
-        PersonsCommon person = new PersonsCommon();\r
-        person.setInAuthority(inAuthority);\r
-       String shortId = personInfo.get(PersonJAXBSchema.SHORT_IDENTIFIER);\r
-       if (shortId == null || shortId.isEmpty()) {\r
-               throw new IllegalArgumentException("shortIdentifier cannot be null or empty");\r
-       }       \r
-       person.setShortIdentifier(shortId);\r
-       \r
-       String value;\r
-        List<String> values = null;\r
-\r
-        if((value = (String)personInfo.get(PersonJAXBSchema.BIRTH_DATE))!=null) {\r
-            StructuredDateGroup birthDate = new StructuredDateGroup();\r
-            birthDate.setDateDisplayDate(value);\r
-            person.setBirthDateGroup(birthDate);\r
-        }\r
-        if((value = (String)personInfo.get(PersonJAXBSchema.DEATH_DATE))!=null) {\r
-            StructuredDateGroup deathDate = new StructuredDateGroup();\r
-            deathDate.setDateDisplayDate(value);\r
-            person.setDeathDateGroup(deathDate);\r
-        }\r
-        if((value = (String)personInfo.get(PersonJAXBSchema.BIRTH_PLACE))!=null)\r
-               person.setBirthPlace(value);\r
-        if((value = (String)personInfo.get(PersonJAXBSchema.DEATH_PLACE))!=null)\r
-               person.setDeathPlace(value);\r
-        if((value = (String)personInfo.get(PersonJAXBSchema.GENDER))!=null)\r
-               person.setGender(value);\r
-         if((value = (String)personInfo.get(PersonJAXBSchema.BIO_NOTE))!=null)\r
-               person.setBioNote(value);\r
-        if((value = (String)personInfo.get(PersonJAXBSchema.NAME_NOTE))!=null)\r
-               person.setNameNote(value);\r
-        \r
-        // Set values in the Term Information Group\r
-        PersonTermGroupList termList = new PersonTermGroupList();\r
-        if (terms == null || terms.isEmpty()) {\r
-            terms = getTermGroupInstance(getGeneratedIdentifier());\r
-        }\r
-        termList.getPersonTermGroup().addAll(terms); \r
-        person.setPersonTermGroupList(termList);\r
-        \r
-        if (personRepeatablesInfo != null) {\r
-            if((values = (List<String>)personRepeatablesInfo.get(PersonJAXBSchema.GROUPS))!=null) {\r
-                    GroupList groupsList = new GroupList();\r
-                    List<String> groups = groupsList.getGroup();\r
-                    groups.addAll(values);\r
-                    person.setGroups(groupsList);\r
-            }\r
-            if((values = (List<String>)personRepeatablesInfo.get(PersonJAXBSchema.NATIONALITIES))!=null) {\r
-                    NationalityList nationalitiesList = new NationalityList();\r
-                    List<String> nationalities = nationalitiesList.getNationality();\r
-                    nationalities.addAll(values);\r
-                    person.setNationalities(nationalitiesList);\r
-            }\r
-\r
-            if((values = (List<String>)personRepeatablesInfo.get(PersonJAXBSchema.OCCUPATIONS))!=null) {\r
-                    OccupationList occupationsList = new OccupationList();\r
-                    List<String> occupations = occupationsList.getOccupation();\r
-                    occupations.addAll(values);\r
-                    person.setOccupations(occupationsList);\r
-            }\r
-            if((values = (List<String>)personRepeatablesInfo.get(PersonJAXBSchema.SCHOOLS_OR_STYLES))!=null) {\r
-                    SchoolOrStyleList schoolOrStyleList = new SchoolOrStyleList();\r
-                    List<String> schoolsOrStyles = schoolOrStyleList.getSchoolOrStyle();\r
-                    schoolsOrStyles.addAll(values);\r
-                    person.setSchoolsOrStyles(schoolOrStyleList);\r
-            }        \r
-        }\r
-\r
-        \r
-        PoxPayloadOut multipart = new PoxPayloadOut(PersonAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);\r
-        PayloadOutputPart commonPart = multipart.addPart(person,\r
-            MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.setLabel(headerLabel);\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, person common ", person, PersonsCommon.class);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-    \r
-    /**\r
-     * Creates the item in authority.\r
-     *\r
-     * @param vcsid the vcsid\r
-     * @param personAuthorityRefName the person authority ref name\r
-     * @param personMap the person map. PersonJAXBSchema.SHORT_IDENTIFIER is REQUIRED.\r
-     * @param client the client\r
-     * @return the string\r
-     */\r
-    public static String createItemInAuthority(String vcsid, \r
-               String personAuthorityRefName, Map<String,String> personMap,\r
-                List<PersonTermGroup> terms, Map<String, List<String>> personRepeatablesMap,\r
-                PersonAuthorityClient client ) {\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-        \r
-        String displayName = "";\r
-        if (terms !=null && terms.size() > 0) {\r
-            displayName = terms.get(0).getTermDisplayName();\r
-        }\r
-       \r
-       if(logger.isDebugEnabled()){\r
-               logger.debug("Creating item with display name: \"" + displayName\r
-                               +"\" in personAuthority: \"" + vcsid +"\"");\r
-       }\r
-       PoxPayloadOut multipart = \r
-               createPersonInstance(vcsid, null /*personAuthorityRefName*/,\r
-                       personMap, terms, personRepeatablesMap, client.getItemCommonPartName());\r
-       \r
-       String result = null;\r
-       ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
-       try {\r
-               int statusCode = res.getStatus();\r
-       \r
-               if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-                       throw new RuntimeException("Could not create Item: \""+personMap.get(PersonJAXBSchema.SHORT_IDENTIFIER)\r
-                                       +"\" in personAuthority: \"" + vcsid //personAuthorityRefName\r
-                                       +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-               }\r
-               if(statusCode != EXPECTED_STATUS_CODE) {\r
-                       throw new RuntimeException("Unexpected Status when creating Item: \""+personMap.get(PersonJAXBSchema.SHORT_IDENTIFIER)\r
-                                       +"\" in personAuthority: \"" + vcsid /*personAuthorityRefName*/ +"\", Status:"+ statusCode);\r
-               }\r
-       \r
-               result = extractId(res);\r
-       } finally {\r
-               res.releaseConnection();\r
-       }\r
-       \r
-       return result;\r
-    }\r
-\r
-    /**\r
-     * Creates the personAuthority ref name.\r
-     *\r
-     * @param shortId the personAuthority shortIdentifier\r
-     * @param displaySuffix displayName to be appended, if non-null\r
-     * @return the string\r
-     */\r
-    /*\r
-    public static String createPersonAuthRefName(String shortId, String displaySuffix) {\r
-       String refName = "urn:cspace:org.collectionspace.demo:personauthority:name("\r
-                       +shortId+")";\r
-       if(displaySuffix!=null&&!displaySuffix.isEmpty())\r
-               refName += "'"+displaySuffix+"'";\r
-       return refName;\r
-    }\r
-    */\r
-\r
-    /**\r
-     * Creates the person ref name.\r
-     *\r
-     * @param personAuthRefName the person auth ref name\r
-     * @param shortId the person shortIdentifier\r
-     * @param displaySuffix displayName to be appended, if non-null\r
-     * @return the string\r
-     */\r
-    /*\r
-    public static String createPersonRefName(\r
-                                               String personAuthRefName, String shortId, String displaySuffix) {\r
-       String refName = personAuthRefName+":person:name("+shortId+")";\r
-       if(displaySuffix!=null&&!displaySuffix.isEmpty())\r
-               refName += "'"+displaySuffix+"'";\r
-       return refName;\r
-    }\r
-    */\r
-\r
-    /**\r
-     * Extract id.\r
-     *\r
-     * @param res the res\r
-     * @return the string\r
-     */\r
-    public static String extractId(ClientResponse<Response> res) {\r
-        MultivaluedMap<String, Object> mvm = res.getMetadata();\r
-        // FIXME: This may throw an NPE if the Location: header isn't present\r
-        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("extractId:uri=" + uri);\r
-        }\r
-        String[] segments = uri.split("/");\r
-        String id = segments[segments.length - 1];\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("id=" + id);\r
-        }\r
-        return id;\r
-    }\r
-    \r
-    /**\r
-     * Returns an error message indicating that the status code returned by a\r
-     * specific call to a service does not fall within a set of valid status\r
-     * codes for that service.\r
-     *\r
-     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).\r
-     *\r
-     * @param statusCode  The invalid status code that was returned in the response,\r
-     *                    from submitting that type of request to the service.\r
-     *\r
-     * @return An error message.\r
-     */\r
-    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {\r
-        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +\r
-                requestType.validStatusCodesAsString();\r
-    }\r
-\r
-\r
-    \r
-    /**\r
-     * Produces a default displayName from the basic name and dates fields.\r
-     * @see PersonDocumentModelHandler.prepareDefaultDisplayName() which\r
-     * duplicates this logic, until we define a service-general utils package\r
-     * that is neither client nor service specific.\r
-     * @param foreName \r
-     * @param middleName\r
-     * @param surName\r
-     * @param birthDate\r
-     * @param deathDate\r
-     * @return display name\r
-     */\r
-    public static String prepareDefaultDisplayName(\r
-               String foreName, String middleName, String surName, \r
-            String birthDate, String deathDate) {\r
-       StringBuilder newStr = new StringBuilder();\r
-               final String sep = " ";\r
-               final String dateSep = "-";\r
-               List<String> nameStrings = \r
-                       Arrays.asList(foreName, middleName, surName);\r
-               boolean firstAdded = false;\r
-       for(String partStr : nameStrings ){\r
-                       if(null != partStr ) {\r
-                               if(firstAdded) {\r
-                                       newStr.append(sep);\r
-                               }\r
-                               newStr.append(partStr);\r
-                               firstAdded = true;\r
-                       }\r
-       }\r
-       // Now we add the dates. In theory could have dates with no name, but that is their problem.\r
-       boolean foundBirth = false;\r
-        if(null != birthDate) {\r
-         if(firstAdded) {\r
-             newStr.append(sep);\r
-         }\r
-         newStr.append(birthDate);\r
-                 newStr.append(dateSep);     // Put this in whether there is a death date or not\r
-         foundBirth = true;\r
-        }\r
-        if(null != deathDate) {\r
-         if(!foundBirth) {\r
-             if(firstAdded) {\r
-                 newStr.append(sep);\r
-             }\r
-             newStr.append(dateSep);\r
-         }\r
-         newStr.append(deathDate);\r
-        }\r
-               return newStr.toString();\r
-    }\r
-    \r
-    public static List<PersonTermGroup> getTermGroupInstance(String identifier) {\r
-        if (Tools.isBlank(identifier)) {\r
-            identifier = getGeneratedIdentifier();\r
-        }\r
-        List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();\r
-        PersonTermGroup term = new PersonTermGroup();\r
-        term.setTermDisplayName(identifier);\r
-        term.setTermName(identifier);\r
-        terms.add(term);\r
-        return terms;\r
-    }\r
-    \r
-    private static String getGeneratedIdentifier() {\r
-        return "id" + new Date().getTime(); \r
-   }\r
-\r
-}\r
+/**    
+ * PersonAuthorityClientUtils.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.client;
+
+import java.util.*;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.person.GroupList;
+import org.collectionspace.services.person.NationalityList;
+import org.collectionspace.services.person.OccupationList;
+import org.collectionspace.services.person.PersonTermGroup;
+import org.collectionspace.services.person.PersonTermGroupList;
+import org.collectionspace.services.person.PersonsCommon;
+import org.collectionspace.services.person.PersonauthoritiesCommon;
+import org.collectionspace.services.person.SchoolOrStyleList;
+import org.jboss.resteasy.client.ClientResponse;
+//import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.collectionspace.services.person.StructuredDateGroup;
+
+/**
+ * The Class PersonAuthorityClientUtils.
+ */
+public class PersonAuthorityClientUtils {
+    
+    /** The Constant logger. */
+    private static final Logger logger =
+        LoggerFactory.getLogger(PersonAuthorityClientUtils.class);
+       private static final ServiceRequestType READ_REQ = ServiceRequestType.READ;
+
+    /**
+     * @param csid the id of the PersonAuthority
+     * @param client if null, creates a new client
+     * @return
+     */
+    public static String getAuthorityRefName(String csid, PersonAuthorityClient client){
+       if (client == null) {
+               client = new PersonAuthorityClient();
+       }
+        ClientResponse<String> res = client.read(csid);
+        try {
+               int statusCode = res.getStatus();
+               if(!READ_REQ.isValidStatusCode(statusCode)
+                       ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {
+                       throw new RuntimeException("Invalid status code returned: "+statusCode);
+               }
+               //FIXME: remove the following try catch once Aron fixes signatures
+               try {
+                   PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+                   PersonauthoritiesCommon personAuthority = 
+                       (PersonauthoritiesCommon) CollectionSpaceClientUtils.extractPart(input,
+                           client.getCommonPartName(), PersonauthoritiesCommon.class);
+                       if(personAuthority == null) {
+                               throw new RuntimeException("Null personAuthority returned from service.");
+                       }
+                   return personAuthority.getRefName();
+               } catch (Exception e) {
+                   throw new RuntimeException(e);
+               }
+        } finally {
+               res.releaseConnection();
+        }
+    }
+
+    /**
+     * @param csid the id of the PersonAuthority
+     * @param client if null, creates a new client
+     * @return
+     */
+    public static String getPersonRefName(String inAuthority, String csid, PersonAuthorityClient client){
+       if ( client == null) {
+               client = new PersonAuthorityClient();
+       }
+        ClientResponse<String> res = client.readItem(inAuthority, csid);
+        try {
+               int statusCode = res.getStatus();
+               if(!READ_REQ.isValidStatusCode(statusCode)
+                               ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {
+                       throw new RuntimeException("Invalid status code returned: "+statusCode);
+               }
+               //FIXME: remove the following try catch once Aron fixes signatures
+               try {
+                   PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+                   PersonsCommon person = 
+                       (PersonsCommon) CollectionSpaceClientUtils.extractPart(input,
+                           client.getItemCommonPartName(), PersonsCommon.class);
+                       if (person == null) {
+                               throw new RuntimeException("Null person returned from service.");
+                       }
+                   return person.getRefName();
+               } catch (Exception e) {
+                   throw new RuntimeException(e);
+               }
+        } finally {
+               res.releaseConnection();
+        }
+    }
+
+    /**
+     * Creates the person authority instance.
+     *
+     * @param displayName the display name
+     * @param shortIdentifier the short Id 
+     * @param headerLabel the header label
+     * @return the multipart output
+     */
+    public static PoxPayloadOut createPersonAuthorityInstance(
+               String displayName, String shortIdentifier, String headerLabel ) {
+        PersonauthoritiesCommon personAuthority = new PersonauthoritiesCommon();
+        personAuthority.setDisplayName(displayName);
+        personAuthority.setShortIdentifier(shortIdentifier);
+        //String refName = createPersonAuthRefName(shortIdentifier, displayName);
+        //personAuthority.setRefName(refName);
+        personAuthority.setVocabType("PersonAuthority");
+        PoxPayloadOut multipart = new PoxPayloadOut(PersonAuthorityClient.SERVICE_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(personAuthority, MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, personAuthority common ", 
+                                       personAuthority, PersonauthoritiesCommon.class);
+        }
+
+        return multipart;
+    }
+
+    /**
+     * Creates a person instance.
+     *
+     * @param inAuthority the owning authority
+     * @param personAuthRefName the owning Authority ref name
+     * @param personInfo the person info
+     * @param headerLabel the header label
+     * @return the multipart output
+     */
+    public static PoxPayloadOut createPersonInstance(String inAuthority,
+               String personAuthRefName,
+               Map<String, String> personInfo,
+                List<PersonTermGroup> terms,
+               String headerLabel){
+        if (terms == null || terms.isEmpty()) {
+            terms = getTermGroupInstance(getGeneratedIdentifier());
+        }
+        final Map<String, List<String>> EMPTY_PERSON_REPEATABLES_INFO =
+                new HashMap<String, List<String>>();
+        return createPersonInstance(inAuthority, null /*personAuthRefName*/,
+                personInfo, terms, EMPTY_PERSON_REPEATABLES_INFO, headerLabel);
+    }
+
+    /**
+     * Creates a person instance.
+     *
+     * @param inAuthority the owning authority
+     * @param personAuthRefName the owning Authority ref name
+     * @param personInfo the person info
+     * @param terms a list of Person terms
+     * @param personRepeatablesInfo names and values of repeatable scalar fields in the Person record
+     * @param headerLabel the header label
+     * @return the multipart output
+     */
+    public static PoxPayloadOut createPersonInstance(String inAuthority, 
+               String personAuthRefName, Map<String, String> personInfo,
+                List<PersonTermGroup> terms,
+                Map<String, List<String>> personRepeatablesInfo, String headerLabel){
+        PersonsCommon person = new PersonsCommon();
+        person.setInAuthority(inAuthority);
+       String shortId = personInfo.get(PersonJAXBSchema.SHORT_IDENTIFIER);
+       if (shortId == null || shortId.isEmpty()) {
+               throw new IllegalArgumentException("shortIdentifier cannot be null or empty");
+       }       
+       person.setShortIdentifier(shortId);
+       
+       String value;
+        List<String> values = null;
+
+        if((value = (String)personInfo.get(PersonJAXBSchema.BIRTH_DATE))!=null) {
+            StructuredDateGroup birthDate = new StructuredDateGroup();
+            birthDate.setDateDisplayDate(value);
+            person.setBirthDateGroup(birthDate);
+        }
+        if((value = (String)personInfo.get(PersonJAXBSchema.DEATH_DATE))!=null) {
+            StructuredDateGroup deathDate = new StructuredDateGroup();
+            deathDate.setDateDisplayDate(value);
+            person.setDeathDateGroup(deathDate);
+        }
+        if((value = (String)personInfo.get(PersonJAXBSchema.BIRTH_PLACE))!=null)
+               person.setBirthPlace(value);
+        if((value = (String)personInfo.get(PersonJAXBSchema.DEATH_PLACE))!=null)
+               person.setDeathPlace(value);
+        if((value = (String)personInfo.get(PersonJAXBSchema.GENDER))!=null)
+               person.setGender(value);
+         if((value = (String)personInfo.get(PersonJAXBSchema.BIO_NOTE))!=null)
+               person.setBioNote(value);
+        if((value = (String)personInfo.get(PersonJAXBSchema.NAME_NOTE))!=null)
+               person.setNameNote(value);
+        
+        // Set values in the Term Information Group
+        PersonTermGroupList termList = new PersonTermGroupList();
+        if (terms == null || terms.isEmpty()) {
+            terms = getTermGroupInstance(getGeneratedIdentifier());
+        }
+        termList.getPersonTermGroup().addAll(terms); 
+        person.setPersonTermGroupList(termList);
+        
+        if (personRepeatablesInfo != null) {
+            if((values = (List<String>)personRepeatablesInfo.get(PersonJAXBSchema.GROUPS))!=null) {
+                    GroupList groupsList = new GroupList();
+                    List<String> groups = groupsList.getGroup();
+                    groups.addAll(values);
+                    person.setGroups(groupsList);
+            }
+            if((values = (List<String>)personRepeatablesInfo.get(PersonJAXBSchema.NATIONALITIES))!=null) {
+                    NationalityList nationalitiesList = new NationalityList();
+                    List<String> nationalities = nationalitiesList.getNationality();
+                    nationalities.addAll(values);
+                    person.setNationalities(nationalitiesList);
+            }
+
+            if((values = (List<String>)personRepeatablesInfo.get(PersonJAXBSchema.OCCUPATIONS))!=null) {
+                    OccupationList occupationsList = new OccupationList();
+                    List<String> occupations = occupationsList.getOccupation();
+                    occupations.addAll(values);
+                    person.setOccupations(occupationsList);
+            }
+            if((values = (List<String>)personRepeatablesInfo.get(PersonJAXBSchema.SCHOOLS_OR_STYLES))!=null) {
+                    SchoolOrStyleList schoolOrStyleList = new SchoolOrStyleList();
+                    List<String> schoolsOrStyles = schoolOrStyleList.getSchoolOrStyle();
+                    schoolsOrStyles.addAll(values);
+                    person.setSchoolsOrStyles(schoolOrStyleList);
+            }        
+        }
+
+        
+        PoxPayloadOut multipart = new PoxPayloadOut(PersonAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(person,
+            MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, person common ", person, PersonsCommon.class);
+        }
+
+        return multipart;
+    }
+    
+    /**
+     * Creates the item in authority.
+     *
+     * @param vcsid the vcsid
+     * @param personAuthorityRefName the person authority ref name
+     * @param personMap the person map. PersonJAXBSchema.SHORT_IDENTIFIER is REQUIRED.
+     * @param client the client
+     * @return the string
+     */
+    public static String createItemInAuthority(String vcsid, 
+               String personAuthorityRefName, Map<String,String> personMap,
+                List<PersonTermGroup> terms, Map<String, List<String>> personRepeatablesMap,
+                PersonAuthorityClient client ) {
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+        
+        String displayName = "";
+        if (terms !=null && terms.size() > 0) {
+            displayName = terms.get(0).getTermDisplayName();
+        }
+       
+       if(logger.isDebugEnabled()){
+               logger.debug("Creating item with display name: \"" + displayName
+                               +"\" in personAuthority: \"" + vcsid +"\"");
+       }
+       PoxPayloadOut multipart = 
+               createPersonInstance(vcsid, null /*personAuthorityRefName*/,
+                       personMap, terms, personRepeatablesMap, client.getItemCommonPartName());
+       
+       String result = null;
+       ClientResponse<Response> res = client.createItem(vcsid, multipart);
+       try {
+               int statusCode = res.getStatus();
+       
+               if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                       throw new RuntimeException("Could not create Item: \""+personMap.get(PersonJAXBSchema.SHORT_IDENTIFIER)
+                                       +"\" in personAuthority: \"" + vcsid //personAuthorityRefName
+                                       +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+               }
+               if(statusCode != EXPECTED_STATUS_CODE) {
+                       throw new RuntimeException("Unexpected Status when creating Item: \""+personMap.get(PersonJAXBSchema.SHORT_IDENTIFIER)
+                                       +"\" in personAuthority: \"" + vcsid /*personAuthorityRefName*/ +"\", Status:"+ statusCode);
+               }
+       
+               result = extractId(res);
+       } finally {
+               res.releaseConnection();
+       }
+       
+       return result;
+    }
+
+    /**
+     * Creates the personAuthority ref name.
+     *
+     * @param shortId the personAuthority shortIdentifier
+     * @param displaySuffix displayName to be appended, if non-null
+     * @return the string
+     */
+    /*
+    public static String createPersonAuthRefName(String shortId, String displaySuffix) {
+       String refName = "urn:cspace:org.collectionspace.demo:personauthority:name("
+                       +shortId+")";
+       if(displaySuffix!=null&&!displaySuffix.isEmpty())
+               refName += "'"+displaySuffix+"'";
+       return refName;
+    }
+    */
+
+    /**
+     * Creates the person ref name.
+     *
+     * @param personAuthRefName the person auth ref name
+     * @param shortId the person shortIdentifier
+     * @param displaySuffix displayName to be appended, if non-null
+     * @return the string
+     */
+    /*
+    public static String createPersonRefName(
+                                               String personAuthRefName, String shortId, String displaySuffix) {
+       String refName = personAuthRefName+":person:name("+shortId+")";
+       if(displaySuffix!=null&&!displaySuffix.isEmpty())
+               refName += "'"+displaySuffix+"'";
+       return refName;
+    }
+    */
+
+    /**
+     * Extract id.
+     *
+     * @param res the res
+     * @return the string
+     */
+    public static String extractId(ClientResponse<Response> res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        // FIXME: This may throw an NPE if the Location: header isn't present
+        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);
+        if(logger.isDebugEnabled()){
+               logger.debug("extractId:uri=" + uri);
+        }
+        String[] segments = uri.split("/");
+        String id = segments[segments.length - 1];
+        if(logger.isDebugEnabled()){
+               logger.debug("id=" + id);
+        }
+        return id;
+    }
+    
+    /**
+     * Returns an error message indicating that the status code returned by a
+     * specific call to a service does not fall within a set of valid status
+     * codes for that service.
+     *
+     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).
+     *
+     * @param statusCode  The invalid status code that was returned in the response,
+     *                    from submitting that type of request to the service.
+     *
+     * @return An error message.
+     */
+    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {
+        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +
+                requestType.validStatusCodesAsString();
+    }
+
+
+    
+    /**
+     * Produces a default displayName from the basic name and dates fields.
+     * @see PersonDocumentModelHandler.prepareDefaultDisplayName() which
+     * duplicates this logic, until we define a service-general utils package
+     * that is neither client nor service specific.
+     * @param foreName 
+     * @param middleName
+     * @param surName
+     * @param birthDate
+     * @param deathDate
+     * @return display name
+     */
+    public static String prepareDefaultDisplayName(
+               String foreName, String middleName, String surName, 
+            String birthDate, String deathDate) {
+       StringBuilder newStr = new StringBuilder();
+               final String sep = " ";
+               final String dateSep = "-";
+               List<String> nameStrings = 
+                       Arrays.asList(foreName, middleName, surName);
+               boolean firstAdded = false;
+       for(String partStr : nameStrings ){
+                       if(null != partStr ) {
+                               if(firstAdded) {
+                                       newStr.append(sep);
+                               }
+                               newStr.append(partStr);
+                               firstAdded = true;
+                       }
+       }
+       // Now we add the dates. In theory could have dates with no name, but that is their problem.
+       boolean foundBirth = false;
+        if(null != birthDate) {
+         if(firstAdded) {
+             newStr.append(sep);
+         }
+         newStr.append(birthDate);
+                 newStr.append(dateSep);     // Put this in whether there is a death date or not
+         foundBirth = true;
+        }
+        if(null != deathDate) {
+         if(!foundBirth) {
+             if(firstAdded) {
+                 newStr.append(sep);
+             }
+             newStr.append(dateSep);
+         }
+         newStr.append(deathDate);
+        }
+               return newStr.toString();
+    }
+    
+    public static List<PersonTermGroup> getTermGroupInstance(String identifier) {
+        if (Tools.isBlank(identifier)) {
+            identifier = getGeneratedIdentifier();
+        }
+        List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();
+        PersonTermGroup term = new PersonTermGroup();
+        term.setTermDisplayName(identifier);
+        term.setTermName(identifier);
+        terms.add(term);
+        return terms;
+    }
+    
+    private static String getGeneratedIdentifier() {
+        return "id" + new Date().getTime(); 
+   }
+
+}
index 4519e9992b28124010fe35f85726d26c49650b99..dbbca89e7182a683567bb52d74acd6841ec7267c 100644 (file)
@@ -1,25 +1,25 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.stdout.encoding=UTF-8\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-log4j.appender.R.encoding=UTF-8\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.encoding=UTF-8
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+log4j.appender.R.encoding=UTF-8
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index c0fc960c82f610f8dcb61d894f1e1d7596bf4cbf..c9e926f27491323902535fe84b0fb58603605192 100644 (file)
@@ -1,61 +1,61 @@
-\r
-<project name="person" default="package" basedir=".">\r
-    <description>\r
-        person service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-    \r
-    <target name="install" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing person Service's &apos;install&apos; target." />\r
-                               </exec>\r
-                               <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->\r
-        <copy todir="${jee.deploy.nuxeo.plugins}">\r
-            <fileset file="nuxeo/*.jar"/>\r
-        </copy>                                \r
-    </target>    \r
-\r
-    <target name="config" description="" depends="install">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Person Service's &apos;config&apos; target." />\r
-                               </exec>\r
-    </target>\r
-    \r
-    <target name="predeploy" description="" depends="config">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Person Service's &apos;predeploy&apos; target." />\r
-                               </exec>\r
-    </target>    \r
-    \r
-    <target name="deploy" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Person Service's &apos;deploy&apos; target." />\r
-                               </exec>\r
-    </target>\r
-    \r
-    <target name="postdeploy">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Person Service." />\r
-                               </exec>         \r
-        <exec executable="echo">\r
-                       <arg value="Importing necessary personauthorities." />\r
-                               </exec>                         \r
-        <java jar="./postdeploy/collectionspace-services-person-importer-jar-with-dependencies.jar"\r
-               fork="true"\r
-               failonerror="true">\r
-                               </java> \r
-    </target>\r
-    \r
-\r
-</project>\r
+
+<project name="person" default="package" basedir=".">
+    <description>
+        person service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+    
+    <target name="install" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing person Service's &apos;install&apos; target." />
+                               </exec>
+                               <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->
+        <copy todir="${jee.deploy.nuxeo.plugins}">
+            <fileset file="nuxeo/*.jar"/>
+        </copy>                                
+    </target>    
+
+    <target name="config" description="" depends="install">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Person Service's &apos;config&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="predeploy" description="" depends="config">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Person Service's &apos;predeploy&apos; target." />
+                               </exec>
+    </target>    
+    
+    <target name="deploy" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Person Service's &apos;deploy&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="postdeploy">
+        <exec executable="echo">
+                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Person Service." />
+                               </exec>         
+        <exec executable="echo">
+                       <arg value="Importing necessary personauthorities." />
+                               </exec>                         
+        <java jar="./postdeploy/collectionspace-services-person-importer-jar-with-dependencies.jar"
+               fork="true"
+               failonerror="true">
+                               </java> 
+    </target>
+    
+
+</project>
index a9b8ce981933c68e70a2f9f90e8ee10091526fd6..445fa30e77edf04e72f3fe88bdf4fffd7856afc6 100644 (file)
@@ -1,32 +1,32 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services;\r
-import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;\r
-\r
-/**\r
- * @author pschmitz\r
- *\r
- */\r
-public interface PersonJAXBSchema extends AuthorityItemJAXBSchema {\r
-       final static String PERSONS_COMMON = "persons_common";\r
-       final static String FORE_NAME = "foreName";\r
-       final static String MIDDLE_NAME = "middleName";\r
-       final static String SUR_NAME = "surName";\r
-       final static String INITIALS = "initials";\r
-       final static String SALUTATIONS = "salutations";\r
-       final static String TITLE = "title";\r
-       final static String NAME_ADDITIONS = "nameAdditions";\r
-       final static String BIRTH_DATE = "birthDate";\r
-       final static String DEATH_DATE = "deathDate";\r
-       final static String BIRTH_PLACE = "birthPlace";\r
-       final static String DEATH_PLACE = "deathPlace";\r
-       final static String GROUPS = "groups";\r
-       final static String NATIONALITIES = "nationalities";\r
-       final static String GENDER = "gender";\r
-       final static String OCCUPATIONS = "occupations";\r
-       final static String SCHOOLS_OR_STYLES = "schoolsOrStyles";\r
-       final static String BIO_NOTE = "bioNote";\r
-       final static String NAME_NOTE = "nameNote";\r
-}\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services;
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
+
+/**
+ * @author pschmitz
+ *
+ */
+public interface PersonJAXBSchema extends AuthorityItemJAXBSchema {
+       final static String PERSONS_COMMON = "persons_common";
+       final static String FORE_NAME = "foreName";
+       final static String MIDDLE_NAME = "middleName";
+       final static String SUR_NAME = "surName";
+       final static String INITIALS = "initials";
+       final static String SALUTATIONS = "salutations";
+       final static String TITLE = "title";
+       final static String NAME_ADDITIONS = "nameAdditions";
+       final static String BIRTH_DATE = "birthDate";
+       final static String DEATH_DATE = "deathDate";
+       final static String BIRTH_PLACE = "birthPlace";
+       final static String DEATH_PLACE = "deathPlace";
+       final static String GROUPS = "groups";
+       final static String NATIONALITIES = "nationalities";
+       final static String GENDER = "gender";
+       final static String OCCUPATIONS = "occupations";
+       final static String SCHOOLS_OR_STYLES = "schoolsOrStyles";
+       final static String BIO_NOTE = "bioNote";
+       final static String NAME_NOTE = "nameNote";
+}
+
index dc2d181124f857ac8daae87243f4adea9991296b..f2584548128197d00735f209ffbe33bd301c39a1 100644 (file)
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.person</artifactId>\r
-    <name>services.person</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <dependencies>\r
-                       <!--\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>    \r
-                               -->\r
-    </dependencies>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-    \r
-    <profiles>\r
-        <profile>\r
-            <id>samples</id>\r
-           <modules>\r
-                <module>sample</module>\r
-           </modules>\r
-        </profile>\r
-    </profiles>\r
-    \r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.person</artifactId>
+    <name>services.person</name>
+    <packaging>pom</packaging>
+
+    <dependencies>
+                       <!--
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>    
+                               -->
+    </dependencies>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+    
+    <profiles>
+        <profile>
+            <id>samples</id>
+           <modules>
+                <module>sample</module>
+           </modules>
+        </profile>
+    </profiles>
+    
+</project>
+
index ad5c57cd53d9532302f088bc1c1dc181d1953141..e526a471229e1318a3fc30268ce460a1dcf76690 100644 (file)
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
index bce7b990c405beee0654f3ce82856674934010e9..0e446eafdf8ffb72ebd977822488fe87524f560b 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.person.client.samples</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.person.client.samples</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 722a68d845f9339a3195d60b55e5f77db94cfa88..b7357045b2b7752d130c34af79c124312df5e15f 100644 (file)
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.person.client.samples</artifactId>\r
-    <packaging>pom</packaging>\r
-    <version>1.0</version>\r
-    <name>person.client.samples</name>\r
-\r
-    <modules>\r
-        <module>sample</module>\r
-    </modules>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.person.client.samples</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0</version>
+    <name>person.client.samples</name>
+
+    <modules>
+        <module>sample</module>
+    </modules>
+</project>
+
index 4905d3908a6288c94f8e5b5ad507bbd8a2e65e14..72d2ee925f77470a14d85c81745a96e99388ada7 100644 (file)
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="src" output="target/classes" path="src/main/java">\r
-               <attributes>\r
-                       <attribute name="optional" value="true"/>\r
-                       <attribute name="maven.pomderived" value="true"/>\r
-               </attributes>\r
-       </classpathentry>\r
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">\r
-               <attributes>\r
-                       <attribute name="maven.pomderived" value="true"/>\r
-               </attributes>\r
-       </classpathentry>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="src" output="target/test-classes" path="src/test/java">\r
-               <attributes>\r
-                       <attribute name="optional" value="true"/>\r
-                       <attribute name="maven.pomderived" value="true"/>\r
-               </attributes>\r
-       </classpathentry>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">\r
-               <attributes>\r
-                       <attribute name="maven.pomderived" value="true"/>\r
-               </attributes>\r
-       </classpathentry>\r
-       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">\r
-               <attributes>\r
-                       <attribute name="maven.pomderived" value="true"/>\r
-               </attributes>\r
-       </classpathentry>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" path="src/main/java">
+               <attributes>
+                       <attribute name="optional" value="true"/>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+               <attributes>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="src" output="target/test-classes" path="src/test/java">
+               <attributes>
+                       <attribute name="optional" value="true"/>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+               <attributes>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+               <attributes>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 578b4c5deaa49d0d929ffd354fb3e3b0d84d6325..ca67680879eb0262e3ef037fd68947b480a34326 100644 (file)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.person.client.sample</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.jdt.core.javabuilder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.jdt.core.javanature</nature>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.person.client.sample</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index c8119ab1d50de1011db01b513d882fd28f893cf1..deedd7d8175b5afddfdfb8b1161dbb49a2ef1bf5 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.person.client.sample</artifactId>\r
-    <packaging>jar</packaging>\r
-    <version>1.0</version>\r
-    <name>person.client.sample</name>\r
-    \r
-    <dependencies>\r
-    <!-- \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.jaxb</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.client</artifactId>\r
-        </dependency>\r
-    -->\r
-    </dependencies>\r
-    \r
-    <repositories>\r
-        <repository>\r
-            <id>libs-releases-local</id>\r
-            <name>libs-releases-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>\r
-            <releases>\r
-                <enabled>true</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>false</enabled>\r
-            </snapshots>            \r
-        </repository>\r
-        \r
-        <repository>\r
-            <id>libs-snapshots-local</id>\r
-            <name>libs-snapshots-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>\r
-            <releases>\r
-                <enabled>false</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>true</enabled>\r
-            </snapshots>            \r
-        </repository>\r
-        <repository>\r
-            <id>nuxeo-public</id>\r
-            <name>nuxeo-public</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public</url>            \r
-            <releases>\r
-                <enabled>true</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>false</enabled>\r
-            </snapshots>            \r
-        </repository>\r
-        <repository>\r
-            <id>nuxeo-public-snapshot</id>\r
-            <name>nuxeo-public-snapshot</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public-snapshot</url>\r
-            <releases>\r
-                <enabled>false</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>true</enabled>\r
-            </snapshots>\r
-        </repository>\r
-    </repositories>    \r
-    \r
-    <build>\r
-        <finalName>person-client-sample</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-assembly-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <goals>\r
-                            <goal>attached</goal>\r
-                        </goals>\r
-                        <phase>package</phase>\r
-                        <configuration>\r
-                            <descriptorRefs>\r
-                                <descriptorRef>jar-with-dependencies</descriptorRef>\r
-                            </descriptorRefs>\r
-                            <archive>\r
-                                <manifest>\r
-                                    <mainClass>org.collectionspace.services.person.client.sample.Sample</mainClass>\r
-                                </manifest>\r
-                            </archive>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-compiler-plugin</artifactId>\r
-                <configuration>\r
-                    <source>1.7</source>\r
-                    <target>1.7</target>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.person.client.sample</artifactId>
+    <packaging>jar</packaging>
+    <version>1.0</version>
+    <name>person.client.sample</name>
+    
+    <dependencies>
+    <!-- 
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.jaxb</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.client</artifactId>
+        </dependency>
+    -->
+    </dependencies>
+    
+    <repositories>
+        <repository>
+            <id>libs-releases-local</id>
+            <name>libs-releases-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>            
+        </repository>
+        
+        <repository>
+            <id>libs-snapshots-local</id>
+            <name>libs-snapshots-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>            
+        </repository>
+        <repository>
+            <id>nuxeo-public</id>
+            <name>nuxeo-public</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public</url>            
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>            
+        </repository>
+        <repository>
+            <id>nuxeo-public-snapshot</id>
+            <name>nuxeo-public-snapshot</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public-snapshot</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+    </repositories>    
+    
+    <build>
+        <finalName>person-client-sample</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>attached</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <descriptorRefs>
+                                <descriptorRef>jar-with-dependencies</descriptorRef>
+                            </descriptorRefs>
+                            <archive>
+                                <manifest>
+                                    <mainClass>org.collectionspace.services.person.client.sample.Sample</mainClass>
+                                </manifest>
+                            </archive>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index 1e09bc184655dbfdcc17b2fc5b926d12b8353a3c..10aa55db21c2e867da198ed7c972610aaca9db3e 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c)) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.person.client.sample;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Arrays;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.apache.log4j.BasicConfigurator;\r
-import org.collectionspace.services.PersonJAXBSchema;\r
-import org.collectionspace.services.client.PersonAuthorityClient;\r
-import org.collectionspace.services.client.PersonAuthorityClientUtils;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.client.test.ServiceRequestType;\r
-import org.collectionspace.services.person.PersonauthoritiesCommon;\r
-import org.collectionspace.services.person.PersonauthoritiesCommonList;\r
-import org.collectionspace.services.person.PersonsCommon;\r
-import org.collectionspace.services.person.PersonsCommonList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;\r
-import org.jboss.resteasy.plugins.providers.multipart.OutputPart;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * PersonAuthority Sample, carries out tests against a\r
- * deployed and running PersonAuthority Service.\r
- *\r
- * $LastChangedRevision: 1055 $\r
- * $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $\r
- */\r
-public class Sample {\r
-    private static final Logger logger =\r
-        LoggerFactory.getLogger(Sample.class);\r
-\r
-    // Instance variables specific to this test.\r
-    private PersonAuthorityClient client = new PersonAuthorityClient();\r
-    final String SERVICE_PATH_COMPONENT = "persons";\r
-    final String ITEM_SERVICE_PATH_COMPONENT = "items";\r
-\r
-\r
-    // ---------------------------------------------------------------\r
-    // Create\r
-    // ---------------------------------------------------------------\r
-\r
-    public void createPersonAuthority(String personAuthorityName, \r
-               List<Map<String, String>> personMaps ) {\r
-\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-\r
-       logger.info("Import: Create personAuthority: \"" + personAuthorityName +"\"");\r
-\r
-\r
-        String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: Laramie20100728 temp fix, made-up displaySuffix.\r
-        String basePersonRefName = PersonAuthorityClientUtils.createPersonAuthRefName(personAuthorityName, displaySuffix);//TODO: Laramie20100728 temp fix  was personAuthorityName, false\r
-       String fullPersonRefName = PersonAuthorityClientUtils.createPersonAuthRefName(personAuthorityName, displaySuffix); //TODO: Laramie20100728 temp fix  was personAuthorityName, true\r
-       PoxPayloadOut multipart = \r
-               PersonAuthorityClientUtils.createPersonAuthorityInstance(\r
-                               personAuthorityName, fullPersonRefName, client.getCommonPartName() );\r
-       ClientResponse<Response> res = client.create(multipart);\r
-\r
-       int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not create enumeration: \""+personAuthorityName\r
-                               +"\" "+ PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when creating enumeration: \""\r
-                               +personAuthorityName +"\", Status:"+ statusCode);\r
-       }\r
-\r
-       // Store the ID returned from this create operation\r
-       // for additional tests below.\r
-       String newPersonAuthId = PersonAuthorityClientUtils.extractId(res);\r
-        logger.info("Import: Created personAuthority: \"" + personAuthorityName +"\" ID:"\r
-                               +newPersonAuthId );\r
-        \r
-        // Add items to the personAuthority\r
-       for(Map<String,String> personMap : personMaps){\r
-               createItemInAuthority(newPersonAuthId, basePersonRefName, personMap);\r
-       }\r
-        \r
-    }\r
-    \r
-    private String createItemInAuthority(String vcsid, \r
-               String personAuthorityRefName, Map<String,String> personMap) {\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-       String foreName = personMap.get(PersonJAXBSchema.FORE_NAME);\r
-       String middleName = personMap.get(PersonJAXBSchema.MIDDLE_NAME);\r
-       String surName = personMap.get(PersonJAXBSchema.SUR_NAME);\r
-        String birthDate = personMap.get(PersonJAXBSchema.BIRTH_DATE);\r
-        String deathDate = personMap.get(PersonJAXBSchema.DEATH_DATE);\r
-       StringBuilder builtName = new StringBuilder();\r
-       if(foreName!=null)\r
-               builtName.append(foreName);\r
-       if(middleName!=null)\r
-               builtName.append(middleName);\r
-       if(surName!=null)\r
-               builtName.append(surName);\r
-        if(birthDate!=null)\r
-             builtName.append(birthDate);\r
-        builtName.append("-");\r
-        if(deathDate!=null)\r
-             builtName.append(deathDate);\r
-\r
-        String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: Laramie20100728 temp fix, made-up displaySuffix.\r
-\r
-       String refName = PersonAuthorityClientUtils.createPersonRefName(personAuthorityRefName, builtName.toString(), displaySuffix); //TODO was ...,true);\r
-       logger.info("Import: Create Item: \""+refName+"\" in personAuthority: \"" + personAuthorityRefName +"\"");\r
-\r
-       if(logger.isDebugEnabled()){\r
-               logger.debug("Import: Create Item: \""+builtName.toString()\r
-                               +"\" in personAuthorityulary: \"" + personAuthorityRefName +"\"");\r
-       }\r
-       PoxPayloadOut multipart = createPersonInstance( vcsid, refName,\r
-                       personMap );\r
-       ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
-\r
-       int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not create Item: \""+refName\r
-                               +"\" in personAuthority: \"" + personAuthorityRefName\r
-                               +"\" "+ PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when creating Item: \""+refName\r
-                               +"\" in personAuthority: \"" + personAuthorityRefName +"\", Status:"+ statusCode);\r
-       }\r
-\r
-       return PersonAuthorityClientUtils.extractId(res);\r
-    }\r
-\r
-\r
-   // ---------------------------------------------------------------\r
-   // Read\r
-   // ---------------------------------------------------------------\r
-\r
-   private PersonauthoritiesCommonList readPersonAuthorities() {\r
-\r
-        // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
-\r
-        // Submit the request to the service and store the response.\r
-        ClientResponse<PersonauthoritiesCommonList> res = client.readList();\r
-        PersonauthoritiesCommonList list = res.getEntity();\r
-\r
-        int statusCode = res.getStatus();\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not read list of personAuthorities: "\r
-                + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when reading " +\r
-                "list of personAuthorities, Status:"+ statusCode);\r
-       }\r
-\r
-        return list;\r
-   }\r
-\r
-    private List<String> readPersonAuthorityIds(PersonauthoritiesCommonList list) {\r
-\r
-        List<String> ids = new ArrayList<String>();\r
-        List<PersonauthoritiesCommonList.PersonauthorityListItem> personAuthorities =\r
-            list.getPersonauthorityListItem();\r
-        for (PersonauthoritiesCommonList.PersonauthorityListItem personAuthority : personAuthorities) {\r
-            ids.add(personAuthority.getCsid());\r
-        }\r
-        return ids;\r
-   }\r
-    \r
-   private PersonauthoritiesCommon readPersonAuthority(String personAuthId) {\r
-\r
-        // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
-\r
-        // Submit the request to the service and store the response.\r
-        PersonauthoritiesCommon personAuthority = null;\r
-        try {\r
-            ClientResponse<String> res = client.read(personAuthId);\r
-            int statusCode = res.getStatus();\r
-            if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-                throw new RuntimeException("Could not read personAuthority"\r
-                    + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-            }\r
-            if(statusCode != EXPECTED_STATUS_CODE) {\r
-                throw new RuntimeException("Unexpected Status when reading " +\r
-                    "personAuthority, Status:"+ statusCode);\r
-            }\r
-            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());\r
-            personAuthority = (PersonauthoritiesCommon) extractPart(input,\r
-                    client.getCommonPartName(), PersonauthoritiesCommon.class);\r
-        } catch (Exception e) {\r
-            throw new RuntimeException("Could not read personAuthority: ", e);\r
-        }\r
-\r
-        return personAuthority;\r
-    }\r
-\r
-    private PersonsCommonList readItemsInPersonAuth(String personAuthId) {\r
-\r
-        // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
-\r
-        // Submit the request to the service and store the response.\r
-        ClientResponse<PersonsCommonList> res = client.readItemList(personAuthId, "", ""); //TODO: Laramie201007289  added empty strings to satisfy api\r
-        PersonsCommonList list = res.getEntity();\r
-\r
-        int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not read items in personAuthority: "\r
-                + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when reading " +\r
-                "items in personAuthority, Status:"+ statusCode);\r
-       }\r
-\r
-        return list;\r
-    }\r
-\r
-    private List<String> readPersonIds(PersonsCommonList list) {\r
-\r
-        List<String> ids = new ArrayList<String>();\r
-        List<PersonsCommonList.PersonListItem> items =\r
-            list.getPersonListItem();\r
-        for (PersonsCommonList.PersonListItem item : items) {\r
-            ids.add(item.getCsid());\r
-        }\r
-        return ids;\r
-   }\r
-\r
-    // ---------------------------------------------------------------\r
-    // Delete\r
-    // ---------------------------------------------------------------\r
-\r
-    private void deletePersonAuthority(String vcsid) {\r
-         // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
-\r
-        ClientResponse<Response> res = client.delete(vcsid);\r
-        int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not delete personAuthority: "\r
-                + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when deleting " +\r
-                "personAuthority, Status:"+ statusCode);\r
-       }\r
-    }\r
-\r
-    private void deleteAllPersonAuthorities() {\r
-        List<String> ids = readPersonAuthorityIds(readPersonAuthorities());\r
-        for (String id : ids) {\r
-            deletePersonAuthority(id);\r
-        }\r
-    }\r
-\r
-        private void deletePerson(String vcsid, String itemcsid) {\r
-         // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
-\r
-        ClientResponse<Response> res = client.deleteItem(vcsid, itemcsid);\r
-        int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not delete personAuthority item: "\r
-                + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when deleting " +\r
-                "personAuthority item, Status:"+ statusCode);\r
-       }\r
-    }\r
-\r
-    private void deleteAllItemsForPersonAuth(String personAuthId) {\r
-        List<String> itemIds = readPersonIds(readItemsInPersonAuth(personAuthId));\r
-        for (String itemId : itemIds) {\r
-            deletePerson(personAuthId, itemId);\r
-        }\r
-    }\r
-\r
-    // ---------------------------------------------------------------\r
-    // Utility methods used by tests above\r
-    // ---------------------------------------------------------------\r
-\r
-    /*\r
-    private PoxPayloadOut createPersonAuthorityInstance(\r
-               String displayName, String refName ) {\r
-        PersonauthoritiesCommon personAuthority = new PersonauthoritiesCommon();\r
-        personAuthority.setDisplayName(displayName);\r
-        personAuthority.setRefName(refName);\r
-        personAuthority.setVocabType("PersonAuthority");\r
-        PoxPayloadOut multipart = new PoxPayloadOut();\r
-        OutputPart commonPart = multipart.addPart(personAuthority, MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.getHeaders().add("label", client.getCommonPartName());\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, personAuthority common ",\r
-                                       personAuthority, PersonauthoritiesCommon.class);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-    */\r
-\r
-    private PoxPayloadOut createPersonInstance(String inAuthority, \r
-               String refName, Map<String, String> personInfo ) {\r
-            PersonsCommon person = new PersonsCommon();\r
-            person.setInAuthority(inAuthority);\r
-               person.setRefName(refName);\r
-               String value = null;\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.FORE_NAME))!=null)\r
-               person.setForeName(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.MIDDLE_NAME))!=null)\r
-               person.setMiddleName(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.SUR_NAME))!=null)\r
-               person.setSurName(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.INITIALS))!=null)\r
-               person.setInitials(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.SALUTATIONS))!=null)\r
-               person.setSalutation(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.TITLE))!=null)\r
-               person.setTitle(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.NAME_ADDITIONS))!=null)\r
-               person.setNameAdditions(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.BIRTH_DATE))!=null) {\r
-                StructuredDateGroup birthDate = new StructuredDateGroup();\r
-                birthDate.setDateDisplayDate(value);\r
-                person.setBirthDateGroup(birthDate);\r
-            }\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.DEATH_DATE))!=null) {\r
-                StructuredDateGroup deathDate = new StructuredDateGroup();\r
-                deathDate.setDateDisplayDate(value);\r
-                person.setDeathDateGroup(deathDate);\r
-            }\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.BIRTH_PLACE))!=null)\r
-               person.setBirthPlace(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.DEATH_PLACE))!=null)\r
-               person.setDeathPlace(value);\r
-\r
-            /* TODO: Laramie20100728  removed missing member calls\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.GROUP))!=null)\r
-               person.setGroup(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.NATIONALITY))!=null)\r
-               person.setNationality(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.OCCUPATION))!=null)\r
-               person.setOccupation(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.SCHOOL_OR_STYLE))!=null)\r
-               person.setSchoolOrStyle(value);\r
-            */\r
-        \r
-            if((value = (String)personInfo.get(PersonJAXBSchema.GENDER))!=null)\r
-                        person.setGender(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.BIO_NOTE))!=null)\r
-               person.setBioNote(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.NAME_NOTE))!=null)\r
-               person.setNameNote(value);\r
-            PoxPayloadOut multipart = new PoxPayloadOut();\r
-            OutputPart commonPart = multipart.addPart(person,\r
-                MediaType.APPLICATION_XML_TYPE);\r
-            commonPart.getHeaders().add("label", client.getItemCommonPartName());\r
-\r
-            if(logger.isDebugEnabled()){\r
-                logger.debug("to be created, person common"+person);\r
-            }\r
-\r
-            return multipart;\r
-        }\r
-\r
-    // Retrieve individual fields of personAuthority records.\r
-\r
-    private String displayAllPersonAuthorities(PersonauthoritiesCommonList list) {\r
-        StringBuffer sb = new StringBuffer();\r
-            List<PersonauthoritiesCommonList.PersonauthorityListItem> personAuthorities =\r
-                    list.getPersonauthorityListItem();\r
-            int i = 0;\r
-        for (PersonauthoritiesCommonList.PersonauthorityListItem personAuthority : personAuthorities) {\r
-            sb.append("personAuthority [" + i + "]" + "\n");\r
-            sb.append(displayPersonAuthorityDetails(personAuthority));\r
-            i++;\r
-        }\r
-        return sb.toString();\r
-    }\r
-\r
-    private String displayPersonAuthorityDetails(\r
-        PersonauthoritiesCommonList.PersonauthorityListItem personAuthority) {\r
-            StringBuffer sb = new StringBuffer();\r
-            sb.append("displayName=" + personAuthority.getDisplayName() + "\n");\r
-            sb.append("vocabType=" + personAuthority.getVocabType() + "\n");\r
-            // sb.append("csid=" + personAuthority.getCsid() + "\n");\r
-            sb.append("URI=" + personAuthority.getUri() + "\n");\r
-        return sb.toString();\r
-    }\r
-\r
-    // Retrieve individual fields of person records.\r
-\r
-    private String displayAllPersons(PersonsCommonList list) {\r
-        StringBuffer sb = new StringBuffer();\r
-        List<PersonsCommonList.PersonListItem> items =\r
-                list.getPersonListItem();\r
-        int i = 0;\r
-        for (PersonsCommonList.PersonListItem item : items) {\r
-            sb.append("person [" + i + "]" + "\n");\r
-            sb.append(displayPersonDetails(item));\r
-            i++;\r
-        }\r
-        return sb.toString();\r
-    }\r
-\r
-    private String displayPersonDetails(\r
-        PersonsCommonList.PersonListItem item) {\r
-            StringBuffer sb = new StringBuffer();\r
-            sb.append("csid=" + item.getCsid() + "\n");\r
-            sb.append("displayName=" + item.getDisplayName() + "\n");\r
-            // sb.append("URI=" + item.getUri() + "\n");\r
-        return sb.toString();\r
-    }\r
-\r
-    private Object extractPart(PoxPayloadIn input, String label,\r
-        Class clazz) throws Exception {\r
-        Object obj = null;\r
-        for(InputPart part : input.getParts()){\r
-            String partLabel = part.getHeaders().getFirst("label");\r
-            if(label.equalsIgnoreCase(partLabel)){\r
-                String partStr = part.getBodyAsString();\r
-                if(logger.isDebugEnabled()){\r
-                    logger.debug("extracted part str=\n" + partStr);\r
-                }\r
-                obj = part.getBody(clazz, null);\r
-                if(logger.isDebugEnabled()){\r
-                    logger.debug("extracted part obj=\n", obj, clazz);\r
-                }\r
-                break;\r
-            }\r
-        }\r
-        return obj;\r
-    }\r
-\r
-       public static void main(String[] args) {\r
-\r
-        // Configure logging.\r
-               BasicConfigurator.configure();\r
-\r
-        logger.info("PersonAuthority Sample starting...");\r
-\r
-               Sample sample = new Sample();\r
-        PersonauthoritiesCommonList personAuthorities;\r
-        List<String> personAuthIds;\r
-        String details = "";\r
-\r
-        // Optionally delete all personAuthorities and persons.\r
-\r
-        boolean ENABLE_DELETE_ALL = false;\r
-        if (ENABLE_DELETE_ALL) {\r
-\r
-            logger.info("Deleting all persons and personAuthorities ...");\r
-\r
-            // For each personAuthority ...\r
-            personAuthorities = sample.readPersonAuthorities();\r
-            personAuthIds = sample.readPersonAuthorityIds(personAuthorities);\r
-            for (String personAuthId : personAuthIds) {\r
-                logger.info("Deleting all persons for personAuthority ...");\r
-                sample.deleteAllItemsForPersonAuth(personAuthId);\r
-                logger.info("Deleting personAuthority ...");\r
-                sample.deletePersonAuthority(personAuthId);\r
-            }\r
-\r
-            logger.info("Reading personAuthorities after deletion ...");\r
-            personAuthorities = sample.readPersonAuthorities();\r
-            details = sample.displayAllPersonAuthorities(personAuthorities);\r
-            logger.info(details);\r
-\r
-            logger.info("Reading items in each personAuthority after deletion ...");\r
-            personAuthIds = sample.readPersonAuthorityIds(personAuthorities);\r
-            for (String personAuthId : personAuthIds) {\r
-                PersonsCommonList items = sample.readItemsInPersonAuth(personAuthId);\r
-                details = sample.displayAllPersons(items);\r
-                logger.info(details);\r
-            }\r
-\r
-        }\r
-\r
-        // Create new authorities, each populated with persons.\r
-\r
-        Map<String, String> johnWayneMap = new HashMap<String,String>();\r
-        johnWayneMap.put(PersonJAXBSchema.FORE_NAME, "John");\r
-        johnWayneMap.put(PersonJAXBSchema.SUR_NAME, "Wayne");\r
-        johnWayneMap.put(PersonJAXBSchema.GENDER, "male");\r
-        Map<String, String> patrickSchmitzMap = new HashMap<String,String>();\r
-        patrickSchmitzMap.put(PersonJAXBSchema.FORE_NAME, "Patrick");\r
-        patrickSchmitzMap.put(PersonJAXBSchema.SUR_NAME, "Schmitz");\r
-        patrickSchmitzMap.put(PersonJAXBSchema.GENDER, "male");\r
-        Map<String, String> janeDoeMap = new HashMap<String,String>();\r
-        janeDoeMap.put(PersonJAXBSchema.FORE_NAME, "Jane");\r
-        janeDoeMap.put(PersonJAXBSchema.SUR_NAME, "Doe");\r
-        janeDoeMap.put(PersonJAXBSchema.GENDER, "female");\r
-        List<Map<String, String>> personsMaps = \r
-               Arrays.asList(johnWayneMap, patrickSchmitzMap, janeDoeMap );\r
-        \r
-        sample.createPersonAuthority("Sample Person Auth", personsMaps);\r
-\r
-               logger.info("PersonAuthority Sample complete.");\r
-\r
-        logger.info("Reading personAuthorities and items ...");\r
-        // Get a list of personAuthorities.\r
-        personAuthorities = sample.readPersonAuthorities();\r
-        // For each personAuthority ...\r
-        for (PersonauthoritiesCommonList.PersonauthorityListItem\r
-            personAuthority : personAuthorities.getPersonauthorityListItem()) {\r
-            // Get its display name.\r
-            logger.info(personAuthority.getDisplayName());\r
-            // Get a list of the persons in this personAuthority.\r
-            PersonsCommonList items =\r
-               sample.readItemsInPersonAuth(personAuthority.getCsid());\r
-            // For each person ...\r
-            for (PersonsCommonList.PersonListItem\r
-                item : items.getPersonListItem()) {\r
-                // Get its short name.\r
-                logger.info(" " + item.getDisplayName());\r
-            }\r
-        }\r
-\r
-        // Sample alternate methods of reading all personAuthorities and\r
-        // persons separately.\r
-        boolean RUN_ADDITIONAL_SAMPLES = false;\r
-        if (RUN_ADDITIONAL_SAMPLES) {\r
-\r
-            logger.info("Reading all personAuthorities ...");\r
-            details = sample.displayAllPersonAuthorities(personAuthorities);\r
-            logger.info(details);\r
-\r
-            logger.info("Reading all persons ...");\r
-            personAuthIds = sample.readPersonAuthorityIds(personAuthorities);\r
-            for (String personAuthId : personAuthIds) {\r
-                PersonsCommonList items = sample.readItemsInPersonAuth(personAuthId);\r
-                details = sample.displayAllPersons(items);\r
-                logger.info(details);\r
-            }\r
-\r
-        }\r
-\r
-       }\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c)) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.collectionspace.services.person.client.sample;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+
+import org.apache.log4j.BasicConfigurator;
+import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonAuthorityClientUtils;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.person.PersonauthoritiesCommon;
+import org.collectionspace.services.person.PersonauthoritiesCommonList;
+import org.collectionspace.services.person.PersonsCommon;
+import org.collectionspace.services.person.PersonsCommonList;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.multipart.InputPart;
+import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * PersonAuthority Sample, carries out tests against a
+ * deployed and running PersonAuthority Service.
+ *
+ * $LastChangedRevision: 1055 $
+ * $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $
+ */
+public class Sample {
+    private static final Logger logger =
+        LoggerFactory.getLogger(Sample.class);
+
+    // Instance variables specific to this test.
+    private PersonAuthorityClient client = new PersonAuthorityClient();
+    final String SERVICE_PATH_COMPONENT = "persons";
+    final String ITEM_SERVICE_PATH_COMPONENT = "items";
+
+
+    // ---------------------------------------------------------------
+    // Create
+    // ---------------------------------------------------------------
+
+    public void createPersonAuthority(String personAuthorityName, 
+               List<Map<String, String>> personMaps ) {
+
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+
+       logger.info("Import: Create personAuthority: \"" + personAuthorityName +"\"");
+
+
+        String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: Laramie20100728 temp fix, made-up displaySuffix.
+        String basePersonRefName = PersonAuthorityClientUtils.createPersonAuthRefName(personAuthorityName, displaySuffix);//TODO: Laramie20100728 temp fix  was personAuthorityName, false
+       String fullPersonRefName = PersonAuthorityClientUtils.createPersonAuthRefName(personAuthorityName, displaySuffix); //TODO: Laramie20100728 temp fix  was personAuthorityName, true
+       PoxPayloadOut multipart = 
+               PersonAuthorityClientUtils.createPersonAuthorityInstance(
+                               personAuthorityName, fullPersonRefName, client.getCommonPartName() );
+       ClientResponse<Response> res = client.create(multipart);
+
+       int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not create enumeration: \""+personAuthorityName
+                               +"\" "+ PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when creating enumeration: \""
+                               +personAuthorityName +"\", Status:"+ statusCode);
+       }
+
+       // Store the ID returned from this create operation
+       // for additional tests below.
+       String newPersonAuthId = PersonAuthorityClientUtils.extractId(res);
+        logger.info("Import: Created personAuthority: \"" + personAuthorityName +"\" ID:"
+                               +newPersonAuthId );
+        
+        // Add items to the personAuthority
+       for(Map<String,String> personMap : personMaps){
+               createItemInAuthority(newPersonAuthId, basePersonRefName, personMap);
+       }
+        
+    }
+    
+    private String createItemInAuthority(String vcsid, 
+               String personAuthorityRefName, Map<String,String> personMap) {
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+       String foreName = personMap.get(PersonJAXBSchema.FORE_NAME);
+       String middleName = personMap.get(PersonJAXBSchema.MIDDLE_NAME);
+       String surName = personMap.get(PersonJAXBSchema.SUR_NAME);
+        String birthDate = personMap.get(PersonJAXBSchema.BIRTH_DATE);
+        String deathDate = personMap.get(PersonJAXBSchema.DEATH_DATE);
+       StringBuilder builtName = new StringBuilder();
+       if(foreName!=null)
+               builtName.append(foreName);
+       if(middleName!=null)
+               builtName.append(middleName);
+       if(surName!=null)
+               builtName.append(surName);
+        if(birthDate!=null)
+             builtName.append(birthDate);
+        builtName.append("-");
+        if(deathDate!=null)
+             builtName.append(deathDate);
+
+        String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: Laramie20100728 temp fix, made-up displaySuffix.
+
+       String refName = PersonAuthorityClientUtils.createPersonRefName(personAuthorityRefName, builtName.toString(), displaySuffix); //TODO was ...,true);
+       logger.info("Import: Create Item: \""+refName+"\" in personAuthority: \"" + personAuthorityRefName +"\"");
+
+       if(logger.isDebugEnabled()){
+               logger.debug("Import: Create Item: \""+builtName.toString()
+                               +"\" in personAuthorityulary: \"" + personAuthorityRefName +"\"");
+       }
+       PoxPayloadOut multipart = createPersonInstance( vcsid, refName,
+                       personMap );
+       ClientResponse<Response> res = client.createItem(vcsid, multipart);
+
+       int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not create Item: \""+refName
+                               +"\" in personAuthority: \"" + personAuthorityRefName
+                               +"\" "+ PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when creating Item: \""+refName
+                               +"\" in personAuthority: \"" + personAuthorityRefName +"\", Status:"+ statusCode);
+       }
+
+       return PersonAuthorityClientUtils.extractId(res);
+    }
+
+
+   // ---------------------------------------------------------------
+   // Read
+   // ---------------------------------------------------------------
+
+   private PersonauthoritiesCommonList readPersonAuthorities() {
+
+        // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;
+
+        // Submit the request to the service and store the response.
+        ClientResponse<PersonauthoritiesCommonList> res = client.readList();
+        PersonauthoritiesCommonList list = res.getEntity();
+
+        int statusCode = res.getStatus();
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not read list of personAuthorities: "
+                + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when reading " +
+                "list of personAuthorities, Status:"+ statusCode);
+       }
+
+        return list;
+   }
+
+    private List<String> readPersonAuthorityIds(PersonauthoritiesCommonList list) {
+
+        List<String> ids = new ArrayList<String>();
+        List<PersonauthoritiesCommonList.PersonauthorityListItem> personAuthorities =
+            list.getPersonauthorityListItem();
+        for (PersonauthoritiesCommonList.PersonauthorityListItem personAuthority : personAuthorities) {
+            ids.add(personAuthority.getCsid());
+        }
+        return ids;
+   }
+    
+   private PersonauthoritiesCommon readPersonAuthority(String personAuthId) {
+
+        // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;
+
+        // Submit the request to the service and store the response.
+        PersonauthoritiesCommon personAuthority = null;
+        try {
+            ClientResponse<String> res = client.read(personAuthId);
+            int statusCode = res.getStatus();
+            if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                throw new RuntimeException("Could not read personAuthority"
+                    + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+            }
+            if(statusCode != EXPECTED_STATUS_CODE) {
+                throw new RuntimeException("Unexpected Status when reading " +
+                    "personAuthority, Status:"+ statusCode);
+            }
+            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+            personAuthority = (PersonauthoritiesCommon) extractPart(input,
+                    client.getCommonPartName(), PersonauthoritiesCommon.class);
+        } catch (Exception e) {
+            throw new RuntimeException("Could not read personAuthority: ", e);
+        }
+
+        return personAuthority;
+    }
+
+    private PersonsCommonList readItemsInPersonAuth(String personAuthId) {
+
+        // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;
+
+        // Submit the request to the service and store the response.
+        ClientResponse<PersonsCommonList> res = client.readItemList(personAuthId, "", ""); //TODO: Laramie201007289  added empty strings to satisfy api
+        PersonsCommonList list = res.getEntity();
+
+        int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not read items in personAuthority: "
+                + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when reading " +
+                "items in personAuthority, Status:"+ statusCode);
+       }
+
+        return list;
+    }
+
+    private List<String> readPersonIds(PersonsCommonList list) {
+
+        List<String> ids = new ArrayList<String>();
+        List<PersonsCommonList.PersonListItem> items =
+            list.getPersonListItem();
+        for (PersonsCommonList.PersonListItem item : items) {
+            ids.add(item.getCsid());
+        }
+        return ids;
+   }
+
+    // ---------------------------------------------------------------
+    // Delete
+    // ---------------------------------------------------------------
+
+    private void deletePersonAuthority(String vcsid) {
+         // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;
+
+        ClientResponse<Response> res = client.delete(vcsid);
+        int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not delete personAuthority: "
+                + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when deleting " +
+                "personAuthority, Status:"+ statusCode);
+       }
+    }
+
+    private void deleteAllPersonAuthorities() {
+        List<String> ids = readPersonAuthorityIds(readPersonAuthorities());
+        for (String id : ids) {
+            deletePersonAuthority(id);
+        }
+    }
+
+        private void deletePerson(String vcsid, String itemcsid) {
+         // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;
+
+        ClientResponse<Response> res = client.deleteItem(vcsid, itemcsid);
+        int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not delete personAuthority item: "
+                + PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when deleting " +
+                "personAuthority item, Status:"+ statusCode);
+       }
+    }
+
+    private void deleteAllItemsForPersonAuth(String personAuthId) {
+        List<String> itemIds = readPersonIds(readItemsInPersonAuth(personAuthId));
+        for (String itemId : itemIds) {
+            deletePerson(personAuthId, itemId);
+        }
+    }
+
+    // ---------------------------------------------------------------
+    // Utility methods used by tests above
+    // ---------------------------------------------------------------
+
+    /*
+    private PoxPayloadOut createPersonAuthorityInstance(
+               String displayName, String refName ) {
+        PersonauthoritiesCommon personAuthority = new PersonauthoritiesCommon();
+        personAuthority.setDisplayName(displayName);
+        personAuthority.setRefName(refName);
+        personAuthority.setVocabType("PersonAuthority");
+        PoxPayloadOut multipart = new PoxPayloadOut();
+        OutputPart commonPart = multipart.addPart(personAuthority, MediaType.APPLICATION_XML_TYPE);
+        commonPart.getHeaders().add("label", client.getCommonPartName());
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, personAuthority common ",
+                                       personAuthority, PersonauthoritiesCommon.class);
+        }
+
+        return multipart;
+    }
+    */
+
+    private PoxPayloadOut createPersonInstance(String inAuthority, 
+               String refName, Map<String, String> personInfo ) {
+            PersonsCommon person = new PersonsCommon();
+            person.setInAuthority(inAuthority);
+               person.setRefName(refName);
+               String value = null;
+            if((value = (String)personInfo.get(PersonJAXBSchema.FORE_NAME))!=null)
+               person.setForeName(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.MIDDLE_NAME))!=null)
+               person.setMiddleName(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.SUR_NAME))!=null)
+               person.setSurName(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.INITIALS))!=null)
+               person.setInitials(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.SALUTATIONS))!=null)
+               person.setSalutation(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.TITLE))!=null)
+               person.setTitle(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.NAME_ADDITIONS))!=null)
+               person.setNameAdditions(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.BIRTH_DATE))!=null) {
+                StructuredDateGroup birthDate = new StructuredDateGroup();
+                birthDate.setDateDisplayDate(value);
+                person.setBirthDateGroup(birthDate);
+            }
+            if((value = (String)personInfo.get(PersonJAXBSchema.DEATH_DATE))!=null) {
+                StructuredDateGroup deathDate = new StructuredDateGroup();
+                deathDate.setDateDisplayDate(value);
+                person.setDeathDateGroup(deathDate);
+            }
+            if((value = (String)personInfo.get(PersonJAXBSchema.BIRTH_PLACE))!=null)
+               person.setBirthPlace(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.DEATH_PLACE))!=null)
+               person.setDeathPlace(value);
+
+            /* TODO: Laramie20100728  removed missing member calls
+            if((value = (String)personInfo.get(PersonJAXBSchema.GROUP))!=null)
+               person.setGroup(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.NATIONALITY))!=null)
+               person.setNationality(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.OCCUPATION))!=null)
+               person.setOccupation(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.SCHOOL_OR_STYLE))!=null)
+               person.setSchoolOrStyle(value);
+            */
+        
+            if((value = (String)personInfo.get(PersonJAXBSchema.GENDER))!=null)
+                        person.setGender(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.BIO_NOTE))!=null)
+               person.setBioNote(value);
+            if((value = (String)personInfo.get(PersonJAXBSchema.NAME_NOTE))!=null)
+               person.setNameNote(value);
+            PoxPayloadOut multipart = new PoxPayloadOut();
+            OutputPart commonPart = multipart.addPart(person,
+                MediaType.APPLICATION_XML_TYPE);
+            commonPart.getHeaders().add("label", client.getItemCommonPartName());
+
+            if(logger.isDebugEnabled()){
+                logger.debug("to be created, person common"+person);
+            }
+
+            return multipart;
+        }
+
+    // Retrieve individual fields of personAuthority records.
+
+    private String displayAllPersonAuthorities(PersonauthoritiesCommonList list) {
+        StringBuffer sb = new StringBuffer();
+            List<PersonauthoritiesCommonList.PersonauthorityListItem> personAuthorities =
+                    list.getPersonauthorityListItem();
+            int i = 0;
+        for (PersonauthoritiesCommonList.PersonauthorityListItem personAuthority : personAuthorities) {
+            sb.append("personAuthority [" + i + "]" + "\n");
+            sb.append(displayPersonAuthorityDetails(personAuthority));
+            i++;
+        }
+        return sb.toString();
+    }
+
+    private String displayPersonAuthorityDetails(
+        PersonauthoritiesCommonList.PersonauthorityListItem personAuthority) {
+            StringBuffer sb = new StringBuffer();
+            sb.append("displayName=" + personAuthority.getDisplayName() + "\n");
+            sb.append("vocabType=" + personAuthority.getVocabType() + "\n");
+            // sb.append("csid=" + personAuthority.getCsid() + "\n");
+            sb.append("URI=" + personAuthority.getUri() + "\n");
+        return sb.toString();
+    }
+
+    // Retrieve individual fields of person records.
+
+    private String displayAllPersons(PersonsCommonList list) {
+        StringBuffer sb = new StringBuffer();
+        List<PersonsCommonList.PersonListItem> items =
+                list.getPersonListItem();
+        int i = 0;
+        for (PersonsCommonList.PersonListItem item : items) {
+            sb.append("person [" + i + "]" + "\n");
+            sb.append(displayPersonDetails(item));
+            i++;
+        }
+        return sb.toString();
+    }
+
+    private String displayPersonDetails(
+        PersonsCommonList.PersonListItem item) {
+            StringBuffer sb = new StringBuffer();
+            sb.append("csid=" + item.getCsid() + "\n");
+            sb.append("displayName=" + item.getDisplayName() + "\n");
+            // sb.append("URI=" + item.getUri() + "\n");
+        return sb.toString();
+    }
+
+    private Object extractPart(PoxPayloadIn input, String label,
+        Class clazz) throws Exception {
+        Object obj = null;
+        for(InputPart part : input.getParts()){
+            String partLabel = part.getHeaders().getFirst("label");
+            if(label.equalsIgnoreCase(partLabel)){
+                String partStr = part.getBodyAsString();
+                if(logger.isDebugEnabled()){
+                    logger.debug("extracted part str=\n" + partStr);
+                }
+                obj = part.getBody(clazz, null);
+                if(logger.isDebugEnabled()){
+                    logger.debug("extracted part obj=\n", obj, clazz);
+                }
+                break;
+            }
+        }
+        return obj;
+    }
+
+       public static void main(String[] args) {
+
+        // Configure logging.
+               BasicConfigurator.configure();
+
+        logger.info("PersonAuthority Sample starting...");
+
+               Sample sample = new Sample();
+        PersonauthoritiesCommonList personAuthorities;
+        List<String> personAuthIds;
+        String details = "";
+
+        // Optionally delete all personAuthorities and persons.
+
+        boolean ENABLE_DELETE_ALL = false;
+        if (ENABLE_DELETE_ALL) {
+
+            logger.info("Deleting all persons and personAuthorities ...");
+
+            // For each personAuthority ...
+            personAuthorities = sample.readPersonAuthorities();
+            personAuthIds = sample.readPersonAuthorityIds(personAuthorities);
+            for (String personAuthId : personAuthIds) {
+                logger.info("Deleting all persons for personAuthority ...");
+                sample.deleteAllItemsForPersonAuth(personAuthId);
+                logger.info("Deleting personAuthority ...");
+                sample.deletePersonAuthority(personAuthId);
+            }
+
+            logger.info("Reading personAuthorities after deletion ...");
+            personAuthorities = sample.readPersonAuthorities();
+            details = sample.displayAllPersonAuthorities(personAuthorities);
+            logger.info(details);
+
+            logger.info("Reading items in each personAuthority after deletion ...");
+            personAuthIds = sample.readPersonAuthorityIds(personAuthorities);
+            for (String personAuthId : personAuthIds) {
+                PersonsCommonList items = sample.readItemsInPersonAuth(personAuthId);
+                details = sample.displayAllPersons(items);
+                logger.info(details);
+            }
+
+        }
+
+        // Create new authorities, each populated with persons.
+
+        Map<String, String> johnWayneMap = new HashMap<String,String>();
+        johnWayneMap.put(PersonJAXBSchema.FORE_NAME, "John");
+        johnWayneMap.put(PersonJAXBSchema.SUR_NAME, "Wayne");
+        johnWayneMap.put(PersonJAXBSchema.GENDER, "male");
+        Map<String, String> patrickSchmitzMap = new HashMap<String,String>();
+        patrickSchmitzMap.put(PersonJAXBSchema.FORE_NAME, "Patrick");
+        patrickSchmitzMap.put(PersonJAXBSchema.SUR_NAME, "Schmitz");
+        patrickSchmitzMap.put(PersonJAXBSchema.GENDER, "male");
+        Map<String, String> janeDoeMap = new HashMap<String,String>();
+        janeDoeMap.put(PersonJAXBSchema.FORE_NAME, "Jane");
+        janeDoeMap.put(PersonJAXBSchema.SUR_NAME, "Doe");
+        janeDoeMap.put(PersonJAXBSchema.GENDER, "female");
+        List<Map<String, String>> personsMaps = 
+               Arrays.asList(johnWayneMap, patrickSchmitzMap, janeDoeMap );
+        
+        sample.createPersonAuthority("Sample Person Auth", personsMaps);
+
+               logger.info("PersonAuthority Sample complete.");
+
+        logger.info("Reading personAuthorities and items ...");
+        // Get a list of personAuthorities.
+        personAuthorities = sample.readPersonAuthorities();
+        // For each personAuthority ...
+        for (PersonauthoritiesCommonList.PersonauthorityListItem
+            personAuthority : personAuthorities.getPersonauthorityListItem()) {
+            // Get its display name.
+            logger.info(personAuthority.getDisplayName());
+            // Get a list of the persons in this personAuthority.
+            PersonsCommonList items =
+               sample.readItemsInPersonAuth(personAuthority.getCsid());
+            // For each person ...
+            for (PersonsCommonList.PersonListItem
+                item : items.getPersonListItem()) {
+                // Get its short name.
+                logger.info(" " + item.getDisplayName());
+            }
+        }
+
+        // Sample alternate methods of reading all personAuthorities and
+        // persons separately.
+        boolean RUN_ADDITIONAL_SAMPLES = false;
+        if (RUN_ADDITIONAL_SAMPLES) {
+
+            logger.info("Reading all personAuthorities ...");
+            details = sample.displayAllPersonAuthorities(personAuthorities);
+            logger.info(details);
+
+            logger.info("Reading all persons ...");
+            personAuthIds = sample.readPersonAuthorityIds(personAuthorities);
+            for (String personAuthId : personAuthIds) {
+                PersonsCommonList items = sample.readItemsInPersonAuth(personAuthId);
+                details = sample.displayAllPersons(items);
+                logger.info(details);
+            }
+
+        }
+
+       }
+
+}
index 429b9f6fe2fb8a87a0dab86aabfdc482b881a740..9270810347f6e81eea603c15eb9699e1cffd2881 100644 (file)
@@ -1,6 +1,6 @@
-#url of the collectionspace server\r
-cspace.url=http://localhost:8180/cspace-services/\r
-cspace.ssl=false\r
-cspace.auth=false\r
-cspace.user=test\r
+#url of the collectionspace server
+cspace.url=http://localhost:8180/cspace-services/
+cspace.ssl=false
+cspace.auth=false
+cspace.user=test
 cspace.password=test
\ No newline at end of file
index f3969c91a8019604066833edd981fd8865033e50..708c1601bc233271c7910940ea7b20de58f3e54b 100644 (file)
@@ -1,38 +1,38 @@
-<?xml version="1.0" encoding="UTF-8" ?>\r
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">\r
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">\r
-\r
-       <appender name="console" class="org.apache.log4j.ConsoleAppender">\r
-               <param name="Target" value="System.out" />\r
-               <layout class="org.apache.log4j.TTCCLayout">\r
-                       <param name="DateFormat" value="ISO8601" />\r
-               </layout>\r
-       </appender>\r
-\r
-       <logger name="org.apache.commons.httpclient" additivity="false">\r
-               <level value="warn" />\r
-               <appender-ref ref="console" />\r
-       </logger>\r
-\r
-       <logger name="httpclient.wire" additivity="false">\r
-               <level value="info" />\r
-               <appender-ref ref="console" />\r
-       </logger>\r
-\r
-<!--\r
-       <logger name="org.collectionspace.services.person.client.sample.Sample" additivity="false">\r
-               <level value="debug" />\r
-               <appender-ref ref="console" />\r
-       </logger>\r
--->\r
-\r
-       <root>\r
-               <priority value="debug" />\r
-               <appender-ref ref="console" />\r
-       </root>\r
-\r
-</log4j:configuration>\r
-\r
-\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+       <appender name="console" class="org.apache.log4j.ConsoleAppender">
+               <param name="Target" value="System.out" />
+               <layout class="org.apache.log4j.TTCCLayout">
+                       <param name="DateFormat" value="ISO8601" />
+               </layout>
+       </appender>
+
+       <logger name="org.apache.commons.httpclient" additivity="false">
+               <level value="warn" />
+               <appender-ref ref="console" />
+       </logger>
+
+       <logger name="httpclient.wire" additivity="false">
+               <level value="info" />
+               <appender-ref ref="console" />
+       </logger>
+
+<!--
+       <logger name="org.collectionspace.services.person.client.sample.Sample" additivity="false">
+               <level value="debug" />
+               <appender-ref ref="console" />
+       </logger>
+-->
+
+       <root>
+               <priority value="debug" />
+               <appender-ref ref="console" />
+       </root>
+
+</log4j:configuration>
+
+
+
+
index 7682b55cce5288800bdaf2ca28b20887f53edbdc..c9d879cf80cbc49aeb15fcf9b50f67dfc460fba1 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.person</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.person.service</artifactId>\r
-    <name>services.person.service</name>\r
-    <packaging>jar</packaging>\r
-    \r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-<!-- CollectionSpace dependencies -->        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.contact.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->        \r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- apache -->\r
-        <dependency>\r
-            <groupId>commons-beanutils</groupId>\r
-            <artifactId>commons-beanutils</artifactId>\r
-            <version>1.6.1</version>\r
-        </dependency>\r
-        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->\r
-        <dependency>\r
-            <groupId>commons-logging</groupId>\r
-            <artifactId>commons-logging</artifactId>\r
-            <version>1.1</version>\r
-        </dependency>\r
-      <!-- javax -->\r
-\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-person</finalName>\r
-        <plugins>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.person.service</artifactId>
+    <name>services.person.service</name>
+    <packaging>jar</packaging>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+<!-- CollectionSpace dependencies -->        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+        <!-- apache -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+        </dependency>
+      <!-- javax -->
+
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-person</finalName>
+        <plugins>
+        </plugins>
+    </build>
+</project>
+
index d8f291998b83cb5e57273cbcdd6b0a69867b82e5..a225f00dbd3f7ae6b600dda5716d0140d1027d69 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 03ef415b14e5bf7c227cfd224e3ddc46fb585d61..e5cc78d3762d55dbfad04e433cfad12412523d3f 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.query</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.query</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d2eb8b0c1d003ce63452216d7e0fa420a473bd94..dd72f1a2d907819f6d9c4a6a4d182ddaa1c0849b 100644 (file)
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.query</artifactId>\r
-    <name>services.query</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <modules>\r
-        <module>service</module>\r
-    </modules>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.query</artifactId>
+    <name>services.query</name>
+    <packaging>pom</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <modules>
+        <module>service</module>
+    </modules>
+
+</project>
+
index 51a66b30a133bdefb9f2d7003edbd112e2540e0c..c1dbcf5ccfafce0cccddbc3721d21018a1ff6287 100644 (file)
@@ -1,91 +1,91 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.query</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.query.service</artifactId>\r
-    <name>services.query.service</name>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- apache -->\r
-        <dependency>\r
-            <groupId>commons-beanutils</groupId>\r
-            <artifactId>commons-beanutils</artifactId>\r
-            <version>1.6.1</version>\r
-        </dependency>\r
-        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->\r
-        <dependency>\r
-            <groupId>commons-logging</groupId>\r
-            <artifactId>commons-logging</artifactId>\r
-            <version>1.1</version>\r
-        </dependency>\r
-\r
-      <!-- javax -->\r
-\r
-<!--         <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>  -->\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>jaxrs-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-query</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.query</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.query.service</artifactId>
+    <name>services.query.service</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+        <!-- apache -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+        </dependency>
+
+      <!-- javax -->
+
+<!--         <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <scope>provided</scope>
+        </dependency>  -->
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>jaxrs-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-query</finalName>
+    </build>
+</project>
+
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 666fb035bf39ed2841432f82d1854ca7d0fe498e..09f14dc9c4f3bc77e50009d2bec78f893d20cb56 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.relation</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.relation</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index d7501e2c414b1a2ce2d6897a7845b083f8d5a48f..b8a2888f85c05af58ffc1b59f294ca0bacb70267 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 21a9fcf9e93bc5a5a6947a130509808ffb3d3d9b..51f850bc9cdc009a32d1f777b30629f5e5e0fc0c 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.relation.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.relation.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index a377252d3623b1ce2791c9a0234d278519831606..0b72b72d5abea18f1bf59671985739cc8cc07803 100644 (file)
-\r
-<project name="relation.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        relation service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy relation in ${jee.server.nuxeo}">\r
-        <ant antfile="nuxeo-platform-cs-relation/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy relation from ${jee.server.nuxeo}">\r
-        <ant antfile="nuxeo-platform-cs-relation/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for relation" depends="package">\r
-        <ant antfile="nuxeo-platform-cs-relation/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-\r
-</project>\r
+
+<project name="relation.3rdparty" default="package" basedir=".">
+    <description>
+        relation service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+
+    </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 relation in ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-relation/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy relation from ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-relation/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for relation" depends="package">
+        <ant antfile="nuxeo-platform-cs-relation/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+
+</project>
index d2906b474e470efbfefb5b8671cdf35c3c5cf24e..275650b20dea5ef45c5d9f370f99c188a10d4b43 100644 (file)
-\r
-<project name="nuxeo-platform-cs-relation" default="package" basedir=".">\r
-    <description>\r
-        relation nuxeo document type\r
-    </description>\r
-    <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../../.."/>\r
-    <!-- environment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="nuxeo.relation.jar"\r
-        value="org.collectionspace.services.relation.3rdparty.nuxeo-${cspace.release}.jar"/>\r
-    <property name="nuxeo.relation.jars.all"\r
-        value="org.collectionspace.services.relation.3rdparty.nuxeo-*.jar"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-        <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-        description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-        description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-        description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy relation doctype in ${jee.server.cspace}">\r
-        <copy file="${basedir}/target/${nuxeo.relation.jar}"\r
-        todir="${jee.deploy.nuxeo.plugins}"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="undeploy relation doctype from ${jee.server.cspace}">\r
-        <delete>\r
-            <fileset dir="${jee.deploy.nuxeo.plugins}">\r
-                <include name="${nuxeo.relation.jars.all}"/>\r
-            </fileset>\r
-        </delete>\r
-    </target>\r
-\r
-    <target name="dist"\r
-        description="generate distribution for relation doctype" depends="package">\r
-        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">\r
-            <fileset file="${basedir}/target/${nuxeo.relation.jar}"/>\r
-        </copy>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="nuxeo-platform-cs-relation" default="package" basedir=".">
+    <description>
+        relation nuxeo document type
+    </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="-V" />
+    <property name="src" location="src"/>
+    <property name="nuxeo.relation.jar"
+        value="org.collectionspace.services.relation.3rdparty.nuxeo-${cspace.release}.jar"/>
+    <property name="nuxeo.relation.jars.all"
+        value="org.collectionspace.services.relation.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/>
+    </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 relation doctype in ${jee.server.cspace}">
+        <copy file="${basedir}/target/${nuxeo.relation.jar}"
+        todir="${jee.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy relation doctype from ${jee.server.cspace}">
+        <delete>
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.relation.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+    <target name="dist"
+        description="generate distribution for relation doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.relation.jar}"/>
+        </copy>
+    </target>
+
+</project>
index e41188208f0afe66b0cd678d093f7b82ecbd5d4b..8db284a39a190165ad4c15eabb45ab37fceccda6 100644 (file)
@@ -1,42 +1,42 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-  <parent>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.relation.3rdparty</artifactId>\r
-    <version>4.2-SNAPSHOT</version>\r
-  </parent>\r
-\r
-  <modelVersion>4.0.0</modelVersion>\r
-  <groupId>org.collectionspace.services</groupId>\r
-  <artifactId>org.collectionspace.services.relation.3rdparty.nuxeo</artifactId>\r
-  <name>services.relation.3rdparty.nuxeo</name>\r
-  <packaging>jar</packaging>\r
-  <description>\r
-    CollectionSpace relation Nuxeo document type.\r
-  </description>\r
-\r
-  <build>\r
-       <resources>\r
-            <resource>\r
-                <directory>src/main/resources</directory>\r
-                <filtering>true</filtering>\r
-            </resource>\r
-               </resources>\r
-    <plugins>\r
-      <plugin>\r
-        <groupId>org.apache.maven.plugins</groupId>\r
-        <artifactId>maven-jar-plugin</artifactId>\r
-        <configuration>\r
-          <archive>\r
-            <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>\r
-            <manifestEntries>\r
-              <Bundle-Version>${eclipseVersion}</Bundle-Version>\r
-              <Bundle-ManifestVersion>2</Bundle-ManifestVersion>\r
-            </manifestEntries>\r
-          </archive>\r
-        </configuration>\r
-      </plugin>\r
-    </plugins>\r
-  </build>\r
-</project>\r
+<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.relation.3rdparty</artifactId>
+    <version>4.2-SNAPSHOT</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.collectionspace.services</groupId>
+  <artifactId>org.collectionspace.services.relation.3rdparty.nuxeo</artifactId>
+  <name>services.relation.3rdparty.nuxeo</name>
+  <packaging>jar</packaging>
+  <description>
+    CollectionSpace relation Nuxeo document type.
+  </description>
+
+  <build>
+       <resources>
+            <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> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
+            <manifestEntries>
+              <Bundle-Version>${eclipseVersion}</Bundle-Version>
+              <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+            </manifestEntries>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
index 180b0bd15f4f6f9df2843e697f5de0411faddefe..0ad9895f8b0a2fa6e14ce1088b33f245d06c8cad 100644 (file)
@@ -1,23 +1,23 @@
-Manifest-Version: 1.0 \r
-Bundle-ManifestVersion: 1 \r
-Bundle-Name: nuxeo-platform-cs-relation\r
-Bundle-SymbolicName: org.collectionspace.relation;singleton:=true\r
-Bundle-Version: 1.0.0\r
-Bundle-Localization: plugin\r
-Bundle-Vendor: Nuxeo \r
-Require-Bundle: org.nuxeo.runtime, \r
- org.nuxeo.ecm.core.api, \r
- org.nuxeo.ecm.core,\r
- org.nuxeo.ecm.core.api,\r
- org.nuxeo.ecm.platform.types.api,\r
- org.nuxeo.ecm.platform.versioning.api,\r
- org.nuxeo.ecm.platform.ui,\r
- org.nuxeo.ecm.platform.forms.layout.client,\r
- org.nuxeo.ecm.platform.ws,\r
- org.collectionspace.collectionspace_core\r
-Provide-Package: org.collectionspace.relation\r
-Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
- OSGI-INF/life-cycle-contrib.xml,\r
- OSGI-INF/ecm-types-contrib.xml,\r
- OSGI-INF/layouts-contrib.xml\r
-\r
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: nuxeo-platform-cs-relation
+Bundle-SymbolicName: org.collectionspace.relation;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.relation
+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
+
index 359946fc1bff5b3dc3f70bd255576a42ff0db80c..4840c01df608e398ec32499b0af6f3e76da623ff 100644 (file)
@@ -1,71 +1,71 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!-- Relation schema (XSD) Entity : Relation Part : Common Used for: Nuxeo \r
-       EP core document type $LastChangedRevision$ $LastChangedDate$ -->\r
-\r
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://collectionspace.org/relation/"\r
-       xmlns:rel="http://collectionspace.org/relation/" targetNamespace="http://collectionspace.org/relation/"\r
-       version="0.1">\r
-\r
-       <!-- Note: nuxeo ecm types does not support xs:anyURI type -->\r
-       <!-- if xs:anyURI is used, it fails to register that doctype -->\r
-\r
-       <!-- conventions for describing relationships -->\r
-       <!-- 1. left to right in alphabetical order for the association relations -->\r
-       <!-- e.g. for association between collectionobject and intake entities -->\r
-       <!-- document-id-1 would be the id of the collectionobject -->\r
-       <!-- document-type-1 would be the doc-type of the collectionobject -->\r
-       <!-- document-id-2 would be the id of the intake -->\r
-       <!-- document-type-2 would be the doc-type of the intake -->\r
-       <!-- 2. left to right container and containee or children -->\r
-       <!-- e.g. for collectionobject containing other collectionobjects -->\r
-       <!-- document-id-1 would be the id of the container collectionobject -->\r
-       <!-- document-type-1 would be the doc-type of the container collectionobject -->\r
-       <!-- document-id-2 would be the id of the contained (or child) collectionobject -->\r
-       <!-- document-type-2 would be the doc-type of the collectionobejct -->\r
-       \r
-       <xs:element name="subjectCsid" type="xs:string" minOccurs="1"\r
-               maxOccurs="1" />     <!-- new name for documentId1 -->\r
-       <xs:element name="subjectDocumentType" type="xs:string"\r
-               minOccurs="1" maxOccurs="1" />     <!-- new name for documentType1 -->\r
-       <xs:element name="subjectUri" type="xs:string" />\r
-       <xs:element name="subjectRefName" type="xs:string" />\r
-        \r
-        <!-- type of relationship between two entities -->\r
-       <xs:element name="relationshipType" type="rel:RelationshipType"\r
-               minOccurs="1" maxOccurs="1" />\r
-        <xs:element name="relationshipMetaType" type="xs:string" minOccurs="0"/>\r
-       <xs:element name="predicate" type="rel:RelationshipType"\r
-               minOccurs="1" maxOccurs="1" />   <!-- new name for relationshipType -->\r
-       <xs:element name="predicateDisplayName" type="xs:string"\r
-               minOccurs="1" />\r
-\r
-       <xs:element name="objectCsid" type="xs:string" minOccurs="1"\r
-               maxOccurs="1" />        <!-- new name for documentId2 -->\r
-       <xs:element name="objectDocumentType" type="xs:string"\r
-               minOccurs="1" maxOccurs="1" />        <!-- new name for documentType2 -->\r
-       <xs:element name="objectUri" type="xs:string" />\r
-       <xs:element name="objectRefName" type="xs:string" />\r
-\r
-       <!-- enumeration defining the type of relationship between two entities -->\r
-       <xs:simpleType name="RelationshipType">\r
-               <xs:restriction base="xs:string">\r
-                       <!-- document with id as document-id-1 is associated with document with \r
-                               id as document-id-2 -->\r
-                       <xs:enumeration value="association" />\r
-                       <!-- document with id as document-id-1 contains one or more document with \r
-                               id as document-id-2 -->\r
-                       <xs:enumeration value="contains" />\r
-                       <!-- document with id as document-id-1 has parent document with id as \r
-                               document-id-2 -->\r
-                       <xs:enumeration value="hasBroader" />\r
-               </xs:restriction>\r
-       </xs:simpleType>\r
-\r
-</xs:schema>\r
-\r
-\r
-\r
-\r
-\r
-\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!-- Relation schema (XSD) Entity : Relation Part : Common Used for: Nuxeo 
+       EP core document type $LastChangedRevision$ $LastChangedDate$ -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://collectionspace.org/relation/"
+       xmlns:rel="http://collectionspace.org/relation/" targetNamespace="http://collectionspace.org/relation/"
+       version="0.1">
+
+       <!-- Note: nuxeo ecm types does not support xs:anyURI type -->
+       <!-- if xs:anyURI is used, it fails to register that doctype -->
+
+       <!-- conventions for describing relationships -->
+       <!-- 1. left to right in alphabetical order for the association relations -->
+       <!-- e.g. for association between collectionobject and intake entities -->
+       <!-- document-id-1 would be the id of the collectionobject -->
+       <!-- document-type-1 would be the doc-type of the collectionobject -->
+       <!-- document-id-2 would be the id of the intake -->
+       <!-- document-type-2 would be the doc-type of the intake -->
+       <!-- 2. left to right container and containee or children -->
+       <!-- e.g. for collectionobject containing other collectionobjects -->
+       <!-- document-id-1 would be the id of the container collectionobject -->
+       <!-- document-type-1 would be the doc-type of the container collectionobject -->
+       <!-- document-id-2 would be the id of the contained (or child) collectionobject -->
+       <!-- document-type-2 would be the doc-type of the collectionobejct -->
+       
+       <xs:element name="subjectCsid" type="xs:string" minOccurs="1"
+               maxOccurs="1" />     <!-- new name for documentId1 -->
+       <xs:element name="subjectDocumentType" type="xs:string"
+               minOccurs="1" maxOccurs="1" />     <!-- new name for documentType1 -->
+       <xs:element name="subjectUri" type="xs:string" />
+       <xs:element name="subjectRefName" type="xs:string" />
+        
+        <!-- type of relationship between two entities -->
+       <xs:element name="relationshipType" type="rel:RelationshipType"
+               minOccurs="1" maxOccurs="1" />
+        <xs:element name="relationshipMetaType" type="xs:string" minOccurs="0"/>
+       <xs:element name="predicate" type="rel:RelationshipType"
+               minOccurs="1" maxOccurs="1" />   <!-- new name for relationshipType -->
+       <xs:element name="predicateDisplayName" type="xs:string"
+               minOccurs="1" />
+
+       <xs:element name="objectCsid" type="xs:string" minOccurs="1"
+               maxOccurs="1" />        <!-- new name for documentId2 -->
+       <xs:element name="objectDocumentType" type="xs:string"
+               minOccurs="1" maxOccurs="1" />        <!-- new name for documentType2 -->
+       <xs:element name="objectUri" type="xs:string" />
+       <xs:element name="objectRefName" type="xs:string" />
+
+       <!-- enumeration defining the type of relationship between two entities -->
+       <xs:simpleType name="RelationshipType">
+               <xs:restriction base="xs:string">
+                       <!-- document with id as document-id-1 is associated with document with 
+                               id as document-id-2 -->
+                       <xs:enumeration value="association" />
+                       <!-- document with id as document-id-1 contains one or more document with 
+                               id as document-id-2 -->
+                       <xs:enumeration value="contains" />
+                       <!-- document with id as document-id-1 has parent document with id as 
+                               document-id-2 -->
+                       <xs:enumeration value="hasBroader" />
+               </xs:restriction>
+       </xs:simpleType>
+
+</xs:schema>
+
+
+
+
+
+
index 21c48302995e091c22de2a33c770efc40a23e136..e01a1353f6b6bb61697cf2e37a1a1127f5e86642 100644 (file)
-\r
-<project name="relation" default="package" basedir=".">\r
-    <description>\r
-        relationship service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy relation service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy relation service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for relation" depends="package">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-\r
-</project>\r
+
+<project name="relation" default="package" basedir=".">
+    <description>
+        relationship service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 relation service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy relation service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for relation" depends="package">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+
+</project>
index f0d47d2971228da27b4cbdc52b6ef46feb73429b..8f0f0d72fecf13c767f5d3873d811c59daceea84 100644 (file)
@@ -1,88 +1,88 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.relation</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.relation.client</artifactId>\r
-    <name>services.relation.client</name>\r
-\r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.client</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-\r
-        <!-- External dependencies -->\r
-\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>cspace-services-relation-client</finalName>\r
-    </build>\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.relation</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.relation.client</artifactId>
+    <name>services.relation.client</name>
+
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.client</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- External dependencies -->
+
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>cspace-services-relation-client</finalName>
+    </build>
+</project>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 6471ecfb43fdbcf760ec55f9798d68be11a54dff..ff21fa67392104ec5704729487464fc16b341b7d 100644 (file)
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.relation</artifactId>\r
-    <name>services.relation</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <modules>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.main</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.relation</artifactId>
+    <name>services.relation</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+
+</project>
+
index 4498491fd5527df6ec9d75c31e2338de2dd92753..f11162d69b77d859bdf8e0d8f25fd5c8201060d0 100644 (file)
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.relation</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.relation.service</artifactId>\r
-    <name>services.relation.service</name>\r
-    <packaging>jar</packaging>\r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.config</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-<!--        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.jaxb</artifactId>\r
-            <version>1.0</version>\r
-        </dependency> -->\r
-        \r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.relation</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.relation.service</artifactId>
+    <name>services.relation.service</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.config</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+<!--        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.relation.jaxb</artifactId>
+            <version>1.0</version>
+        </dependency> -->
+        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         
         <dependency>
             <groupId>org.collectionspace.services</groupId>
             <version>${project.version}</version>
         </dependency>        
         
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.location.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.place.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.work.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.taxonomy.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.concept.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-\r
-      <!-- javax -->\r
-\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-relation</finalName>\r
-    </build>\r
-</project>\r
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.location.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.place.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.work.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.taxonomy.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.concept.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+      <!-- javax -->
+
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-relation</finalName>
+    </build>
+</project>
index c93a8bc1e88e664380e065cd3cf8b9f3c1439bfd..dff09ae20a39463786d7677ee86fb84e93cc0fd4 100644 (file)
-package org.collectionspace.services.relation.nuxeo;\r
-\r
-//import junit.framework.Assert;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.common.document.InvalidDocumentException;\r
-import org.collectionspace.services.common.document.ValidatorHandlerImpl;\r
-import org.collectionspace.services.common.api.RefName.Authority;\r
-import org.collectionspace.services.common.api.RefName.AuthorityItem;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.relation.RelationsCommon;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-//import org.testng.Assert;\r
-\r
-public class RelationValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut>         {\r
-\r
-    /** The logger. */\r
-    private final Logger logger = LoggerFactory.getLogger(RelationValidatorHandler.class);\r
-    /* Error messages \r
-     */\r
-    private static final String VALIDATION_ERROR = "The relation record payload was invalid. See log file for more details.";\r
-    private static final String SUBJECT_EQUALS_OBJECT_ERROR = "The subject ID and object ID cannot be the same.";\r
-    \r
-    @Override\r
-    protected Class<?> getCommonPartClass() {\r
-       return RelationsCommon.class;\r
-    }\r
-    \r
-    @Override\r
-    protected void handleCreate()\r
-               throws InvalidDocumentException{\r
-       try {\r
-               RelationsCommon relationsCommon = (RelationsCommon)getCommonPart();\r
-               CS_ASSERT(relationsCommon != null);\r
-               if (logger.isTraceEnabled() == true) {\r
-                       logger.trace(relationsCommon.toString());\r
-               }\r
-               \r
-            String subjectCsid = relationsCommon.getSubjectCsid();\r
-            String objectCsid = relationsCommon.getObjectCsid();\r
-               \r
-            // If no CSID for a subject or object is included in the create payload,\r
-            // a refName must be provided for that subject or object as an alternate identifier.\r
-            CS_ASSERT(hasCsid(subjectCsid) || hasSubjectRefname(relationsCommon));\r
-            CS_ASSERT(hasCsid(objectCsid) || hasObjectRefname(relationsCommon));\r
-               \r
-            // The Subject identifier and Object ID must not be identical:\r
-            // that is, a resource cannot be related to itself.\r
-            if (hasCsid(subjectCsid) && hasCsid(objectCsid)) {\r
-               CS_ASSERT (subjectCsid.trim().equalsIgnoreCase(objectCsid.trim()) == false,\r
-                        SUBJECT_EQUALS_OBJECT_ERROR);\r
-            }\r
-\r
-            // A relationship type must be provided.\r
-            CS_ASSERT(relationsCommon.getRelationshipType() != null);\r
-\r
-       } catch (AssertionError e) {\r
-               if (logger.isErrorEnabled() == true) {\r
-                       logger.error(e.getMessage(), e);\r
-               }\r
-               throw new InvalidDocumentException(VALIDATION_ERROR, e);\r
-       }\r
-    }\r
-\r
-       @Override\r
-       protected void handleGet() {\r
-               // TODO Auto-generated method stub\r
-       }\r
-\r
-       @Override\r
-       protected void handleGetAll() {\r
-               // TODO Auto-generated method stub\r
-       }\r
-\r
-       @Override\r
-       protected void handleUpdate() {\r
-               // TODO Auto-generated method stub\r
-       }\r
-\r
-       @Override\r
-       protected void handleDelete() {\r
-               // TODO Auto-generated method stub\r
-    }\r
-\r
-    private boolean hasCsid(String csid) {\r
-        boolean hasCsid = false;\r
-        if (Tools.notBlank(csid)) {\r
-            hasCsid = true;\r
-        }\r
-        return hasCsid;\r
-    }\r
-\r
-    private boolean hasSubjectRefname(RelationsCommon relationsCommon) {\r
-        String subjectRefName = relationsCommon.getSubjectRefName();\r
-        return hasRefName(subjectRefName);\r
-    }\r
-\r
-    private boolean hasObjectRefname(RelationsCommon relationsCommon) {\r
-        String objectRefName = relationsCommon.getObjectRefName();\r
-        return hasRefName(objectRefName);\r
-    }\r
-\r
-    private boolean hasRefName(String refName) {\r
-        boolean hasRefname = false;\r
-        if (Tools.isBlank(refName)) {\r
-            return hasRefname;\r
-        } else {\r
-            Authority authority = Authority.parse(refName);\r
-            AuthorityItem authItem = AuthorityItem.parse(refName);\r
-            if (authority != null || authItem != null) {\r
-                hasRefname = true;\r
-            }\r
-            return hasRefname;\r
-        }\r
-\r
-    }\r
-}\r
+package org.collectionspace.services.relation.nuxeo;
+
+//import junit.framework.Assert;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandlerImpl;
+import org.collectionspace.services.common.api.RefName.Authority;
+import org.collectionspace.services.common.api.RefName.AuthorityItem;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.relation.RelationsCommon;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+//import org.testng.Assert;
+
+public class RelationValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut>         {
+
+    /** The logger. */
+    private final Logger logger = LoggerFactory.getLogger(RelationValidatorHandler.class);
+    /* Error messages 
+     */
+    private static final String VALIDATION_ERROR = "The relation record payload was invalid. See log file for more details.";
+    private static final String SUBJECT_EQUALS_OBJECT_ERROR = "The subject ID and object ID cannot be the same.";
+    
+    @Override
+    protected Class<?> getCommonPartClass() {
+       return RelationsCommon.class;
+    }
+    
+    @Override
+    protected void handleCreate()
+               throws InvalidDocumentException{
+       try {
+               RelationsCommon relationsCommon = (RelationsCommon)getCommonPart();
+               CS_ASSERT(relationsCommon != null);
+               if (logger.isTraceEnabled() == true) {
+                       logger.trace(relationsCommon.toString());
+               }
+               
+            String subjectCsid = relationsCommon.getSubjectCsid();
+            String objectCsid = relationsCommon.getObjectCsid();
+               
+            // If no CSID for a subject or object is included in the create payload,
+            // a refName must be provided for that subject or object as an alternate identifier.
+            CS_ASSERT(hasCsid(subjectCsid) || hasSubjectRefname(relationsCommon));
+            CS_ASSERT(hasCsid(objectCsid) || hasObjectRefname(relationsCommon));
+               
+            // The Subject identifier and Object ID must not be identical:
+            // that is, a resource cannot be related to itself.
+            if (hasCsid(subjectCsid) && hasCsid(objectCsid)) {
+               CS_ASSERT (subjectCsid.trim().equalsIgnoreCase(objectCsid.trim()) == false,
+                        SUBJECT_EQUALS_OBJECT_ERROR);
+            }
+
+            // A relationship type must be provided.
+            CS_ASSERT(relationsCommon.getRelationshipType() != null);
+
+       } catch (AssertionError e) {
+               if (logger.isErrorEnabled() == true) {
+                       logger.error(e.getMessage(), e);
+               }
+               throw new InvalidDocumentException(VALIDATION_ERROR, e);
+       }
+    }
+
+       @Override
+       protected void handleGet() {
+               // TODO Auto-generated method stub
+       }
+
+       @Override
+       protected void handleGetAll() {
+               // TODO Auto-generated method stub
+       }
+
+       @Override
+       protected void handleUpdate() {
+               // TODO Auto-generated method stub
+       }
+
+       @Override
+       protected void handleDelete() {
+               // TODO Auto-generated method stub
+    }
+
+    private boolean hasCsid(String csid) {
+        boolean hasCsid = false;
+        if (Tools.notBlank(csid)) {
+            hasCsid = true;
+        }
+        return hasCsid;
+    }
+
+    private boolean hasSubjectRefname(RelationsCommon relationsCommon) {
+        String subjectRefName = relationsCommon.getSubjectRefName();
+        return hasRefName(subjectRefName);
+    }
+
+    private boolean hasObjectRefname(RelationsCommon relationsCommon) {
+        String objectRefName = relationsCommon.getObjectRefName();
+        return hasRefName(objectRefName);
+    }
+
+    private boolean hasRefName(String refName) {
+        boolean hasRefname = false;
+        if (Tools.isBlank(refName)) {
+            return hasRefname;
+        } else {
+            Authority authority = Authority.parse(refName);
+            AuthorityItem authItem = AuthorityItem.parse(refName);
+            if (authority != null || authItem != null) {
+                hasRefname = true;
+            }
+            return hasRefname;
+        }
+
+    }
+}
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index a970c72fb2376353b16781c2b4e4735841353412..7e4e4f732a7f2feaba162957e68fb4d050e819fd 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.report</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.report</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 887c666a0adc7c62b20fb57eec0268089f3a6313..a665ec42df9f20949963c2a394f4731c09fecf4b 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.report.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.report.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 4051538af27bf4a1718235139a87381d49414cbb..83c710cceae3bc393656fcc0fbfc5200f179f317 100644 (file)
-<project name="report.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        report service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <!-- Preserve the legacy name for this target -->\r
-    <target name="deploy_jasper_samples" depends="deploy_report_files" />\r
-\r
-    <target name="deploy_report_files" \r
-        description="Copy report files to ${jee.server.cspace}/cspace/reports">\r
-        <copy todir="${jee.server.cspace}/cspace/reports" overwrite="true">\r
-            <fileset dir="${basedir}/jasper-cs-report/src/main/resources"\r
-                includes="*.jrxml"/>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy report in ${jee.server.nuxeo}">\r
-        <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-            <ant antfile="nuxeo-platform-cs-report/build.xml" target="deploy" inheritall="false"/>\r
-        -->\r
-        <antcall target="deploy_report_files" />\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy report from ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-       leaving this only for backwards compatibility reasons. -->\r
-        <ant antfile="nuxeo-platform-cs-report/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for report" depends="package">\r
-        <ant antfile="nuxeo-platform-cs-report/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-\r
-</project>\r
+<project name="report.3rdparty" default="package" basedir=".">
+    <description>
+        report service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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>
+    
+    <!-- Preserve the legacy name for this target -->
+    <target name="deploy_jasper_samples" depends="deploy_report_files" />
+
+    <target name="deploy_report_files" 
+        description="Copy report files to ${jee.server.cspace}/cspace/reports">
+        <copy todir="${jee.server.cspace}/cspace/reports" overwrite="true">
+            <fileset dir="${basedir}/jasper-cs-report/src/main/resources"
+                includes="*.jrxml"/>
+        </copy>
+    </target>
+
+    <target name="deploy" depends="install"
+        description="deploy report in ${jee.server.nuxeo}">
+        <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+            <ant antfile="nuxeo-platform-cs-report/build.xml" target="deploy" inheritall="false"/>
+        -->
+        <antcall target="deploy_report_files" />
+    </target>
+
+    <target name="undeploy"
+    description="undeploy report from ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       leaving this only for backwards compatibility reasons. -->
+        <ant antfile="nuxeo-platform-cs-report/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for report" depends="package">
+        <ant antfile="nuxeo-platform-cs-report/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+
+</project>
index 1cca8161d83b7331b3ff32e9fa0bf7fc09188ff7..3035f14fdf8d2e34a27ccafa62655a6878697691 100644 (file)
@@ -1,23 +1,23 @@
-Manifest-Version: 1.0 \r
-Bundle-ManifestVersion: 1 \r
-Bundle-Name: NuxeoCS\r
-Bundle-SymbolicName: org.collectionspace.report;singleton:=true \r
-Bundle-Version: 1.0.0\r
-Bundle-Localization: plugin\r
-Bundle-Vendor: Nuxeo \r
-Require-Bundle: org.nuxeo.runtime, \r
- org.nuxeo.ecm.core.api, \r
- org.nuxeo.ecm.core,\r
- org.nuxeo.ecm.core.api,\r
- org.nuxeo.ecm.platform.types.api,\r
- org.nuxeo.ecm.platform.versioning.api,\r
- org.nuxeo.ecm.platform.ui,\r
- org.nuxeo.ecm.platform.forms.layout.client,\r
- org.nuxeo.ecm.platform.ws,\r
- org.collectionspace.collectionspace_core\r
-Provide-Package: org.collectionspace.report\r
-Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
- OSGI-INF/life-cycle-contrib.xml,\r
- OSGI-INF/ecm-types-contrib.xml,\r
- OSGI-INF/layouts-contrib.xml\r
-\r
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: NuxeoCS
+Bundle-SymbolicName: org.collectionspace.report;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.report
+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
+
index 3c2b75960449f23c7f600cd12df263c92f2074da..2c19db83f29a8e25a084d07c4541a5ddc64aed37 100644 (file)
@@ -1,40 +1,40 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
-    Report schema (XSD)\r
-\r
-    Entity  : Report\r
-    Part    : Common\r
-    Used for: Nuxeo EP core document type\r
-\r
-    $LastChangedRevision: 2498 $\r
-    $LastChangedDate: 2010-06-16 14:47:45 -0700 (Wed, 16 Jun 2010) $\r
--->\r
-\r
-<xs:schema \r
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-    xmlns:ns="http://collectionspace.org/report/"\r
-    xmlns="http://collectionspace.org/report/"\r
-    targetNamespace="http://collectionspace.org/report/"\r
-    version="0.1">\r
-    \r
-    <!-- See http://wiki.collectionspace.org/display/collectionspace/Report+Schema -->\r
-\r
-    <xs:element name="name" type="xs:string"/>\r
-    <xs:element name="notes" type="xs:string"/>\r
-    <xs:element name="forDocTypes">\r
-        <xs:complexType>\r
-            <xs:sequence>\r
-                <xs:element name="forDocType" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>\r
-            </xs:sequence>\r
-        </xs:complexType>\r
-    </xs:element>\r
-    <xs:element name="supportsNoContext" type="xs:boolean"/>\r
-    <xs:element name="supportsSingleDoc" type="xs:boolean"/>\r
-    <xs:element name="supportsDocList" type="xs:boolean"/>\r
-    <xs:element name="supportsGroup" type="xs:boolean"/>\r
-       <!-- NYI <xs:element name="supportsQuery" type="xs:boolean"/>  -->\r
-    <xs:element name="filename" type="xs:string"/>\r
-    <xs:element name="outputMIME" type="xs:string"/>\r
-\r
-</xs:schema>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Report schema (XSD)
+
+    Entity  : Report
+    Part    : Common
+    Used for: Nuxeo EP core document type
+
+    $LastChangedRevision: 2498 $
+    $LastChangedDate: 2010-06-16 14:47:45 -0700 (Wed, 16 Jun 2010) $
+-->
+
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/report/"
+    xmlns="http://collectionspace.org/report/"
+    targetNamespace="http://collectionspace.org/report/"
+    version="0.1">
+    
+    <!-- See http://wiki.collectionspace.org/display/collectionspace/Report+Schema -->
+
+    <xs:element name="name" type="xs:string"/>
+    <xs:element name="notes" type="xs:string"/>
+    <xs:element name="forDocTypes">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="forDocType" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="supportsNoContext" type="xs:boolean"/>
+    <xs:element name="supportsSingleDoc" type="xs:boolean"/>
+    <xs:element name="supportsDocList" type="xs:boolean"/>
+    <xs:element name="supportsGroup" type="xs:boolean"/>
+       <!-- NYI <xs:element name="supportsQuery" type="xs:boolean"/>  -->
+    <xs:element name="filename" type="xs:string"/>
+    <xs:element name="outputMIME" type="xs:string"/>
+
+</xs:schema>
index 10fd6209632bb5f6e2f6f9407837557ed8ed78eb..27aef3b3849aa710e961fe49628adba9aa82a186 100644 (file)
@@ -1,24 +1,24 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.report</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.report.3rdparty</artifactId>\r
-    <name>services.report.3rdparty</name>\r
-    <packaging>pom</packaging>\r
-    \r
-    <description>\r
-        3rd party build for report service\r
-    </description>\r
-\r
-    <modules>\r
-    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <module>nuxeo-platform-cs-report</module>\r
-        -->\r
-    </modules>\r
-</project>\r
+<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>
+        <artifactId>org.collectionspace.services.report</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.report.3rdparty</artifactId>
+    <name>services.report.3rdparty</name>
+    <packaging>pom</packaging>
+    
+    <description>
+        3rd party build for report service
+    </description>
+
+    <modules>
+    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <module>nuxeo-platform-cs-report</module>
+        -->
+    </modules>
+</project>
index 74aaed852d5197ccca7d702ba2b009ac93953b83..4ee7837108c18e86ac2c2afd5c58a1e387a810d0 100644 (file)
-\r
-<project name="report" default="package" basedir=".">\r
-    <description>\r
-        report service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy report service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy report service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-    description="distribute report service">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="report" default="package" basedir=".">
+    <description>
+        report service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 report service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy report service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+    description="distribute report service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
index 281f041f69758a811f2eb5c7ed7550498e8e2b4c..82816f8814c74cde987c28136e2ba5ffc6addfef 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.report</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.report.client</artifactId>\r
-    <name>services.report.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-<!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.report.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.person.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.acquisition.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.acquisition.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.organization.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-<!-- External dependencies -->        \r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-report-client</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.report</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.report.client</artifactId>
+    <name>services.report.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+<!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.report.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.acquisition.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.acquisition.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.organization.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+<!-- External dependencies -->        
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-report-client</finalName>
+    </build>
+</project>
+
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index d5a461fea34d361402945506f8cc802a44842b5c..6a47fc84d12927ddb546c6765488dfc89542a571 100644 (file)
@@ -1,19 +1,19 @@
-/**\r
- * \r
- */\r
-package org.collectionspace.services;\r
-\r
-import org.collectionspace.services.jaxb.InvocableJAXBSchema;\r
-\r
-/**\r
- * @author pschmitz\r
- *\r
- */\r
-public interface ReportJAXBSchema extends InvocableJAXBSchema {\r
-       final static String NAME = "name";\r
-       final static String NOTES = "notes";\r
-       final static String FILENAME = "filename";\r
-       final static String OUTPUT_MIME = "outputMIME";\r
-}\r
-\r
-\r
+/**
+ * 
+ */
+package org.collectionspace.services;
+
+import org.collectionspace.services.jaxb.InvocableJAXBSchema;
+
+/**
+ * @author pschmitz
+ *
+ */
+public interface ReportJAXBSchema extends InvocableJAXBSchema {
+       final static String NAME = "name";
+       final static String NOTES = "notes";
+       final static String FILENAME = "filename";
+       final static String OUTPUT_MIME = "outputMIME";
+}
+
+
index 801d3961f117dd4c7f6ad36eb4b591e7aa098db7..bb6b889369dbaac8cf417a4ff851aa9e70aedaa2 100644 (file)
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- A comment. -->\r
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-       <parent>\r
-               <groupId>org.collectionspace.services</groupId>\r
-               <artifactId>org.collectionspace.services.main</artifactId>\r
-               <version>4.2-SNAPSHOT</version>\r
-       </parent>\r
-\r
-       <modelVersion>4.0.0</modelVersion>\r
-       <groupId>org.collectionspace.services</groupId>\r
-       <artifactId>org.collectionspace.services.report</artifactId>\r
-       <name>services.report</name>\r
-       <packaging>pom</packaging>\r
-\r
-       <dependencies>\r
-               <dependency>\r
-                       <groupId>net.sf.jasperreports</groupId>\r
-                       <artifactId>jasperreports</artifactId>\r
-                       <version>5.0.1</version>\r
-                       <exclusions>\r
-                               <exclusion>\r
-                                       <artifactId>itext</artifactId>\r
-                                       <groupId>com.lowagie</groupId>\r
-                               </exclusion>\r
-                       </exclusions>\r
-               </dependency>\r
-               <!-- Jasper Reports fonts are still at 4.0.0, but are compatible with later \r
-                       software releases - ADR 2012-06-05 -->\r
-               <!-- http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=97145 -->\r
-               <dependency>\r
-                       <groupId>net.sf.jasperreports</groupId>\r
-                       <artifactId>jasperreports-fonts</artifactId>\r
-                       <version>4.0.0</version>\r
-               </dependency>\r
-               <!-- For some reason, have to declare this dependency explicitly, ot it does not find it.\r
-                       It is a dependency of jasperreports 5.0.1 \r
-                       -->\r
-               <dependency>\r
-                       <groupId>com.lowagie</groupId>\r
-                       <artifactId>itext</artifactId>\r
-                       <version>2.1.7</version>\r
-               </dependency>\r
-               <!-- The Jasper POM declares this as a compile-time dependency, but it is needed at runtime.\r
-                       -->\r
-               <dependency>\r
-                       <groupId>org.codehaus.groovy</groupId>\r
-                       <artifactId>groovy-all</artifactId>\r
-                       <version>2.0.1</version>\r
-               </dependency>\r
-       </dependencies>\r
-\r
-\r
-       <modules>\r
-               <module>jaxb</module>\r
-               <module>service</module>\r
-               <module>3rdparty</module>\r
-               <module>client</module>\r
-       </modules>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A comment. -->
+<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.main</artifactId>
+               <version>4.2-SNAPSHOT</version>
+       </parent>
+
+       <modelVersion>4.0.0</modelVersion>
+       <groupId>org.collectionspace.services</groupId>
+       <artifactId>org.collectionspace.services.report</artifactId>
+       <name>services.report</name>
+       <packaging>pom</packaging>
+
+       <dependencies>
+               <dependency>
+                       <groupId>net.sf.jasperreports</groupId>
+                       <artifactId>jasperreports</artifactId>
+                       <version>5.0.1</version>
+                       <exclusions>
+                               <exclusion>
+                                       <artifactId>itext</artifactId>
+                                       <groupId>com.lowagie</groupId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <!-- Jasper Reports fonts are still at 4.0.0, but are compatible with later 
+                       software releases - ADR 2012-06-05 -->
+               <!-- http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=97145 -->
+               <dependency>
+                       <groupId>net.sf.jasperreports</groupId>
+                       <artifactId>jasperreports-fonts</artifactId>
+                       <version>4.0.0</version>
+               </dependency>
+               <!-- For some reason, have to declare this dependency explicitly, ot it does not find it.
+                       It is a dependency of jasperreports 5.0.1 
+                       -->
+               <dependency>
+                       <groupId>com.lowagie</groupId>
+                       <artifactId>itext</artifactId>
+                       <version>2.1.7</version>
+               </dependency>
+               <!-- The Jasper POM declares this as a compile-time dependency, but it is needed at runtime.
+                       -->
+               <dependency>
+                       <groupId>org.codehaus.groovy</groupId>
+                       <artifactId>groovy-all</artifactId>
+                       <version>2.0.1</version>
+               </dependency>
+       </dependencies>
+
+
+       <modules>
+               <module>jaxb</module>
+               <module>service</module>
+               <module>3rdparty</module>
+               <module>client</module>
+       </modules>
+
+</project>
+
index c5fdcc47bcd4c9b874d823c06f9b68e3a4dd5891..5493c379fd81c29833ae6010e62ad88fd4257ad7 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.report</artifactId>        \r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.report.service</artifactId>\r
-    <name>services.report.service</name>\r
-    <packaging>jar</packaging>       \r
-\r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.config</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.report.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.report.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->        \r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-      <!-- javax -->\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-report</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.report</artifactId>        
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.report.service</artifactId>
+    <name>services.report.service</name>
+    <packaging>jar</packaging>       
+
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.config</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.report.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.report.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+      <!-- javax -->
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <version>${nuxeo.core.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-report</finalName>
+    </build>
+</project>
+
index 2baf505b3efa9c2edea9c393c2714a39c2ce8749..0f45f2fd1682110c1cf449c0fc69878da84ddcd2 100644 (file)
@@ -1,82 +1,82 @@
-/**\r
- *  This document is a part of the source code and related artifacts\r
- *  for CollectionSpace, an open source collections management system\r
- *  for museums and related institutions:\r
-\r
- *  http://www.collectionspace.org\r
- *  http://wiki.collectionspace.org\r
-\r
- *  Copyright 2009 University of California at Berkeley\r
-\r
- *  Licensed under the Educational Community License (ECL), Version 2.0.\r
- *  You may not use this file except in compliance with this License.\r
-\r
- *  You may obtain a copy of the ECL 2.0 License at\r
-\r
- *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.report.nuxeo;\r
-\r
-import java.sql.Connection;\r
-import java.sql.SQLException;\r
-import java.sql.Statement;\r
-import java.util.List;\r
-\r
-import org.collectionspace.services.common.ServiceMain;\r
-import org.collectionspace.services.common.api.Tools;\r
-import org.collectionspace.services.common.init.IInitHandler;\r
-import org.collectionspace.services.common.init.InitHandler;\r
-import org.collectionspace.services.common.storage.DatabaseProductType;\r
-import org.collectionspace.services.common.storage.JDBCTools;\r
-\r
-import org.collectionspace.services.config.service.InitHandler.Params.Field;\r
-import org.collectionspace.services.config.service.InitHandler.Params.Property;\r
-import org.collectionspace.services.config.service.ServiceBindingType;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * ReportPostInitHandler, post-init action to add grant reader access to DB\r
- * \r
- * In the configuration file, looks for a single Field declaration \r
- * with a param value that has the name of the reader account/role.\r
- * If not specified, it will assume 'reader'; \r
- * \r
- * $LastChangedRevision: 5103 $\r
- * $LastChangedDate: 2011-06-23 16:50:06 -0700 (Thu, 23 Jun 2011) $\r
- */\r
-public class ReportPostInitHandler extends InitHandler implements IInitHandler {\r
-\r
-    final Logger logger = LoggerFactory.getLogger(ReportPostInitHandler.class);\r
-   \r
-    public static final String READER_ROLE_NAME_KEY = "readerRoleName";\r
-    public static final String DEFAULT_READER_ROLE_NAME = "reader" + ServiceMain.getInstance().getCspaceInstanceId();\r
-    private String readerRoleName = DEFAULT_READER_ROLE_NAME;\r
-    \r
-    /** See the class javadoc for this class: it shows the syntax supported in the configuration params.\r
-     */\r
-    @Override\r
-    public void onRepositoryInitialized(String dataSourceName,\r
-               String repositoryName,\r
-               String cspaceInstanceId,\r
-               ServiceBindingType sbt, \r
-               List<Field> fields, \r
-               List<Property> propertyList) throws Exception {\r
-        //Check for existing privileges, and if not there, grant them\r
-       for(Property prop : propertyList) {\r
-                if(READER_ROLE_NAME_KEY.equals(prop.getKey())) {\r
-                    String value = prop.getValue();\r
-                    if(Tools.notEmpty(value) && !DEFAULT_READER_ROLE_NAME.equals(value)){\r
-                        readerRoleName = value + ServiceMain.getInstance().getCspaceInstanceId();\r
-                        logger.debug("ReportPostInitHandler: overriding readerRoleName default value to use: "\r
-                                + value);\r
-                }\r
-            }\r
-        }\r
-        String privilegeName = JDBCTools.DATABASE_SELECT_PRIVILEGE_NAME;\r
-        JDBCTools.grantPrivilegeToDatabaseUser(dataSourceName, repositoryName, cspaceInstanceId, privilegeName, readerRoleName);\r
-    }\r
-    \r
-\r
-}\r
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.report.nuxeo;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.List;
+
+import org.collectionspace.services.common.ServiceMain;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.init.IInitHandler;
+import org.collectionspace.services.common.init.InitHandler;
+import org.collectionspace.services.common.storage.DatabaseProductType;
+import org.collectionspace.services.common.storage.JDBCTools;
+
+import org.collectionspace.services.config.service.InitHandler.Params.Field;
+import org.collectionspace.services.config.service.InitHandler.Params.Property;
+import org.collectionspace.services.config.service.ServiceBindingType;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * ReportPostInitHandler, post-init action to add grant reader access to DB
+ * 
+ * In the configuration file, looks for a single Field declaration 
+ * with a param value that has the name of the reader account/role.
+ * If not specified, it will assume 'reader'; 
+ * 
+ * $LastChangedRevision: 5103 $
+ * $LastChangedDate: 2011-06-23 16:50:06 -0700 (Thu, 23 Jun 2011) $
+ */
+public class ReportPostInitHandler extends InitHandler implements IInitHandler {
+
+    final Logger logger = LoggerFactory.getLogger(ReportPostInitHandler.class);
+   
+    public static final String READER_ROLE_NAME_KEY = "readerRoleName";
+    public static final String DEFAULT_READER_ROLE_NAME = "reader" + ServiceMain.getInstance().getCspaceInstanceId();
+    private String readerRoleName = DEFAULT_READER_ROLE_NAME;
+    
+    /** See the class javadoc for this class: it shows the syntax supported in the configuration params.
+     */
+    @Override
+    public void onRepositoryInitialized(String dataSourceName,
+               String repositoryName,
+               String cspaceInstanceId,
+               ServiceBindingType sbt, 
+               List<Field> fields, 
+               List<Property> propertyList) throws Exception {
+        //Check for existing privileges, and if not there, grant them
+       for(Property prop : propertyList) {
+                if(READER_ROLE_NAME_KEY.equals(prop.getKey())) {
+                    String value = prop.getValue();
+                    if(Tools.notEmpty(value) && !DEFAULT_READER_ROLE_NAME.equals(value)){
+                        readerRoleName = value + ServiceMain.getInstance().getCspaceInstanceId();
+                        logger.debug("ReportPostInitHandler: overriding readerRoleName default value to use: "
+                                + value);
+                }
+            }
+        }
+        String privilegeName = JDBCTools.DATABASE_SELECT_PRIVILEGE_NAME;
+        JDBCTools.grantPrivilegeToDatabaseUser(dataSourceName, repositoryName, cspaceInstanceId, privilegeName, readerRoleName);
+    }
+    
+
+}
index 9e4045ef87600e5a9d87c56bbd4b827c12ba893d..f66fc5071f34fa3d7423d3071148324f0ea16784 100644 (file)
@@ -1,18 +1,18 @@
-package org.collectionspace.services.report.nuxeo;\r
-\r
-import org.collectionspace.services.common.context.ServiceContext;\r
-import org.collectionspace.services.common.document.InvalidDocumentException;\r
-import org.collectionspace.services.common.document.ValidatorHandler;\r
-import org.collectionspace.services.common.document.DocumentHandler.Action;\r
-\r
-public class ReportValidatorHandler implements ValidatorHandler {\r
-\r
-       @Override\r
-       public void validate(Action action, ServiceContext ctx)\r
-                       throws InvalidDocumentException {\r
-               // TODO Auto-generated method stub\r
-               System.out.println("ReportValidatorHandler executed.");\r
-\r
-       }\r
-\r
-}\r
+package org.collectionspace.services.report.nuxeo;
+
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandler;
+import org.collectionspace.services.common.document.DocumentHandler.Action;
+
+public class ReportValidatorHandler implements ValidatorHandler {
+
+       @Override
+       public void validate(Action action, ServiceContext ctx)
+                       throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               System.out.println("ReportValidatorHandler executed.");
+
+       }
+
+}
index d8f291998b83cb5e57273cbcdd6b0a69867b82e5..a225f00dbd3f7ae6b600dda5716d0140d1027d69 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 9177229bfabd19043b0c96c14e64c88adb548c74..389ecef9f813f1a94b2e4a628e52ca192caeb08a 100644 (file)
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.sdk</artifactId>\r
-    <packaging>pom</packaging>\r
-    <name>services.sdk</name>\r
-    <version>4.2-SNAPSHOT</version>\r
-    \r
-    <distributionManagement>\r
-        <repository>\r
-            <id>libs-releases-local</id>\r
-            <name>libs-releases-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>\r
-        </repository>\r
-        <snapshotRepository>\r
-            <id>libs-snapshots-local</id>\r
-            <name>libs-snapshots-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>\r
-        </snapshotRepository>\r
-    </distributionManagement>\r
-    \r
-    <profiles>\r
-               <profile>\r
-                       <id>samples</id>\r
-           <modules>\r
-            <module>sample</module>\r
-           </modules>\r
-               </profile>\r
-       </profiles>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.sdk</artifactId>
+    <packaging>pom</packaging>
+    <name>services.sdk</name>
+    <version>4.2-SNAPSHOT</version>
+    
+    <distributionManagement>
+        <repository>
+            <id>libs-releases-local</id>
+            <name>libs-releases-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>
+        </repository>
+        <snapshotRepository>
+            <id>libs-snapshots-local</id>
+            <name>libs-snapshots-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>
+        </snapshotRepository>
+    </distributionManagement>
+    
+    <profiles>
+               <profile>
+                       <id>samples</id>
+           <modules>
+            <module>sample</module>
+           </modules>
+               </profile>
+       </profiles>
+
+</project>
+
index 425cd1620f3d44a6c3d1d8c43488a67552f09765..7c3d14f89b703a4e761aff556779976ec43c6db2 100644 (file)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
-       <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
-       <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+       <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+       <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 3653faae88eefc88d686a6ebb9bc0e85dafdfa8f..332e1a9462b0cfe18083760faf7258ce1e4c6120 100644 (file)
@@ -1,60 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services.client</groupId>\r
-    <artifactId>org.collectionspace.services.client.sample</artifactId>\r
-    <packaging>jar</packaging>\r
-    <name>client.sample</name>\r
-    \r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-simple</artifactId>\r
-            <version>1.5.2</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <repositories>\r
-        <repository>\r
-            <id>libs-releases-local</id>\r
-            <name>libs-releases-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>\r
-            <releases>\r
-                <enabled>true</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>false</enabled>\r
-            </snapshots>            \r
-        </repository>        \r
-        <repository>\r
-            <id>libs-snapshots-local</id>\r
-            <name>libs-snapshots-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>\r
-            <releases>\r
-                <enabled>false</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>true</enabled>\r
-            </snapshots>            \r
-        </repository>\r
-    </repositories>    \r
-    \r
-    <build>\r
-        <finalName>client-sample</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-compiler-plugin</artifactId>\r
-                <configuration>\r
-                    <source>1.7</source>\r
-                    <target>1.7</target>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services.client</groupId>
+    <artifactId>org.collectionspace.services.client.sample</artifactId>
+    <packaging>jar</packaging>
+    <name>client.sample</name>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <version>1.5.2</version>
+        </dependency>
+    </dependencies>
+    
+    <repositories>
+        <repository>
+            <id>libs-releases-local</id>
+            <name>libs-releases-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>            
+        </repository>        
+        <repository>
+            <id>libs-snapshots-local</id>
+            <name>libs-snapshots-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>            
+        </repository>
+    </repositories>    
+    
+    <build>
+        <finalName>client-sample</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index 7a29f137c841e5bfd145c01fc431c4de1a37df40..28b800e398d7a224cda882e5c0890153114f95ea 100644 (file)
-/**    \r
- * Sample.java\r
- *\r
- * {Purpose of This Class}\r
- *\r
- * {Other Notes Relating to This Class (Optional)}\r
- *\r
- * $LastChangedBy: $\r
- * $LastChangedRevision: $\r
- * $LastChangedDate: $\r
- *\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright © 2009 {Contributing Institution}\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- */\r
-package org.collectionspace.services.sdk.sample;\r
-\r
-import java.io.IOException;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.collectionobject.ObjectNameGroup;\r
-import org.collectionspace.services.collectionobject.ObjectNameList;\r
-import org.testng.Assert;\r
-\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;\r
-import org.jboss.resteasy.plugins.providers.multipart.OutputPart;\r
-\r
-import org.collectionspace.services.client.CollectionObjectClient;\r
-import org.collectionspace.services.collectionobject.CollectionobjectsCommon;\r
-import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;\r
-\r
-/**\r
- * The Class Sample.\r
- */\r
-public class Sample {\r
-\r
-       /** The collection object client. */\r
-       private static CollectionObjectClient collectionObjectClient = new CollectionObjectClient();\r
-\r
-       /**\r
-        * @param args\r
-        */\r
-       public static void main(String[] args) {\r
-\r
-               System.out.println("Base URL is: "\r
-                               + collectionObjectClient.getBaseURL());\r
-\r
-               String csid = createCollectionObject();\r
-               System.out.println("Created a new collection object with CSID=" + csid);\r
-\r
-               CollectionobjectsCommon co = readCollectionObject(csid);\r
-               System.out.println("Got a collection object with CSID=" + csid);\r
-               \r
-               int status = updateCollectionObject(csid);\r
-               System.out.println("Updated the collection object with CSID=" + csid);\r
-       }\r
-\r
-       /**\r
-        * Creates the collection object.\r
-        * \r
-        * @return the string\r
-        */\r
-       static String createCollectionObject() {\r
-               String result = null;\r
-\r
-               CollectionobjectsCommon co = new CollectionobjectsCommon();\r
-        ObjectNameList onl = co.getObjectNameList();\r
-        ObjectNameGroup ong = new ObjectNameGroup();\r
-        ong.setObjectName("Keiko CollectionobjectsCommon");\r
-        onl.getObjectNameGroup().add(ong);\r
-\r
-               MultipartOutput multipart = new MultipartOutput();\r
-               OutputPart commonPart = multipart.addPart(co,\r
-                               MediaType.APPLICATION_XML_TYPE);\r
-               commonPart.getHeaders().add("label",\r
-                               collectionObjectClient.getCommonPartName());\r
-\r
-               ClientResponse<Response> response = collectionObjectClient\r
-                               .create(multipart);\r
-               Assert.assertEquals(response.getStatus(), Response.Status.CREATED\r
-                               .getStatusCode());\r
-               result = extractId(response);\r
-\r
-               return result;\r
-       }\r
-\r
-       /**\r
-        * Read collection object.\r
-        * \r
-        * @param csid\r
-        *            the csid\r
-        * \r
-        * @return the collectionobjects common\r
-        */\r
-       static CollectionobjectsCommon readCollectionObject(String csid) {\r
-               CollectionobjectsCommon result = null;\r
-\r
-               ClientResponse<MultipartInput> response = collectionObjectClient\r
-                               .read(csid);\r
-               Assert.assertEquals(response.getStatus(), Response.Status.OK\r
-                               .getStatusCode());\r
-               try {\r
-                       MultipartInput input = (MultipartInput) response.getEntity();\r
-                       result = (CollectionobjectsCommon) extractPart(input,\r
-                                       collectionObjectClient.getCommonPartName(),\r
-                                       CollectionobjectsCommon.class);\r
-               } catch (Exception e) {\r
-                       throw new RuntimeException(e);\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-       /**\r
-        * Update collection object.\r
-        */\r
-       static int updateCollectionObject(String csid) {\r
-               ClientResponse<MultipartInput> response = collectionObjectClient\r
-                               .read(csid);\r
-               Assert.assertEquals(response.getStatus(), Response.Status.OK\r
-                               .getStatusCode());\r
-\r
-               MultipartInput input = (MultipartInput) response.getEntity();\r
-               CollectionobjectsCommon collectionObject = (CollectionobjectsCommon) extractPart(\r
-                               input, collectionObjectClient.getCommonPartName(),\r
-                               CollectionobjectsCommon.class);\r
-               Assert.assertNotNull(collectionObject);\r
-\r
-               // Update the content of this resource.\r
-               collectionObject.setObjectNumber("updated-"\r
-                               + collectionObject.getObjectNumber());\r
-        String name = collectionObject.getObjectNameList().getObjectNameGroup().get(0).getObjectName();\r
-               collectionObject.getObjectNameList().getObjectNameGroup().get(0).setObjectName("updated-"+ name);\r
-\r
-               // Submit the request to the service and store the response.\r
-               MultipartOutput output = new MultipartOutput();\r
-               OutputPart commonPart = output.addPart(collectionObject,\r
-                               MediaType.APPLICATION_XML_TYPE);\r
-               commonPart.getHeaders().add("label",\r
-                               collectionObjectClient.getCommonPartName());\r
-\r
-               response = collectionObjectClient.update(csid, output);\r
-               int statusCode = response.getStatus();\r
-\r
-               return statusCode;\r
-       }\r
-\r
-       //\r
-       // Utility methods that belong somewhere in the SDK and NOT the sample.\r
-       //\r
-       \r
-       /**\r
-        * Extract id.\r
-        * \r
-        * @param res\r
-        *            the res\r
-        * \r
-        * @return the string\r
-        */\r
-       static String extractId(ClientResponse<Response> res) {\r
-               String result = null;\r
-\r
-               try {\r
-                       MultivaluedMap mvm = res.getMetadata();\r
-                       String uri = (String) ((ArrayList) mvm.get("Location")).get(0);\r
-                       String[] segments = uri.split("/");\r
-                       result = segments[segments.length - 1];\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-       /**\r
-        * Extract part.\r
-        * \r
-        * @param input\r
-        *            the input\r
-        * @param label\r
-        *            the label\r
-        * @param clazz\r
-        *            the clazz\r
-        * \r
-        * @return the object\r
-        * \r
-        * @throws Exception\r
-        *             the exception\r
-        */\r
-       static Object extractPart(MultipartInput input, String label, Class clazz) {\r
-               Object obj = null;\r
-               \r
-               try {\r
-                       for (InputPart part : input.getParts()) {\r
-                               String partLabel = part.getHeaders().getFirst("label");\r
-                               if (label.equalsIgnoreCase(partLabel)) {\r
-                                       String partStr = part.getBodyAsString();\r
-                                       obj = part.getBody(clazz, null);\r
-                                       break;\r
-                               }\r
-                       }\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-\r
-               return obj;\r
-       }\r
-\r
-}\r
+/**    
+ * Sample.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright © 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.sdk.sample;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.collectionobject.ObjectNameGroup;
+import org.collectionspace.services.collectionobject.ObjectNameList;
+import org.testng.Assert;
+
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.multipart.InputPart;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
+import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+
+import org.collectionspace.services.client.CollectionObjectClient;
+import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
+import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
+
+/**
+ * The Class Sample.
+ */
+public class Sample {
+
+       /** The collection object client. */
+       private static CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
+
+       /**
+        * @param args
+        */
+       public static void main(String[] args) {
+
+               System.out.println("Base URL is: "
+                               + collectionObjectClient.getBaseURL());
+
+               String csid = createCollectionObject();
+               System.out.println("Created a new collection object with CSID=" + csid);
+
+               CollectionobjectsCommon co = readCollectionObject(csid);
+               System.out.println("Got a collection object with CSID=" + csid);
+               
+               int status = updateCollectionObject(csid);
+               System.out.println("Updated the collection object with CSID=" + csid);
+       }
+
+       /**
+        * Creates the collection object.
+        * 
+        * @return the string
+        */
+       static String createCollectionObject() {
+               String result = null;
+
+               CollectionobjectsCommon co = new CollectionobjectsCommon();
+        ObjectNameList onl = co.getObjectNameList();
+        ObjectNameGroup ong = new ObjectNameGroup();
+        ong.setObjectName("Keiko CollectionobjectsCommon");
+        onl.getObjectNameGroup().add(ong);
+
+               MultipartOutput multipart = new MultipartOutput();
+               OutputPart commonPart = multipart.addPart(co,
+                               MediaType.APPLICATION_XML_TYPE);
+               commonPart.getHeaders().add("label",
+                               collectionObjectClient.getCommonPartName());
+
+               ClientResponse<Response> response = collectionObjectClient
+                               .create(multipart);
+               Assert.assertEquals(response.getStatus(), Response.Status.CREATED
+                               .getStatusCode());
+               result = extractId(response);
+
+               return result;
+       }
+
+       /**
+        * Read collection object.
+        * 
+        * @param csid
+        *            the csid
+        * 
+        * @return the collectionobjects common
+        */
+       static CollectionobjectsCommon readCollectionObject(String csid) {
+               CollectionobjectsCommon result = null;
+
+               ClientResponse<MultipartInput> response = collectionObjectClient
+                               .read(csid);
+               Assert.assertEquals(response.getStatus(), Response.Status.OK
+                               .getStatusCode());
+               try {
+                       MultipartInput input = (MultipartInput) response.getEntity();
+                       result = (CollectionobjectsCommon) extractPart(input,
+                                       collectionObjectClient.getCommonPartName(),
+                                       CollectionobjectsCommon.class);
+               } catch (Exception e) {
+                       throw new RuntimeException(e);
+               }
+
+               return result;
+       }
+
+       /**
+        * Update collection object.
+        */
+       static int updateCollectionObject(String csid) {
+               ClientResponse<MultipartInput> response = collectionObjectClient
+                               .read(csid);
+               Assert.assertEquals(response.getStatus(), Response.Status.OK
+                               .getStatusCode());
+
+               MultipartInput input = (MultipartInput) response.getEntity();
+               CollectionobjectsCommon collectionObject = (CollectionobjectsCommon) extractPart(
+                               input, collectionObjectClient.getCommonPartName(),
+                               CollectionobjectsCommon.class);
+               Assert.assertNotNull(collectionObject);
+
+               // Update the content of this resource.
+               collectionObject.setObjectNumber("updated-"
+                               + collectionObject.getObjectNumber());
+        String name = collectionObject.getObjectNameList().getObjectNameGroup().get(0).getObjectName();
+               collectionObject.getObjectNameList().getObjectNameGroup().get(0).setObjectName("updated-"+ name);
+
+               // Submit the request to the service and store the response.
+               MultipartOutput output = new MultipartOutput();
+               OutputPart commonPart = output.addPart(collectionObject,
+                               MediaType.APPLICATION_XML_TYPE);
+               commonPart.getHeaders().add("label",
+                               collectionObjectClient.getCommonPartName());
+
+               response = collectionObjectClient.update(csid, output);
+               int statusCode = response.getStatus();
+
+               return statusCode;
+       }
+
+       //
+       // Utility methods that belong somewhere in the SDK and NOT the sample.
+       //
+       
+       /**
+        * Extract id.
+        * 
+        * @param res
+        *            the res
+        * 
+        * @return the string
+        */
+       static String extractId(ClientResponse<Response> res) {
+               String result = null;
+
+               try {
+                       MultivaluedMap mvm = res.getMetadata();
+                       String uri = (String) ((ArrayList) mvm.get("Location")).get(0);
+                       String[] segments = uri.split("/");
+                       result = segments[segments.length - 1];
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+
+               return result;
+       }
+
+       /**
+        * Extract part.
+        * 
+        * @param input
+        *            the input
+        * @param label
+        *            the label
+        * @param clazz
+        *            the clazz
+        * 
+        * @return the object
+        * 
+        * @throws Exception
+        *             the exception
+        */
+       static Object extractPart(MultipartInput input, String label, Class clazz) {
+               Object obj = null;
+               
+               try {
+                       for (InputPart part : input.getParts()) {
+                               String partLabel = part.getHeaders().getFirst("label");
+                               if (label.equalsIgnoreCase(partLabel)) {
+                                       String partStr = part.getBodyAsString();
+                                       obj = part.getBody(clazz, null);
+                                       break;
+                               }
+                       }
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+
+               return obj;
+       }
+
+}
index 429b9f6fe2fb8a87a0dab86aabfdc482b881a740..9270810347f6e81eea603c15eb9699e1cffd2881 100644 (file)
@@ -1,6 +1,6 @@
-#url of the collectionspace server\r
-cspace.url=http://localhost:8180/cspace-services/\r
-cspace.ssl=false\r
-cspace.auth=false\r
-cspace.user=test\r
+#url of the collectionspace server
+cspace.url=http://localhost:8180/cspace-services/
+cspace.ssl=false
+cspace.auth=false
+cspace.user=test
 cspace.password=test
\ No newline at end of file
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index ddf9eb9fa61b980431c91734c1770ad68c1bdb89..0d93f6ebf34920866725346fc2970ed9ed2eb90e 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.security</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.security</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 88412c6ef177c431d5821c240f32958eaa27fad5..8a0d733bf0d0ff18e97653c044befc29fc60f753 100644 (file)
-\r
-<project name="security" default="package" basedir=".">\r
-    <description>\r
-        security service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-    <property name="build" location="build"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy security service">\r
-        \r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy security service">\r
-        <\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-    description="distribute security service}">\r
-\r
-    </target>\r
-\r
-</project>\r
+
+<project name="security" default="package" basedir=".">
+    <description>
+        security service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+    <property name="build" location="build"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 security service">
+        
+    </target>
+
+    <target name="undeploy"
+    description="undeploy security service">
+        <
+    </target>
+
+    <target name="dist" depends="package"
+    description="distribute security service}">
+
+    </target>
+
+</project>
index 45a73990dacecd9a9ed4022b5f0d3ba748408d73..3f51a1f5bce8a2f960dc4ad2038f8af0875df899 100644 (file)
-<project name="security.client" default="package" basedir=".">\r
-    <description>\r
-        collectionspace security service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init">\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">\r
-        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>\r
-        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>\r
-        <delete file="${dest.hibernate.cfg}" verbose="true" />\r
-        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url}" />\r
-        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />\r
-        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />\r
-        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->\r
-        <filter token="DB_DIALECT" value="${db.dialect}" />\r
-        <copy todir="${basedir}/target/test-classes" filtering="true">\r
-            <fileset dir="${basedir}/src/test/resources">\r
-                <include name="hibernate.cfg.xml" />\r
-            </fileset>\r
-        </copy>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy security service in ${jee.server.cspace}">\r
-        \r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy security service from ${jee.server.cspace}">\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for security service" depends="package">\r
-        \r
-    </target>\r
-\r
-</project>\r
+<project name="security.client" default="package" basedir=".">
+    <description>
+        collectionspace security service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init">
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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="setup_hibernate.cfg" description="replace property keywords in hibernate.cfg.xml">
+        <property name="src.hibernate.cfg" value="${basedir}/src/test/resources/hibernate.cfg.xml"/>
+        <property name="dest.hibernate.cfg" value="${basedir}/target/test-classes/hibernate.cfg.xml"/>
+        <delete file="${dest.hibernate.cfg}" verbose="true" />
+        <filter token="DB_CSPACE_URL" value="${db.jdbc.cspace.url}" />
+        <filter token="DB_DRIVER_CLASS" value="${db.jdbc.driver.class}" />
+        <filter token="DB_CSPACE_USER" value="${db.cspace.user}" />
+        <filter token="DB_CSPACE_PASSWORD" value="${env.DB_CSPACE_PASSWORD}" /> <!-- double-sub from ${db.cspace.user.password} fails -->
+        <filter token="DB_DIALECT" value="${db.dialect}" />
+        <copy todir="${basedir}/target/test-classes" filtering="true">
+            <fileset dir="${basedir}/src/test/resources">
+                <include name="hibernate.cfg.xml" />
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="deploy" depends="install"
+    description="deploy security service in ${jee.server.cspace}">
+        
+    </target>
+
+    <target name="undeploy"
+    description="undeploy security service from ${jee.server.cspace}">
+    </target>
+
+    <target name="dist"
+    description="generate distribution for security service" depends="package">
+        
+    </target>
+
+</project>
index 387ccd556386cbce2b1654f304c5a6f9d1c005d4..a462c8ef4a2a72fe33d264dd43a404034f359662 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.security</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.security.client</artifactId>\r
-    <name>services.security.client</name>\r
-\r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- authentication tests use CollectionObject service and Account service -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.account.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.dimension.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.intake.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-\r
-    <build>\r
-        <finalName>cspace-services-security-client</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <artifactId>maven-antrun-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <id>subs-hibernate-config</id>\r
-                        <phase>generate-test-resources</phase>\r
-                        <goals>\r
-                            <goal>run</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <tasks>\r
-                                <property name="runtime-classpath" refid="maven.runtime.classpath"/>\r
-                                <ant target="setup_hibernate.cfg" inheritRefs="true"/>\r
-                            </tasks>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.security</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.security.client</artifactId>
+    <name>services.security.client</name>
+
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- authentication tests use CollectionObject service and Account service -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.account.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authorization-mgt.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.dimension.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.intake.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>cspace-services-security-client</finalName>
+        <plugins>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>subs-hibernate-config</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <property name="runtime-classpath" refid="maven.runtime.classpath"/>
+                                <ant target="setup_hibernate.cfg" inheritRefs="true"/>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 078bfbeaf15bb6c9fe9fe11c7e2321a457fd4021..b432428cbec394c9cf8a79b7f4d6f3643bdb21d2 100644 (file)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.security</artifactId>\r
-    <name>services.security</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <properties>\r
-    </properties>\r
-\r
-    <modules>\r
-        <module>client</module>\r
-    </modules>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.security</artifactId>
+    <name>services.security</name>
+    <packaging>pom</packaging>
+
+    <properties>
+    </properties>
+
+    <modules>
+        <module>client</module>
+    </modules>
+
+</project>
+
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index dbf94a5899af50aa642322afe3629bbcacbd4b44..e47deb16f32cf3012278207c14f2b34038d113cc 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.vocabulary</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.vocabulary</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 046988541367fd64d33e579a0fffd089df36a9b2..25df93560f348ae8c09835f2bdb160af9cac4829 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index c8187641e1b320610c242ca9ed4f28d62b4909f3..6bf47fbc8398963c391f9cf99b7cc0b58c977cf5 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.vocabulary.3rdparty</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.vocabulary.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index 743b53d81507f78aeabecb7a23752b0a2b191e4f..1f77423cf8d16f53efc2b72237d8f7ecef6473c2 100644 (file)
-\r
-<project name="vocabulary.3rdparty" default="package" basedir=".">\r
-    <description>\r
-        vocabulary service 3rdparty\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../../.."/>\r
-    <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="init" >\r
-    <!-- Create the time stamp -->\r
-        <tstamp/>\r
-    </target>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-    description="deploy vocabulary in ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <ant antfile="nuxeo-platform-cs-vocabulary/build.xml" target="deploy" inheritall="false"/>\r
-        -->\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-    description="undeploy vocabulary from ${jee.server.nuxeo}">\r
-       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-       leaving this only for backwards compatibility reasons. -->\r
-        <ant antfile="nuxeo-platform-cs-vocabulary/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist"\r
-    description="generate distribution for vocabulary" depends="package">\r
-        <ant antfile="nuxeo-platform-cs-vocabulary/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-vocabulary/build.xml" target="dist_installer" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="vocabulary.3rdparty" default="package" basedir=".">
+    <description>
+        vocabulary service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </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 vocabulary in ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <ant antfile="nuxeo-platform-cs-vocabulary/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+    description="undeploy vocabulary from ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       leaving this only for backwards compatibility reasons. -->
+        <ant antfile="nuxeo-platform-cs-vocabulary/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for vocabulary" depends="package">
+        <ant antfile="nuxeo-platform-cs-vocabulary/build.xml" target="dist" inheritall="false"/>
+    </target>
+    
+    <target name="dist_installer"
+    description="generate distribution for collectionobject" depends="package">
+        <ant antfile="nuxeo-platform-cs-vocabulary/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index fbefc97b1f0e137ba32145078757809a07af4f76..5f8c5a6d09c2eb71a32219fd817bb9461d624eb5 100644 (file)
@@ -1,16 +1,16 @@
-Files formerly located in this directory are no longer needed\r
--------------------------------------------------------------\r
-\r
-In CollectionSpace versions 4.0 and higher, changes were introduced\r
-which streamline and simplify the process through which you configure\r
-fields in CollectionSpace's main record types.\r
-\r
-In most cases now, you will typically change the behavior of existing fields,\r
-or create extension schemas to add new fields specific to your museum and/or\r
-community of practice, merely by editing simpler XML-based configuration\r
-files within CollectionSpace's Application layer.\r
-\r
-Services layer files that were formerly located in this directory and\r
-other, similar directories - which you previously needed to manually\r
-create or edit - are now generated automatically from your configuration\r
+Files formerly located in this directory are no longer needed
+-------------------------------------------------------------
+
+In CollectionSpace versions 4.0 and higher, changes were introduced
+which streamline and simplify the process through which you configure
+fields in CollectionSpace's main record types.
+
+In most cases now, you will typically change the behavior of existing fields,
+or create extension schemas to add new fields specific to your museum and/or
+community of practice, merely by editing simpler XML-based configuration
+files within CollectionSpace's Application layer.
+
+Services layer files that were formerly located in this directory and
+other, similar directories - which you previously needed to manually
+create or edit - are now generated automatically from your configuration
 in the Application layer.
\ No newline at end of file
index 055a0483a9799dd82fefaad730c735f38d8f7549..6dc9972e989bd916cae5771f8672665137d69f14 100644 (file)
@@ -1,24 +1,24 @@
-\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.vocabulary</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.vocabulary.3rdparty</artifactId>\r
-    <name>services.vocabulary.3rdparty</name>\r
-    <packaging>pom</packaging>\r
-    <description>\r
-        3rd party build for vocabulary service\r
-    </description>\r
-\r
-    <modules>\r
-    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool\r
-        <module>nuxeo-platform-cs-vocabulary</module>\r
-        -->\r
-    </modules>\r
-</project>\r
+
+<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.vocabulary</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.vocabulary.3rdparty</artifactId>
+    <name>services.vocabulary.3rdparty</name>
+    <packaging>pom</packaging>
+    <description>
+        3rd party build for vocabulary service
+    </description>
+
+    <modules>
+    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <module>nuxeo-platform-cs-vocabulary</module>
+        -->
+    </modules>
+</project>
index e6396b27ea163f9ddde9af048bd03e09d790d458..8c78722f2724da9627416a96c0c203c205d82646 100644 (file)
-\r
-<project name="vocabulary" default="package" basedir=".">\r
-    <description>\r
-        vocabulary service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-        <!-- enviornment should be declared before reading build.properties -->\r
-    <property environment="env" />\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-\r
-    <target name="package" depends="package-unix,package-windows"\r
-  description="Package CollectionSpace Services" />\r
-  \r
-    <target name="package-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    \r
-    <target name="package-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="package" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="install" depends="install-unix,install-windows"\r
-  description="Install" />\r
-    <target name="install-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="install-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="install" />\r
-            <arg value="-Dmaven.test.skip=true" />\r
-            <arg value="-f" />\r
-            <arg value="${basedir}/pom.xml" />\r
-            <arg value="-N" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="clean" depends="clean-unix,clean-windows"\r
-  description="Delete target directories" >\r
-        <delete dir="${build}"/>\r
-    </target>\r
-    <target name="clean-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="clean-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="clean" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
-    <target name="test-unix" if="osfamily-unix">\r
-        <exec executable="mvn" failonerror="true">\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-    <target name="test-windows" if="osfamily-windows">\r
-        <exec executable="cmd" failonerror="true">\r
-            <arg value="/c" />\r
-            <arg value="mvn.bat" />\r
-            <arg value="test" />\r
-            <arg value="${mvn.opts}" />\r
-        </exec>\r
-    </target>\r
-\r
-    <target name="deploy" depends="install"\r
-        description="deploy vocabulary service">\r
-        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="undeploy"\r
-        description="undeploy vocabulary service">\r
-        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist" depends="package"\r
-        description="distribute vocabulary service">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
-    </target>\r
-\r
-    <target name="dist_installer" depends="package"\r
-        description="distribute vocabulary service">        \r
-        <!-- copy install scripts, etc. -->\r
-        <copy todir="${services.trunk}/${dist.installer.services}/vocabulary">\r
-            <fileset dir="${basedir}/installer/"/>\r
-        </copy>\r
-        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>\r
-    </target>\r
-\r
-</project>\r
+
+<project name="vocabulary" default="package" basedir=".">
+    <description>
+        vocabulary service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+        <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <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 vocabulary service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy vocabulary service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+        description="distribute vocabulary service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+    <target name="dist_installer" depends="package"
+        description="distribute vocabulary service">        
+        <!-- copy install scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.installer.services}/vocabulary">
+            <fileset dir="${basedir}/installer/"/>
+        </copy>
+        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
index e72438e8a7c5ffcb9fe5f3a44e1998f0d04df84b..538bde2bdadfd8a1b27d2c10fb77918dbc060afb 100644 (file)
@@ -1,78 +1,78 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.vocabulary</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.vocabulary.client</artifactId>\r
-    <name>services.vocabulary.client</name>\r
-    \r
-    <dependencies>\r
-        <!-- keep slf4j dependencies on the top -->\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <!-- filter out unwanted jars -->\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-vocabulary-client</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.vocabulary</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.vocabulary.client</artifactId>
+    <name>services.vocabulary.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-vocabulary-client</finalName>
+    </build>
+</project>
+
index 5c4930645647d3aabf94d08db356d3dfc7592462..5b39a29a4d33998a02f79ace0395409cf8df755d 100644 (file)
-package org.collectionspace.services.client;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Map;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;\r
-import org.collectionspace.services.client.test.ServiceRequestType;\r
-import org.collectionspace.services.vocabulary.VocabularyitemsCommon;\r
-import org.collectionspace.services.vocabulary.VocabulariesCommon;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-//import org.jboss.resteasy.plugins.providers.multipart.PoxPayloadOut;\r
-//import org.jboss.resteasy.plugins.providers.multipart.OutputPart;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class VocabularyClientUtils {\r
-    private static final Logger logger =\r
-        LoggerFactory.getLogger(VocabularyClientUtils.class);\r
-    \r
-    public static PoxPayloadOut createEnumerationInstance(\r
-               String displayName, String shortIdentifier, String headerLabel ) {\r
-        VocabulariesCommon vocabulary = new VocabulariesCommon();\r
-        vocabulary.setDisplayName(displayName);\r
-        vocabulary.setShortIdentifier(shortIdentifier);\r
-        //String refName = createVocabularyRefName(shortIdentifier, displayName);\r
-        //vocabulary.setRefName(refName);\r
-        vocabulary.setVocabType("enum");\r
-        PoxPayloadOut multipart = new PoxPayloadOut(VocabularyClient.SERVICE_PAYLOAD_NAME);\r
-        PayloadOutputPart commonPart = multipart.addPart(vocabulary, MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.setLabel(headerLabel);\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, vocabulary common for enumeration ", \r
-                                       vocabulary, VocabulariesCommon.class);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-\r
-               // Note that we do not use the map, but we will once we add more info to the \r
-               // items\r
-    public static PoxPayloadOut createVocabularyItemInstance( \r
-               String vocabularyRefName, Map<String, String> vocabItemInfo, String headerLabel){\r
-        VocabularyitemsCommon vocabularyItem = new VocabularyitemsCommon();\r
-       String shortId = vocabItemInfo.get(AuthorityItemJAXBSchema.SHORT_IDENTIFIER);\r
-       String displayName = vocabItemInfo.get(AuthorityItemJAXBSchema.DISPLAY_NAME);\r
-               vocabularyItem.setShortIdentifier(shortId);\r
-               vocabularyItem.setDisplayName(displayName);\r
-       //String refName = createVocabularyItemRefName(vocabularyRefName, shortId, displayName);\r
-               //vocabularyItem.setRefName(refName);\r
-               PoxPayloadOut multipart = new PoxPayloadOut(VocabularyClient.SERVICE_ITEM_PAYLOAD_NAME);\r
-        PayloadOutputPart commonPart = multipart.addPart(vocabularyItem,\r
-            MediaType.APPLICATION_XML_TYPE);\r
-        commonPart.setLabel(headerLabel);\r
-\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("to be created, vocabularyItem common ", vocabularyItem, VocabularyitemsCommon.class);\r
-        }\r
-\r
-        return multipart;\r
-    }\r
-\r
-    public static String createItemInVocabulary(String vcsid, \r
-               String vocabularyRefName, Map<String,String> itemMap,\r
-               VocabularyClient client ) {\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-\r
-       if(logger.isDebugEnabled()){\r
-               logger.debug("Import: Create Item: \""+itemMap.get(AuthorityItemJAXBSchema.SHORT_IDENTIFIER)\r
-                               +"\" in vocabularyAuthority: \"" + vcsid +"\"");\r
-       }\r
-       PoxPayloadOut multipart = createVocabularyItemInstance(null, //vocabularyRefName,\r
-                               itemMap, client.getItemCommonPartName());\r
-       ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
-\r
-       int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not create Item: \"" + itemMap.get(AuthorityItemJAXBSchema.DISPLAY_NAME)\r
-                               + "\" in personAuthority: \"" + vcsid //vocabularyRefName\r
-                               + "\" " + invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when creating Item: \""+itemMap.get(AuthorityItemJAXBSchema.DISPLAY_NAME)\r
-                               + "\" in vocabularyAuthority: \"" + vcsid /*vocabularyRefName*/ + "\", Status:" + statusCode);\r
-       }\r
-\r
-       return extractId(res);\r
-    }\r
-\r
-    /**\r
-     * Returns an error message indicating that the status code returned by a\r
-     * specific call to a service does not fall within a set of valid status\r
-     * codes for that service.\r
-     *\r
-     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).\r
-     *\r
-     * @param statusCode  The invalid status code that was returned in the response,\r
-     *                    from submitting that type of request to the service.\r
-     *\r
-     * @return An error message.\r
-     */\r
-    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {\r
-        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +\r
-                requestType.validStatusCodesAsString();\r
-    }\r
-\r
-    public static String extractId(ClientResponse<Response> res) {\r
-        MultivaluedMap<String, Object> mvm = res.getMetadata();\r
-        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);\r
-        if(logger.isDebugEnabled()){\r
-               logger.info("extractId:uri=" + uri);\r
-        }\r
-        String[] segments = uri.split("/");\r
-        String id = segments[segments.length - 1];\r
-        if(logger.isDebugEnabled()){\r
-               logger.debug("id=" + id);\r
-        }\r
-        return id;\r
-    }\r
-    \r
-    /*\r
-    public static String createVocabularyRefName(String shortIdentifier, String displaySuffix) {\r
-       String refName = "urn:cspace:org.collectionspace.demo:vocabulary:name("\r
-                       + shortIdentifier + ")";\r
-       if(displaySuffix != null && !displaySuffix.isEmpty())\r
-               refName += "'" + displaySuffix + "'";\r
-       return refName;\r
-    }\r
-\r
-    public static String createVocabularyItemRefName(\r
-                                               String vocabularyRefName, String shortIdentifier, String displaySuffix) {\r
-       String refName = vocabularyRefName+":item:name("+shortIdentifier+")";\r
-       if(displaySuffix != null && !displaySuffix.isEmpty())\r
-               refName += "'" + displaySuffix + "'";\r
-       return refName;\r
-    }\r
-    */\r
-\r
-}\r
+package org.collectionspace.services.client;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
+import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.vocabulary.VocabularyitemsCommon;
+import org.collectionspace.services.vocabulary.VocabulariesCommon;
+import org.jboss.resteasy.client.ClientResponse;
+//import org.jboss.resteasy.plugins.providers.multipart.PoxPayloadOut;
+//import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class VocabularyClientUtils {
+    private static final Logger logger =
+        LoggerFactory.getLogger(VocabularyClientUtils.class);
+    
+    public static PoxPayloadOut createEnumerationInstance(
+               String displayName, String shortIdentifier, String headerLabel ) {
+        VocabulariesCommon vocabulary = new VocabulariesCommon();
+        vocabulary.setDisplayName(displayName);
+        vocabulary.setShortIdentifier(shortIdentifier);
+        //String refName = createVocabularyRefName(shortIdentifier, displayName);
+        //vocabulary.setRefName(refName);
+        vocabulary.setVocabType("enum");
+        PoxPayloadOut multipart = new PoxPayloadOut(VocabularyClient.SERVICE_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(vocabulary, MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, vocabulary common for enumeration ", 
+                                       vocabulary, VocabulariesCommon.class);
+        }
+
+        return multipart;
+    }
+
+               // Note that we do not use the map, but we will once we add more info to the 
+               // items
+    public static PoxPayloadOut createVocabularyItemInstance( 
+               String vocabularyRefName, Map<String, String> vocabItemInfo, String headerLabel){
+        VocabularyitemsCommon vocabularyItem = new VocabularyitemsCommon();
+       String shortId = vocabItemInfo.get(AuthorityItemJAXBSchema.SHORT_IDENTIFIER);
+       String displayName = vocabItemInfo.get(AuthorityItemJAXBSchema.DISPLAY_NAME);
+               vocabularyItem.setShortIdentifier(shortId);
+               vocabularyItem.setDisplayName(displayName);
+       //String refName = createVocabularyItemRefName(vocabularyRefName, shortId, displayName);
+               //vocabularyItem.setRefName(refName);
+               PoxPayloadOut multipart = new PoxPayloadOut(VocabularyClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(vocabularyItem,
+            MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, vocabularyItem common ", vocabularyItem, VocabularyitemsCommon.class);
+        }
+
+        return multipart;
+    }
+
+    public static String createItemInVocabulary(String vcsid, 
+               String vocabularyRefName, Map<String,String> itemMap,
+               VocabularyClient client ) {
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+
+       if(logger.isDebugEnabled()){
+               logger.debug("Import: Create Item: \""+itemMap.get(AuthorityItemJAXBSchema.SHORT_IDENTIFIER)
+                               +"\" in vocabularyAuthority: \"" + vcsid +"\"");
+       }
+       PoxPayloadOut multipart = createVocabularyItemInstance(null, //vocabularyRefName,
+                               itemMap, client.getItemCommonPartName());
+       ClientResponse<Response> res = client.createItem(vcsid, multipart);
+
+       int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not create Item: \"" + itemMap.get(AuthorityItemJAXBSchema.DISPLAY_NAME)
+                               + "\" in personAuthority: \"" + vcsid //vocabularyRefName
+                               + "\" " + invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when creating Item: \""+itemMap.get(AuthorityItemJAXBSchema.DISPLAY_NAME)
+                               + "\" in vocabularyAuthority: \"" + vcsid /*vocabularyRefName*/ + "\", Status:" + statusCode);
+       }
+
+       return extractId(res);
+    }
+
+    /**
+     * Returns an error message indicating that the status code returned by a
+     * specific call to a service does not fall within a set of valid status
+     * codes for that service.
+     *
+     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).
+     *
+     * @param statusCode  The invalid status code that was returned in the response,
+     *                    from submitting that type of request to the service.
+     *
+     * @return An error message.
+     */
+    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {
+        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +
+                requestType.validStatusCodesAsString();
+    }
+
+    public static String extractId(ClientResponse<Response> res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);
+        if(logger.isDebugEnabled()){
+               logger.info("extractId:uri=" + uri);
+        }
+        String[] segments = uri.split("/");
+        String id = segments[segments.length - 1];
+        if(logger.isDebugEnabled()){
+               logger.debug("id=" + id);
+        }
+        return id;
+    }
+    
+    /*
+    public static String createVocabularyRefName(String shortIdentifier, String displaySuffix) {
+       String refName = "urn:cspace:org.collectionspace.demo:vocabulary:name("
+                       + shortIdentifier + ")";
+       if(displaySuffix != null && !displaySuffix.isEmpty())
+               refName += "'" + displaySuffix + "'";
+       return refName;
+    }
+
+    public static String createVocabularyItemRefName(
+                                               String vocabularyRefName, String shortIdentifier, String displaySuffix) {
+       String refName = vocabularyRefName+":item:name("+shortIdentifier+")";
+       if(displaySuffix != null && !displaySuffix.isEmpty())
+               refName += "'" + displaySuffix + "'";
+       return refName;
+    }
+    */
+
+}
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
index 156a1135fbfb3110381b7d454c5ff9a2a80a128c..a87c4b6522b5d24be56bfbb2e124856d95dff1c1 100644 (file)
@@ -1,61 +1,61 @@
-\r
-<project name="vocabulary" default="package" basedir=".">\r
-    <description>\r
-        vocabulary service\r
-    </description>\r
-  <!-- set global properties for this build -->\r
-    <property name="services.trunk" value="../.."/>\r
-    <property file="${services.trunk}/build.properties" />\r
-    <property name="mvn.opts" value="-V" />\r
-    <property name="src" location="src"/>\r
-\r
-    <condition property="osfamily-unix">\r
-        <os family="unix" />\r
-    </condition>\r
-    <condition property="osfamily-windows">\r
-        <os family="windows" />\r
-    </condition>\r
-    \r
-    <target name="install" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Vocabulary Service's &apos;install&apos; target." />\r
-                               </exec>\r
-                               <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->\r
-        <copy todir="${jee.deploy.nuxeo.plugins}">\r
-            <fileset file="nuxeo/*.jar"/>\r
-        </copy>                                \r
-    </target>    \r
-\r
-    <target name="config" description="" depends="install">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Vocabulary Service's &apos;config&apos; target." />\r
-                               </exec>\r
-    </target>\r
-    \r
-    <target name="predeploy" description="" depends="config">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Vocabulary Service's &apos;predeploy&apos; target." />\r
-                               </exec>\r
-    </target>    \r
-    \r
-    <target name="deploy" description="">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing Vocabulary Service's &apos;deploy&apos; target." />\r
-                               </exec>\r
-    </target>\r
-    \r
-    <target name="postdeploy">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Vocabulary Service." />\r
-                               </exec>         \r
-        <exec executable="echo">\r
-                       <arg value="Importing necessary vocabularies." />\r
-                               </exec>                         \r
-        <java jar="./postdeploy/collectionspace-services-vocabulary-importer-jar-with-dependencies.jar"\r
-               fork="true"\r
-               failonerror="true">\r
-                               </java> \r
-    </target>\r
-    \r
-\r
-</project>\r
+
+<project name="vocabulary" default="package" basedir=".">
+    <description>
+        vocabulary service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="-V" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+    
+    <target name="install" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Vocabulary Service's &apos;install&apos; target." />
+                               </exec>
+                               <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->
+        <copy todir="${jee.deploy.nuxeo.plugins}">
+            <fileset file="nuxeo/*.jar"/>
+        </copy>                                
+    </target>    
+
+    <target name="config" description="" depends="install">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Vocabulary Service's &apos;config&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="predeploy" description="" depends="config">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Vocabulary Service's &apos;predeploy&apos; target." />
+                               </exec>
+    </target>    
+    
+    <target name="deploy" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Vocabulary Service's &apos;deploy&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="postdeploy">
+        <exec executable="echo">
+                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Vocabulary Service." />
+                               </exec>         
+        <exec executable="echo">
+                       <arg value="Importing necessary vocabularies." />
+                               </exec>                         
+        <java jar="./postdeploy/collectionspace-services-vocabulary-importer-jar-with-dependencies.jar"
+               fork="true"
+               failonerror="true">
+                               </java> 
+    </target>
+    
+
+</project>
index d409970a940940d7a929eecc65f394954f4d89b6..7cdf6d82ae01304bd57a6495fc526275da8e256c 100644 (file)
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
-    <parent>\r
-        <artifactId>org.collectionspace.services.main</artifactId>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.vocabulary</artifactId>\r
-    <name>services.vocabulary</name>\r
-    <packaging>pom</packaging>\r
-\r
-    <dependencies>\r
-                       <!--\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>    \r
-                               -->\r
-    </dependencies>\r
-\r
-    <modules>\r
-        <module>jaxb</module>\r
-        <module>service</module>\r
-        <module>3rdparty</module>\r
-        <module>client</module>\r
-    </modules>\r
-\r
-    <profiles>\r
-        <profile>\r
-            <id>samples</id>\r
-            <modules>\r
-                <module>sample</module>\r
-            </modules>\r
-        </profile>\r
-    </profiles>\r
-\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.vocabulary</artifactId>
+    <name>services.vocabulary</name>
+    <packaging>pom</packaging>
+
+    <dependencies>
+                       <!--
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>    
+                               -->
+    </dependencies>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+
+    <profiles>
+        <profile>
+            <id>samples</id>
+            <modules>
+                <module>sample</module>
+            </modules>
+        </profile>
+    </profiles>
+
+</project>
+
index d8f291998b83cb5e57273cbcdd6b0a69867b82e5..a225f00dbd3f7ae6b600dda5716d0140d1027d69 100644 (file)
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
index 89c52d5274c758f55f0f79c220a8909579db1dde..2366e4ffaa4f09a64fe72e69c3209cffd26c554c 100644 (file)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.vocabulary.client.samples</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.vocabulary.client.samples</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index e5aec84a3d9bb7e439f58d0401062317a382ad21..574b8fe6c972d0dfedf94344c4698b4586cec8cf 100644 (file)
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.vocabulary.client.samples</artifactId>\r
-    <packaging>pom</packaging>\r
-    <version>1.0</version>\r
-    <name>vocabulary.client.samples</name>\r
-\r
-    <modules>\r
-        <module>sample</module>\r
-    </modules>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.vocabulary.client.samples</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0</version>
+    <name>vocabulary.client.samples</name>
+
+    <modules>
+        <module>sample</module>
+    </modules>
+</project>
+
index e08b6fd1a36566bbea12c7a569e19f792a465a47..524e532e81e7dad5554029e9623ebeac6aa31af1 100644 (file)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>org.collectionspace.services.vocabulary.client.sample</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.jdt.core.javabuilder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.eclipse.m2e.core.maven2Builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.jdt.core.javanature</nature>\r
-               <nature>org.eclipse.m2e.core.maven2Nature</nature>\r
-       </natures>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.vocabulary.client.sample</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
index ffa0516ae01bc63cdf2a0dfcc041a20457437b8b..4988b2285f86c3db607fb6650a2dcb28382f7232 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <modelVersion>4.0.0</modelVersion>\r
-    <groupId>org.collectionspace.services</groupId>\r
-    <artifactId>org.collectionspace.services.vocabulary.client.sample</artifactId>\r
-    <packaging>jar</packaging>\r
-    <version>4.2-SNAPSHOT</version>\r
-    <name>vocabulary.client.sample</name>\r
-    \r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.vocabulary.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-    </dependencies>\r
-    \r
-    <repositories>\r
-        <repository>\r
-            <id>libs-releases-local</id>\r
-            <name>libs-releases-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>\r
-            <releases>\r
-                <enabled>true</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>false</enabled>\r
-            </snapshots>            \r
-        </repository>        \r
-        <repository>\r
-            <id>libs-snapshots-local</id>\r
-            <name>libs-snapshots-local</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>\r
-            <releases>\r
-                <enabled>false</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>true</enabled>\r
-            </snapshots>            \r
-        </repository>\r
-\r
-        <repository>\r
-            <id>collectionspace-releases</id>\r
-            <name>collectionspace-releases</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public</url>            \r
-            <releases>\r
-                <enabled>true</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>false</enabled>\r
-            </snapshots>            \r
-        </repository>\r
-        <repository>\r
-            <id>nuxeo-public-snapshot</id>\r
-            <name>nuxeo-public-snapshot</name>\r
-            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public-snapshot</url>\r
-            <releases>\r
-                <enabled>false</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>true</enabled>\r
-            </snapshots>\r
-        </repository>\r
-<!--        \r
-        <repository>\r
-            <id>nuxeo-public-snapshot</id>\r
-            <url>http://maven.nuxeo.org/public-snapshot/</url>\r
-            <releases>\r
-                <enabled>false</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>true</enabled>\r
-            </snapshots>\r
-        </repository>\r
-        <repository>\r
-            <id>nuxeo-public</id>\r
-            <url>http://maven.nuxeo.org/public/</url>\r
-            <releases>\r
-                <enabled>true</enabled>\r
-            </releases>\r
-            <snapshots>\r
-                <enabled>false</enabled>\r
-            </snapshots>\r
-        </repository>        \r
--->        \r
-    </repositories>    \r
-    \r
-    <build>\r
-        <finalName>vocabulary-client-sample</finalName>\r
-        <plugins>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-assembly-plugin</artifactId>\r
-                <executions>\r
-                    <execution>\r
-                        <goals>\r
-                            <goal>attached</goal>\r
-                        </goals>\r
-                        <phase>package</phase>\r
-                        <configuration>\r
-                            <descriptorRefs>\r
-                                <descriptorRef>jar-with-dependencies</descriptorRef>\r
-                            </descriptorRefs>\r
-                            <archive>\r
-                                <manifest>\r
-                                    <mainClass>org.collectionspace.services.vocabulary.client.sample.Sample</mainClass>\r
-                                </manifest>\r
-                            </archive>\r
-                        </configuration>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
-            <plugin>\r
-                <groupId>org.apache.maven.plugins</groupId>\r
-                <artifactId>maven-compiler-plugin</artifactId>\r
-                <configuration>\r
-                    <source>1.7</source>\r
-                    <target>1.7</target>\r
-                </configuration>\r
-            </plugin>\r
-        </plugins>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.vocabulary.client.sample</artifactId>
+    <packaging>jar</packaging>
+    <version>4.2-SNAPSHOT</version>
+    <name>vocabulary.client.sample</name>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.vocabulary.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    
+    <repositories>
+        <repository>
+            <id>libs-releases-local</id>
+            <name>libs-releases-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-release-local</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>            
+        </repository>        
+        <repository>
+            <id>libs-snapshots-local</id>
+            <name>libs-snapshots-local</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/libs-snapshot-local</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>            
+        </repository>
+
+        <repository>
+            <id>collectionspace-releases</id>
+            <name>collectionspace-releases</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public</url>            
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>            
+        </repository>
+        <repository>
+            <id>nuxeo-public-snapshot</id>
+            <name>nuxeo-public-snapshot</name>
+            <url>http://nightly.collectionspace.org:8081/artifactory/nuxeo-public-snapshot</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+<!--        
+        <repository>
+            <id>nuxeo-public-snapshot</id>
+            <url>http://maven.nuxeo.org/public-snapshot/</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+        <repository>
+            <id>nuxeo-public</id>
+            <url>http://maven.nuxeo.org/public/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>        
+-->        
+    </repositories>    
+    
+    <build>
+        <finalName>vocabulary-client-sample</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>attached</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <descriptorRefs>
+                                <descriptorRef>jar-with-dependencies</descriptorRef>
+                            </descriptorRefs>
+                            <archive>
+                                <manifest>
+                                    <mainClass>org.collectionspace.services.vocabulary.client.sample.Sample</mainClass>
+                                </manifest>
+                            </archive>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
index ee006622b566b8139a4ee8427c459ac1d8930d86..897604a456ea0046cf1747cd3d3f16f71093856f 100644 (file)
-/**\r
- * This document is a part of the source code and related artifacts\r
- * for CollectionSpace, an open source collections management system\r
- * for museums and related institutions:\r
- *\r
- * http://www.collectionspace.org\r
- * http://wiki.collectionspace.org\r
- *\r
- * Copyright (c)) 2009 Regents of the University of California\r
- *\r
- * Licensed under the Educational Community License (ECL), Version 2.0.\r
- * You may not use this file except in compliance with this License.\r
- *\r
- * You may obtain a copy of the ECL 2.0 License at\r
- * https://source.collectionspace.org/collection-space/LICENSE.txt\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.collectionspace.services.vocabulary.client.sample;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Arrays;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.apache.log4j.BasicConfigurator;\r
-//import org.collectionspace.services.VocabularyItemJAXBSchema; \r
-import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;\r
-\r
-import org.collectionspace.services.client.PayloadInputPart;\r
-import org.collectionspace.services.client.PoxPayloadIn;\r
-import org.collectionspace.services.client.PoxPayloadOut;\r
-import org.collectionspace.services.client.VocabularyClient;\r
-import org.collectionspace.services.client.VocabularyClientUtils;\r
-import org.collectionspace.services.client.test.ServiceRequestType;\r
-import org.collectionspace.services.vocabulary.VocabulariesCommon;\r
-import org.collectionspace.services.vocabulary.VocabulariesCommonList;\r
-import org.collectionspace.services.vocabulary.VocabularyitemsCommon;\r
-import org.collectionspace.services.vocabulary.VocabularyitemsCommonList;\r
-import org.jboss.resteasy.client.ClientResponse;\r
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;\r
-import org.jboss.resteasy.plugins.providers.multipart.OutputPart;\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-/**\r
- * VocabularyServiceTest, carries out tests against a\r
- * deployed and running Vocabulary Service.\r
- *\r
- * $LastChangedRevision$\r
- * $LastChangedDate$\r
- */\r
-public class Sample {\r
-    private static final Logger logger =\r
-        LoggerFactory.getLogger(Sample.class);\r
-\r
-    // Instance variables specific to this test.\r
-    private VocabularyClient client = new VocabularyClient();\r
-    final String SERVICE_PATH_COMPONENT = "vocabularies";\r
-    final String ITEM_SERVICE_PATH_COMPONENT = "items";\r
-\r
-\r
-    // ---------------------------------------------------------------\r
-    // Create\r
-    // ---------------------------------------------------------------\r
-\r
-    public void createEnumeration(String vocabName, List<String> enumValues ) {\r
-\r
-       // Expected status code: 201 Created\r
-       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
-\r
-       if(logger.isDebugEnabled()){\r
-               logger.debug("Import: Create vocabulary: \"" + vocabName +"\"");\r
-       }\r
-\r
-        String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: Laramie20100728 temp fix, made-up displaySuffix.\r
-        String baseVocabRefName = VocabularyClientUtils.createVocabularyRefName(vocabName, displaySuffix);   //TODO: Laramie20100728 temp fix  was vocabName, false\r
-       String fullVocabRefName = VocabularyClientUtils.createVocabularyRefName(vocabName, displaySuffix);   //TODO: Laramie20100728 temp fix  was vocabName, true\r
-       PoxPayloadOut multipart = VocabularyClientUtils.createEnumerationInstance(\r
-                       vocabName, fullVocabRefName, client.getCommonPartName());\r
-       ClientResponse<Response> res = client.create(multipart);\r
-\r
-       int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not create enumeration: \""+vocabName\r
-                               +"\" "+ VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when creating enumeration: \""\r
-                               +vocabName +"\", Status:"+ statusCode);\r
-       }\r
-\r
-       // Store the ID returned from this create operation\r
-       // for additional tests below.\r
-       String newVocabId = VocabularyClientUtils.extractId(res);\r
-       if(logger.isDebugEnabled()){\r
-               logger.debug("Import: Created vocabulary: \"" + vocabName +"\" ID:"\r
-                               +newVocabId );\r
-       }\r
-       for(String itemName : enumValues){\r
-            HashMap<String, String> itemInfo = new HashMap<String, String>();\r
-            itemInfo.put(AuthorityItemJAXBSchema.DISPLAY_NAME, itemName);\r
-               VocabularyClientUtils.createItemInVocabulary(newVocabId, \r
-                               baseVocabRefName, itemInfo, client);\r
-       }\r
-    }\r
-    \r
-   // ---------------------------------------------------------------\r
-   // Read\r
-   // ---------------------------------------------------------------\r
-\r
-   private VocabulariesCommonList readVocabularies() {\r
-\r
-        // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
-\r
-        // Submit the request to the service and store the response.\r
-        ClientResponse<VocabulariesCommonList> res = client.readList();\r
-        VocabulariesCommonList list = res.getEntity();\r
-\r
-        int statusCode = res.getStatus();\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not read list of vocabularies: "\r
-                + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when reading " +\r
-                "list of vocabularies, Status:"+ statusCode);\r
-       }\r
-\r
-        return list;\r
-   }\r
-\r
-    private List<String> readVocabularyIds(VocabulariesCommonList list) {\r
-\r
-        List<String> ids = new ArrayList<String>();\r
-        List<VocabulariesCommonList.VocabularyListItem> vocabularies =\r
-            list.getVocabularyListItem();\r
-        for (VocabulariesCommonList.VocabularyListItem vocabulary : vocabularies) {\r
-            ids.add(vocabulary.getCsid());\r
-        }\r
-        return ids;\r
-   }\r
-    \r
-   private VocabulariesCommon readVocabulary(String vocabId) {\r
-\r
-        // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
-\r
-        // Submit the request to the service and store the response.\r
-        VocabulariesCommon vocabulary = null;\r
-        try {\r
-            ClientResponse<String> res = client.read(vocabId);\r
-            int statusCode = res.getStatus();\r
-            if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-                throw new RuntimeException("Could not read vocabulary"\r
-                    + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-            }\r
-            if(statusCode != EXPECTED_STATUS_CODE) {\r
-                throw new RuntimeException("Unexpected Status when reading " +\r
-                    "vocabulary, Status:"+ statusCode);\r
-            }\r
-            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());\r
-            vocabulary = (VocabulariesCommon) extractPart(input,\r
-                    client.getCommonPartName(), VocabulariesCommon.class);\r
-        } catch (Exception e) {\r
-            throw new RuntimeException("Could not read vocabulary: ", e);\r
-        }\r
-\r
-        return vocabulary;\r
-    }\r
-\r
-    private VocabularyitemsCommonList readItemsInVocab(String vocabId) {\r
-\r
-        // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
-\r
-        // Submit the request to the service and store the response.\r
-                          //  readItemList(String inAuthority, String partialTerm, String keywords)\r
-        ClientResponse<VocabularyitemsCommonList> res =  client.readItemList(vocabId, "", ""); //TODO: figure out these params.  I just put in empty string to make it recompile after refactoring.  Laramie20100728\r
-        VocabularyitemsCommonList list = res.getEntity();\r
-\r
-        int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not read items in vocabulary: "\r
-                + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when reading " +\r
-                "items in vocabulary, Status:"+ statusCode);\r
-       }\r
-\r
-        return list;\r
-    }\r
-\r
-    private List<String> readVocabularyItemIds(VocabularyitemsCommonList list) {\r
-\r
-        List<String> ids = new ArrayList<String>();\r
-        List<VocabularyitemsCommonList.VocabularyitemListItem> items =\r
-            list.getVocabularyitemListItem();\r
-        for (VocabularyitemsCommonList.VocabularyitemListItem item : items) {\r
-            ids.add(item.getCsid());\r
-        }\r
-        return ids;\r
-   }\r
-\r
-    // ---------------------------------------------------------------\r
-    // Delete\r
-    // ---------------------------------------------------------------\r
-\r
-    private void deleteVocabulary(String vcsid) {\r
-         // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
-\r
-        ClientResponse<Response> res = client.delete(vcsid);\r
-        int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not delete vocabulary: "\r
-                + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when deleting " +\r
-                "vocabulary, Status:"+ statusCode);\r
-       }\r
-    }\r
-\r
-    private void deleteAllVocabularies() {\r
-        List<String> ids = readVocabularyIds(readVocabularies());\r
-        for (String id : ids) {\r
-            deleteVocabulary(id);\r
-        }\r
-    }\r
-\r
-        private void deleteVocabularyItem(String vcsid, String itemcsid) {\r
-         // Expected status code: 200 OK\r
-       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
-       // Type of service request being tested\r
-       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
-\r
-        ClientResponse<Response> res = client.deleteItem(vcsid, itemcsid);\r
-        int statusCode = res.getStatus();\r
-\r
-       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
-               throw new RuntimeException("Could not delete vocabulary item: "\r
-                + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-       }\r
-       if(statusCode != EXPECTED_STATUS_CODE) {\r
-               throw new RuntimeException("Unexpected Status when deleting " +\r
-                "vocabulary item, Status:"+ statusCode);\r
-       }\r
-    }\r
-\r
-    private void deleteAllItemsForVocab(String vocabId) {\r
-        List<String> itemIds = readVocabularyItemIds(readItemsInVocab(vocabId));\r
-        for (String itemId : itemIds) {\r
-            deleteVocabularyItem(vocabId, itemId);\r
-        }\r
-    }\r
-\r
-    // ---------------------------------------------------------------\r
-    // Utility methods used by tests above\r
-    // ---------------------------------------------------------------\r
-\r
-    // Retrieve individual fields of vocabulary records.\r
-\r
-    private String displayAllVocabularies(VocabulariesCommonList list) {\r
-        StringBuffer sb = new StringBuffer();\r
-            List<VocabulariesCommonList.VocabularyListItem> vocabularies =\r
-                    list.getVocabularyListItem();\r
-            int i = 0;\r
-        for (VocabulariesCommonList.VocabularyListItem vocabulary : vocabularies) {\r
-            sb.append("vocabulary [" + i + "]" + "\n");\r
-            sb.append(displayVocabularyDetails(vocabulary));\r
-            i++;\r
-        }\r
-        return sb.toString();\r
-    }\r
-\r
-    private String displayVocabularyDetails(\r
-        VocabulariesCommonList.VocabularyListItem vocabulary) {\r
-            StringBuffer sb = new StringBuffer();\r
-            sb.append("displayName=" + vocabulary.getDisplayName() + "\n");\r
-            sb.append("vocabType=" + vocabulary.getVocabType() + "\n");\r
-            // sb.append("csid=" + vocabulary.getCsid() + "\n");\r
-            sb.append("URI=" + vocabulary.getUri() + "\n");\r
-        return sb.toString();\r
-    }\r
-\r
-    // Retrieve individual fields of vocabulary item records.\r
-\r
-    private String displayAllVocabularyItems(VocabularyitemsCommonList list) {\r
-        StringBuffer sb = new StringBuffer();\r
-        List<VocabularyitemsCommonList.VocabularyitemListItem> items =\r
-                list.getVocabularyitemListItem();\r
-        int i = 0;\r
-        for (VocabularyitemsCommonList.VocabularyitemListItem item : items) {\r
-            sb.append("vocabulary item [" + i + "]" + "\n");\r
-            sb.append(displayVocabularyItemDetails(item));\r
-            i++;\r
-        }\r
-        return sb.toString();\r
-    }\r
-\r
-    private String displayVocabularyItemDetails(\r
-        VocabularyitemsCommonList.VocabularyitemListItem item) {\r
-            StringBuffer sb = new StringBuffer();\r
-            sb.append("csid=" + item.getCsid() + "\n");\r
-            sb.append("displayName=" + item.getDisplayName() + "\n");\r
-            // sb.append("URI=" + item.getUri() + "\n");\r
-        return sb.toString();\r
-    }\r
-\r
-    // TODO this should be moved to a common utils class\r
-    private Object extractPart(PoxPayloadIn input, String label,\r
-        Class clazz) throws Exception {\r
-        Object obj = null;\r
-        obj = input.getPart(label);\r
-        /*\r
-        for(PayloadInputPart part : input.getParts()){\r
-            String partLabel = part.getHeaders().getFirst("label");\r
-            if(label.equalsIgnoreCase(partLabel)){\r
-                String partStr = part.getBodyAsString();\r
-                if(logger.isDebugEnabled()){\r
-                    logger.debug("extracted part str=\n" + partStr);\r
-                }\r
-                obj = part.getBody(clazz, null);\r
-                if(logger.isDebugEnabled()){\r
-                    logger.debug("extracted part obj=\n", obj, clazz);\r
-                }\r
-                break;\r
-            }\r
-        }\r
-        */\r
-        return obj;\r
-    }\r
-\r
-       public static void main(String[] args) {\r
-\r
-        // Configure logging.\r
-               BasicConfigurator.configure();\r
-\r
-        logger.info("VocabularyBaseImport starting...");\r
-\r
-               Sample vbi = new Sample();\r
-        VocabulariesCommonList vocabularies;\r
-        List<String> vocabIds;\r
-        String details = "";\r
-\r
-        // Optionally delete all vocabularies and vocabulary items.\r
-\r
-        boolean ENABLE_DELETE_ALL = false;\r
-        if (ENABLE_DELETE_ALL) {\r
-\r
-            logger.info("Deleting all vocabulary items and vocabularies ...");\r
-\r
-            // For each vocabulary ...\r
-            vocabularies = vbi.readVocabularies();\r
-            vocabIds = vbi.readVocabularyIds(vocabularies);\r
-            for (String vocabId : vocabIds) {\r
-                logger.info("Deleting all vocabulary items for vocabulary ...");\r
-                vbi.deleteAllItemsForVocab(vocabId);\r
-                logger.info("Deleting vocabulary ...");\r
-                vbi.deleteVocabulary(vocabId);\r
-            }\r
-\r
-            logger.info("Reading vocabularies after deletion ...");\r
-            vocabularies = vbi.readVocabularies();\r
-            details = vbi.displayAllVocabularies(vocabularies);\r
-            logger.info(details);\r
-\r
-            logger.info("Reading items in each vocabulary after deletion ...");\r
-            vocabIds = vbi.readVocabularyIds(vocabularies);\r
-            for (String vocabId : vocabIds) {\r
-                VocabularyitemsCommonList items = vbi.readItemsInVocab(vocabId);\r
-                details = vbi.displayAllVocabularyItems(items);\r
-                logger.info(details);\r
-            }\r
-\r
-        }\r
-\r
-        // Create new vocabularies, each populated with vocabulary items.\r
-\r
-               final String acquisitionMethodsVocabName = "Acquisition Methods";\r
-               final String entryMethodsVocabName = "Entry Methods";\r
-               final String entryReasonsVocabName = "Entry Reasons";\r
-               final String responsibleDeptsVocabName = "Responsible Departments";\r
-\r
-               List<String> acquisitionMethodsEnumValues = \r
-                       Arrays.asList("Gift","Purchase","Exchange","Transfer","Treasure");\r
-               List<String> entryMethodsEnumValues = \r
-                       Arrays.asList("In person","Post","Found on doorstep");\r
-               List<String> entryReasonsEnumValues = \r
-                       Arrays.asList("Enquiry","Commission","Loan");\r
-               List<String> respDeptNamesEnumValues = \r
-                       Arrays.asList("Antiquities","Architecture and Design","Decorative Arts",\r
-                                                                       "Ethnography","Herpetology","Media and Performance Art",\r
-                                                                       "Paintings and Sculpture","Paleobotany","Photographs",\r
-                                                                       "Prints and Drawings");\r
-        \r
-               vbi.createEnumeration(acquisitionMethodsVocabName, acquisitionMethodsEnumValues);\r
-               vbi.createEnumeration(entryMethodsVocabName, entryMethodsEnumValues);\r
-               vbi.createEnumeration(entryReasonsVocabName, entryReasonsEnumValues);\r
-               vbi.createEnumeration(responsibleDeptsVocabName, respDeptNamesEnumValues);\r
-\r
-               logger.info("VocabularyBaseImport complete.");\r
-\r
-        logger.info("Reading vocabularies and items ...");\r
-        // Get a list of vocabularies.\r
-        vocabularies = vbi.readVocabularies();\r
-        // For each vocabulary ...\r
-        for (VocabulariesCommonList.VocabularyListItem\r
-            vocabulary : vocabularies.getVocabularyListItem()) {\r
-            // Get its display name.\r
-            logger.info(vocabulary.getDisplayName());\r
-            // Get a list of the vocabulary items in this vocabulary.\r
-            VocabularyitemsCommonList items =\r
-                vbi.readItemsInVocab(vocabulary.getCsid());\r
-            // For each vocabulary item ...\r
-            for (VocabularyitemsCommonList.VocabularyitemListItem\r
-                item : items.getVocabularyitemListItem()) {\r
-                // Get its display name.\r
-                logger.info(" " + item.getDisplayName());\r
-            }\r
-        }\r
-\r
-        // Sample alternate methods of reading all vocabularies and\r
-        // vocabulary items separately.\r
-        boolean RUN_ADDITIONAL_SAMPLES = false;\r
-        if (RUN_ADDITIONAL_SAMPLES) {\r
-\r
-            logger.info("Reading all vocabularies ...");\r
-            details = vbi.displayAllVocabularies(vocabularies);\r
-            logger.info(details);\r
-\r
-            logger.info("Reading all vocabulary items ...");\r
-            vocabIds = vbi.readVocabularyIds(vocabularies);\r
-            for (String vocabId : vocabIds) {\r
-                VocabularyitemsCommonList items = vbi.readItemsInVocab(vocabId);\r
-                details = vbi.displayAllVocabularyItems(items);\r
-                logger.info(details);\r
-            }\r
-\r
-        }\r
-\r
-       }\r
-\r
-}\r
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c)) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.collectionspace.services.vocabulary.client.sample;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+
+import org.apache.log4j.BasicConfigurator;
+//import org.collectionspace.services.VocabularyItemJAXBSchema; 
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
+
+import org.collectionspace.services.client.PayloadInputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.client.VocabularyClient;
+import org.collectionspace.services.client.VocabularyClientUtils;
+import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.vocabulary.VocabulariesCommon;
+import org.collectionspace.services.vocabulary.VocabulariesCommonList;
+import org.collectionspace.services.vocabulary.VocabularyitemsCommon;
+import org.collectionspace.services.vocabulary.VocabularyitemsCommonList;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.multipart.InputPart;
+import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * VocabularyServiceTest, carries out tests against a
+ * deployed and running Vocabulary Service.
+ *
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ */
+public class Sample {
+    private static final Logger logger =
+        LoggerFactory.getLogger(Sample.class);
+
+    // Instance variables specific to this test.
+    private VocabularyClient client = new VocabularyClient();
+    final String SERVICE_PATH_COMPONENT = "vocabularies";
+    final String ITEM_SERVICE_PATH_COMPONENT = "items";
+
+
+    // ---------------------------------------------------------------
+    // Create
+    // ---------------------------------------------------------------
+
+    public void createEnumeration(String vocabName, List<String> enumValues ) {
+
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+
+       if(logger.isDebugEnabled()){
+               logger.debug("Import: Create vocabulary: \"" + vocabName +"\"");
+       }
+
+        String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: Laramie20100728 temp fix, made-up displaySuffix.
+        String baseVocabRefName = VocabularyClientUtils.createVocabularyRefName(vocabName, displaySuffix);   //TODO: Laramie20100728 temp fix  was vocabName, false
+       String fullVocabRefName = VocabularyClientUtils.createVocabularyRefName(vocabName, displaySuffix);   //TODO: Laramie20100728 temp fix  was vocabName, true
+       PoxPayloadOut multipart = VocabularyClientUtils.createEnumerationInstance(
+                       vocabName, fullVocabRefName, client.getCommonPartName());
+       ClientResponse<Response> res = client.create(multipart);
+
+       int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not create enumeration: \""+vocabName
+                               +"\" "+ VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when creating enumeration: \""
+                               +vocabName +"\", Status:"+ statusCode);
+       }
+
+       // Store the ID returned from this create operation
+       // for additional tests below.
+       String newVocabId = VocabularyClientUtils.extractId(res);
+       if(logger.isDebugEnabled()){
+               logger.debug("Import: Created vocabulary: \"" + vocabName +"\" ID:"
+                               +newVocabId );
+       }
+       for(String itemName : enumValues){
+            HashMap<String, String> itemInfo = new HashMap<String, String>();
+            itemInfo.put(AuthorityItemJAXBSchema.DISPLAY_NAME, itemName);
+               VocabularyClientUtils.createItemInVocabulary(newVocabId, 
+                               baseVocabRefName, itemInfo, client);
+       }
+    }
+    
+   // ---------------------------------------------------------------
+   // Read
+   // ---------------------------------------------------------------
+
+   private VocabulariesCommonList readVocabularies() {
+
+        // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;
+
+        // Submit the request to the service and store the response.
+        ClientResponse<VocabulariesCommonList> res = client.readList();
+        VocabulariesCommonList list = res.getEntity();
+
+        int statusCode = res.getStatus();
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not read list of vocabularies: "
+                + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when reading " +
+                "list of vocabularies, Status:"+ statusCode);
+       }
+
+        return list;
+   }
+
+    private List<String> readVocabularyIds(VocabulariesCommonList list) {
+
+        List<String> ids = new ArrayList<String>();
+        List<VocabulariesCommonList.VocabularyListItem> vocabularies =
+            list.getVocabularyListItem();
+        for (VocabulariesCommonList.VocabularyListItem vocabulary : vocabularies) {
+            ids.add(vocabulary.getCsid());
+        }
+        return ids;
+   }
+    
+   private VocabulariesCommon readVocabulary(String vocabId) {
+
+        // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;
+
+        // Submit the request to the service and store the response.
+        VocabulariesCommon vocabulary = null;
+        try {
+            ClientResponse<String> res = client.read(vocabId);
+            int statusCode = res.getStatus();
+            if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                throw new RuntimeException("Could not read vocabulary"
+                    + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+            }
+            if(statusCode != EXPECTED_STATUS_CODE) {
+                throw new RuntimeException("Unexpected Status when reading " +
+                    "vocabulary, Status:"+ statusCode);
+            }
+            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+            vocabulary = (VocabulariesCommon) extractPart(input,
+                    client.getCommonPartName(), VocabulariesCommon.class);
+        } catch (Exception e) {
+            throw new RuntimeException("Could not read vocabulary: ", e);
+        }
+
+        return vocabulary;
+    }
+
+    private VocabularyitemsCommonList readItemsInVocab(String vocabId) {
+
+        // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;
+
+        // Submit the request to the service and store the response.
+                          //  readItemList(String inAuthority, String partialTerm, String keywords)
+        ClientResponse<VocabularyitemsCommonList> res =  client.readItemList(vocabId, "", ""); //TODO: figure out these params.  I just put in empty string to make it recompile after refactoring.  Laramie20100728
+        VocabularyitemsCommonList list = res.getEntity();
+
+        int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not read items in vocabulary: "
+                + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when reading " +
+                "items in vocabulary, Status:"+ statusCode);
+       }
+
+        return list;
+    }
+
+    private List<String> readVocabularyItemIds(VocabularyitemsCommonList list) {
+
+        List<String> ids = new ArrayList<String>();
+        List<VocabularyitemsCommonList.VocabularyitemListItem> items =
+            list.getVocabularyitemListItem();
+        for (VocabularyitemsCommonList.VocabularyitemListItem item : items) {
+            ids.add(item.getCsid());
+        }
+        return ids;
+   }
+
+    // ---------------------------------------------------------------
+    // Delete
+    // ---------------------------------------------------------------
+
+    private void deleteVocabulary(String vcsid) {
+         // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;
+
+        ClientResponse<Response> res = client.delete(vcsid);
+        int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not delete vocabulary: "
+                + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when deleting " +
+                "vocabulary, Status:"+ statusCode);
+       }
+    }
+
+    private void deleteAllVocabularies() {
+        List<String> ids = readVocabularyIds(readVocabularies());
+        for (String id : ids) {
+            deleteVocabulary(id);
+        }
+    }
+
+        private void deleteVocabularyItem(String vcsid, String itemcsid) {
+         // Expected status code: 200 OK
+       int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;
+
+        ClientResponse<Response> res = client.deleteItem(vcsid, itemcsid);
+        int statusCode = res.getStatus();
+
+       if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+               throw new RuntimeException("Could not delete vocabulary item: "
+                + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+       }
+       if(statusCode != EXPECTED_STATUS_CODE) {
+               throw new RuntimeException("Unexpected Status when deleting " +
+                "vocabulary item, Status:"+ statusCode);
+       }
+    }
+
+    private void deleteAllItemsForVocab(String vocabId) {
+        List<String> itemIds = readVocabularyItemIds(readItemsInVocab(vocabId));
+        for (String itemId : itemIds) {
+            deleteVocabularyItem(vocabId, itemId);
+        }
+    }
+
+    // ---------------------------------------------------------------
+    // Utility methods used by tests above
+    // ---------------------------------------------------------------
+
+    // Retrieve individual fields of vocabulary records.
+
+    private String displayAllVocabularies(VocabulariesCommonList list) {
+        StringBuffer sb = new StringBuffer();
+            List<VocabulariesCommonList.VocabularyListItem> vocabularies =
+                    list.getVocabularyListItem();
+            int i = 0;
+        for (VocabulariesCommonList.VocabularyListItem vocabulary : vocabularies) {
+            sb.append("vocabulary [" + i + "]" + "\n");
+            sb.append(displayVocabularyDetails(vocabulary));
+            i++;
+        }
+        return sb.toString();
+    }
+
+    private String displayVocabularyDetails(
+        VocabulariesCommonList.VocabularyListItem vocabulary) {
+            StringBuffer sb = new StringBuffer();
+            sb.append("displayName=" + vocabulary.getDisplayName() + "\n");
+            sb.append("vocabType=" + vocabulary.getVocabType() + "\n");
+            // sb.append("csid=" + vocabulary.getCsid() + "\n");
+            sb.append("URI=" + vocabulary.getUri() + "\n");
+        return sb.toString();
+    }
+
+    // Retrieve individual fields of vocabulary item records.
+
+    private String displayAllVocabularyItems(VocabularyitemsCommonList list) {
+        StringBuffer sb = new StringBuffer();
+        List<VocabularyitemsCommonList.VocabularyitemListItem> items =
+                list.getVocabularyitemListItem();
+        int i = 0;
+        for (VocabularyitemsCommonList.VocabularyitemListItem item : items) {
+            sb.append("vocabulary item [" + i + "]" + "\n");
+            sb.append(displayVocabularyItemDetails(item));
+            i++;
+        }
+        return sb.toString();
+    }
+
+    private String displayVocabularyItemDetails(
+        VocabularyitemsCommonList.VocabularyitemListItem item) {
+            StringBuffer sb = new StringBuffer();
+            sb.append("csid=" + item.getCsid() + "\n");
+            sb.append("displayName=" + item.getDisplayName() + "\n");
+            // sb.append("URI=" + item.getUri() + "\n");
+        return sb.toString();
+    }
+
+    // TODO this should be moved to a common utils class
+    private Object extractPart(PoxPayloadIn input, String label,
+        Class clazz) throws Exception {
+        Object obj = null;
+        obj = input.getPart(label);
+        /*
+        for(PayloadInputPart part : input.getParts()){
+            String partLabel = part.getHeaders().getFirst("label");
+            if(label.equalsIgnoreCase(partLabel)){
+                String partStr = part.getBodyAsString();
+                if(logger.isDebugEnabled()){
+                    logger.debug("extracted part str=\n" + partStr);
+                }
+                obj = part.getBody(clazz, null);
+                if(logger.isDebugEnabled()){
+                    logger.debug("extracted part obj=\n", obj, clazz);
+                }
+                break;
+            }
+        }
+        */
+        return obj;
+    }
+
+       public static void main(String[] args) {
+
+        // Configure logging.
+               BasicConfigurator.configure();
+
+        logger.info("VocabularyBaseImport starting...");
+
+               Sample vbi = new Sample();
+        VocabulariesCommonList vocabularies;
+        List<String> vocabIds;
+        String details = "";
+
+        // Optionally delete all vocabularies and vocabulary items.
+
+        boolean ENABLE_DELETE_ALL = false;
+        if (ENABLE_DELETE_ALL) {
+
+            logger.info("Deleting all vocabulary items and vocabularies ...");
+
+            // For each vocabulary ...
+            vocabularies = vbi.readVocabularies();
+            vocabIds = vbi.readVocabularyIds(vocabularies);
+            for (String vocabId : vocabIds) {
+                logger.info("Deleting all vocabulary items for vocabulary ...");
+                vbi.deleteAllItemsForVocab(vocabId);
+                logger.info("Deleting vocabulary ...");
+                vbi.deleteVocabulary(vocabId);
+            }
+
+            logger.info("Reading vocabularies after deletion ...");
+            vocabularies = vbi.readVocabularies();
+            details = vbi.displayAllVocabularies(vocabularies);
+            logger.info(details);
+
+            logger.info("Reading items in each vocabulary after deletion ...");
+            vocabIds = vbi.readVocabularyIds(vocabularies);
+            for (String vocabId : vocabIds) {
+                VocabularyitemsCommonList items = vbi.readItemsInVocab(vocabId);
+                details = vbi.displayAllVocabularyItems(items);
+                logger.info(details);
+            }
+
+        }
+
+        // Create new vocabularies, each populated with vocabulary items.
+
+               final String acquisitionMethodsVocabName = "Acquisition Methods";
+               final String entryMethodsVocabName = "Entry Methods";
+               final String entryReasonsVocabName = "Entry Reasons";
+               final String responsibleDeptsVocabName = "Responsible Departments";
+
+               List<String> acquisitionMethodsEnumValues = 
+                       Arrays.asList("Gift","Purchase","Exchange","Transfer","Treasure");
+               List<String> entryMethodsEnumValues = 
+                       Arrays.asList("In person","Post","Found on doorstep");
+               List<String> entryReasonsEnumValues = 
+                       Arrays.asList("Enquiry","Commission","Loan");
+               List<String> respDeptNamesEnumValues = 
+                       Arrays.asList("Antiquities","Architecture and Design","Decorative Arts",
+                                                                       "Ethnography","Herpetology","Media and Performance Art",
+                                                                       "Paintings and Sculpture","Paleobotany","Photographs",
+                                                                       "Prints and Drawings");
+        
+               vbi.createEnumeration(acquisitionMethodsVocabName, acquisitionMethodsEnumValues);
+               vbi.createEnumeration(entryMethodsVocabName, entryMethodsEnumValues);
+               vbi.createEnumeration(entryReasonsVocabName, entryReasonsEnumValues);
+               vbi.createEnumeration(responsibleDeptsVocabName, respDeptNamesEnumValues);
+
+               logger.info("VocabularyBaseImport complete.");
+
+        logger.info("Reading vocabularies and items ...");
+        // Get a list of vocabularies.
+        vocabularies = vbi.readVocabularies();
+        // For each vocabulary ...
+        for (VocabulariesCommonList.VocabularyListItem
+            vocabulary : vocabularies.getVocabularyListItem()) {
+            // Get its display name.
+            logger.info(vocabulary.getDisplayName());
+            // Get a list of the vocabulary items in this vocabulary.
+            VocabularyitemsCommonList items =
+                vbi.readItemsInVocab(vocabulary.getCsid());
+            // For each vocabulary item ...
+            for (VocabularyitemsCommonList.VocabularyitemListItem
+                item : items.getVocabularyitemListItem()) {
+                // Get its display name.
+                logger.info(" " + item.getDisplayName());
+            }
+        }
+
+        // Sample alternate methods of reading all vocabularies and
+        // vocabulary items separately.
+        boolean RUN_ADDITIONAL_SAMPLES = false;
+        if (RUN_ADDITIONAL_SAMPLES) {
+
+            logger.info("Reading all vocabularies ...");
+            details = vbi.displayAllVocabularies(vocabularies);
+            logger.info(details);
+
+            logger.info("Reading all vocabulary items ...");
+            vocabIds = vbi.readVocabularyIds(vocabularies);
+            for (String vocabId : vocabIds) {
+                VocabularyitemsCommonList items = vbi.readItemsInVocab(vocabId);
+                details = vbi.displayAllVocabularyItems(items);
+                logger.info(details);
+            }
+
+        }
+
+       }
+
+}
index 429b9f6fe2fb8a87a0dab86aabfdc482b881a740..9270810347f6e81eea603c15eb9699e1cffd2881 100644 (file)
@@ -1,6 +1,6 @@
-#url of the collectionspace server\r
-cspace.url=http://localhost:8180/cspace-services/\r
-cspace.ssl=false\r
-cspace.auth=false\r
-cspace.user=test\r
+#url of the collectionspace server
+cspace.url=http://localhost:8180/cspace-services/
+cspace.ssl=false
+cspace.auth=false
+cspace.user=test
 cspace.password=test
\ No newline at end of file
index cceb8d139de3cc14e733a93414bbd5a47dc39cee..48b393e154137596f78d89b1f794a35ef76fb107 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<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">\r
-    <parent>\r
-        <groupId>org.collectionspace.services</groupId>\r
-        <artifactId>org.collectionspace.services.vocabulary</artifactId>\r
-        <version>4.2-SNAPSHOT</version>\r
-    </parent>\r
-    \r
-    <modelVersion>4.0.0</modelVersion>\r
-    <artifactId>org.collectionspace.services.vocabulary.service</artifactId>\r
-    <name>services.vocabulary.service</name>\r
-    <packaging>jar</packaging>\r
-    \r
-    <dependencies>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-        </dependency>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.config</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-                   <groupId>org.collectionspace.services</groupId>\r
-                   <artifactId>org.collectionspace.services.vocabulary.client</artifactId>\r
-               <version>${project.version}</version>\r
-        </dependency>\r
-        \r
-        <!-- External dependencies -->\r
-        <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- apache -->\r
-        <dependency>\r
-            <groupId>commons-beanutils</groupId>\r
-            <artifactId>commons-beanutils</artifactId>\r
-            <version>1.6.1</version>\r
-        </dependency>\r
-        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->\r
-        <dependency>\r
-            <groupId>commons-logging</groupId>\r
-            <artifactId>commons-logging</artifactId>\r
-            <version>1.1</version>\r
-        </dependency>\r
-      <!-- javax -->\r
-\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        \r
-        <!-- jboss -->\r
-\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-        \r
-        <!-- nuxeo -->\r
-\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-\r
-    </dependencies>\r
-    \r
-    <build>\r
-        <finalName>collectionspace-services-vocabulary</finalName>\r
-    </build>\r
-</project>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<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.vocabulary</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.vocabulary.service</artifactId>
+    <name>services.vocabulary.service</name>
+    <packaging>jar</packaging>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.config</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+                   <groupId>org.collectionspace.services</groupId>
+                   <artifactId>org.collectionspace.services.vocabulary.client</artifactId>
+               <version>${project.version}</version>
+        </dependency>
+        
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        
+        <!-- apache -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+        </dependency>
+      <!-- javax -->
+
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-vocabulary</finalName>
+    </build>
+</project>
+
index fb5cad529ab9e1fede3577becd3068b76b052890..409d564e52414a3cf7fa4ce8fb4243056cac2219 100644 (file)
@@ -1,20 +1,20 @@
-Manifest-Version: 1.0 \r
-Bundle-ManifestVersion: 1 \r
-Bundle-Name: NuxeoCS\r
-Bundle-SymbolicName: org.collectionspace.workflow;singleton:=true \r
-Bundle-Version: 1.0.0\r
-Bundle-Localization: plugin\r
-Bundle-Vendor: Nuxeo \r
-Require-Bundle: org.nuxeo.runtime, \r
- org.nuxeo.ecm.core.api, \r
- org.nuxeo.ecm.core,\r
- org.nuxeo.ecm.core.api,\r
- org.nuxeo.ecm.platform.types.api,\r
- org.nuxeo.ecm.platform.versioning.api,\r
- org.nuxeo.ecm.platform.ui,\r
- org.nuxeo.ecm.platform.forms.layout.client,\r
- org.nuxeo.ecm.platform.ws,\r
- org.collectionspace.collectionspace_core\r
-Provide-Package: org.collectionspace.workflow\r
-Nuxeo-Component: OSGI-INF/core-types-contrib.xml\r
-\r
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: NuxeoCS
+Bundle-SymbolicName: org.collectionspace.workflow;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.workflow
+Nuxeo-Component: OSGI-INF/core-types-contrib.xml
+
index c93c1b938d1b29449f9ffd073ee98a5539743a78..215c9d0ed2c6789eb656e3e2e959e1e7ae9cb071 100644 (file)
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-\r
-<!--\r
-    Workflow schema (XSD)\r
-    \r
-    Entity  : Workflow\r
-    Part    : Common\r
-    Used for: Nuxeo EP core document type\r
-\r
-    $LastChangedRevision: 2316 $\r
-    $LastChangedDate: 2010-06-02 16:03:51 -0700 (Wed, 02 Jun 2010) $\r
--->\r
-\r
-<xs:schema \r
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-    xmlns:ns="http://collectionspace.org/workflow/"\r
-    xmlns="http://collectionspace.org/workflow/"\r
-    targetNamespace="http://collectionspace.org/workflow/"\r
-    version="0.1">\r
-    <!--  Workflow Information Group -->\r
-       <xs:element name="lifeCyclePolicy" type="xs:string"/>\r
-       <xs:element name="currentLifeCycleState" type="xs:string"/>\r
-       <xs:element name="allowedStateTransitionList" type="stateTransitionList">\r
-        <xs:complexType>\r
-            <xs:sequence>\r
-                               <xs:element name="stateTransition" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
-            </xs:sequence>\r
-        </xs:complexType>\r
-    </xs:element>\r
-</xs:schema>\r
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Workflow schema (XSD)
+    
+    Entity  : Workflow
+    Part    : Common
+    Used for: Nuxeo EP core document type
+
+    $LastChangedRevision: 2316 $
+    $LastChangedDate: 2010-06-02 16:03:51 -0700 (Wed, 02 Jun 2010) $
+-->
+
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/workflow/"
+    xmlns="http://collectionspace.org/workflow/"
+    targetNamespace="http://collectionspace.org/workflow/"
+    version="0.1">
+    <!--  Workflow Information Group -->
+       <xs:element name="lifeCyclePolicy" type="xs:string"/>
+       <xs:element name="currentLifeCycleState" type="xs:string"/>
+       <xs:element name="allowedStateTransitionList" type="stateTransitionList">
+        <xs:complexType>
+            <xs:sequence>
+                               <xs:element name="stateTransition" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
index 18c510350fd16aa0b59d63d387ee5634a4d3fea1..148a3e865d06602c35f74f8f1c73df7c4484efc7 100644 (file)
@@ -1,23 +1,23 @@
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=INFO\r
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO