]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-600, CSPACE-572 Fixed. Removed inVocabulary reference from all REST payloads...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Wed, 9 Dec 2009 20:25:15 +0000 (20:25 +0000)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Wed, 9 Dec 2009 20:25:15 +0000 (20:25 +0000)
Work on CSPACE-590, CSPACE-547. Added support for refname to payloads.

services/vocabulary/client/src/test/java/org/collectionspace/services/client/test/VocabularyServiceTest.java
services/vocabulary/import/src/main/java/org/collectionspace/services/vocabulary/importer/VocabularyBaseImport.java
services/vocabulary/jaxb/src/main/java/org/collectionspace/services/VocabularyItemJAXBSchema.java
services/vocabulary/jaxb/src/main/java/org/collectionspace/services/VocabularyItemListItemJAXBSchema.java
services/vocabulary/jaxb/src/main/java/org/collectionspace/services/VocabularyJAXBSchema.java
services/vocabulary/jaxb/src/main/java/org/collectionspace/services/VocabularyListItemJAXBSchema.java
services/vocabulary/jaxb/src/main/resources/vocabulary_common.xsd
services/vocabulary/jaxb/src/main/resources/vocabularyitem_common.xsd
services/vocabulary/sample/sample/src/main/java/org/collectionspace/services/vocabulary/client/sample/Sample.java
services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyDocumentModelHandler.java
services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java

index 6da36afc06f16bd27186554032c9356d4614f14a..af40300a4c429840325cd34655a56f9ae702518b 100644 (file)
@@ -970,7 +970,6 @@ public class VocabularyServiceTest extends AbstractServiceTest {
     private MultipartOutput createVocabularyItemInstance(String inVocabulary,
         String displayName, String refName) {
         VocabularyitemsCommon vocabularyItem = new VocabularyitemsCommon();
-        vocabularyItem.setInVocabulary(inVocabulary);
         vocabularyItem.setDisplayName(displayName);
         if(refName!=null)
                vocabularyItem.setRefName(refName);
index e448af7d8574b8e04884034cb840f1a555cc778a..c352319676a8229355aac85fec9326ab3a5263d5 100644 (file)
@@ -104,7 +104,7 @@ public class VocabularyBaseImport {
        if(logger.isDebugEnabled()){
                logger.debug("Import: Create Item: \""+itemName+"\" in vocabulary: \"" + vocabName +"\"");
        }
-       MultipartOutput multipart = createVocabularyItemInstance(vcsid, itemName, refName);
+       MultipartOutput multipart = createVocabularyItemInstance(itemName, refName);
        ClientResponse<Response> res = client.createItem(vcsid, multipart);
 
        int statusCode = res.getStatus();
@@ -145,9 +145,8 @@ public class VocabularyBaseImport {
     }
 
     private MultipartOutput createVocabularyItemInstance(
-               String inVocabulary, String displayName, String refName) {
+               String displayName, String refName) {
        VocabularyitemsCommon vocabularyItem = new VocabularyitemsCommon();
-       vocabularyItem.setInVocabulary(inVocabulary);
        vocabularyItem.setDisplayName(displayName);
        vocabularyItem.setRefName(refName);
         MultipartOutput multipart = new MultipartOutput();
index c0c3038e03b1263e2c924563c044ce4385b4ed3f..97127893b0a1dc01e949bfaee0614a0b41fd2aff 100644 (file)
@@ -9,7 +9,8 @@ package org.collectionspace.services;
  */\r
 public interface VocabularyItemJAXBSchema {\r
        final static String DISPLAY_NAME = "displayName";\r
-       final static String IN_VOCABULARY = "inVocabulary";\r
+       final static String REF_NAME = "refName";\r
+       final static String CSID = "csid";\r
 }\r
 \r
 \r
index f5f947b4cc6dd0229a90b4eccfa04edf6edcbaf5..204a4879b08e121f40b3157c0b33efc93c228a65 100644 (file)
@@ -2,6 +2,7 @@ package org.collectionspace.services;
 \r
 public interface VocabularyItemListItemJAXBSchema {\r
        final static String DISPLAY_NAME = "displayName";\r
+       final static String REF_NAME = "refName";\r
        final static String CSID = "csid";\r
        final static String URI = "url";\r
 }\r
index fa90ed4ad3ad8c0e7152a663960e443b86ec2e10..09d23eb7a7056520c70170eb375607fad735d029 100644 (file)
@@ -9,7 +9,9 @@ package org.collectionspace.services;
  */\r
 public interface VocabularyJAXBSchema {\r
        final static String DISPLAY_NAME = "displayName";\r
+       final static String REF_NAME = "refName";\r
        final static String VOCAB_TYPE = "vocabType";\r
+       final static String CSID = "csid";\r
 }\r
 \r
 \r
index eae544106ef168599d1f4f0240740c4e5e83585f..de04bc5331e8bb005214da92a7af88401425d027 100644 (file)
@@ -2,6 +2,7 @@ package org.collectionspace.services;
 \r
 public interface VocabularyListItemJAXBSchema {\r
        final static String DISPLAY_NAME = "displayName";\r
+       final static String REF_NAME = "refName";\r
        final static String VOCAB_TYPE = "vocabType";\r
        final static String CSID = "csid";\r
        final static String URI = "url";\r
index 539f589cc01d8413e54f862ec46727824b3ff5d9..0b3cf6470f01edf5ec12bf7ecfbe74f5a5b841f1 100644 (file)
@@ -50,6 +50,8 @@
                         <xs:sequence>
                             <xs:element name="displayName" type="xs:string"
                                 minOccurs="1" />
+                            <xs:element name="refName" type="xs:string"
+                                minOccurs="1" />
                             <xs:element name="vocabType" type="xs:string"
                                 minOccurs="1" />
                             <!-- uri to retrieve vocabulary details -->
index cd2a95ee6ecaa0a578c46517cff9b6b23078ab87..6f3b0498181890b6b440f738c6552f1cf490e475 100644 (file)
                 
                 <!--  Vocabularyitem Information Group -->
                 <!--  inVocabulary is the csid of the owning Vocabulary -->
-                <xs:element name="inVocabulary" type="xs:string" />
                 <xs:element name="displayName" type="xs:string"/>
                 <xs:element name="refName" type="xs:string"/>
-
             </xs:sequence>
         </xs:complexType>
     </xs:element>
@@ -40,6 +38,8 @@
                             <!-- uri to retrieve vocabularyitem details -->
                             <xs:element name="uri" type="xs:anyURI"
                                 minOccurs="1" />
+                            <xs:element name="refName" type="xs:string"
+                                minOccurs="1" />
                             <xs:element name="csid" type="xs:string"
                                 minOccurs="1" />
                         </xs:sequence>
index f55a4a203a1ed0aa3708fd5c8b95dd14491e4b78..d6f647535eef1e418c6758815c996bb64e067538 100644 (file)
@@ -110,7 +110,7 @@ public class Sample {
        ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
 \r
        logger.info("Import: Create Item: \""+itemName+"\" in vocabulary: \"" + vocabName +"\"");\r
-       MultipartOutput multipart = createVocabularyItemInstance(vcsid, itemName, refName);\r
+       MultipartOutput multipart = createVocabularyItemInstance(itemName, refName);\r
        ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
 \r
        int statusCode = res.getStatus();\r
@@ -314,9 +314,8 @@ public class Sample {
     }\r
 \r
     private MultipartOutput createVocabularyItemInstance(\r
-               String inVocabulary, String displayName, String refName) {\r
+               String displayName, String refName) {\r
        VocabularyitemsCommon vocabularyItem = new VocabularyitemsCommon();\r
-       vocabularyItem.setInVocabulary(inVocabulary);\r
        vocabularyItem.setDisplayName(displayName);\r
        vocabularyItem.setRefName(refName);\r
         MultipartOutput multipart = new MultipartOutput();\r
index 40ee88cddc826e095dcd029ba35e85f420724b5e..b60a31033721522ca2de6bae89eb9332ec153c00 100644 (file)
@@ -124,6 +124,8 @@ public class VocabularyDocumentModelHandler
             VocabularyListItem ilistItem = new VocabularyListItem();
             ilistItem.setDisplayName((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
                     VocabularyJAXBSchema.DISPLAY_NAME));
+            ilistItem.setRefName((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
+                    VocabularyJAXBSchema.REF_NAME));
             ilistItem.setVocabType((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
                     VocabularyJAXBSchema.VOCAB_TYPE));
             String id = NuxeoUtils.extractId(docModel.getPathAsString());
@@ -135,7 +137,6 @@ public class VocabularyDocumentModelHandler
         return coList;
     }
 
-
     /**
      * getQProperty converts the given property to qualified schema property
      * @param prop
index be8ca9f38f1e517931ce53ad4244a37a3d1155aa..4025fa0cfcf87b1a09dca449091cb3480f6d7a69 100644 (file)
@@ -136,9 +136,13 @@ public class VocabularyItemDocumentModelHandler
                while(iter.hasNext()){
                    DocumentModel docModel = iter.next();
                    VocabularyitemListItem ilistItem = new VocabularyitemListItem();
-                   ilistItem.setDisplayName((String) docModel.getProperty(getServiceContext().getCommonPartLabel("vocabularyItems"),
-                           VocabularyItemJAXBSchema.DISPLAY_NAME));
-                    String id = NuxeoUtils.extractId(docModel.getPathAsString());
+                   ilistItem.setDisplayName(
+                                                                       (String) docModel.getProperty(getServiceContext().getCommonPartLabel("vocabularyItems"),
+                                                                       VocabularyItemJAXBSchema.DISPLAY_NAME));
+                   ilistItem.setRefName(
+                                                                       (String) docModel.getProperty(getServiceContext().getCommonPartLabel("vocabularyItems"),
+                                                                       VocabularyItemJAXBSchema.REF_NAME));
+                                                       String id = NuxeoUtils.extractId(docModel.getPathAsString());
                    ilistItem.setUri("/vocabularies/"+inVocabulary+"/items/" + id);
                    ilistItem.setCsid(id);
                    list.add(ilistItem);
@@ -152,8 +156,6 @@ public class VocabularyItemDocumentModelHandler
         return coList;
     }
 
-
-
     /**
      * getQProperty converts the given property to qualified schema property
      * @param prop