From: Aron Roberts Date: Thu, 8 Sep 2011 01:25:50 +0000 (+0000) Subject: CSPACE-4345: Cleaned up vestigial 'import' modules in four vocabulary and authority... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=edb751d82a1736cc8baf5a72cb1aa746102124e4;p=tmp%2Fjakarta-migration.git CSPACE-4345: Cleaned up vestigial 'import' modules in four vocabulary and authority services: vocabulary, person, organization and location. The presence of these long-unused modules, following conversion of each of those services to emit list results in AbstractCommonList format, was resulting in compilation errors while attempting to generate the distribution tarballs via 'ant dist-jboss-domains', as these old import modules were referenced by the dependent 'dist' task. --- diff --git a/services/location/build.xml b/services/location/build.xml index ce5d33547..5ff749388 100644 --- a/services/location/build.xml +++ b/services/location/build.xml @@ -118,7 +118,6 @@ - - diff --git a/services/location/import/.classpath b/services/location/import/.classpath deleted file mode 100644 index 199bbbbdb..000000000 --- a/services/location/import/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/services/location/import/.project b/services/location/import/.project deleted file mode 100644 index ae21be519..000000000 --- a/services/location/import/.project +++ /dev/null @@ -1,26 +0,0 @@ - - - org.collectionspace.services.person.importer - - - org.collectionspace.services.client - org.collectionspace.services.common - org.collectionspace.services.person.jaxb - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/services/location/import/.settings/org.maven.ide.eclipse.prefs b/services/location/import/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index fd8796b9b..000000000 --- a/services/location/import/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,9 +0,0 @@ -#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/location/import/build.xml b/services/location/import/build.xml deleted file mode 100644 index 1b691286e..000000000 --- a/services/location/import/build.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - location service - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/services/location/import/pom.xml b/services/location/import/pom.xml deleted file mode 100644 index 99c382d74..000000000 --- a/services/location/import/pom.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - org.collectionspace.services - org.collectionspace.services.location - 1.11-SNAPSHOT - - - 4.0.0 - org.collectionspace.services - org.collectionspace.services.location.importer - services.location.importer - - - - - org.slf4j - slf4j-api - 1.5.2 - - - - - org.collectionspace.services - org.collectionspace.services.location.jaxb - ${project.version} - - - org.collectionspace.services - org.collectionspace.services.client - ${project.version} - - - org.collectionspace.services - org.collectionspace.services.location.client - ${project.version} - - - - org.jboss.resteasy - resteasy-jaxrs - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - - - org.jboss.resteasy - resteasy-multipart-provider - - - commons-httpclient - commons-httpclient - 3.1 - - - - - collectionspace-services-location-importer - - - org.apache.maven.plugins - maven-assembly-plugin - - - - attached - - package - - - jar-with-dependencies - - - - org.collectionspace.services.location.importer.LocationAuthorityBaseImport - - - - - - - - - - diff --git a/services/location/import/src/main/java/org/collectionspace/services/location/importer/LocationAuthorityBaseImport.java b/services/location/import/src/main/java/org/collectionspace/services/location/importer/LocationAuthorityBaseImport.java deleted file mode 100644 index 7f4bc3390..000000000 --- a/services/location/import/src/main/java/org/collectionspace/services/location/importer/LocationAuthorityBaseImport.java +++ /dev/null @@ -1,160 +0,0 @@ -/** - * 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.location.importer; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - -import org.apache.log4j.BasicConfigurator; -import org.collectionspace.services.LocationJAXBSchema; -import org.collectionspace.services.client.LocationAuthorityClient; -import org.collectionspace.services.client.LocationAuthorityClientUtils; -import org.collectionspace.services.client.PoxPayloadOut; -import org.collectionspace.services.client.test.ServiceRequestType; -import org.collectionspace.services.location.LocationauthoritiesCommon; -import org.collectionspace.services.location.LocationauthoritiesCommonList; -import org.collectionspace.services.location.LocationsCommon; -import org.collectionspace.services.location.LocationsCommonList; -import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.OutputPart; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * LocationAuthorityServiceTest, carries out tests against a - * deployed and running LocationAuthority Service. - * - * $LastChangedRevision: 753 $ - * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $ - */ -public class LocationAuthorityBaseImport { - private static final Logger logger = - LoggerFactory.getLogger(LocationAuthorityBaseImport.class); - - // Instance variables specific to this test. - private LocationAuthorityClient client = new LocationAuthorityClient(); - - public void createLocationAuthority(String locationAuthorityName, - List> locationMaps ) { - - // Expected status code: 201 Created - int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode(); - // Type of service request being tested - ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE; - - if(logger.isDebugEnabled()){ - logger.debug("Import: Create locationAuthority: \"" + locationAuthorityName +"\""); - } - - - - String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: this is just made-up. Laramie20100728 temp fix, made-up displaySuffix. - String baseLocationRefName = LocationAuthorityClientUtils.createLocationAuthRefName(locationAuthorityName, displaySuffix);//TODO: make displaySuffix correct. Laramie20100729 temp fix, made-up displaySuffix. was (locationAuthorityName, false); - String fullLocationRefName = LocationAuthorityClientUtils.createLocationAuthRefName(locationAuthorityName, displaySuffix);//TODO: make displaySuffix correct. Laramie20100729 temp fix, made-up displaySuffix. was (locationAuthorityName, true); - - PoxPayloadOut multipart = LocationAuthorityClientUtils.createLocationAuthorityInstance(locationAuthorityName, fullLocationRefName, client.getCommonPartName()); - ClientResponse res = client.create(multipart); - - int statusCode = res.getStatus(); - - if(!REQUEST_TYPE.isValidStatusCode(statusCode)) { - throw new RuntimeException("Could not create enumeration: \""+locationAuthorityName - +"\" "+ LocationAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); - } - if(statusCode != EXPECTED_STATUS_CODE) { - throw new RuntimeException("Unexpected Status when creating enumeration: \"" - +locationAuthorityName +"\", Status:"+ statusCode); - } - - // Store the ID returned from this create operation - // for additional tests below. - String newLocationAuthorityId = LocationAuthorityClientUtils.extractId(res); - if(logger.isDebugEnabled()){ - logger.debug("Import: Created locationAuthorityulary: \"" + locationAuthorityName +"\" ID:" - +newLocationAuthorityId ); - } - for(Map locationMap : locationMaps){ - LocationAuthorityClientUtils.createItemInAuthority( - newLocationAuthorityId, baseLocationRefName, locationMap, client); - } - } - - public static void main(String[] args) { - - BasicConfigurator.configure(); - logger.info("LocationAuthorityBaseImport starting..."); - - LocationAuthorityBaseImport pabi = new LocationAuthorityBaseImport(); - final String demoLocationAuthorityName = "Demo Location Authority"; - - /* Strings are: - shortName, longName, nameAdditions, contactName, - foundingDate, dissolutionDate, foundingPlace, function, description - */ - - - /* TODO: Laramie20100728 This is broken. Removing for now. - Map johnWayneMap = new HashMap(); - johnWayneMap.put(LocationJAXBSchema.FORE_NAME, "John"); - johnWayneMap.put(LocationJAXBSchema.SUR_NAME, "Wayne"); - johnWayneMap.put(LocationJAXBSchema.GENDER, "male"); - johnWayneMap.put(LocationJAXBSchema.BIRTH_DATE, "May 26, 1907"); - johnWayneMap.put(LocationJAXBSchema.BIRTH_PLACE, "Winterset, Iowa"); - johnWayneMap.put(LocationJAXBSchema.DEATH_DATE, "June 11, 1979"); - johnWayneMap.put(LocationJAXBSchema.BIO_NOTE, "born Marion Robert Morrison and better" + - "known by his stage name John Wayne, was an American film actor, director " + - "and producer. He epitomized rugged masculinity and has become an enduring " + - "American icon. He is famous for his distinctive voice, walk and height. " + - "He was also known for his conservative political views and his support in " + - "the 1950s for anti-communist positions."); - Map patrickSchmitzMap = new HashMap(); - patrickSchmitzMap.put(LocationJAXBSchema.FORE_NAME, "Patrick"); - patrickSchmitzMap.put(LocationJAXBSchema.SUR_NAME, "Schmitz"); - patrickSchmitzMap.put(LocationJAXBSchema.GENDER, "male"); - patrickSchmitzMap.put(LocationJAXBSchema.BIRTH_DATE, "7/15/1960"); - patrickSchmitzMap.put(LocationJAXBSchema.BIRTH_PLACE, "MI"); - Map janeDoeMap = new HashMap(); - janeDoeMap.put(LocationJAXBSchema.FORE_NAME, "Jane"); - janeDoeMap.put(LocationJAXBSchema.SUR_NAME, "Doe"); - janeDoeMap.put(LocationJAXBSchema.GENDER, "female"); - janeDoeMap.put(LocationJAXBSchema.BIRTH_DATE, "7/04/1901"); - janeDoeMap.put(LocationJAXBSchema.DEATH_DATE, "4/01/1999"); - janeDoeMap.put(LocationJAXBSchema.BIRTH_PLACE, "Anytown, USA"); - janeDoeMap.put(LocationJAXBSchema.BIRTH_PLACE, "Nowheresville, USA"); - List> locationsMaps = - Arrays.asList(johnWayneMap, patrickSchmitzMap, janeDoeMap ); - - pabi.createLocationAuthority(demoLocationAuthorityName, locationsMaps); - */ - logger.info("LocationAuthorityBaseImport test is empty because LocationJAXBSchema had code changes. See org.collectionspace.services.location.importer.LocationAuthorityBaseImport"); - logger.info("LocationAuthorityBaseImport complete."); - } -} diff --git a/services/location/pom.xml b/services/location/pom.xml index f20ed26c5..f0c86161b 100644 --- a/services/location/pom.xml +++ b/services/location/pom.xml @@ -28,15 +28,14 @@ client - - - samples + + + samples - import - + - - + + diff --git a/services/organization/build.xml b/services/organization/build.xml index 84a94fc75..ada81c0e6 100644 --- a/services/organization/build.xml +++ b/services/organization/build.xml @@ -118,7 +118,6 @@ - - diff --git a/services/organization/import/.classpath b/services/organization/import/.classpath deleted file mode 100644 index 199bbbbdb..000000000 --- a/services/organization/import/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/services/organization/import/.project b/services/organization/import/.project deleted file mode 100644 index 08d161391..000000000 --- a/services/organization/import/.project +++ /dev/null @@ -1,26 +0,0 @@ - - - org.collectionspace.services.organization.importer - - - org.collectionspace.services.client - org.collectionspace.services.common - org.collectionspace.services.organization.jaxb - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/services/organization/import/.settings/org.maven.ide.eclipse.prefs b/services/organization/import/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index fd8796b9b..000000000 --- a/services/organization/import/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,9 +0,0 @@ -#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/organization/import/build.xml b/services/organization/import/build.xml deleted file mode 100644 index 001ca5ded..000000000 --- a/services/organization/import/build.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - organization service - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/services/organization/import/pom.xml b/services/organization/import/pom.xml deleted file mode 100644 index 3895902b1..000000000 --- a/services/organization/import/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - org.collectionspace.services - org.collectionspace.services.organization - 1.11-SNAPSHOT - - - 4.0.0 - org.collectionspace.services - org.collectionspace.services.organization.importer - services.organization.importer - - - - - org.slf4j - slf4j-api - 1.5.2 - - - - - org.collectionspace.services - org.collectionspace.services.organization.jaxb - ${project.version} - - - org.collectionspace.services - org.collectionspace.services.client - ${project.version} - - - org.collectionspace.services - org.collectionspace.services.organization.client - ${project.version} - - - org.jboss.resteasy - resteasy-jaxrs - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - - - org.jboss.resteasy - resteasy-multipart-provider - - - commons-httpclient - commons-httpclient - 3.1 - - - - - collectionspace-services-organization-importer - - - org.apache.maven.plugins - maven-assembly-plugin - - - - attached - - package - - - jar-with-dependencies - - - - org.collectionspace.services.organization.importer.OrgAuthorityBaseImport - - - - - - - - - - diff --git a/services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java b/services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java deleted file mode 100644 index 0662d229b..000000000 --- a/services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * This document is a part of the source code and related artifacts - * for CollectionSpace, an open source collections management system - * for museums and related institutions: - * - * http://www.collectionspace.org - * http://wiki.collectionspace.org - * - * Copyright (c)) 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.collectionspace.services.organization.importer; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - -import org.apache.log4j.BasicConfigurator; -import org.collectionspace.services.OrganizationJAXBSchema; -import org.collectionspace.services.client.OrgAuthorityClient; -import org.collectionspace.services.client.OrgAuthorityClientUtils; -import org.collectionspace.services.client.PoxPayloadOut; -import org.collectionspace.services.client.test.ServiceRequestType; -import org.jboss.resteasy.client.ClientResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * OrgAuthorityServiceTest, carries out tests against a - * deployed and running OrgAuthority Service. - * - * $LastChangedRevision: 753 $ - * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $ - */ -public class OrgAuthorityBaseImport { - private static final Logger logger = - LoggerFactory.getLogger(OrgAuthorityBaseImport.class); - - // Instance variables specific to this test. - private OrgAuthorityClient client = new OrgAuthorityClient(); - final String SERVICE_PATH_COMPONENT = "orgauthorities"; - final String ITEM_SERVICE_PATH_COMPONENT = "items"; - - public void createOrgAuthority(String orgAuthorityDisplayName, String orgAuthorityShortId, - List> orgInfos ) { - - // Expected status code: 201 Created - int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode(); - // Type of service request being tested - ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE; - - if(logger.isDebugEnabled()){ - logger.debug("Import: Create orgAuthority: \"" + orgAuthorityShortId +"\""); - } - String baseOrgAuthRefName = OrgAuthorityClientUtils.createOrgAuthRefName(orgAuthorityShortId, null); - PoxPayloadOut multipart = - OrgAuthorityClientUtils.createOrgAuthorityInstance( - orgAuthorityDisplayName, orgAuthorityShortId, client.getCommonPartName()); - ClientResponse res = client.create(multipart); - - int statusCode = res.getStatus(); - - if(!REQUEST_TYPE.isValidStatusCode(statusCode)) { - throw new RuntimeException("Could not create enumeration: \""+orgAuthorityShortId - +"\" "+ OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); - } - if(statusCode != EXPECTED_STATUS_CODE) { - throw new RuntimeException("Unexpected Status when creating enumeration: \"" - +orgAuthorityShortId +"\", Status:"+ statusCode); - } - - // Store the ID returned from this create operation - // for additional tests below. - String newOrgAuthorityId = OrgAuthorityClientUtils.extractId(res); - if(logger.isDebugEnabled()){ - logger.debug("Import: Created orgAuthorityulary: \"" + orgAuthorityShortId +"\" ID:" - +newOrgAuthorityId ); - } - - - /* - *TODO: Laramie20100728 this code is out of date, and needs to use the new API. Commenting out for now. - * - *orgRepeatablesInfo is undefined; - *for(Map orgInfo : orgInfos){ - * OrgAuthorityClientUtils.createItemInAuthority(newOrgAuthorityId, baseOrgAuthRefName, orgInfo, orgRepeatablesInfo, client); - *} - */ - logger.error("MethodcreateOrgAuthority(String orgAuthorityDisplayName, String orgAuthorityShortId,List> orgInfos ) not implemented properly."); - } - - // --------------------------------------------------------------- - // Utility methods used by methods above - // --------------------------------------------------------------- - - public static void main(String[] args) { - - BasicConfigurator.configure(); - logger.info("OrgAuthorityBaseImport starting..."); - - OrgAuthorityBaseImport oabi = new OrgAuthorityBaseImport(); - final String demoOrgAuthorityName = "Demo Org Authority"; - final String demoOrgAuthorityShortId = "demoOrgAuth"; - - Map mmiOrgMap = new HashMap(); - mmiOrgMap.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, "mmi"); - mmiOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "MMI"); - mmiOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Museum of the Moving Image"); - //TODO: CONTACT_NAME is not in API any more. mmiOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Megan Forbes"); - mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1984"); - mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Astoria, NY"); - Map pahmaOrgMap = new HashMap(); - pahmaOrgMap.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, "pahma"); - pahmaOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "PAHMA"); - pahmaOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Phoebe A. Hearst Museum of Anthropology"); - pahmaOrgMap.put(OrganizationJAXBSchema.NAME_ADDITIONS, "University of California, Berkeley"); - //TODO: CONTACT_NAME is not in API any more. pahmaOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Michael Black"); - pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1901"); - pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Berkeley, CA"); - Map savoyOrgMap = new HashMap(); - savoyOrgMap.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, "savoyTh"); - savoyOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "Savoy Theatre"); - savoyOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1900"); - savoyOrgMap.put(OrganizationJAXBSchema.DISSOLUTION_DATE, "1952"); - savoyOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "New York, NY"); - List> orgMaps = - Arrays.asList(mmiOrgMap, pahmaOrgMap, savoyOrgMap ); - - oabi.createOrgAuthority(demoOrgAuthorityName, demoOrgAuthorityShortId, orgMaps); - - logger.info("OrgAuthorityBaseImport complete."); - } -} diff --git a/services/organization/pom.xml b/services/organization/pom.xml index c24d8438e..2197e3f5a 100644 --- a/services/organization/pom.xml +++ b/services/organization/pom.xml @@ -28,15 +28,14 @@ client - - - samples + + + samples - import - sample - - - + sample + + + diff --git a/services/person/build.xml b/services/person/build.xml index 7a718502e..b87daf2c3 100644 --- a/services/person/build.xml +++ b/services/person/build.xml @@ -118,7 +118,6 @@ - - diff --git a/services/person/import/.classpath b/services/person/import/.classpath deleted file mode 100644 index 199bbbbdb..000000000 --- a/services/person/import/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/services/person/import/.project b/services/person/import/.project deleted file mode 100644 index ae21be519..000000000 --- a/services/person/import/.project +++ /dev/null @@ -1,26 +0,0 @@ - - - org.collectionspace.services.person.importer - - - org.collectionspace.services.client - org.collectionspace.services.common - org.collectionspace.services.person.jaxb - - - - 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.maven.ide.eclipse.prefs b/services/person/import/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index fd8796b9b..000000000 --- a/services/person/import/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,9 +0,0 @@ -#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 deleted file mode 100644 index 3f56da086..000000000 --- a/services/person/import/build.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - person service - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/services/person/import/pom.xml b/services/person/import/pom.xml deleted file mode 100644 index ae99914a5..000000000 --- a/services/person/import/pom.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - org.collectionspace.services - org.collectionspace.services.person - 1.11-SNAPSHOT - - - 4.0.0 - org.collectionspace.services - org.collectionspace.services.person.importer - services.person.importer - - - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - org.collectionspace.services - org.collectionspace.services.person.jaxb - ${project.version} - - - org.collectionspace.services - org.collectionspace.services.client - ${project.version} - - - org.collectionspace.services - org.collectionspace.services.person.client - ${project.version} - - - - org.jboss.resteasy - resteasy-jaxrs - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - - - org.jboss.resteasy - resteasy-multipart-provider - - - 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 - - - - - - - - - - diff --git a/services/person/import/src/main/java/org/collectionspace/services/person/importer/PersonAuthorityBaseImport.java b/services/person/import/src/main/java/org/collectionspace/services/person/importer/PersonAuthorityBaseImport.java deleted file mode 100644 index 205485972..000000000 --- a/services/person/import/src/main/java/org/collectionspace/services/person/importer/PersonAuthorityBaseImport.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * This document is a part of the source code and related artifacts - * for CollectionSpace, an open source collections management system - * for museums and related institutions: - * - * http://www.collectionspace.org - * http://wiki.collectionspace.org - * - * Copyright (c)) 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.collectionspace.services.person.importer; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - -import org.apache.log4j.BasicConfigurator; -import org.collectionspace.services.PersonJAXBSchema; -import org.collectionspace.services.client.PersonAuthorityClient; -import org.collectionspace.services.client.PersonAuthorityClientUtils; -import org.collectionspace.services.client.PoxPayloadOut; -import org.collectionspace.services.client.test.ServiceRequestType; -import org.collectionspace.services.person.PersonauthoritiesCommon; -import org.collectionspace.services.person.PersonauthoritiesCommonList; -import org.collectionspace.services.person.PersonsCommon; -import org.collectionspace.services.person.PersonsCommonList; -import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.OutputPart; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 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 PersonAuthorityBaseImport { - private static final Logger logger = - LoggerFactory.getLogger(PersonAuthorityBaseImport.class); - - // Instance variables specific to this test. - private PersonAuthorityClient client = new PersonAuthorityClient(); - - public void createPersonAuthority(String displayName, String shortId, - List> personMaps ) { - - // Expected status code: 201 Created - int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode(); - // Type of service request being tested - ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE; - - if(logger.isDebugEnabled()){ - logger.debug("Import: Create personAuthority: \"" + displayName +"\""); - } - String basePersonRefName = - PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null); - PoxPayloadOut multipart = - PersonAuthorityClientUtils.createPersonAuthorityInstance( - displayName, shortId, client.getCommonPartName()); - ClientResponse res = client.create(multipart); - - int statusCode = res.getStatus(); - - if(!REQUEST_TYPE.isValidStatusCode(statusCode)) { - throw new RuntimeException("Could not create enumeration: \""+displayName - +"\" "+ PersonAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); - } - if(statusCode != EXPECTED_STATUS_CODE) { - throw new RuntimeException("Unexpected Status when creating enumeration: \"" - +displayName +"\", Status:"+ statusCode); - } - - // Store the ID returned from this create operation - // for additional tests below. - String newPersonAuthorityId = PersonAuthorityClientUtils.extractId(res); - if(logger.isDebugEnabled()){ - logger.debug("Import: Created personAuthorityulary: \"" + displayName +"\" ID:" - +newPersonAuthorityId ); - } - - /* - *TODO: Laramie20100728 this code is out of date, and needs to use the new API. Commenting out for now. - * - *for(Map personMap : personMaps){ - * PersonAuthorityClientUtils.createItemInAuthority( - * newPersonAuthorityId, basePersonRefName, personMap, client); - *} - */ - logger.error("Method PersonAuthorityBaseImport.createPersonAuthority not implemented properly."); - - } - - public static void main(String[] args) { - - BasicConfigurator.configure(); - logger.info("PersonAuthorityBaseImport starting..."); - - PersonAuthorityBaseImport pabi = new PersonAuthorityBaseImport(); - final String demoPersonAuthorityName = "Demo Person Authority"; - final String demoPersonAuthorityShortId = "demoPersonAuth"; - - /* Strings are: - shortName, longName, nameAdditions, contactName, - foundingDate, dissolutionDate, foundingPlace, function, description - */ - Map johnWayneMap = new HashMap(); - johnWayneMap.put(PersonJAXBSchema.SHORT_IDENTIFIER, "johnWayne_Actor"); - johnWayneMap.put(PersonJAXBSchema.FORE_NAME, "John"); - johnWayneMap.put(PersonJAXBSchema.SUR_NAME, "Wayne"); - johnWayneMap.put(PersonJAXBSchema.GENDER, "male"); - johnWayneMap.put(PersonJAXBSchema.BIRTH_DATE, "May 26, 1907"); - johnWayneMap.put(PersonJAXBSchema.BIRTH_PLACE, "Winterset, Iowa"); - johnWayneMap.put(PersonJAXBSchema.DEATH_DATE, "June 11, 1979"); - johnWayneMap.put(PersonJAXBSchema.BIO_NOTE, "born Marion Robert Morrison and better" + - "known by his stage name John Wayne, was an American film actor, director " + - "and producer. He epitomized rugged masculinity and has become an enduring " + - "American icon. He is famous for his distinctive voice, walk and height. " + - "He was also known for his conservative political views and his support in " + - "the 1950s for anti-communist positions."); - Map patrickSchmitzMap = new HashMap(); - patrickSchmitzMap.put(PersonJAXBSchema.SHORT_IDENTIFIER, "plSchmitz_Geek"); - patrickSchmitzMap.put(PersonJAXBSchema.FORE_NAME, "Patrick"); - patrickSchmitzMap.put(PersonJAXBSchema.SUR_NAME, "Schmitz"); - patrickSchmitzMap.put(PersonJAXBSchema.GENDER, "male"); - patrickSchmitzMap.put(PersonJAXBSchema.BIRTH_DATE, "7/15/1960"); - patrickSchmitzMap.put(PersonJAXBSchema.BIRTH_PLACE, "MI"); - Map janeDoeMap = new HashMap(); - janeDoeMap.put(PersonJAXBSchema.FORE_NAME, "Jane"); - janeDoeMap.put(PersonJAXBSchema.SUR_NAME, "Doe"); - janeDoeMap.put(PersonJAXBSchema.GENDER, "female"); - janeDoeMap.put(PersonJAXBSchema.BIRTH_DATE, "7/04/1901"); - janeDoeMap.put(PersonJAXBSchema.DEATH_DATE, "4/01/1999"); - janeDoeMap.put(PersonJAXBSchema.BIRTH_PLACE, "Anytown, USA"); - janeDoeMap.put(PersonJAXBSchema.BIRTH_PLACE, "Nowheresville, USA"); - List> personsMaps = - Arrays.asList(johnWayneMap, patrickSchmitzMap, janeDoeMap ); - - pabi.createPersonAuthority(demoPersonAuthorityName, - demoPersonAuthorityShortId, personsMaps); - - logger.info("PersonAuthorityBaseImport complete."); - } -} diff --git a/services/person/pom.xml b/services/person/pom.xml index 363db6f6f..6ad4c1a50 100644 --- a/services/person/pom.xml +++ b/services/person/pom.xml @@ -28,15 +28,14 @@ client - - - samples + + + samples - import - sample + sample - - + + diff --git a/services/vocabulary/build.xml b/services/vocabulary/build.xml index 85d54f00b..a53566b08 100644 --- a/services/vocabulary/build.xml +++ b/services/vocabulary/build.xml @@ -118,7 +118,6 @@ - - diff --git a/services/vocabulary/import/.classpath b/services/vocabulary/import/.classpath deleted file mode 100644 index 199bbbbdb..000000000 --- a/services/vocabulary/import/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/services/vocabulary/import/.project b/services/vocabulary/import/.project deleted file mode 100644 index 2de957cd1..000000000 --- a/services/vocabulary/import/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - org.collectionspace.services.vocabulary.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/vocabulary/import/.settings/org.maven.ide.eclipse.prefs b/services/vocabulary/import/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index fd8796b9b..000000000 --- a/services/vocabulary/import/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,9 +0,0 @@ -#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/vocabulary/import/build.xml b/services/vocabulary/import/build.xml deleted file mode 100644 index b183150a6..000000000 --- a/services/vocabulary/import/build.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - vocabulary service - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/services/vocabulary/import/pom.xml b/services/vocabulary/import/pom.xml deleted file mode 100644 index 3acded810..000000000 --- a/services/vocabulary/import/pom.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - org.collectionspace.services - org.collectionspace.services.vocabulary - 1.11-SNAPSHOT - - - 4.0.0 - org.collectionspace.services - org.collectionspace.services.vocabulary.importer - services.vocabulary.importer - - - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - - org.collectionspace.services - org.collectionspace.services.vocabulary.jaxb - ${project.version} - - - org.collectionspace.services - org.collectionspace.services.client - ${project.version} - - - org.collectionspace.services - org.collectionspace.services.vocabulary.client - ${project.version} - - - - org.jboss.resteasy - resteasy-jaxrs - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - - - org.jboss.resteasy - resteasy-multipart-provider - - - commons-httpclient - commons-httpclient - 3.1 - - - - - collectionspace-services-vocabulary-importer - - - org.apache.maven.plugins - maven-assembly-plugin - - - - attached - - package - - - jar-with-dependencies - - - - org.collectionspace.services.vocabulary.importer.VocabularyBaseImport - - - - - - - - - - diff --git a/services/vocabulary/import/src/main/java/org/collectionspace/services/vocabulary/importer/VocabularyBaseImport.java b/services/vocabulary/import/src/main/java/org/collectionspace/services/vocabulary/importer/VocabularyBaseImport.java deleted file mode 100644 index 1e26c6880..000000000 --- a/services/vocabulary/import/src/main/java/org/collectionspace/services/vocabulary/importer/VocabularyBaseImport.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * This document is a part of the source code and related artifacts - * for CollectionSpace, an open source collections management system - * for museums and related institutions: - * - * http://www.collectionspace.org - * http://wiki.collectionspace.org - * - * Copyright (c)) 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.collectionspace.services.vocabulary.importer; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - -import javax.ws.rs.core.Response; - -import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema; -import org.collectionspace.services.client.PoxPayloadOut; -import org.collectionspace.services.client.VocabularyClient; -import org.collectionspace.services.client.VocabularyClientUtils; -import org.collectionspace.services.client.test.ServiceRequestType; -import org.jboss.resteasy.client.ClientResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * VocabularyServiceTest, carries out tests against a - * deployed and running Vocabulary Service. - * - * $LastChangedRevision: 753 $ - * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $ - */ -public class VocabularyBaseImport { - - private static final Logger logger = - LoggerFactory.getLogger(VocabularyBaseImport.class); - // Instance variables specific to this test. - private VocabularyClient client = new VocabularyClient(); - final String SERVICE_PATH_COMPONENT = "vocabularies"; - final String ITEM_SERVICE_PATH_COMPONENT = "items"; - - public void createEnumeration(String vocabDisplayName, String shortName, List enumValues) { - - // Expected status code: 201 Created - int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode(); - // Type of service request being tested - ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE; - - if (logger.isDebugEnabled()) { - logger.debug("Import: Create vocabulary: \"" + vocabDisplayName + "\""); - } - String baseVocabRefName = VocabularyClientUtils.createVocabularyRefName(shortName, null); - PoxPayloadOut multipart = VocabularyClientUtils.createEnumerationInstance( - vocabDisplayName, shortName, client.getCommonPartName()); - ClientResponse res = client.create(multipart); - - int statusCode = res.getStatus(); - - if (!REQUEST_TYPE.isValidStatusCode(statusCode)) { - throw new RuntimeException("Could not create enumeration: \"" + vocabDisplayName - + "\" " + VocabularyClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); - } - if (statusCode != EXPECTED_STATUS_CODE) { - throw new RuntimeException("Unexpected Status when creating enumeration: \"" - + vocabDisplayName + "\", Status:" + statusCode); - } - - // Store the ID returned from this create operation - // for additional tests below. - String newVocabId = VocabularyClientUtils.extractId(res); - if (logger.isDebugEnabled()) { - logger.debug("Import: Created vocabulary: \"" + vocabDisplayName + "\" ID:" - + newVocabId); - } - for (String itemName : enumValues) { - HashMap itemInfo = new HashMap(); - itemInfo.put(AuthorityItemJAXBSchema.DISPLAY_NAME, itemName); - VocabularyClientUtils.createItemInVocabulary(newVocabId, - baseVocabRefName, itemInfo, client); - } - } - - public static void main(String[] args) { - - logger.info("VocabularyBaseImport starting..."); - - VocabularyBaseImport vbi = new VocabularyBaseImport(); - final String acquisitionMethodsVocabName = "Acquisition Methods"; - final String entryMethodsVocabName = "Entry Methods"; - final String entryReasonsVocabName = "Entry Reasons"; - final String responsibleDeptsVocabName = "Responsible Departments"; - final String termStatusVocabName = "Term Status"; - - final String acquisitionMethodsShortName = "acqMethods"; - final String entryMethodsShortName = "entryMethods"; - final String entryReasonsShortName = "entryReasons"; - final String responsibleDeptsShortName = "responsibleDepts"; - final String termStatusShortName = "termStatus"; - - List acquisitionMethodsEnumValues = - Arrays.asList("Gift", "Purchase", "Exchange", "Transfer", "Treasure"); - List entryMethodsEnumValues = - Arrays.asList("In person", "Post", "Found on doorstep"); - List entryReasonsEnumValues = - Arrays.asList("Enquiry", "Commission", "Loan"); - List respDeptNamesEnumValues = - Arrays.asList("Antiquities", "Architecture and Design", "Decorative Arts", - "Ethnography", "Herpetology", "Media and Performance Art", - "Paintings and Sculpture", "Paleobotany", "Photographs", - "Prints and Drawings"); - List termStatusEnumValues = - Arrays.asList("Provisional", "Under Review", "Accepted", "Rejected"); - - vbi.createEnumeration(acquisitionMethodsVocabName, acquisitionMethodsShortName, acquisitionMethodsEnumValues); - vbi.createEnumeration(entryMethodsVocabName, entryMethodsShortName, entryMethodsEnumValues); - vbi.createEnumeration(entryReasonsVocabName, entryReasonsShortName, entryReasonsEnumValues); - vbi.createEnumeration(responsibleDeptsVocabName, responsibleDeptsShortName, respDeptNamesEnumValues); - vbi.createEnumeration(termStatusVocabName, termStatusShortName, termStatusEnumValues); - - logger.info("VocabularyBaseImport complete."); - } -} diff --git a/services/vocabulary/import/src/main/resources/log4j.properties b/services/vocabulary/import/src/main/resources/log4j.properties deleted file mode 100644 index 5d288d87d..000000000 --- a/services/vocabulary/import/src/main/resources/log4j.properties +++ /dev/null @@ -1,23 +0,0 @@ -log4j.rootLogger=debug, stdout, R - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout - -# Pattern to output the caller's file name and line number. -log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n - -log4j.appender.R=org.apache.log4j.RollingFileAppender -log4j.appender.R.File=target/test-client.log - -log4j.appender.R.MaxFileSize=100KB -# Keep one backup file -log4j.appender.R.MaxBackupIndex=1 - -log4j.appender.R.layout=org.apache.log4j.PatternLayout -log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n - -#packages -log4j.logger.org.collectionspace=DEBUG -log4j.logger.org.apache=INFO -log4j.logger.httpclient=INFO -log4j.logger.org.jboss.resteasy=WARN diff --git a/services/vocabulary/pom.xml b/services/vocabulary/pom.xml index f521140fc..5dadbf8ea 100644 --- a/services/vocabulary/pom.xml +++ b/services/vocabulary/pom.xml @@ -34,7 +34,6 @@ samples - import sample