]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-2601: Checking in Laramie's set of changes to ten files - nearly all in sdk...
authorAron Roberts <aron@socrates.berkeley.edu>
Mon, 9 Aug 2010 20:02:16 +0000 (20:02 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Mon, 9 Aug 2010 20:02:16 +0000 (20:02 +0000)
services/collectionobject/sample/sample/src/main/java/org/collectionspace/services/collectionobject/client/sample/Sample.java
services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java
services/organization/sample/sample/src/main/java/org/collectionspace/services/organization/client/sample/Sample.java
services/person/import/src/main/java/org/collectionspace/services/person/importer/PersonAuthorityBaseImport.java
services/person/sample/sample/src/main/java/org/collectionspace/services/person/client/sample/Sample.java
services/query/service/src/main/java/org/collectionspace/services/query/QueryResource.java
services/sdk/sample/src/main/java/org/collectionspace/services/sdk/sample/Sample.java
services/vocabulary/import/src/main/java/org/collectionspace/services/vocabulary/importer/VocabularyBaseImport.java
services/vocabulary/sample/sample/src/main/java/org/collectionspace/services/vocabulary/client/sample/Sample.java

index 0eedbaa11afb423d1641a0a670e6b473db4268b1..9611ee611d39033a7cc0d0a347fb4debccce2390 100644 (file)
@@ -203,7 +203,9 @@ public class Sample {
 
        CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
        collectionObject.setObjectNumber("some object number here");
-       collectionObject.setObjectName("some object name here");
+       collectionObject.getObjectNameList().getObjectNameGroup().get(0).setObjectName("some object name here");
+
+
        ResponsibleDepartmentList deptList = new ResponsibleDepartmentList();
        List<String> depts = deptList.getResponsibleDepartment();
        // @TODO Use properly formatted refNames for representative departments
@@ -211,10 +213,9 @@ public class Sample {
        depts.add("urn:org.collectionspace.services.department:Registrar");
        depts.add("urn:org.walkerart.department:Fine Art");
        collectionObject.setAge(""); // Test using an empty String.
-//       collectionObject.setBriefDescription("Papier mache bird mask with horns, " +
-//               "painted red with black and yellow spots. " +
-//               "Puerto Rico. ca. 8&quot; high, 6&quot; wide, projects 10&quot; (with horns).");
-
+       collectionObject.getBriefDescriptions().getBriefDescription().add("Papier mache bird mask with horns, " +
+                      "painted red with black and yellow spots. " +
+                      "Puerto Rico. ca. 8&quot; high, 6&quot; wide, projects 10&quot; (with horns).");
        MultipartOutput multipart = new MultipartOutput();
        OutputPart commonPart = multipart.addPart(collectionObject,
                MediaType.APPLICATION_XML_TYPE);
index 75bd8ae113bfa76cceaad0ce9fd1f47d0565d43b..eda8264ddc304250294bbd4add50bce4475a35b5 100644 (file)
@@ -93,10 +93,17 @@ public class OrgAuthorityBaseImport {
                logger.debug("Import: Created orgAuthorityulary: \"" + orgAuthorityShortId +"\" ID:"
                                +newOrgAuthorityId );
        }
-       for(Map<String,String> orgInfo : orgInfos){
-            OrgAuthorityClientUtils.createItemInAuthority(
-                       newOrgAuthorityId, baseOrgAuthRefName, orgInfo, client);
-       }
+
+        
+        /*
+        *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.");
     }
     
     // ---------------------------------------------------------------
@@ -116,7 +123,7 @@ public class OrgAuthorityBaseImport {
         mmiOrgMap.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, "mmi");
         mmiOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "MMI");
         mmiOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Museum of the Moving Image");
-        mmiOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Megan Forbes");
+        //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>();
@@ -124,7 +131,7 @@ public class OrgAuthorityBaseImport {
         pahmaOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "PAHMA");
         pahmaOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Phoebe A. Hearst Museum of Anthropology");
         pahmaOrgMap.put(OrganizationJAXBSchema.NAME_ADDITIONS, "University of California, Berkeley");
-        pahmaOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Michael Black");
+        //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>();
index 91602d8c7922c297887c70eb855970653799b8d2..5331b522fd06e150d8de5f70f01d83bd0d4a8f73 100644 (file)
@@ -235,8 +235,11 @@ public class Sample {
        ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
 \r
         // Submit the request to the service and store the response.\r
-        ClientResponse<OrganizationsCommonList> res =\r
-                client.readItemList(orgAuthId);\r
+\r
+        //was: ClientResponse<OrganizationsCommonList> res = client.readItemList(orgAuthId);\r
+        //new API: readItemList(String inAuthority, String partialTerm, String keywords)\r
+        ClientResponse<OrganizationsCommonList> res = client.readItemList(orgAuthId, "", "");//TODO:   .New call, most certainly wrong.  Just trying to get this to compile. Laramie20100728\r
+\r
         OrganizationsCommonList list = res.getEntity();\r
 \r
         int statusCode = res.getStatus();\r
@@ -442,14 +445,14 @@ public class Sample {
         Map<String, String> mmiOrgMap = new HashMap<String,String>();\r
         mmiOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "MMI");\r
         mmiOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Museum of the Moving Image");\r
-        mmiOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Megan Forbes");\r
+        //mmiOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Megan Forbes");\r
         mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1984");\r
         mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Astoria, NY");\r
         Map<String, String> pahmaOrgMap = new HashMap<String,String>();\r
         pahmaOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "PAHMA");\r
         pahmaOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Phoebe A. Hearst Museum of Anthropology");\r
         pahmaOrgMap.put(OrganizationJAXBSchema.NAME_ADDITIONS, "University of California, Berkeley");\r
-        pahmaOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Michael Black");\r
+        //pahmaOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Michael Black");\r
         pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1901");\r
         pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Berkeley, CA");\r
         Map<String, String> savoyOrgMap = new HashMap<String,String>();\r
index f688106014203b3c7c332e3c671c9d4d0330d8b8..e7f628d3e0dbd73cf229b0d789445e4a05d369cd 100644 (file)
@@ -98,10 +98,17 @@ public class PersonAuthorityBaseImport {
                logger.debug("Import: Created personAuthorityulary: \"" + displayName +"\" ID:"
                                +newPersonAuthorityId );
        }
-       for(Map<String,String> personMap : personMaps){
-               PersonAuthorityClientUtils.createItemInAuthority(
-                               newPersonAuthorityId, basePersonRefName, personMap, client);
-       }
+
+       /*
+        *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) {
index bd3be3c6a776c893f1384d873cb2cf689f98581d..b8a815368a9c0e36672be04fd9866e2fd9ae8be7 100644 (file)
@@ -80,8 +80,11 @@ public class Sample {
        ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
 \r
        logger.info("Import: Create personAuthority: \"" + personAuthorityName +"\"");\r
-       String basePersonRefName = PersonAuthorityClientUtils.createPersonAuthRefName(personAuthorityName, false);\r
-       String fullPersonRefName = PersonAuthorityClientUtils.createPersonAuthRefName(personAuthorityName, true);\r
+\r
+\r
+        String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: Laramie20100728 temp fix, made-up displaySuffix.\r
+        String basePersonRefName = PersonAuthorityClientUtils.createPersonAuthRefName(personAuthorityName, displaySuffix);//TODO: Laramie20100728 temp fix  was personAuthorityName, false\r
+       String fullPersonRefName = PersonAuthorityClientUtils.createPersonAuthRefName(personAuthorityName, displaySuffix); //TODO: Laramie20100728 temp fix  was personAuthorityName, true\r
        MultipartOutput multipart = \r
                PersonAuthorityClientUtils.createPersonAuthorityInstance(\r
                                personAuthorityName, fullPersonRefName, client.getCommonPartName() );\r
@@ -134,7 +137,10 @@ public class Sample {
                builtName.append("-");\r
        if(deathDate!=null)\r
                builtName.append(deathDate);\r
-       String refName = PersonAuthorityClientUtils.createPersonRefName(personAuthorityRefName, builtName.toString(), true);\r
+\r
+        String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: Laramie20100728 temp fix, made-up displaySuffix.\r
+\r
+       String refName = PersonAuthorityClientUtils.createPersonRefName(personAuthorityRefName, builtName.toString(), displaySuffix); //TODO was ...,true);\r
        logger.info("Import: Create Item: \""+refName+"\" in personAuthority: \"" + personAuthorityRefName +"\"");\r
 \r
        if(logger.isDebugEnabled()){\r
@@ -238,8 +244,7 @@ public class Sample {
        ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
 \r
         // Submit the request to the service and store the response.\r
-        ClientResponse<PersonsCommonList> res =\r
-                client.readItemList(personAuthId);\r
+        ClientResponse<PersonsCommonList> res = client.readItemList(personAuthId, "", ""); //TODO: Laramie201007289  added empty strings to satisfy api\r
         PersonsCommonList list = res.getEntity();\r
 \r
         int statusCode = res.getStatus();\r
@@ -375,16 +380,20 @@ public class Sample {
                person.setBirthPlace(value);\r
             if((value = (String)personInfo.get(PersonJAXBSchema.DEATH_PLACE))!=null)\r
                person.setDeathPlace(value);\r
+\r
+            /* TODO: Laramie20100728  removed missing member calls\r
             if((value = (String)personInfo.get(PersonJAXBSchema.GROUP))!=null)\r
                person.setGroup(value);\r
             if((value = (String)personInfo.get(PersonJAXBSchema.NATIONALITY))!=null)\r
                person.setNationality(value);\r
-            if((value = (String)personInfo.get(PersonJAXBSchema.GENDER))!=null)\r
-               person.setGender(value);\r
             if((value = (String)personInfo.get(PersonJAXBSchema.OCCUPATION))!=null)\r
                person.setOccupation(value);\r
             if((value = (String)personInfo.get(PersonJAXBSchema.SCHOOL_OR_STYLE))!=null)\r
                person.setSchoolOrStyle(value);\r
+            */\r
+        \r
+            if((value = (String)personInfo.get(PersonJAXBSchema.GENDER))!=null)\r
+                        person.setGender(value);\r
             if((value = (String)personInfo.get(PersonJAXBSchema.BIO_NOTE))!=null)\r
                person.setBioNote(value);\r
             if((value = (String)personInfo.get(PersonJAXBSchema.NAME_NOTE))!=null)\r
index ad6b3d2280d2aa89f0adc093babf3460156a9dc0..c6f6d6057646682fa6f5e3724f3cb89748df9c6f 100644 (file)
@@ -41,12 +41,13 @@ import javax.ws.rs.core.UriInfo;
 \r
 import org.collectionspace.services.common.query.QueryManager;\r
 //import org.collectionspace.services.common.NuxeoClientType;\r
-import org.collectionspace.services.common.ServiceMain;\r
+/*import org.collectionspace.services.common.ServiceMain;\r
 import org.collectionspace.services.common.document.DocumentNotFoundException;\r
 import org.collectionspace.services.common.document.DocumentHandler;\r
 import org.collectionspace.services.common.repository.RepositoryClient;\r
 import org.collectionspace.services.common.repository.RepositoryClientFactory;\r
 import org.jboss.resteasy.util.HttpResponseCodes;\r
+*/\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
index 414592d9cf52463a1cbe4158aeee4da235d9747b..7a29f137c841e5bfd145c01fc431c4de1a37df40 100644 (file)
@@ -35,6 +35,8 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;\r
 import javax.ws.rs.core.Response;\r
 \r
+import org.collectionspace.services.collectionobject.ObjectNameGroup;\r
+import org.collectionspace.services.collectionobject.ObjectNameList;\r
 import org.testng.Assert;\r
 \r
 import org.jboss.resteasy.client.ClientResponse;\r
@@ -82,7 +84,10 @@ public class Sample {
                String result = null;\r
 \r
                CollectionobjectsCommon co = new CollectionobjectsCommon();\r
-               co.setObjectName("Keiko CollectionobjectsCommon");\r
+        ObjectNameList onl = co.getObjectNameList();\r
+        ObjectNameGroup ong = new ObjectNameGroup();\r
+        ong.setObjectName("Keiko CollectionobjectsCommon");\r
+        onl.getObjectNameGroup().add(ong);\r
 \r
                MultipartOutput multipart = new MultipartOutput();\r
                OutputPart commonPart = multipart.addPart(co,\r
@@ -144,8 +149,8 @@ public class Sample {
                // Update the content of this resource.\r
                collectionObject.setObjectNumber("updated-"\r
                                + collectionObject.getObjectNumber());\r
-               collectionObject.setObjectName("updated-"\r
-                               + collectionObject.getObjectName());\r
+        String name = collectionObject.getObjectNameList().getObjectNameGroup().get(0).getObjectName();\r
+               collectionObject.getObjectNameList().getObjectNameGroup().get(0).setObjectName("updated-"+ name);\r
 \r
                // Submit the request to the service and store the response.\r
                MultipartOutput output = new MultipartOutput();\r
index 3a41051d3eec12d8bf4debe98fe6af10f49b3696..ec6089297d02533ed2ea6a90e9e118a0868189c4 100644 (file)
@@ -28,7 +28,7 @@ import java.util.List;
 
 import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.VocabularyItemJAXBSchema;
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
 import org.collectionspace.services.client.VocabularyClient;
 import org.collectionspace.services.client.VocabularyClientUtils;
 import org.collectionspace.services.client.test.ServiceRequestType;
index 9bfcad16a355008c84bd78dd46908a032610b6ad..f49bcf89992a9bb47663a73a997dfca3b51bd68f 100644 (file)
@@ -33,7 +33,9 @@ import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;\r
 \r
 import org.apache.log4j.BasicConfigurator;\r
-import org.collectionspace.services.VocabularyItemJAXBSchema;\r
+//import org.collectionspace.services.VocabularyItemJAXBSchema; \r
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;\r
+\r
 import org.collectionspace.services.client.VocabularyClient;\r
 import org.collectionspace.services.client.VocabularyClientUtils;\r
 import org.collectionspace.services.client.test.ServiceRequestType;\r
@@ -80,8 +82,10 @@ public class Sample {
        if(logger.isDebugEnabled()){\r
                logger.debug("Import: Create vocabulary: \"" + vocabName +"\"");\r
        }\r
-       String baseVocabRefName = VocabularyClientUtils.createVocabularyRefName(vocabName, false);\r
-       String fullVocabRefName = VocabularyClientUtils.createVocabularyRefName(vocabName, true);\r
+\r
+        String displaySuffix = "displayName-" + System.currentTimeMillis(); //TODO: Laramie20100728 temp fix, made-up displaySuffix.\r
+        String baseVocabRefName = VocabularyClientUtils.createVocabularyRefName(vocabName, displaySuffix);   //TODO: Laramie20100728 temp fix  was vocabName, false\r
+       String fullVocabRefName = VocabularyClientUtils.createVocabularyRefName(vocabName, displaySuffix);   //TODO: Laramie20100728 temp fix  was vocabName, true\r
        MultipartOutput multipart = VocabularyClientUtils.createEnumerationInstance(\r
                        vocabName, fullVocabRefName, client.getCommonPartName());\r
        ClientResponse<Response> res = client.create(multipart);\r
@@ -106,7 +110,7 @@ public class Sample {
        }\r
        for(String itemName : enumValues){\r
             HashMap<String, String> itemInfo = new HashMap<String, String>();\r
-            itemInfo.put(VocabularyItemJAXBSchema.DISPLAY_NAME, itemName);\r
+            itemInfo.put(AuthorityItemJAXBSchema.DISPLAY_NAME, itemName);\r
                VocabularyClientUtils.createItemInVocabulary(newVocabId, \r
                                baseVocabRefName, itemInfo, client);\r
        }\r
@@ -189,8 +193,8 @@ public class Sample {
        ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
 \r
         // Submit the request to the service and store the response.\r
-        ClientResponse<VocabularyitemsCommonList> res =\r
-                client.readItemList(vocabId);\r
+                          //  readItemList(String inAuthority, String partialTerm, String keywords)\r
+        ClientResponse<VocabularyitemsCommonList> res =  client.readItemList(vocabId, "", ""); //TODO: figure out these params.  I just put in empty string to make it recompile after refactoring.  Laramie20100728\r
         VocabularyitemsCommonList list = res.getEntity();\r
 \r
         int statusCode = res.getStatus();\r