<target name="dist" depends="package"\r
description="distribute location service">\r
<ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
- <ant antfile="import/build.xml" target="dist" inheritall="false"/>\r
</target>\r
\r
<target name="dist_installer" depends="package"\r
<fileset dir="${basedir}/installer/"/>\r
</copy>\r
<ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>\r
- <ant antfile="import/build.xml" target="dist_installer" inheritall="false"/>\r
</target>\r
\r
</project>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
- <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
- <name>org.collectionspace.services.person.importer</name>\r
- <comment></comment>\r
- <projects>\r
- <project>org.collectionspace.services.client</project>\r
- <project>org.collectionspace.services.common</project>\r
- <project>org.collectionspace.services.person.jaxb</project>\r
- </projects>\r
- <buildSpec>\r
- <buildCommand>\r
- <name>org.eclipse.jdt.core.javabuilder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- <buildCommand>\r
- <name>org.maven.ide.eclipse.maven2Builder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- </buildSpec>\r
- <natures>\r
- <nature>org.eclipse.jdt.core.javanature</nature>\r
- <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
- </natures>\r
-</projectDescription>\r
+++ /dev/null
-#Tue Nov 10 14:56:18 PST 2009\r
-activeProfiles=\r
-eclipse.preferences.version=1\r
-fullBuildGoals=process-test-resources\r
-includeModules=false\r
-resolveWorkspaceProjects=true\r
-resourceFilterGoals=process-resources resources\:testResources\r
-skipCompilerPlugin=true\r
-version=1\r
+++ /dev/null
-\r
-<project name="location" default="package" basedir=".">\r
- <description>\r
- location service\r
- </description>\r
- <!-- set global properties for this build -->\r
- <property name="services.trunk" value="../../.."/>\r
- <property file="${services.trunk}/build.properties" />\r
- <property name="mvn.opts" value="" />\r
- <property name="src" location="src"/>\r
-\r
- <condition property="osfamily-unix">\r
- <os family="unix" />\r
- </condition>\r
- <condition property="osfamily-windows">\r
- <os family="windows" />\r
- </condition>\r
- \r
- <target name="package" depends="package-unix,package-windows"\r
- description="Package CollectionSpace Services" />\r
- \r
- <target name="package-unix" if="osfamily-unix">\r
- <exec executable="mvn" failonerror="true">\r
- <arg value="package" />\r
- <arg value="-Dmaven.test.skip=true" />\r
- <arg value="-f" />\r
- <arg value="${basedir}/pom.xml" />\r
- <arg value="-N" />\r
- <arg value="${mvn.opts}" />\r
- </exec>\r
- </target>\r
- \r
- <target name="package-windows" if="osfamily-windows">\r
- <exec executable="cmd" failonerror="true">\r
- <arg value="/c" />\r
- <arg value="mvn.bat" />\r
- <arg value="package" />\r
- <arg value="-Dmaven.test.skip=true" />\r
- <arg value="-f" />\r
- <arg value="${basedir}/pom.xml" />\r
- <arg value="-N" />\r
- <arg value="${mvn.opts}" />\r
- </exec>\r
- </target> \r
-\r
- <target name="dist" depends="package"\r
- description="distribute location service importer tool">\r
- </target>\r
-\r
- <target name="dist_installer" depends="package"\r
- description="distribute location service importer tool"> \r
- <!-- copy install scripts, etc. -->\r
- <copy todir="${services.trunk}/${dist.installer.services}/location/postdeploy">\r
- <fileset dir="${basedir}/target">\r
- <include name="*with-dependencies*.jar"/>\r
- </fileset>\r
- </copy>\r
- </target>\r
-\r
-</project>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
- <parent>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.location</artifactId>\r
- <version>1.11-SNAPSHOT</version>\r
- </parent>\r
-\r
- <modelVersion>4.0.0</modelVersion>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.location.importer</artifactId>\r
- <name>services.location.importer</name>\r
- \r
- <dependencies>\r
- <!-- keep slf4j dependencies on the top -->\r
- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-api</artifactId>\r
- <version>1.5.2</version>\r
- </dependency>\r
- <!-- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-log4j12</artifactId>\r
- <version>1.5.2</version>\r
- </dependency> -->\r
- <!-- CollectionSpace Dependencies -->\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.location.jaxb</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.client</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.location.client</artifactId>\r
- <version>${project.version}</version>\r
- </dependency> \r
-<!-- \r
- <dependency>\r
- <groupId>org.testng</groupId>\r
- <artifactId>testng</artifactId>\r
- <version>5.6</version>\r
- </dependency>\r
- --> \r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-jaxrs</artifactId>\r
- <!-- filter out unwanted jars -->\r
- <exclusions>\r
- <exclusion>\r
- <groupId>tjws</groupId>\r
- <artifactId>webserver</artifactId>\r
- </exclusion>\r
- </exclusions>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-jaxb-provider</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-multipart-provider</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>commons-httpclient</groupId>\r
- <artifactId>commons-httpclient</artifactId>\r
- <version>3.1</version>\r
- </dependency>\r
- </dependencies>\r
- \r
- <build>\r
- <finalName>collectionspace-services-location-importer</finalName>\r
- <plugins>\r
- <plugin>\r
- <groupId>org.apache.maven.plugins</groupId>\r
- <artifactId>maven-assembly-plugin</artifactId>\r
- <executions>\r
- <execution>\r
- <goals>\r
- <goal>attached</goal>\r
- </goals>\r
- <phase>package</phase>\r
- <configuration>\r
- <descriptorRefs>\r
- <descriptorRef>jar-with-dependencies</descriptorRef>\r
- </descriptorRefs>\r
- <archive>\r
- <manifest>\r
- <mainClass>org.collectionspace.services.location.importer.LocationAuthorityBaseImport</mainClass>\r
- </manifest>\r
- </archive>\r
- </configuration>\r
- </execution>\r
- </executions>\r
- </plugin> \r
- </plugins>\r
- </build>\r
-</project>\r
-\r
+++ /dev/null
-/**
- * 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<Map<String, String>> 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<Response> 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<String,String> 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<String, String> johnWayneMap = new HashMap<String,String>();
- 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<String, String> patrickSchmitzMap = new HashMap<String,String>();
- 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<String, String> janeDoeMap = new HashMap<String,String>();
- 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<Map<String, String>> 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.");
- }
-}
<module>client</module>\r
</modules>\r
\r
- <profiles>\r
- <profile>\r
- <id>samples</id>\r
+ <profiles>\r
+ <profile>\r
+ <id>samples</id>\r
<modules>\r
- <module>import</module>\r
- <!-- <module>sample</module> -->\r
+ <!-- <module>sample</module> -->\r
</modules>\r
- </profile>\r
- </profiles>\r
+ </profile>\r
+ </profiles>\r
\r
</project>\r
\r
<target name="dist" depends="package"\r
description="distribute organization service">\r
<ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
- <ant antfile="import/build.xml" target="dist" inheritall="false"/>\r
</target>\r
\r
<target name="dist_installer" depends="package"\r
<fileset dir="${basedir}/installer/"/>\r
</copy>\r
<ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>\r
- <ant antfile="import/build.xml" target="dist_installer" inheritall="false"/>\r
</target>\r
\r
</project>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
- <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
- <name>org.collectionspace.services.organization.importer</name>\r
- <comment></comment>\r
- <projects>\r
- <project>org.collectionspace.services.client</project>\r
- <project>org.collectionspace.services.common</project>\r
- <project>org.collectionspace.services.organization.jaxb</project>\r
- </projects>\r
- <buildSpec>\r
- <buildCommand>\r
- <name>org.eclipse.jdt.core.javabuilder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- <buildCommand>\r
- <name>org.maven.ide.eclipse.maven2Builder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- </buildSpec>\r
- <natures>\r
- <nature>org.eclipse.jdt.core.javanature</nature>\r
- <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
- </natures>\r
-</projectDescription>\r
+++ /dev/null
-#Tue Nov 10 14:56:18 PST 2009\r
-activeProfiles=\r
-eclipse.preferences.version=1\r
-fullBuildGoals=process-test-resources\r
-includeModules=false\r
-resolveWorkspaceProjects=true\r
-resourceFilterGoals=process-resources resources\:testResources\r
-skipCompilerPlugin=true\r
-version=1\r
+++ /dev/null
-\r
-<project name="organization" default="package" basedir=".">\r
- <description>\r
- organization service\r
- </description>\r
- <!-- set global properties for this build -->\r
- <property name="services.trunk" value="../../.."/>\r
- <property file="${services.trunk}/build.properties" />\r
- <property name="mvn.opts" value="" />\r
- <property name="src" location="src"/>\r
-\r
- <condition property="osfamily-unix">\r
- <os family="unix" />\r
- </condition>\r
- <condition property="osfamily-windows">\r
- <os family="windows" />\r
- </condition>\r
- \r
- <target name="package" depends="package-unix,package-windows"\r
- description="Package CollectionSpace Services" />\r
- \r
- <target name="package-unix" if="osfamily-unix">\r
- <exec executable="mvn" failonerror="true">\r
- <arg value="package" />\r
- <arg value="-Dmaven.test.skip=true" />\r
- <arg value="-f" />\r
- <arg value="${basedir}/pom.xml" />\r
- <arg value="-N" />\r
- <arg value="${mvn.opts}" />\r
- </exec>\r
- </target>\r
- \r
- <target name="package-windows" if="osfamily-windows">\r
- <exec executable="cmd" failonerror="true">\r
- <arg value="/c" />\r
- <arg value="mvn.bat" />\r
- <arg value="package" />\r
- <arg value="-Dmaven.test.skip=true" />\r
- <arg value="-f" />\r
- <arg value="${basedir}/pom.xml" />\r
- <arg value="-N" />\r
- <arg value="${mvn.opts}" />\r
- </exec>\r
- </target> \r
-\r
- <target name="dist" depends="package"\r
- description="distribute organization service importer tool">\r
- </target>\r
-\r
- <target name="dist_installer" depends="package"\r
- description="distribute organization service importer tool"> \r
- <!-- copy install scripts, etc. -->\r
- <copy todir="${services.trunk}/${dist.installer.services}/organization/postdeploy">\r
- <fileset dir="${basedir}/target">\r
- <include name="*with-dependencies*.jar"/>\r
- </fileset>\r
- </copy>\r
- </target>\r
-\r
-</project>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
- <parent>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.organization</artifactId>\r
- <version>1.11-SNAPSHOT</version>\r
- </parent>\r
-\r
- <modelVersion>4.0.0</modelVersion>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.organization.importer</artifactId>\r
- <name>services.organization.importer</name>\r
- \r
- <dependencies>\r
- <!-- keep slf4j dependencies on the top -->\r
- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-api</artifactId>\r
- <version>1.5.2</version>\r
- </dependency>\r
- <!-- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-log4j12</artifactId>\r
- <version>1.5.2</version>\r
- </dependency> -->\r
- <!-- CollectionSpace dependencies -->\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.organization.jaxb</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.client</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.organization.client</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-jaxrs</artifactId>\r
- <!-- filter out unwanted jars -->\r
- <exclusions>\r
- <exclusion>\r
- <groupId>tjws</groupId>\r
- <artifactId>webserver</artifactId>\r
- </exclusion>\r
- </exclusions>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-jaxb-provider</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-multipart-provider</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>commons-httpclient</groupId>\r
- <artifactId>commons-httpclient</artifactId>\r
- <version>3.1</version>\r
- </dependency>\r
- </dependencies>\r
- \r
- <build>\r
- <finalName>collectionspace-services-organization-importer</finalName>\r
- <plugins>\r
- <plugin>\r
- <groupId>org.apache.maven.plugins</groupId>\r
- <artifactId>maven-assembly-plugin</artifactId>\r
- <executions>\r
- <execution>\r
- <goals>\r
- <goal>attached</goal>\r
- </goals>\r
- <phase>package</phase>\r
- <configuration>\r
- <descriptorRefs>\r
- <descriptorRef>jar-with-dependencies</descriptorRef>\r
- </descriptorRefs>\r
- <archive>\r
- <manifest>\r
- <mainClass>org.collectionspace.services.organization.importer.OrgAuthorityBaseImport</mainClass>\r
- </manifest>\r
- </archive>\r
- </configuration>\r
- </execution>\r
- </executions>\r
- </plugin> \r
- </plugins>\r
- </build>\r
-</project>\r
-\r
+++ /dev/null
-/**
- * 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<Map<String,String>> orgInfos ) {
-
- // Expected status code: 201 Created
- int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
- // Type of service request being tested
- ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
-
- if(logger.isDebugEnabled()){
- logger.debug("Import: Create orgAuthority: \"" + orgAuthorityShortId +"\"");
- }
- String baseOrgAuthRefName = OrgAuthorityClientUtils.createOrgAuthRefName(orgAuthorityShortId, null);
- PoxPayloadOut multipart =
- OrgAuthorityClientUtils.createOrgAuthorityInstance(
- orgAuthorityDisplayName, orgAuthorityShortId, client.getCommonPartName());
- ClientResponse<Response> 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<String,String> orgInfo : orgInfos){
- * OrgAuthorityClientUtils.createItemInAuthority(newOrgAuthorityId, baseOrgAuthRefName, orgInfo, orgRepeatablesInfo, client);
- *}
- */
- logger.error("MethodcreateOrgAuthority(String orgAuthorityDisplayName, String orgAuthorityShortId,List<Map<String,String>> 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<String, String> mmiOrgMap = new HashMap<String,String>();
- 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<String, String> pahmaOrgMap = new HashMap<String,String>();
- 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<String, String> savoyOrgMap = new HashMap<String,String>();
- 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<Map<String, String>> orgMaps =
- Arrays.asList(mmiOrgMap, pahmaOrgMap, savoyOrgMap );
-
- oabi.createOrgAuthority(demoOrgAuthorityName, demoOrgAuthorityShortId, orgMaps);
-
- logger.info("OrgAuthorityBaseImport complete.");
- }
-}
<module>client</module>\r
</modules>\r
\r
- <profiles>\r
- <profile>\r
- <id>samples</id>\r
+ <profiles>\r
+ <profile>\r
+ <id>samples</id>\r
<modules>\r
- <module>import</module>\r
- <module>sample</module>\r
- </modules>\r
- </profile>\r
- </profiles>\r
+ <module>sample</module>\r
+ </modules>\r
+ </profile>\r
+ </profiles>\r
\r
</project>\r
\r
<target name="dist" depends="package"\r
description="distribute person service">\r
<ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
- <ant antfile="import/build.xml" target="dist" inheritall="false"/>\r
</target>\r
\r
<target name="dist_installer" depends="package"\r
<fileset dir="${basedir}/installer/"/>\r
</copy>\r
<ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>\r
- <ant antfile="import/build.xml" target="dist_installer" inheritall="false"/>\r
</target>\r
\r
</project>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
- <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
- <name>org.collectionspace.services.person.importer</name>\r
- <comment></comment>\r
- <projects>\r
- <project>org.collectionspace.services.client</project>\r
- <project>org.collectionspace.services.common</project>\r
- <project>org.collectionspace.services.person.jaxb</project>\r
- </projects>\r
- <buildSpec>\r
- <buildCommand>\r
- <name>org.eclipse.jdt.core.javabuilder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- <buildCommand>\r
- <name>org.maven.ide.eclipse.maven2Builder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- </buildSpec>\r
- <natures>\r
- <nature>org.eclipse.jdt.core.javanature</nature>\r
- <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
- </natures>\r
-</projectDescription>\r
+++ /dev/null
-#Tue Nov 10 14:56:18 PST 2009\r
-activeProfiles=\r
-eclipse.preferences.version=1\r
-fullBuildGoals=process-test-resources\r
-includeModules=false\r
-resolveWorkspaceProjects=true\r
-resourceFilterGoals=process-resources resources\:testResources\r
-skipCompilerPlugin=true\r
-version=1\r
+++ /dev/null
-\r
-<project name="person" default="package" basedir=".">\r
- <description>\r
- person service\r
- </description>\r
- <!-- set global properties for this build -->\r
- <property name="services.trunk" value="../../.."/>\r
- <property file="${services.trunk}/build.properties" />\r
- <property name="mvn.opts" value="" />\r
- <property name="src" location="src"/>\r
-\r
- <condition property="osfamily-unix">\r
- <os family="unix" />\r
- </condition>\r
- <condition property="osfamily-windows">\r
- <os family="windows" />\r
- </condition>\r
- \r
- <target name="package" depends="package-unix,package-windows"\r
- description="Package CollectionSpace Services" />\r
- \r
- <target name="package-unix" if="osfamily-unix">\r
- <exec executable="mvn" failonerror="true">\r
- <arg value="package" />\r
- <arg value="-Dmaven.test.skip=true" />\r
- <arg value="-f" />\r
- <arg value="${basedir}/pom.xml" />\r
- <arg value="-N" />\r
- <arg value="${mvn.opts}" />\r
- </exec>\r
- </target>\r
- \r
- <target name="package-windows" if="osfamily-windows">\r
- <exec executable="cmd" failonerror="true">\r
- <arg value="/c" />\r
- <arg value="mvn.bat" />\r
- <arg value="package" />\r
- <arg value="-Dmaven.test.skip=true" />\r
- <arg value="-f" />\r
- <arg value="${basedir}/pom.xml" />\r
- <arg value="-N" />\r
- <arg value="${mvn.opts}" />\r
- </exec>\r
- </target> \r
-\r
- <target name="dist" depends="package"\r
- description="distribute person service importer tool">\r
- </target>\r
-\r
- <target name="dist_installer" depends="package"\r
- description="distribute person service importer tool"> \r
- <!-- copy install scripts, etc. -->\r
- <copy todir="${services.trunk}/${dist.installer.services}/person/postdeploy">\r
- <fileset dir="${basedir}/target">\r
- <include name="*with-dependencies*.jar"/>\r
- </fileset>\r
- </copy>\r
- </target>\r
-\r
-</project>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
- <parent>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.person</artifactId>\r
- <version>1.11-SNAPSHOT</version>\r
- </parent>\r
-\r
- <modelVersion>4.0.0</modelVersion>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.person.importer</artifactId>\r
- <name>services.person.importer</name>\r
- \r
- <dependencies>\r
- <!-- keep slf4j dependencies on the top -->\r
- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-api</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-log4j12</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.person.jaxb</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.client</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.person.client</artifactId>\r
- <version>${project.version}</version>\r
- </dependency> \r
-<!-- \r
- <dependency>\r
- <groupId>org.testng</groupId>\r
- <artifactId>testng</artifactId>\r
- <version>5.6</version>\r
- </dependency>\r
- --> \r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-jaxrs</artifactId>\r
- <!-- filter out unwanted jars -->\r
- <exclusions>\r
- <exclusion>\r
- <groupId>tjws</groupId>\r
- <artifactId>webserver</artifactId>\r
- </exclusion>\r
- </exclusions>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-jaxb-provider</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-multipart-provider</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>commons-httpclient</groupId>\r
- <artifactId>commons-httpclient</artifactId>\r
- <version>3.1</version>\r
- </dependency>\r
- </dependencies>\r
- \r
- <build>\r
- <finalName>collectionspace-services-person-importer</finalName>\r
- <plugins>\r
- <plugin>\r
- <groupId>org.apache.maven.plugins</groupId>\r
- <artifactId>maven-assembly-plugin</artifactId>\r
- <executions>\r
- <execution>\r
- <goals>\r
- <goal>attached</goal>\r
- </goals>\r
- <phase>package</phase>\r
- <configuration>\r
- <descriptorRefs>\r
- <descriptorRef>jar-with-dependencies</descriptorRef>\r
- </descriptorRefs>\r
- <archive>\r
- <manifest>\r
- <mainClass>org.collectionspace.services.person.importer.PersonAuthorityBaseImport</mainClass>\r
- </manifest>\r
- </archive>\r
- </configuration>\r
- </execution>\r
- </executions>\r
- </plugin> \r
- </plugins>\r
- </build>\r
-</project>\r
-\r
+++ /dev/null
-/**
- * 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<Map<String, String>> personMaps ) {
-
- // Expected status code: 201 Created
- int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
- // Type of service request being tested
- ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
-
- if(logger.isDebugEnabled()){
- logger.debug("Import: Create personAuthority: \"" + displayName +"\"");
- }
- String basePersonRefName =
- PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
- PoxPayloadOut multipart =
- PersonAuthorityClientUtils.createPersonAuthorityInstance(
- displayName, shortId, client.getCommonPartName());
- ClientResponse<Response> 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<String,String> 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<String, String> johnWayneMap = new HashMap<String,String>();
- 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<String, String> patrickSchmitzMap = new HashMap<String,String>();
- 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<String, String> janeDoeMap = new HashMap<String,String>();
- 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<Map<String, String>> personsMaps =
- Arrays.asList(johnWayneMap, patrickSchmitzMap, janeDoeMap );
-
- pabi.createPersonAuthority(demoPersonAuthorityName,
- demoPersonAuthorityShortId, personsMaps);
-
- logger.info("PersonAuthorityBaseImport complete.");
- }
-}
<module>client</module>\r
</modules>\r
\r
- <profiles>\r
- <profile>\r
- <id>samples</id>\r
+ <profiles>\r
+ <profile>\r
+ <id>samples</id>\r
<modules>\r
- <module>import</module>\r
- <module>sample</module>\r
+ <module>sample</module>\r
</modules>\r
- </profile>\r
- </profiles>\r
+ </profile>\r
+ </profiles>\r
\r
</project>\r
\r
<target name="dist" depends="package"\r
description="distribute vocabulary service">\r
<ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
- <ant antfile="import/build.xml" target="dist" inheritall="false"/>\r
</target>\r
\r
<target name="dist_installer" depends="package"\r
<fileset dir="${basedir}/installer/"/>\r
</copy>\r
<ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>\r
- <ant antfile="import/build.xml" target="dist_installer" inheritall="false"/>\r
</target>\r
\r
</project>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
- <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
- <name>org.collectionspace.services.vocabulary.importer</name>\r
- <comment></comment>\r
- <projects>\r
- </projects>\r
- <buildSpec>\r
- <buildCommand>\r
- <name>org.eclipse.jdt.core.javabuilder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- <buildCommand>\r
- <name>org.maven.ide.eclipse.maven2Builder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- </buildSpec>\r
- <natures>\r
- <nature>org.eclipse.jdt.core.javanature</nature>\r
- <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
- </natures>\r
-</projectDescription>\r
+++ /dev/null
-#Tue Nov 10 14:56:18 PST 2009\r
-activeProfiles=\r
-eclipse.preferences.version=1\r
-fullBuildGoals=process-test-resources\r
-includeModules=false\r
-resolveWorkspaceProjects=true\r
-resourceFilterGoals=process-resources resources\:testResources\r
-skipCompilerPlugin=true\r
-version=1\r
+++ /dev/null
-\r
-<project name="vocabulary" default="package" basedir=".">\r
- <description>\r
- vocabulary service\r
- </description>\r
- <!-- set global properties for this build -->\r
- <property name="services.trunk" value="../../.."/>\r
- <property file="${services.trunk}/build.properties" />\r
- <property name="mvn.opts" value="" />\r
- <property name="src" location="src"/>\r
-\r
- <condition property="osfamily-unix">\r
- <os family="unix" />\r
- </condition>\r
- <condition property="osfamily-windows">\r
- <os family="windows" />\r
- </condition>\r
- \r
- <target name="package" depends="package-unix,package-windows"\r
- description="Package CollectionSpace Services" />\r
- \r
- <target name="package-unix" if="osfamily-unix">\r
- <exec executable="mvn" failonerror="true">\r
- <arg value="package" />\r
- <arg value="-Dmaven.test.skip=true" />\r
- <arg value="-f" />\r
- <arg value="${basedir}/pom.xml" />\r
- <arg value="-N" />\r
- <arg value="${mvn.opts}" />\r
- </exec>\r
- </target>\r
- \r
- <target name="package-windows" if="osfamily-windows">\r
- <exec executable="cmd" failonerror="true">\r
- <arg value="/c" />\r
- <arg value="mvn.bat" />\r
- <arg value="package" />\r
- <arg value="-Dmaven.test.skip=true" />\r
- <arg value="-f" />\r
- <arg value="${basedir}/pom.xml" />\r
- <arg value="-N" />\r
- <arg value="${mvn.opts}" />\r
- </exec>\r
- </target> \r
-\r
- <target name="dist" depends="package"\r
- description="distribute vocabulary service importer tool">\r
- </target>\r
-\r
- <target name="dist_installer" depends="package"\r
- description="distribute vocabulary service importer tool"> \r
- <!-- copy install scripts, etc. -->\r
- <copy todir="${services.trunk}/${dist.installer.services}/vocabulary/postdeploy">\r
- <fileset dir="${basedir}/target">\r
- <include name="*with-dependencies*.jar"/>\r
- </fileset>\r
- </copy>\r
- </target>\r
-\r
-</project>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
- <parent>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.vocabulary</artifactId>\r
- <version>1.11-SNAPSHOT</version>\r
- </parent>\r
-\r
- <modelVersion>4.0.0</modelVersion>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.vocabulary.importer</artifactId>\r
- <name>services.vocabulary.importer</name>\r
-\r
- <dependencies>\r
- <!-- keep slf4j dependencies on the top -->\r
- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-api</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-log4j12</artifactId>\r
- </dependency>\r
- <!-- CollectionSpace dependencies -->\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.client</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.collectionspace.services</groupId>\r
- <artifactId>org.collectionspace.services.vocabulary.client</artifactId>\r
- <version>${project.version}</version>\r
- </dependency>\r
- <!--\r
- <dependency>\r
- <groupId>org.testng</groupId>\r
- <artifactId>testng</artifactId>\r
- <version>5.6</version>\r
- </dependency>\r
- -->\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-jaxrs</artifactId>\r
- <!-- filter out unwanted jars -->\r
- <exclusions>\r
- <exclusion>\r
- <groupId>tjws</groupId>\r
- <artifactId>webserver</artifactId>\r
- </exclusion>\r
- </exclusions>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-jaxb-provider</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.jboss.resteasy</groupId>\r
- <artifactId>resteasy-multipart-provider</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>commons-httpclient</groupId>\r
- <artifactId>commons-httpclient</artifactId>\r
- <version>3.1</version>\r
- </dependency>\r
- </dependencies>\r
-\r
- <build>\r
- <finalName>collectionspace-services-vocabulary-importer</finalName>\r
- <plugins>\r
- <plugin>\r
- <groupId>org.apache.maven.plugins</groupId>\r
- <artifactId>maven-assembly-plugin</artifactId>\r
- <executions>\r
- <execution>\r
- <goals>\r
- <goal>attached</goal>\r
- </goals>\r
- <phase>package</phase>\r
- <configuration>\r
- <descriptorRefs>\r
- <descriptorRef>jar-with-dependencies</descriptorRef>\r
- </descriptorRefs>\r
- <archive>\r
- <manifest>\r
- <mainClass>org.collectionspace.services.vocabulary.importer.VocabularyBaseImport</mainClass>\r
- </manifest>\r
- </archive>\r
- </configuration>\r
- </execution>\r
- </executions>\r
- </plugin>\r
- </plugins>\r
- </build>\r
-</project>\r
-\r
+++ /dev/null
-/**
- * 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<String> enumValues) {
-
- // Expected status code: 201 Created
- int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
- // Type of service request being tested
- ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
-
- if (logger.isDebugEnabled()) {
- logger.debug("Import: Create vocabulary: \"" + vocabDisplayName + "\"");
- }
- String baseVocabRefName = VocabularyClientUtils.createVocabularyRefName(shortName, null);
- PoxPayloadOut multipart = VocabularyClientUtils.createEnumerationInstance(
- vocabDisplayName, shortName, client.getCommonPartName());
- ClientResponse<Response> 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<String, String> itemInfo = new HashMap<String, String>();
- 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<String> acquisitionMethodsEnumValues =
- Arrays.asList("Gift", "Purchase", "Exchange", "Transfer", "Treasure");
- List<String> entryMethodsEnumValues =
- Arrays.asList("In person", "Post", "Found on doorstep");
- List<String> entryReasonsEnumValues =
- Arrays.asList("Enquiry", "Commission", "Loan");
- List<String> respDeptNamesEnumValues =
- Arrays.asList("Antiquities", "Architecture and Design", "Decorative Arts",
- "Ethnography", "Herpetology", "Media and Performance Art",
- "Paintings and Sculpture", "Paleobotany", "Photographs",
- "Prints and Drawings");
- List<String> 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.");
- }
-}
+++ /dev/null
-log4j.rootLogger=debug, stdout, R\r
-\r
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-\r
-# Pattern to output the caller's file name and line number.\r
-log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-log4j.appender.R=org.apache.log4j.RollingFileAppender\r
-log4j.appender.R.File=target/test-client.log\r
-\r
-log4j.appender.R.MaxFileSize=100KB\r
-# Keep one backup file\r
-log4j.appender.R.MaxBackupIndex=1\r
-\r
-log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
-log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
-\r
-#packages\r
-log4j.logger.org.collectionspace=DEBUG\r
-log4j.logger.org.apache=INFO\r
-log4j.logger.httpclient=INFO\r
-log4j.logger.org.jboss.resteasy=WARN\r
<profile>\r
<id>samples</id>\r
<modules>\r
- <module>import</module>\r
<module>sample</module>\r
</modules>\r
</profile>\r