From 3527d476f7ea06223bcca0322269259a9f8ea657 Mon Sep 17 00:00:00 2001 From: Patrick Schmitz Date: Sat, 9 Jan 2010 01:01:43 +0000 Subject: [PATCH] CSPACE-578 Added support for PersonAuthority service, with basic tests, and a demo import mechanism that creates a simple authority with a few people in it. --- services/JaxRsServiceProvider/pom.xml | 2 - .../CollectionSpaceJaxRsApplication.java | 2 + services/build.xml | 4 + .../src/main/config/tenant-bindings.xml | 59 + services/person/.classpath | 6 + services/person/.project | 23 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.maven.ide.eclipse.prefs | 9 + services/person/3rdparty/.classpath | 6 + services/person/3rdparty/.project | 23 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.maven.ide.eclipse.prefs | 9 + services/person/3rdparty/build.xml | 131 ++ .../nuxeo-platform-cs-person/.classpath | 7 + .../nuxeo-platform-cs-person/.project | 23 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.maven.ide.eclipse.prefs | 9 + .../nuxeo-platform-cs-person/build.xml | 138 ++ .../3rdparty/nuxeo-platform-cs-person/pom.xml | 19 + .../src/main/resources/META-INF/MANIFEST.MF | 22 + .../resources/OSGI-INF/core-types-contrib.xml | 23 + .../OSGI-INF/deployment-fragment.xml | 408 ++++++ .../resources/OSGI-INF/ecm-types-contrib.xml | 53 + .../resources/OSGI-INF/layouts-contrib.xml | 365 ++++++ .../schemas/personauthorities_common.xsd | 31 + .../main/resources/schemas/persons_common.xsd | 48 + services/person/3rdparty/pom.xml | 23 + services/person/build.xml | 134 ++ services/person/client/.classpath | 8 + services/person/client/.project | 26 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.maven.ide.eclipse.prefs | 9 + services/person/client/pom.xml | 111 ++ .../client/PersonAuthorityClient.java | 157 +++ .../services/client/PersonAuthorityProxy.java | 76 ++ .../test/PersonAuthorityServiceTest.java | 1122 +++++++++++++++++ .../src/test/resources/log4j.properties | 23 + services/person/import/.classpath | 7 + services/person/import/.project | 23 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.maven.ide.eclipse.prefs | 9 + services/person/import/build.xml | 60 + services/person/import/pom.xml | 130 ++ services/person/installer/build.xml | 61 + services/person/jaxb/.classpath | 8 + services/person/jaxb/.project | 23 + .../jaxb/.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.maven.ide.eclipse.prefs | 9 + services/person/jaxb/pom.xml | 105 ++ .../services/PersonAuthorityJAXBSchema.java | 17 + .../PersonAuthorityListItemJAXBSchema.java | 9 + .../services/PersonJAXBSchema.java | 35 + .../services/PersonListItemJAXBSchema.java | 8 + .../jaxb/src/main/resources/person_common.xsd | 71 ++ .../main/resources/personauthority_common.xsd | 70 + services/person/pom.xml | 70 + services/person/sample/.classpath | 6 + services/person/sample/.project | 23 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.maven.ide.eclipse.prefs | 9 + services/person/sample/pom.xml | 14 + services/person/sample/sample/.classpath | 8 + services/person/sample/sample/.project | 17 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.maven.ide.eclipse.prefs | 9 + services/person/sample/sample/pom.xml | 112 ++ .../collectionspace-client.properties | 6 + .../sample/src/main/resources/log4j.xml | 38 + services/person/service/.classpath | 7 + services/person/service/.project | 25 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.maven.ide.eclipse.prefs | 9 + services/person/service/pom.xml | 154 +++ services/pom.xml | 1 + 74 files changed, 4305 insertions(+), 2 deletions(-) create mode 100644 services/person/.classpath create mode 100644 services/person/.project create mode 100644 services/person/.settings/org.eclipse.jdt.core.prefs create mode 100644 services/person/.settings/org.maven.ide.eclipse.prefs create mode 100644 services/person/3rdparty/.classpath create mode 100644 services/person/3rdparty/.project create mode 100644 services/person/3rdparty/.settings/org.eclipse.jdt.core.prefs create mode 100644 services/person/3rdparty/.settings/org.maven.ide.eclipse.prefs create mode 100644 services/person/3rdparty/build.xml create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/.classpath create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/.project create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/.settings/org.eclipse.jdt.core.prefs create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/.settings/org.maven.ide.eclipse.prefs create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/build.xml create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/pom.xml create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/META-INF/MANIFEST.MF create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/core-types-contrib.xml create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/deployment-fragment.xml create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/ecm-types-contrib.xml create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/layouts-contrib.xml create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/personauthorities_common.xsd create mode 100644 services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/persons_common.xsd create mode 100644 services/person/3rdparty/pom.xml create mode 100644 services/person/build.xml create mode 100644 services/person/client/.classpath create mode 100644 services/person/client/.project create mode 100644 services/person/client/.settings/org.eclipse.jdt.core.prefs create mode 100644 services/person/client/.settings/org.maven.ide.eclipse.prefs create mode 100644 services/person/client/pom.xml create mode 100644 services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java create mode 100644 services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java create mode 100644 services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java create mode 100644 services/person/client/src/test/resources/log4j.properties create mode 100644 services/person/import/.classpath create mode 100644 services/person/import/.project create mode 100644 services/person/import/.settings/org.eclipse.jdt.core.prefs create mode 100644 services/person/import/.settings/org.maven.ide.eclipse.prefs create mode 100644 services/person/import/build.xml create mode 100644 services/person/import/pom.xml create mode 100644 services/person/installer/build.xml create mode 100644 services/person/jaxb/.classpath create mode 100644 services/person/jaxb/.project create mode 100644 services/person/jaxb/.settings/org.eclipse.jdt.core.prefs create mode 100644 services/person/jaxb/.settings/org.maven.ide.eclipse.prefs create mode 100644 services/person/jaxb/pom.xml create mode 100644 services/person/jaxb/src/main/java/org/collectionspace/services/PersonAuthorityJAXBSchema.java create mode 100644 services/person/jaxb/src/main/java/org/collectionspace/services/PersonAuthorityListItemJAXBSchema.java create mode 100644 services/person/jaxb/src/main/java/org/collectionspace/services/PersonJAXBSchema.java create mode 100644 services/person/jaxb/src/main/java/org/collectionspace/services/PersonListItemJAXBSchema.java create mode 100644 services/person/jaxb/src/main/resources/person_common.xsd create mode 100644 services/person/jaxb/src/main/resources/personauthority_common.xsd create mode 100644 services/person/pom.xml create mode 100644 services/person/sample/.classpath create mode 100644 services/person/sample/.project create mode 100644 services/person/sample/.settings/org.eclipse.jdt.core.prefs create mode 100644 services/person/sample/.settings/org.maven.ide.eclipse.prefs create mode 100644 services/person/sample/pom.xml create mode 100644 services/person/sample/sample/.classpath create mode 100644 services/person/sample/sample/.project create mode 100644 services/person/sample/sample/.settings/org.eclipse.jdt.core.prefs create mode 100644 services/person/sample/sample/.settings/org.maven.ide.eclipse.prefs create mode 100644 services/person/sample/sample/pom.xml create mode 100644 services/person/sample/sample/src/main/resources/collectionspace-client.properties create mode 100644 services/person/sample/sample/src/main/resources/log4j.xml create mode 100644 services/person/service/.classpath create mode 100644 services/person/service/.project create mode 100644 services/person/service/.settings/org.eclipse.jdt.core.prefs create mode 100644 services/person/service/.settings/org.maven.ide.eclipse.prefs create mode 100644 services/person/service/pom.xml diff --git a/services/JaxRsServiceProvider/pom.xml b/services/JaxRsServiceProvider/pom.xml index 6e2c4d674..f3c1cd753 100644 --- a/services/JaxRsServiceProvider/pom.xml +++ b/services/JaxRsServiceProvider/pom.xml @@ -67,13 +67,11 @@ org.collectionspace.services.organization.service 1.0 - org.collectionspace.services org.collectionspace.services.relation.service diff --git a/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java b/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java index ed27f6015..0e6aefe92 100644 --- a/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java +++ b/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java @@ -34,6 +34,7 @@ import org.collectionspace.services.contact.ContactResource; import org.collectionspace.services.vocabulary.VocabularyResource; import org.collectionspace.services.organization.OrgAuthorityResource; +import org.collectionspace.services.person.PersonAuthorityResource; //import org.collectionspace.services.query.QueryResource; @@ -64,6 +65,7 @@ public class CollectionSpaceJaxRsApplication extends Application { singletons.add(new NewRelationResource()); singletons.add(new VocabularyResource()); singletons.add(new OrgAuthorityResource()); + singletons.add(new PersonAuthorityResource()); singletons.add(new DimensionResource()); singletons.add(new ContactResource()); diff --git a/services/build.xml b/services/build.xml index 40a7dfe5c..bd067d748 100644 --- a/services/build.xml +++ b/services/build.xml @@ -149,6 +149,7 @@ + @@ -161,6 +162,7 @@ + @@ -188,6 +190,7 @@ + + + + + nuxeo-java + + + + + + + + + + + + + + + + + + + nuxeo-java + + + + + + + + + + + + + + + + nuxeo-java diff --git a/services/person/.classpath b/services/person/.classpath new file mode 100644 index 000000000..046988541 --- /dev/null +++ b/services/person/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/services/person/.project b/services/person/.project new file mode 100644 index 000000000..eba3c0275 --- /dev/null +++ b/services/person/.project @@ -0,0 +1,23 @@ + + + org.collectionspace.services.person + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + diff --git a/services/person/.settings/org.eclipse.jdt.core.prefs b/services/person/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..2341888c8 --- /dev/null +++ b/services/person/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Tue Oct 06 13:26:43 PDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/services/person/.settings/org.maven.ide.eclipse.prefs b/services/person/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 000000000..95a5ba022 --- /dev/null +++ b/services/person/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Fri Sep 11 17:00:29 PDT 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/services/person/3rdparty/.classpath b/services/person/3rdparty/.classpath new file mode 100644 index 000000000..046988541 --- /dev/null +++ b/services/person/3rdparty/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/services/person/3rdparty/.project b/services/person/3rdparty/.project new file mode 100644 index 000000000..a84a0da90 --- /dev/null +++ b/services/person/3rdparty/.project @@ -0,0 +1,23 @@ + + + org.collectionspace.services.person.3rdparty + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + diff --git a/services/person/3rdparty/.settings/org.eclipse.jdt.core.prefs b/services/person/3rdparty/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..4956ebcc9 --- /dev/null +++ b/services/person/3rdparty/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Mon Oct 05 17:07:08 PDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/services/person/3rdparty/.settings/org.maven.ide.eclipse.prefs b/services/person/3rdparty/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 000000000..93b6f8a66 --- /dev/null +++ b/services/person/3rdparty/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Fri Sep 11 17:00:30 PDT 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/services/person/3rdparty/build.xml b/services/person/3rdparty/build.xml new file mode 100644 index 000000000..224c06abb --- /dev/null +++ b/services/person/3rdparty/build.xml @@ -0,0 +1,131 @@ + + + + person service 3rdparty + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/.classpath b/services/person/3rdparty/nuxeo-platform-cs-person/.classpath new file mode 100644 index 000000000..84b3661d2 --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/.project b/services/person/3rdparty/nuxeo-platform-cs-person/.project new file mode 100644 index 000000000..748ad4ef9 --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/.project @@ -0,0 +1,23 @@ + + + org.collectionspace.services.person.3rdparty.nuxeo + Person Nuxeo Document Type + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.maven.ide.eclipse.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/.settings/org.eclipse.jdt.core.prefs b/services/person/3rdparty/nuxeo-platform-cs-person/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..8c32cc875 --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Mon Jan 04 16:43:20 PST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/.settings/org.maven.ide.eclipse.prefs b/services/person/3rdparty/nuxeo-platform-cs-person/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 000000000..552ddbfcf --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Tue Oct 06 13:25:17 PDT 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/build.xml b/services/person/3rdparty/nuxeo-platform-cs-person/build.xml new file mode 100644 index 000000000..6dcb0ea75 --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/build.xml @@ -0,0 +1,138 @@ + + + + person nuxeo document type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/pom.xml b/services/person/3rdparty/nuxeo-platform-cs-person/pom.xml new file mode 100644 index 000000000..21d3cd73a --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/pom.xml @@ -0,0 +1,19 @@ + + + org.collectionspace.services + nuxeo-platform-collectionspace + 1.0 + + + 4.0.0 + org.collectionspace.services + 1.0 + org.collectionspace.services.person.3rdparty.nuxeo + jar + services.person.3rdparty.nuxeo + + Person Nuxeo Document Type + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/META-INF/MANIFEST.MF b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 000000000..a1c679336 --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 1 +Bundle-Name: NuxeoCS +Bundle-SymbolicName: org.collectionspace.person;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.publishing.api, + org.nuxeo.ecm.platform.ws +Provide-Package: org.collectionspace.person +Nuxeo-Component: OSGI-INF/core-types-contrib.xml, + OSGI-INF/ecm-types-contrib.xml, + OSGI-INF/layouts-contrib.xml + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/core-types-contrib.xml b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/core-types-contrib.xml new file mode 100644 index 000000000..e8eb9f719 --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/core-types-contrib.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/deployment-fragment.xml b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/deployment-fragment.xml new file mode 100644 index 000000000..8bbdd72b6 --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/deployment-fragment.xml @@ -0,0 +1,408 @@ + + + + + + ${bundle.fileName} + + + + + nuxeo.war + /nuxeo + + + + + + + + + + + + Seam Context Filter + /ws/FileManageWS + + + + Seam Context Filter + /DocumentManagerWS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #{currentServerLocation.name}/#{currentTabAction.label} + + + + Create new document in #{currentDocument.name} + + + + Create new document in #{currentDocument.name} + + + + breadcrumb=command.user_dashboard + + + + breadcrumb=command.manageMembers + + + + breadcrumb=command.manageMembers + + + + breadcrumb=title.orgauthorities + + + + breadcrumb=command.advancedSearch + + + + + + en + en_GB + en_US + fr + de + es + it + ar + ru + ja + vn + + + messages + + + + config/addWorkspace.jpdl.xml + + + + + + generic_error_page + /generic_error_page.xhtml + + + + + generic_message_page + /generic_message_page.xhtml + + + + + home + /nxstartup.xhtml + + + + + user_login + /login.xhtml + + + + + user_logout + /logout.xhtml + + + + + view_servers + /view_servers.xhtml + + + + + + + view_domains + /view_domains.xhtml + + + + + select_document_type + /select_document_type.xhtml + + + + + create_document + /create_document.xhtml + + + + + edit_document + /edit_document.xhtml + + + + + view_documents + /view_documents.xhtml + + + + + create_file + /create_file.xhtml + + + + + create_workspace_wizard + /createWorkspaceWizard.xhtml + + + + + send_email + /document_email.xhtml + + + + + + view_workspaces + /view_workspaces.xhtml + + + + + + create_domain + /create_domain.xhtml + + + + + + edit_domain + /edit_domain.xhtml + + + + + + create_workspace + /create_workspace.xhtml + + + + + + edit_workspace + /edit_workspace.xhtml + + + + + + + members_management + /members_management.xhtml + + + + + view_users + /view_users.xhtml + + + + + view_many_users + /view_many_users.xhtml + + + + + edit_user + /edit_user.xhtml + + + + + edit_user_password + /edit_user_password.xhtml + + + + + view_user + /view_user.xhtml + + + + + create_user + /create_user.xhtml + + + + + view_groups + /view_groups.xhtml + + + + + view_group + /view_group.xhtml + + + + + edit_group + /edit_group.xhtml + + + + + create_group + /create_group.xhtml + + + + + view_orgauthorities + /view_orgauthorities.xhtml + + + + + view_orgauthority + /view_orgauthority.xhtml + + + + + + + search_form + /search/search_form.xhtml + + + + + search_results_nxql + /search/search_results_nxql.xhtml + + + + + search_results_advanced + + /search/search_results_advanced.xhtml + + + + + + search_results_simple + /search/search_results_simple.xhtml + + + + + + + clipboard + /incl/clipboard.xhtml + + + + + user_dashboard + /user_dashboard.xhtml + + + + + select_workspace_template + /select_workspace_template.xhtml + + + + + pdf_generation_error + /pdf_generation_error.xhtml + + + + + mass_edit + /massedit_documents.xhtml + + + + + mass_edit_confirm + /massedit_documents_preview.xhtml + + + + + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/ecm-types-contrib.xml b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/ecm-types-contrib.xml new file mode 100644 index 000000000..837f0887e --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/ecm-types-contrib.xml @@ -0,0 +1,53 @@ + + + + + + + view_documents + + + heading + cspersonauthority + + + + + + Personauthority + + + + + + Personauthority + + + + + + + + + view_documents + + + heading + person + + + + + + Person + + + + + + Person + + + + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/layouts-contrib.xml b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/layouts-contrib.xml new file mode 100644 index 000000000..a1e1e4c6f --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/OSGI-INF/layouts-contrib.xml @@ -0,0 +1,365 @@ + + + + + + + + + + + + displayName + refName + vocabType + + + + + + + true + + displayName + + + dataInputText + + + + + + + + true + + refName + + + dataInputText + + + + + + + + true + + vocabType + + + dataInputText + + + + + + + + + + + + + displayName + refName + inAuthority + foreName + middleName + surName + initials + salutation + title + nameAdditions + birthDate + deathDate + birthPlace + deathPlace + group + nationality + gender + occupation + schoolOrStyle + bioNote + nameNote + + + + + + + true + + displayName + + + dataInputText + + + + + + + + true + + refName + + + dataInputText + + + + + + + + true + + inAuthority + + + dataInputText + + + + + + + + true + + foreName + + + dataInputText + + + + + + + + true + + middleName + + + dataInputText + + + + + + + + true + + surName + + + dataInputText + + + + + + + + true + + initials + + + dataInputText + + + + + + + + true + + salutation + + + dataInputText + + + + + + + + true + + title + + + dataInputText + + + + + + + + true + + nameAdditions + + + dataInputText + + + + + + + + true + + birthDate + + + dataInputText + + + + + + + + true + + deathDate + + + dataInputText + + + + + + + + true + + birthPlace + + + dataInputText + + + + + + + + true + + deathPlace + + + dataInputText + + + + + + + + true + + group + + + dataInputText + + + + + + + + true + + nationality + + + dataInputText + + + + + + + + true + + gender + + + dataInputText + + + + + + + + true + + occupation + + + dataInputText + + + + + + + + true + + schoolOrStyle + + + dataInputText + + + + + + + + true + + bioNote + + + dataInputText + + + + + + + + true + + nameNote + + + dataInputText + + + + + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/personauthorities_common.xsd b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/personauthorities_common.xsd new file mode 100644 index 000000000..915bc31a6 --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/personauthorities_common.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/persons_common.xsd b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/persons_common.xsd new file mode 100644 index 000000000..4df8c59dd --- /dev/null +++ b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/persons_common.xsd @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/3rdparty/pom.xml b/services/person/3rdparty/pom.xml new file mode 100644 index 000000000..328c6de55 --- /dev/null +++ b/services/person/3rdparty/pom.xml @@ -0,0 +1,23 @@ + + + + org.collectionspace.services.person + org.collectionspace.services + 1.0 + + 4.0.0 + org.collectionspace.services + 1.0 + org.collectionspace.services.person.3rdparty + pom + services.person.3rdparty + + 3rd party build for person service + + + + nuxeo-platform-cs-person + + diff --git a/services/person/build.xml b/services/person/build.xml new file mode 100644 index 000000000..b5a6c76f0 --- /dev/null +++ b/services/person/build.xml @@ -0,0 +1,134 @@ + + + + person service + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/client/.classpath b/services/person/client/.classpath new file mode 100644 index 000000000..cec251a43 --- /dev/null +++ b/services/person/client/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/services/person/client/.project b/services/person/client/.project new file mode 100644 index 000000000..ba2d51a96 --- /dev/null +++ b/services/person/client/.project @@ -0,0 +1,26 @@ + + + org.collectionspace.services.person.client + + + org.collectionspace.services.client + org.collectionspace.services.common + org.collectionspace.services.person.jaxb + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.maven.ide.eclipse.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/services/person/client/.settings/org.eclipse.jdt.core.prefs b/services/person/client/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..c97287836 --- /dev/null +++ b/services/person/client/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Mon Jan 04 16:43:16 PST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/services/person/client/.settings/org.maven.ide.eclipse.prefs b/services/person/client/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 000000000..ddebb8bf5 --- /dev/null +++ b/services/person/client/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Mon Jan 04 16:40:35 PST 2010 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/services/person/client/pom.xml b/services/person/client/pom.xml new file mode 100644 index 000000000..a79046155 --- /dev/null +++ b/services/person/client/pom.xml @@ -0,0 +1,111 @@ + + + + + org.collectionspace.services.person + org.collectionspace.services + 1.0 + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.person.client + 1.0 + services.person.client + + + + + org.slf4j + slf4j-api + test + + + org.slf4j + slf4j-log4j12 + test + + + org.collectionspace.services + org.collectionspace.services.person.jaxb + 1.0 + + + org.collectionspace.services + org.collectionspace.services.client + 1.0 + + + + org.testng + testng + 5.6 + + + org.slf4j + slf4j-api + 1.5.2 + + + org.slf4j + slf4j-log4j12 + 1.5.2 + + + org.jboss.resteasy + resteasy-jaxrs + 1.0.2.GA + + + + tjws + webserver + + + + + org.jboss.resteasy + resteasy-jaxb-provider + 1.0.2.GA + + + org.jboss.resteasy + resteasy-multipart-provider + 1.0.2.GA + + + commons-httpclient + commons-httpclient + 3.1 + + + + + collectionspace-services-person-client + + + org.apache.maven.plugins + maven-surefire-plugin + + + + log4j.configuration + file:target/test-classes/log4j.properties + + + + + + maven-compiler-plugin + 2.0.2 + + 1.6 + 1.6 + + + + + + diff --git a/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java new file mode 100644 index 000000000..ac8d0eced --- /dev/null +++ b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java @@ -0,0 +1,157 @@ +package org.collectionspace.services.client; + +import javax.ws.rs.core.Response; + +import org.collectionspace.services.person.PersonauthoritiesCommonList; +import org.collectionspace.services.person.PersonsCommonList; +import org.collectionspace.services.client.PersonAuthorityProxy; + +import org.jboss.resteasy.client.ClientResponse; +import org.jboss.resteasy.client.ProxyFactory; +import org.jboss.resteasy.plugins.providers.RegisterBuiltin; +import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; +import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; +import org.jboss.resteasy.spi.ResteasyProviderFactory; + +/** + * A PersonAuthorityClient. + + * @version $Revision:$ + */ +public class PersonAuthorityClient extends BaseServiceClient { + + /* (non-Javadoc) + * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent() + */ + @Override + public String getServicePathComponent() { + return "personauthorities"; + } + + public String getItemCommonPartName() { + return getCommonPartName("persons"); + } + + /** + * + */ + private static final PersonAuthorityClient instance = new PersonAuthorityClient(); + /** + * + */ + private PersonAuthorityProxy personAuthorityProxy; + + /** + * + * Default constructor for PersonAuthorityClient class. + * + */ + public PersonAuthorityClient() { + ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); + RegisterBuiltin.register(factory); + personAuthorityProxy = ProxyFactory.create(PersonAuthorityProxy.class, getBaseURL()); + } + + /** + * FIXME Comment this + * + * @return + */ + public static PersonAuthorityClient getInstance() { + return instance; + } + + /** + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#readList() + */ + public ClientResponse readList() { + return personAuthorityProxy.readList(); + } + + /** + * @param csid + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#read(java.lang.String) + */ + + public ClientResponse read(String csid) { + return personAuthorityProxy.read(csid); + } + + /** + * @param personAuthority + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#createPersonAuthority(org.collectionspace.hello.PersonAuthority) + */ + public ClientResponse create(MultipartOutput multipart) { + return personAuthorityProxy.create(multipart); + } + + /** + * @param csid + * @param personAuthority + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#updatePersonAuthority(java.lang.Long, org.collectionspace.hello.PersonAuthority) + */ + public ClientResponse update(String csid, MultipartOutput multipart) { + return personAuthorityProxy.update(csid, multipart); + + } + + /** + * @param csid + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#deletePersonAuthority(java.lang.Long) + */ + public ClientResponse delete(String csid) { + return personAuthorityProxy.delete(csid); + } + + /** + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#readItemList() + */ + public ClientResponse readItemList(String vcsid) { + return personAuthorityProxy.readItemList(vcsid); + } + + /** + * @param csid + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#read(java.lang.String) + */ + + public ClientResponse readItem(String vcsid, String csid) { + return personAuthorityProxy.readItem(vcsid, csid); + } + + /** + * @param personAuthority + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#createPersonAuthority(org.collectionspace.hello.PersonAuthority) + */ + public ClientResponse createItem(String vcsid, MultipartOutput multipart) { + return personAuthorityProxy.createItem(vcsid, multipart); + } + + /** + * @param csid + * @param personAuthority + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#updatePersonAuthority(java.lang.Long, org.collectionspace.hello.PersonAuthority) + */ + public ClientResponse updateItem(String vcsid, String csid, MultipartOutput multipart) { + return personAuthorityProxy.updateItem(vcsid, csid, multipart); + + } + + /** + * @param csid + * @return + * @see org.collectionspace.services.client.PersonAuthorityProxy#deletePersonAuthority(java.lang.Long) + */ + public ClientResponse deleteItem(String vcsid, String csid) { + return personAuthorityProxy.deleteItem(vcsid, csid); + } +} diff --git a/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java new file mode 100644 index 000000000..6b6f7de3e --- /dev/null +++ b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java @@ -0,0 +1,76 @@ +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.core.Response; + +import org.collectionspace.services.person.PersonauthoritiesCommonList; +import org.collectionspace.services.person.PersonsCommonList; +import org.jboss.resteasy.client.ClientResponse; +import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; +import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; + +/** + * @version $Revision:$ + */ +@Path("/personauthorities/") +@Produces({"multipart/mixed"}) +@Consumes({"multipart/mixed"}) +public interface PersonAuthorityProxy { + + // List Personauthorities + @GET + @Produces({"application/xml"}) + ClientResponse readList(); + + //(C)reate + @POST + ClientResponse create(MultipartOutput multipart); + + //(R)ead + @GET + @Path("/{csid}") + ClientResponse read(@PathParam("csid") String csid); + + //(U)pdate + @PUT + @Path("/{csid}") + ClientResponse update(@PathParam("csid") String csid, MultipartOutput multipart); + + //(D)elete + @DELETE + @Path("/{csid}") + ClientResponse delete(@PathParam("csid") String csid); + + // List Items + @GET + @Produces({"application/xml"}) + @Path("/{vcsid}/items/") + ClientResponse readItemList(@PathParam("vcsid") String vcsid); + + //(C)reate Item + @POST + @Path("/{vcsid}/items/") + ClientResponse createItem(@PathParam("vcsid") String vcsid, MultipartOutput multipart); + + //(R)ead + @GET + @Path("/{vcsid}/items/{csid}") + ClientResponse readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid); + + //(U)pdate + @PUT + @Path("/{vcsid}/items/{csid}") + ClientResponse updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, MultipartOutput multipart); + + //(D)elete + @DELETE + @Path("/{vcsid}/items/{csid}") + ClientResponse deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid); +} diff --git a/services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java b/services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java new file mode 100644 index 000000000..79c43c779 --- /dev/null +++ b/services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java @@ -0,0 +1,1122 @@ +/** + * 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.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.client.PersonAuthorityClient; +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.MultipartInput; +import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; +import org.jboss.resteasy.plugins.providers.multipart.OutputPart; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +/** + * PersonAuthorityServiceTest, carries out tests against a + * deployed and running PersonAuthority Service. + * + * $LastChangedRevision: 753 $ + * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $ + */ +public class PersonAuthorityServiceTest extends AbstractServiceTest { + + private final Logger logger = + LoggerFactory.getLogger(PersonAuthorityServiceTest.class); + + // Instance variables specific to this test. + private PersonAuthorityClient client = new PersonAuthorityClient(); + final String SERVICE_PATH_COMPONENT = "personauthorities"; + final String ITEM_SERVICE_PATH_COMPONENT = "items"; + private String knownResourceId = null; + private String lastPersonAuthId = null; + private String knownResourceRefName = null; + private String knownItemResourceId = null; + private int nItemsToCreateInList = 3; + private List allResourceIdsCreated = new ArrayList(); + private Map allResourceItemIdsCreated = + new HashMap(); + + protected String createPersonAuthRefName(String personAuthorityName) { + return "urn:cspace:org.collectionspace.demo:personauthority:name(" + +personAuthorityName+")"; + } + + protected String createPersonRefName( + String personAuthRefName, String personName) { + return personAuthRefName+":person:name("+personName+")"; + } + + + // --------------------------------------------------------------- + // CRUD tests : CREATE tests + // --------------------------------------------------------------- + // Success outcomes + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class) + public void create(String testName) throws Exception { + + // Perform setup, such as initializing the type of service request + // (e.g. CREATE, DELETE), its valid and expected status codes, and + // its associated HTTP method name (e.g. POST, DELETE). + setupCreate(testName); + + // Submit the request to the service and store the response. + String identifier = createIdentifier(); + String displayName = "displayName-" + identifier; + String refName = createPersonAuthRefName(displayName); + String typeName = "vocabType-" + identifier; + MultipartOutput multipart = + createPersonAuthorityInstance(displayName, refName, typeName); + ClientResponse res = client.create(multipart); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + + // Store the refname from the first resource created + // for additional tests below. + knownResourceRefName = refName; + + lastPersonAuthId = extractId(res); + // Store the ID returned from the first resource created + // for additional tests below. + if (knownResourceId == null){ + knownResourceId = lastPersonAuthId; + if (logger.isDebugEnabled()) { + logger.debug(testName + ": knownResourceId=" + knownResourceId); + } + } + // Store the IDs from every resource created by tests, + // so they can be deleted after tests have been run. + allResourceIdsCreated.add(extractId(res)); + + } + + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create"}) + public void createItem(String testName) { + setupCreate(testName); + + knownItemResourceId = createItemInAuthority(lastPersonAuthId, knownResourceRefName); + if(logger.isDebugEnabled()){ + logger.debug(testName + ": knownItemResourceId=" + knownItemResourceId); + } + } + + private String createItemInAuthority(String vcsid, String authRefName) { + + final String testName = "createItemInAuthority"; + if(logger.isDebugEnabled()){ + logger.debug(testName + ":..."); + } + + // Submit the request to the service and store the response. + String identifier = createIdentifier(); + String refName = createPersonRefName(authRefName, "Patrick Schmitz"); + MultipartOutput multipart = createPersonInstance(vcsid, refName, + "Patrick","Lee","Schmitz","pls", null, null, null, + "1960", null, "Detroit, MI", null, "Coders", "American", "male", + null, null, null, null ); + ClientResponse res = client.createItem(vcsid, multipart); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + + // Store the ID returned from the first item resource created + // for additional tests below. + if (knownItemResourceId == null){ + knownItemResourceId = extractId(res); + if (logger.isDebugEnabled()) { + logger.debug(testName + ": knownItemResourceId=" + knownItemResourceId); + } + } + + // Store the IDs from any item resources created + // by tests, along with the IDs of their parents, so these items + // can be deleted after all tests have been run. + // + // Item resource IDs are unique, so these are used as keys; + // the non-unique IDs of their parents are stored as associated values. + allResourceItemIdsCreated.put(extractId(res), vcsid); + + return extractId(res); + } + + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create", "createItem"}) + public void createList(String testName) throws Exception { + for (int i = 0; i < 3; i++) { + create(testName); + knownResourceId = lastPersonAuthId; + if (logger.isDebugEnabled()) { + logger.debug(testName + ": Resetting knownResourceId to" + knownResourceId); + } + // Add nItemsToCreateInList items to each personauthority + for (int j = 0; j < nItemsToCreateInList; j++) { + createItem(testName); + } + } + } + + // Failure outcomes + // Placeholders until the three tests below can be uncommented. + // See Issue CSPACE-401. + @Override + public void createWithEmptyEntityBody(String testName) throws Exception { + } + + @Override + public void createWithMalformedXml(String testName) throws Exception { + } + + @Override + public void createWithWrongXmlSchema(String testName) throws Exception { + } + + /* + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create", "testSubmitRequest"}) + public void createWithEmptyEntityBody(String testName) throws Exception { + + // Perform setup. + setupCreateWithEmptyEntityBody(testName); + + // Submit the request to the service and store the response. + String method = REQUEST_TYPE.httpMethodName(); + String url = getServiceRootURL(); + String mediaType = MediaType.APPLICATION_XML; + final String entity = ""; + int statusCode = submitRequest(method, url, mediaType, entity); + + // Check the status code of the response: does it match + // the expected response(s)? + if(logger.isDebugEnabled()) { + logger.debug(testName + ": url=" + url + + " status=" + statusCode); + } + Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create", "testSubmitRequest"}) + public void createWithMalformedXml(String testName) throws Exception { + + // Perform setup. + setupCreateWithMalformedXml(testName); + + // Submit the request to the service and store the response. + String method = REQUEST_TYPE.httpMethodName(); + String url = getServiceRootURL(); + String mediaType = MediaType.APPLICATION_XML; + final String entity = MALFORMED_XML_DATA; // Constant from base class. + int statusCode = submitRequest(method, url, mediaType, entity); + + // Check the status code of the response: does it match + // the expected response(s)? + if(logger.isDebugEnabled()){ + logger.debug(testName + ": url=" + url + + " status=" + statusCode); + } + Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create", "testSubmitRequest"}) + public void createWithWrongXmlSchema(String testName) throws Exception { + + // Perform setup. + setupCreateWithWrongXmlSchema(testName); + + // Submit the request to the service and store the response. + String method = REQUEST_TYPE.httpMethodName(); + String url = getServiceRootURL(); + String mediaType = MediaType.APPLICATION_XML; + final String entity = WRONG_XML_SCHEMA_DATA; + int statusCode = submitRequest(method, url, mediaType, entity); + + // Check the status code of the response: does it match + // the expected response(s)? + if(logger.isDebugEnabled()){ + logger.debug(testName + ": url=" + url + + " status=" + statusCode); + } + Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + */ + + // --------------------------------------------------------------- + // CRUD tests : READ tests + // --------------------------------------------------------------- + // Success outcomes + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create"}) + public void read(String testName) throws Exception { + + // Perform setup. + setupRead(); + + // Submit the request to the service and store the response. + ClientResponse res = client.read(knownResourceId); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + //FIXME: remove the following try catch once Aron fixes signatures + try { + MultipartInput input = (MultipartInput) res.getEntity(); + PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input, + client.getCommonPartName(), PersonauthoritiesCommon.class); + Assert.assertNotNull(personAuthority); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /* + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"read"}) + public void readByName(String testName) throws Exception { + + // Perform setup. + setupRead(); + + // Submit the request to the service and store the response. + ClientResponse res = client.read(knownResourceId); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + //FIXME: remove the following try catch once Aron fixes signatures + try { + MultipartInput input = (MultipartInput) res.getEntity(); + PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input, + client.getCommonPartName(), PersonauthoritiesCommon.class); + Assert.assertNotNull(personAuthority); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + */ + + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"createItem", "read"}) + public void readItem(String testName) throws Exception { + + // Perform setup. + setupRead(testName); + + // Submit the request to the service and store the response. + ClientResponse 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + + // Check whether we've received a person. + MultipartInput input = (MultipartInput) res.getEntity(); + PersonsCommon person = (PersonsCommon) extractPart(input, + client.getItemCommonPartName(), PersonsCommon.class); + Assert.assertNotNull(person); + + } + + // Failure outcomes + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"read"}) + public void readNonExistent(String testName) { + + // Perform setup. + setupReadNonExistent(testName); + + // Submit the request to the service and store the response. + ClientResponse res = client.read(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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"readItem", "readNonExistent"}) + public void readItemNonExistent(String testName) { + + // Perform setup. + setupReadNonExistent(testName); + + // Submit the request to the service and store the response. + ClientResponse 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + // --------------------------------------------------------------- + // CRUD tests : READ_LIST tests + // --------------------------------------------------------------- + // Success outcomes + + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"createList", "read"}) + public void readList(String testName) throws Exception { + + // Perform setup. + setupReadList(testName); + + // Submit the request to the service and store the response. + ClientResponse res = client.readList(); + PersonauthoritiesCommonList list = res.getEntity(); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + + // Optionally output additional data about list members for debugging. + boolean iterateThroughList = false; + if (iterateThroughList && logger.isDebugEnabled()) { + List items = + list.getPersonauthorityListItem(); + int i = 0; + for (PersonauthoritiesCommonList.PersonauthorityListItem item : items) { + String csid = item.getCsid(); + logger.debug(testName + ": list-item[" + i + "] csid=" + + csid); + logger.debug(testName + ": list-item[" + i + "] displayName=" + + item.getDisplayName()); + logger.debug(testName + ": list-item[" + i + "] URI=" + + item.getUri()); + readItemList(csid); + i++; + } + } + } + + @Test(dependsOnMethods = {"createList", "readItem"}) + public void readItemList() { + readItemList(knownResourceId); + } + + private void readItemList(String vcsid) { + + final String testName = "readItemList"; + + // Perform setup. + setupReadList(testName); + + // Submit the request to the service and store the response. + ClientResponse res = + client.readItemList(vcsid); + PersonsCommonList list = res.getEntity(); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + + List items = + list.getPersonListItem(); + int nItemsReturned = items.size(); + if(logger.isDebugEnabled()){ + logger.debug(" " + testName + ": Expected " + + nItemsToCreateInList+" items; got: "+nItemsReturned); + } + Assert.assertEquals( nItemsReturned, nItemsToCreateInList); + + // Optionally output additional data about list members for debugging. + boolean iterateThroughList = false; + if (iterateThroughList && logger.isDebugEnabled()) { + int i = 0; + for (PersonsCommonList.PersonListItem item : items) { + logger.debug(" " + testName + ": list-item[" + i + "] csid=" + + item.getCsid()); + logger.debug(" " + testName + ": list-item[" + i + "] displayName=" + + item.getDisplayName()); + logger.debug(" " + testName + ": list-item[" + i + "] URI=" + + item.getUri()); + i++; + } + } + } + + // Failure outcomes + // None at present. + // --------------------------------------------------------------- + // CRUD tests : UPDATE tests + // --------------------------------------------------------------- + // Success outcomes + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"read"}) + public void update(String testName) throws Exception { + + // Perform setup. + setupUpdate(testName); + + // Retrieve the contents of a resource to update. + ClientResponse res = + client.read(knownResourceId); + if(logger.isDebugEnabled()){ + logger.debug(testName + ": read status = " + res.getStatus()); + } + Assert.assertEquals(res.getStatus(), EXPECTED_STATUS_CODE); + + if(logger.isDebugEnabled()){ + logger.debug("got PersonAuthority to update with ID: " + knownResourceId); + } + MultipartInput input = (MultipartInput) res.getEntity(); + PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input, + client.getCommonPartName(), PersonauthoritiesCommon.class); + Assert.assertNotNull(personAuthority); + + // Update the contents of this resource. + personAuthority.setDisplayName("updated-" + personAuthority.getDisplayName()); + personAuthority.setVocabType("updated-" + personAuthority.getVocabType()); + if(logger.isDebugEnabled()){ + logger.debug("to be updated PersonAuthority"); + logger.debug(objectAsXmlString(personAuthority, PersonauthoritiesCommon.class)); + } + + // Submit the updated resource to the service and store the response. + MultipartOutput output = new MultipartOutput(); + OutputPart commonPart = output.addPart(personAuthority, MediaType.APPLICATION_XML_TYPE); + commonPart.getHeaders().add("label", client.getCommonPartName()); + res = client.update(knownResourceId, output); + int statusCode = res.getStatus(); + + // Check the status code of the response: does it match the expected response(s)? + if(logger.isDebugEnabled()){ + logger.debug("update: status = " + statusCode); + } + Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + + // Retrieve the updated resource and verify that its contents exist. + input = (MultipartInput) res.getEntity(); + PersonauthoritiesCommon updatedPersonAuthority = + (PersonauthoritiesCommon) extractPart(input, + client.getCommonPartName(), PersonauthoritiesCommon.class); + Assert.assertNotNull(updatedPersonAuthority); + + // Verify that the updated resource received the correct data. + Assert.assertEquals(updatedPersonAuthority.getDisplayName(), + personAuthority.getDisplayName(), + "Data in updated object did not match submitted data."); + } + + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"readItem", "update"}) + public void updateItem(String testName) throws Exception { + + // Perform setup. + setupUpdate(testName); + + ClientResponse res = + client.readItem(knownResourceId, knownItemResourceId); + if(logger.isDebugEnabled()){ + logger.debug(testName + ": read status = " + res.getStatus()); + } + Assert.assertEquals(res.getStatus(), EXPECTED_STATUS_CODE); + + if(logger.isDebugEnabled()){ + logger.debug("got Person to update with ID: " + + knownItemResourceId + + " in PersonAuthority: " + knownResourceId ); + } + MultipartInput input = (MultipartInput) res.getEntity(); + PersonsCommon person = (PersonsCommon) extractPart(input, + client.getItemCommonPartName(), PersonsCommon.class); + Assert.assertNotNull(person); + + // Update the contents of this resource. + person.setForeName("updated-" + person.getForeName()); + if(logger.isDebugEnabled()){ + logger.debug("to be updated Person"); + logger.debug(objectAsXmlString(person, + PersonsCommon.class)); + } + + // Submit the updated resource to the service and store the response. + MultipartOutput output = new MultipartOutput(); + OutputPart commonPart = output.addPart(person, MediaType.APPLICATION_XML_TYPE); + commonPart.getHeaders().add("label", client.getItemCommonPartName()); + res = client.updateItem(knownResourceId, knownItemResourceId, output); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + + // Retrieve the updated resource and verify that its contents exist. + input = (MultipartInput) res.getEntity(); + PersonsCommon updatedPerson = + (PersonsCommon) extractPart(input, + client.getItemCommonPartName(), PersonsCommon.class); + Assert.assertNotNull(updatedPerson); + + // Verify that the updated resource received the correct data. + Assert.assertEquals(updatedPerson.getForeName(), + person.getForeName(), + "Data in updated Person did not match submitted data."); + } + + // Failure outcomes + // Placeholders until the three tests below can be uncommented. + // See Issue CSPACE-401. + @Override + public void updateWithEmptyEntityBody(String testName) throws Exception { + } + + @Override + public void updateWithMalformedXml(String testName) throws Exception { + } + + @Override + public void updateWithWrongXmlSchema(String testName) throws Exception { + } + + /* + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create", "update", "testSubmitRequest"}) + public void updateWithEmptyEntityBody(String testName) throws Exception { + + // Perform setup. + setupUpdateWithEmptyEntityBody(testName); + + // Submit the request to the service and store the response. + String method = REQUEST_TYPE.httpMethodName(); + String url = getResourceURL(knownResourceId); + String mediaType = MediaType.APPLICATION_XML; + final String entity = ""; + int statusCode = submitRequest(method, url, mediaType, entity); + + // Check the status code of the response: does it match + // the expected response(s)? + if(logger.isDebugEnabled()){ + logger.debug(testName + ": url=" + url + + " status=" + statusCode); + } + Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create", "update", "testSubmitRequest"}) + public void updateWithMalformedXml(String testName) throws Exception { + + // Perform setup. + setupUpdateWithMalformedXml(testName); + + // Submit the request to the service and store the response. + String method = REQUEST_TYPE.httpMethodName(); + String url = getResourceURL(knownResourceId); + String mediaType = MediaType.APPLICATION_XML; + final String entity = MALFORMED_XML_DATA; + int statusCode = submitRequest(method, url, mediaType, entity); + + // Check the status code of the response: does it match + // the expected response(s)? + if(logger.isDebugEnabled()){ + logger.debug(testName + ": url=" + url + + " status=" + statusCode); + } + Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create", "update", "testSubmitRequest"}) + public void updateWithWrongXmlSchema(String testName) throws Exception { + + // Perform setup. + setupUpdateWithWrongXmlSchema(testName); + + // Submit the request to the service and store the response. + String method = REQUEST_TYPE.httpMethodName(); + String url = getResourceURL(knownResourceId); + String mediaType = MediaType.APPLICATION_XML; + final String entity = WRONG_XML_SCHEMA_DATA; + int statusCode = submitRequest(method, url, mediaType, entity); + + // Check the status code of the response: does it match + // the expected response(s)? + if(logger.isDebugEnabled()){ + logger.debug("updateWithWrongXmlSchema: url=" + url + + " status=" + statusCode); + } + Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + */ + + + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"update", "testSubmitRequest"}) + public void updateNonExistent(String testName) throws Exception { + + // Perform setup. + setupUpdateNonExistent(testName); + + // 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. + + // The only relevant ID may be the one used in update(), below. + MultipartOutput multipart = createPersonAuthorityInstance(NON_EXISTENT_ID); + ClientResponse res = + client.update(NON_EXISTENT_ID, multipart); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"updateItem", "testItemSubmitRequest"}) + public void updateNonExistentItem(String testName) throws Exception { + + // Perform setup. + setupUpdateNonExistent(testName); + + // 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. + + // The only relevant ID may be the one used in update(), below. + MultipartOutput multipart = createPersonInstance(NON_EXISTENT_ID, + createPersonRefName(NON_EXISTENT_ID, NON_EXISTENT_ID), + "Patrick","Lee","Schmitz","pls", null, null, null, + "1960", null, "Detroit, MI", null, "Coders", "American", "male", + null, null, null, null ); + ClientResponse res = + client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + // --------------------------------------------------------------- + // CRUD tests : DELETE tests + // --------------------------------------------------------------- + // Success outcomes + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"}) + public void delete(String testName) throws Exception { + + // Perform setup. + setupDelete(testName); + + // Submit the request to the service and store the response. + ClientResponse res = client.delete(knownResourceId); + 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"createItem", "readItemList", "testItemSubmitRequest", + "updateItem"}) + public void deleteItem(String testName) throws Exception { + + // Perform setup. + setupDelete(testName); + + // Submit the request to the service and store the response. + ClientResponse 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + // Failure outcomes + @Override + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"delete"}) + public void deleteNonExistent(String testName) throws Exception { + + // Perform setup. + setupDeleteNonExistent(testName); + + // Submit the request to the service and store the response. + ClientResponse res = client.delete(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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class, + dependsOnMethods = {"deleteItem"}) + public void deleteNonExistentItem(String testName) { + + // Perform setup. + setupDeleteNonExistent(testName); + + // Submit the request to the service and store the response. + ClientResponse 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(REQUEST_TYPE.isValidStatusCode(statusCode), + invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); + Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); + } + + // --------------------------------------------------------------- + // Utility tests : tests of code used in tests above + // --------------------------------------------------------------- + /** + * Tests the code for manually submitting data that is used by several + * of the methods above. + */ + @Test(dependsOnMethods = {"create", "read"}) + public void testSubmitRequest() { + + // 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 = getResourceURL(knownResourceId); + int statusCode = submitRequest(method, url); + + // Check the status code of the response: does it match + // the expected response(s)? + if(logger.isDebugEnabled()){ + logger.debug("testSubmitRequest: url=" + url + + " status=" + statusCode); + } + Assert.assertEquals(statusCode, EXPECTED_STATUS); + + } + + @Test(dependsOnMethods = {"createItem", "readItem", "testSubmitRequest"}) + 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); + + } + + // --------------------------------------------------------------- + // 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() { + if (logger.isDebugEnabled()) { + logger.debug("Cleaning up temporary resources created for testing ..."); + } + // Clean up person resources. + String personAuthorityResourceId; + String personResourceId; + for (Map.Entry entry : allResourceItemIdsCreated.entrySet()) { + personResourceId = entry.getKey(); + personAuthorityResourceId = entry.getValue(); + // Note: Any non-success responses are ignored and not reported. + ClientResponse res = + client.deleteItem(personAuthorityResourceId, personResourceId); + } + // Clean up personAuthority resources. + for (String resourceId : allResourceIdsCreated) { + // Note: Any non-success responses are ignored and not reported. + ClientResponse res = client.delete(resourceId); + } + } + + // --------------------------------------------------------------- + // Utility methods used by tests above + // --------------------------------------------------------------- + @Override + public String getServicePathComponent() { + return SERVICE_PATH_COMPONENT; + } + + public String getItemServicePathComponent() { + return ITEM_SERVICE_PATH_COMPONENT; + } + + /** + * 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 personAuthority, followed by the + * path component for the items. + * + * @return The root URL for a service. + */ + protected String getItemServiceRootURL(String parentResourceIdentifier) { + return getResourceURL(parentResourceIdentifier) + "/" + getItemServicePathComponent(); + } + + /** + * 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; + } + + private MultipartOutput createPersonAuthorityInstance(String identifier) { + String displayName = "displayName-" + identifier; + String refName = createPersonAuthRefName(displayName); + String typeName = "vocabType-" + identifier; + return createPersonAuthorityInstance( + displayName, refName,typeName ); + } + + private MultipartOutput createPersonAuthorityInstance( + String displayName, String refName, String vocabType) { + PersonauthoritiesCommon personAuthority = new PersonauthoritiesCommon(); + personAuthority.setDisplayName(displayName); + if(refName!=null) + personAuthority.setRefName(refName); + personAuthority.setVocabType(vocabType); + MultipartOutput multipart = new MultipartOutput(); + 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"); + logger.debug(objectAsXmlString(personAuthority, PersonauthoritiesCommon.class)); + } + return multipart; + } + + private MultipartOutput createPersonInstance(String inAuthority, String refName, + String foreName, String middleName, String surName, + String initials, String salutation, String title, String nameAdditions, + String birthDate, String deathDate, String birthPlace, String deathPlace, + String group, String nationality, String gender, String occupation, + String schoolOrStyle, String bioNote, String nameNote ) { + PersonsCommon person = new PersonsCommon(); + person.setInAuthority(inAuthority); + person.setRefName(refName); + if(foreName!=null) + person.setForeName(foreName); + if(middleName!=null) + person.setMiddleName(middleName); + if(surName!=null) + person.setSurName(surName); + if(initials!=null) + person.setInitials(initials); + if(salutation!=null) + person.setSalutation(salutation); + if(title!=null) + person.setTitle(title); + if(nameAdditions!=null) + person.setNameAdditions(nameAdditions); + if(birthDate!=null) + person.setBirthDate(birthDate); + if(deathDate!=null) + person.setDeathDate(deathDate); + if(birthPlace!=null) + person.setBirthPlace(birthPlace); + if(deathPlace!=null) + person.setDeathPlace(deathPlace); + if(group!=null) + person.setGroup(group); + if(nationality!=null) + person.setNationality(nationality); + if(gender!=null) + person.setGender(gender); + if(occupation!=null) + person.setOccupation(occupation); + if(schoolOrStyle!=null) + person.setSchoolOrStyle(schoolOrStyle); + if(bioNote!=null) + person.setBioNote(bioNote); + if(nameNote!=null) + person.setNameNote(nameNote); + MultipartOutput multipart = new MultipartOutput(); + 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"); + logger.debug(objectAsXmlString(person, + PersonsCommon.class)); + } + + return multipart; + } +} diff --git a/services/person/client/src/test/resources/log4j.properties b/services/person/client/src/test/resources/log4j.properties new file mode 100644 index 000000000..18c510350 --- /dev/null +++ b/services/person/client/src/test/resources/log4j.properties @@ -0,0 +1,23 @@ +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 diff --git a/services/person/import/.classpath b/services/person/import/.classpath new file mode 100644 index 000000000..83343792e --- /dev/null +++ b/services/person/import/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/services/person/import/.project b/services/person/import/.project new file mode 100644 index 000000000..6d98bdb53 --- /dev/null +++ b/services/person/import/.project @@ -0,0 +1,23 @@ + + + org.collectionspace.services.person.importer + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + diff --git a/services/person/import/.settings/org.eclipse.jdt.core.prefs b/services/person/import/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..8bc35048b --- /dev/null +++ b/services/person/import/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Tue Nov 10 14:56:23 PST 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/services/person/import/.settings/org.maven.ide.eclipse.prefs b/services/person/import/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 000000000..fd8796b9b --- /dev/null +++ b/services/person/import/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Tue Nov 10 14:56:18 PST 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/services/person/import/build.xml b/services/person/import/build.xml new file mode 100644 index 000000000..3f56da086 --- /dev/null +++ b/services/person/import/build.xml @@ -0,0 +1,60 @@ + + + + person service + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/import/pom.xml b/services/person/import/pom.xml new file mode 100644 index 000000000..8ab42fad1 --- /dev/null +++ b/services/person/import/pom.xml @@ -0,0 +1,130 @@ + + + + + org.collectionspace.services + org.collectionspace.services.person + 1.0 + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.person.importer + 1.0 + services.person.importer + + + + + org.collectionspace.services + org.collectionspace.services.person.jaxb + 1.0 + + + org.collectionspace.services + org.collectionspace.services.client + 1.0 + + + org.collectionspace.services + org.collectionspace.services.person.client + 1.0 + + + + + org.slf4j + slf4j-api + 1.5.2 + + + + org.jboss.resteasy + resteasy-jaxrs + 1.0.2.GA + + + + tjws + webserver + + + + + org.jboss.resteasy + resteasy-jaxb-provider + 1.0.2.GA + + + org.jboss.resteasy + resteasy-multipart-provider + 1.0.2.GA + + + commons-httpclient + commons-httpclient + 3.1 + + + + + collectionspace-services-person-importer + + + org.apache.maven.plugins + maven-assembly-plugin + + + + attached + + package + + + jar-with-dependencies + + + + org.collectionspace.services.person.importer.PersonAuthorityBaseImport + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + log4j.configuration + file:target/test-classes/log4j.properties + + + + + + maven-compiler-plugin + 2.0.2 + + 1.6 + 1.6 + + + + + + diff --git a/services/person/installer/build.xml b/services/person/installer/build.xml new file mode 100644 index 000000000..506af7be4 --- /dev/null +++ b/services/person/installer/build.xml @@ -0,0 +1,61 @@ + + + + person service + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/jaxb/.classpath b/services/person/jaxb/.classpath new file mode 100644 index 000000000..199bbbbdb --- /dev/null +++ b/services/person/jaxb/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/services/person/jaxb/.project b/services/person/jaxb/.project new file mode 100644 index 000000000..27c00a817 --- /dev/null +++ b/services/person/jaxb/.project @@ -0,0 +1,23 @@ + + + org.collectionspace.services.person.jaxb + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.maven.ide.eclipse.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/services/person/jaxb/.settings/org.eclipse.jdt.core.prefs b/services/person/jaxb/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..0b4dbbea4 --- /dev/null +++ b/services/person/jaxb/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Mon Oct 05 17:07:09 PDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/services/person/jaxb/.settings/org.maven.ide.eclipse.prefs b/services/person/jaxb/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 000000000..528843671 --- /dev/null +++ b/services/person/jaxb/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Mon Oct 05 17:07:08 PDT 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/services/person/jaxb/pom.xml b/services/person/jaxb/pom.xml new file mode 100644 index 000000000..2616fc9ed --- /dev/null +++ b/services/person/jaxb/pom.xml @@ -0,0 +1,105 @@ + + + + + org.collectionspace.services.person + org.collectionspace.services + 1.0 + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.person.jaxb + 1.0 + services.person.jaxb + + + + com.sun.xml.bind + jaxb-impl + 2.0.2 + + + org.jvnet.jaxb2-commons + property-listener-injector + 1.0 + + + org.jvnet.jaxb2_commons + runtime + 0.4.1.4 + + + + collectionspace-services-person-jaxb + install + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + + + + generate + + + + + + + javax.activation + activation + 1.1 + + + com.sun.xml.bind + jaxb-impl + 2.1.2 + + + + + -XtoString + -Xinject-listener-code + + + + + + + org.jvnet.jaxb2_commons + + basic + 0.4.1 + + + + org.jvnet.jaxb2-commons + + + property-listener-injector + + 1.0 + + + + + + + + maven-compiler-plugin + 2.0.2 + + 1.6 + 1.6 + + + + + + diff --git a/services/person/jaxb/src/main/java/org/collectionspace/services/PersonAuthorityJAXBSchema.java b/services/person/jaxb/src/main/java/org/collectionspace/services/PersonAuthorityJAXBSchema.java new file mode 100644 index 000000000..cef5d5e1a --- /dev/null +++ b/services/person/jaxb/src/main/java/org/collectionspace/services/PersonAuthorityJAXBSchema.java @@ -0,0 +1,17 @@ +/** + * + */ +package org.collectionspace.services; + +/** + * @author pschmitz + * + */ +public interface PersonAuthorityJAXBSchema { + final static String DISPLAY_NAME = "displayName"; + final static String REF_NAME = "refName"; + final static String VOCAB_TYPE = "vocabType"; + final static String CSID = "csid"; +} + + diff --git a/services/person/jaxb/src/main/java/org/collectionspace/services/PersonAuthorityListItemJAXBSchema.java b/services/person/jaxb/src/main/java/org/collectionspace/services/PersonAuthorityListItemJAXBSchema.java new file mode 100644 index 000000000..b36ba9170 --- /dev/null +++ b/services/person/jaxb/src/main/java/org/collectionspace/services/PersonAuthorityListItemJAXBSchema.java @@ -0,0 +1,9 @@ +package org.collectionspace.services; + +public interface PersonAuthorityListItemJAXBSchema { + final static String DISPLAY_NAME = "displayName"; + final static String REF_NAME = "refName"; + final static String VOCAB_TYPE = "vocabType"; + final static String CSID = "csid"; + final static String URI = "url"; +} diff --git a/services/person/jaxb/src/main/java/org/collectionspace/services/PersonJAXBSchema.java b/services/person/jaxb/src/main/java/org/collectionspace/services/PersonJAXBSchema.java new file mode 100644 index 000000000..b8e3e072b --- /dev/null +++ b/services/person/jaxb/src/main/java/org/collectionspace/services/PersonJAXBSchema.java @@ -0,0 +1,35 @@ +/** + * + */ +package org.collectionspace.services; + +/** + * @author pschmitz + * + */ +public interface PersonJAXBSchema { + final static String CSID = "csid"; + final static String IN_AUTHORITY = "inAuthority"; + final static String REF_NAME = "refName"; + final static String DISPLAY_NAME = "displayName"; + final static String DN_COMPUTED = "dnComputed"; + 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 GROUP = "group"; + final static String NATIONALITY = "nationality"; + final static String GENDER = "gender"; + final static String OCCUPATION = "occupation"; + final static String SCHOOL_OR_STYLE = "schoolOrStyle"; + final static String BIO_NOTE = "bioNote"; + final static String NAME_NOTE = "nameNote"; +} + diff --git a/services/person/jaxb/src/main/java/org/collectionspace/services/PersonListItemJAXBSchema.java b/services/person/jaxb/src/main/java/org/collectionspace/services/PersonListItemJAXBSchema.java new file mode 100644 index 000000000..0f501c83a --- /dev/null +++ b/services/person/jaxb/src/main/java/org/collectionspace/services/PersonListItemJAXBSchema.java @@ -0,0 +1,8 @@ +package org.collectionspace.services; + +public interface PersonListItemJAXBSchema { + final static String DISPLAY_NAME = "displayName"; + final static String REF_NAME = "refName"; + final static String CSID = "csid"; + final static String URI = "url"; +} diff --git a/services/person/jaxb/src/main/resources/person_common.xsd b/services/person/jaxb/src/main/resources/person_common.xsd new file mode 100644 index 000000000..c74ebc699 --- /dev/null +++ b/services/person/jaxb/src/main/resources/person_common.xsd @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/jaxb/src/main/resources/personauthority_common.xsd b/services/person/jaxb/src/main/resources/personauthority_common.xsd new file mode 100644 index 000000000..ea863ee97 --- /dev/null +++ b/services/person/jaxb/src/main/resources/personauthority_common.xsd @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/pom.xml b/services/person/pom.xml new file mode 100644 index 000000000..cfbee0884 --- /dev/null +++ b/services/person/pom.xml @@ -0,0 +1,70 @@ + + + + org.collectionspace.services.main + org.collectionspace.services + 1.0 + + 4.0.0 + org.collectionspace.services + 1.0 + org.collectionspace.services.person + pom + services.person + + + jaxb + service + 3rdparty + client + import + sample + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + + + org.apache.maven.plugins + maven-site-plugin + + /usr/bin/unzip -o > err.txt + + + + org.apache.maven.plugins + maven-war-plugin + 2.0.1 + + WEB-INF/lib/*.jar + + + true + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.0.2 + + 1.6 + 1.6 + + + + + + diff --git a/services/person/sample/.classpath b/services/person/sample/.classpath new file mode 100644 index 000000000..d8f291998 --- /dev/null +++ b/services/person/sample/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/services/person/sample/.project b/services/person/sample/.project new file mode 100644 index 000000000..c37a73f39 --- /dev/null +++ b/services/person/sample/.project @@ -0,0 +1,23 @@ + + + org.collectionspace.services.person.samples + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + diff --git a/services/person/sample/.settings/org.eclipse.jdt.core.prefs b/services/person/sample/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..9fa2bf3ac --- /dev/null +++ b/services/person/sample/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Mon Nov 23 11:54:01 PST 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.source=1.3 diff --git a/services/person/sample/.settings/org.maven.ide.eclipse.prefs b/services/person/sample/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 000000000..e3f71bde4 --- /dev/null +++ b/services/person/sample/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Mon Nov 23 11:53:50 PST 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/services/person/sample/pom.xml b/services/person/sample/pom.xml new file mode 100644 index 000000000..722a68d84 --- /dev/null +++ b/services/person/sample/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.person.client.samples + pom + 1.0 + person.client.samples + + + sample + + + diff --git a/services/person/sample/sample/.classpath b/services/person/sample/sample/.classpath new file mode 100644 index 000000000..199bbbbdb --- /dev/null +++ b/services/person/sample/sample/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/services/person/sample/sample/.project b/services/person/sample/sample/.project new file mode 100644 index 000000000..403be48ad --- /dev/null +++ b/services/person/sample/sample/.project @@ -0,0 +1,17 @@ + + org.collectionspace.services.person.client.sample + + + + + org.eclipse.jdt.core.javabuilder + + + org.maven.ide.eclipse.maven2Builder + + + + org.maven.ide.eclipse.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/services/person/sample/sample/.settings/org.eclipse.jdt.core.prefs b/services/person/sample/sample/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..d6eca4e65 --- /dev/null +++ b/services/person/sample/sample/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Thu Jan 07 14:31:49 PST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/services/person/sample/sample/.settings/org.maven.ide.eclipse.prefs b/services/person/sample/sample/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 000000000..bac30c99a --- /dev/null +++ b/services/person/sample/sample/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Thu Jan 07 14:30:38 PST 2010 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/services/person/sample/sample/pom.xml b/services/person/sample/sample/pom.xml new file mode 100644 index 000000000..f1bf0d821 --- /dev/null +++ b/services/person/sample/sample/pom.xml @@ -0,0 +1,112 @@ + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.person.client.sample + jar + 1.0 + person.client.sample + + + + org.collectionspace.services + org.collectionspace.services.person.jaxb + 1.0 + + + org.collectionspace.services + org.collectionspace.services.client + 1.0 + + + org.collectionspace.services + org.collectionspace.services.person.client + 1.0 + + + + + + libs-releases-local + libs-releases-local + http://source.collectionspace.org:8081/artifactory/libs-releases-local + + true + + + false + + + + + libs-snapshots-local + libs-snapshots-local + http://source.collectionspace.org:8081/artifactory/libs-snapshots-local + + false + + + true + + + + collectionspace-releases + collectionspace-releases + http://source.collectionspace.org:8081/artifactory/public-nuxeo + + true + + + false + + + + collectionspace-snapshots + collectionspace-snapshots + http://source.collectionspace.org:8081/artifactory/public-snapshot-nuxeo + + false + + + true + + + + + + person-client-sample + + + org.apache.maven.plugins + maven-assembly-plugin + + + + attached + + package + + + jar-with-dependencies + + + + org.collectionspace.services.person.client.sample.Sample + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + diff --git a/services/person/sample/sample/src/main/resources/collectionspace-client.properties b/services/person/sample/sample/src/main/resources/collectionspace-client.properties new file mode 100644 index 000000000..429b9f6fe --- /dev/null +++ b/services/person/sample/sample/src/main/resources/collectionspace-client.properties @@ -0,0 +1,6 @@ +#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 diff --git a/services/person/sample/sample/src/main/resources/log4j.xml b/services/person/sample/sample/src/main/resources/log4j.xml new file mode 100644 index 000000000..f3969c91a --- /dev/null +++ b/services/person/sample/sample/src/main/resources/log4j.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/person/service/.classpath b/services/person/service/.classpath new file mode 100644 index 000000000..83343792e --- /dev/null +++ b/services/person/service/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/services/person/service/.project b/services/person/service/.project new file mode 100644 index 000000000..82b120add --- /dev/null +++ b/services/person/service/.project @@ -0,0 +1,25 @@ + + + org.collectionspace.services.person.service + + + org.collectionspace.services.common + org.collectionspace.services.person.jaxb + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.maven.ide.eclipse.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/services/person/service/.settings/org.eclipse.jdt.core.prefs b/services/person/service/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..588ea278c --- /dev/null +++ b/services/person/service/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Mon Jan 04 16:43:19 PST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/services/person/service/.settings/org.maven.ide.eclipse.prefs b/services/person/service/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 000000000..ddebb8bf5 --- /dev/null +++ b/services/person/service/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Mon Jan 04 16:40:35 PST 2010 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/services/person/service/pom.xml b/services/person/service/pom.xml new file mode 100644 index 000000000..6e48de49f --- /dev/null +++ b/services/person/service/pom.xml @@ -0,0 +1,154 @@ + + + + + org.collectionspace.services.person + org.collectionspace.services + 1.0 + + + 4.0.0 + org.collectionspace.services + org.collectionspace.services.person.service + jar + 1.0 + services.person.service + + + + org.collectionspace.services + org.collectionspace.services.common + 1.0 + + + org.collectionspace.services + org.collectionspace.services.person.jaxb + 1.0 + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + junit + junit + 4.1 + test + + + org.testng + testng + 5.6 + + + + + commons-beanutils + commons-beanutils + 1.6.1 + + + + commons-logging + commons-logging + 1.1 + + + + + + javax.security + jaas + 1.0.01 + provided + + + + dom4j + dom4j + 1.6.1 + provided + + + + + + org.jboss.resteasy + resteasy-jaxrs + 1.0.2.GA + + + tjws + webserver + + + + + org.jboss.resteasy + resteasy-jaxb-provider + 1.0.2.GA + + + org.jboss.resteasy + resteasy-multipart-provider + 1.0.2.GA + + + + + + org.nuxeo.ecm.core + nuxeo-core-api + ${nuxeo.version.1.5} + + + jboss-remoting + jboss + + + + + + org.restlet + org.restlet + 1.0.7 + + + com.noelios.restlet + com.noelios.restlet.ext.httpclient + 1.0.7 + + + com.noelios.restlet + com.noelios.restlet + 1.0.7 + + + + + + collectionspace-services-person + + + org.codehaus.mojo + jboss-maven-plugin + + ${jboss.dir} + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + diff --git a/services/pom.xml b/services/pom.xml index 3f92548a5..6bd3e6feb 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -22,6 +22,7 @@ acquisition vocabulary organization + person id collectionobject intake -- 2.47.3