]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-149. Revised schema for organization to match the spec.
authorPatrick Schmitz <pschmitz@berkeley.edu>
Tue, 5 Jan 2010 23:11:09 +0000 (23:11 +0000)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Tue, 5 Jan 2010 23:11:09 +0000 (23:11 +0000)
services/organization/3rdparty/nuxeo-platform-cs-organization/src/main/resources/schemas/organizations_common.xsd
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java
services/organization/import/src/main/java/org/collectionspace/services/organization/importer/OrgAuthorityBaseImport.java
services/organization/jaxb/src/main/resources/organization_common.xsd
services/organization/sample/sample/src/main/java/org/collectionspace/services/organization/client/sample/Sample.java

index a15057748102c15b6aa15ef46f355cc597ba8f5c..5e4bacb44339a3d4e49ade68bc8980dbe0db26c0 100644 (file)
                <!--  inAuthority is the csid of the owning OrgAuthority -->
                <xs:element name="inAuthority" type="xs:string" />
                <xs:element name="refName" type="xs:string"/>
-               <xs:element name="displayName" type="xs:string"/>
+               <xs:element name="shortName" type="xs:string"/>
                <xs:element name="longName" type="xs:string"/>
+               <xs:element name="nameAdditions" type="xs:string"/>
+               <xs:element name="contactName" type="xs:string"/>
+               <xs:element name="foundingDate" type="xs:string"/>
+               <xs:element name="dissolutionDate" type="xs:string"/>
+               <xs:element name="foundingPlace" type="xs:string"/>
+               <xs:element name="function" type="xs:string"/>
                <xs:element name="description" type="xs:string"/>
 
 </xs:schema>
index 8241900d276422bf2f2555cfb3c5e944435a4e9b..830a642c16ad3fb9e9ad08529ae0bea0308a9806 100644 (file)
@@ -148,8 +148,9 @@ public class OrgAuthorityServiceTest extends AbstractServiceTest {
         String identifier = createIdentifier();
         String refName = createRefName(identifier);
         MultipartOutput multipart = createOrganizationInstance(vcsid, 
-                       identifier, refName, "Longer Name for "+identifier,
-                       "This is a fake organization that was created by a test method.");
+               identifier, refName, "Longer Name for "+identifier,
+               null, "joe@org.org", "1910", null, "Anytown, USA", "testing",  
+               "This is a fake organization that was created by a test method." );
         ClientResponse<Response> res = client.createItem(vcsid, multipart);
         int statusCode = res.getStatus();
 
@@ -611,7 +612,7 @@ public class OrgAuthorityServiceTest extends AbstractServiceTest {
         Assert.assertNotNull(organization);
 
         // Update the contents of this resource.
-        organization.setDisplayName("updated-" + organization.getDisplayName());
+        organization.setShortName("updated-" + organization.getShortName());
         if(logger.isDebugEnabled()){
             logger.debug("to be updated Organization");
             logger.debug(objectAsXmlString(organization,
@@ -641,8 +642,8 @@ public class OrgAuthorityServiceTest extends AbstractServiceTest {
         Assert.assertNotNull(updatedOrganization);
 
         // Verify that the updated resource received the correct data.
-        Assert.assertEquals(updatedOrganization.getDisplayName(),
-                organization.getDisplayName(),
+        Assert.assertEquals(updatedOrganization.getShortName(),
+                organization.getShortName(),
                 "Data in updated Organization did not match submitted data.");
     }
 
@@ -784,7 +785,7 @@ public class OrgAuthorityServiceTest extends AbstractServiceTest {
         // The only relevant ID may be the one used in update(), below.
         MultipartOutput multipart = createOrganizationInstance(
                        knownResourceId, NON_EXISTENT_ID, createRefName(NON_EXISTENT_ID),
-                       null, null);
+                       null, null, null, null, null, null, null, null);
         ClientResponse<MultipartInput> res =
                 client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
         int statusCode = res.getStatus();
@@ -1038,13 +1039,28 @@ public class OrgAuthorityServiceTest extends AbstractServiceTest {
     }
 
     private MultipartOutput createOrganizationInstance(String inAuthority,
-        String displayName, String refName, String longName, String description) {
+        String shortName, String refName, String longName, 
+        String nameAdditions, String contactName, 
+        String foundingDate, String dissolutionDate, String foundingPlace,
+        String function, String description ) {
         OrganizationsCommon organization = new OrganizationsCommon();
-        organization.setDisplayName(displayName);
+        organization.setShortName(shortName);
         if(refName!=null)
                organization.setRefName(refName);
         if(longName!=null)
                organization.setLongName(longName);
+        if(nameAdditions!=null)
+               organization.setNameAdditions(nameAdditions);
+        if(contactName!=null)
+               organization.setContactName(contactName);
+        if(foundingDate!=null)
+               organization.setFoundingDate(foundingDate);
+        if(dissolutionDate!=null)
+               organization.setDissolutionDate(dissolutionDate);
+        if(foundingPlace!=null)
+               organization.setFoundingPlace(foundingPlace);
+        if(function!=null)
+               organization.setFunction(function);
         if(description!=null)
                organization.setDescription(description);
         MultipartOutput multipart = new MultipartOutput();
index c4d124c6dfe754ec934580f51aa43fe521ef85aa..e6b1832d4f6d971081e2c4bdc5c2bcc7003c3c55 100644 (file)
@@ -104,7 +104,8 @@ public class OrgAuthorityBaseImport {
        if(logger.isDebugEnabled()){
                logger.debug("Import: Create Item: \""+itemName+"\" in orgAuthorityulary: \"" + orgAuthorityName +"\"");
        }
-       MultipartOutput multipart = createOrganizationInstance(itemName, refName);
+       MultipartOutput multipart = createOrganizationInstance(itemName, refName,
+                       null, null, null, null, null, null, null, null, null );
        ClientResponse<Response> res = client.createItem(vcsid, multipart);
 
        int statusCode = res.getStatus();
@@ -144,13 +145,34 @@ public class OrgAuthorityBaseImport {
         return multipart;
     }
 
-    private MultipartOutput createOrganizationInstance(
-               String displayName, String refName) {
-       OrganizationsCommon organization = new OrganizationsCommon();
-       organization.setDisplayName(displayName);
-       organization.setRefName(refName);
+    private MultipartOutput createOrganizationInstance(String inAuthority,
+        String shortName, String refName, String longName, 
+        String nameAdditions, String contactName, 
+        String foundingDate, String dissolutionDate, String foundingPlace,
+        String function, String description ) {
+        OrganizationsCommon organization = new OrganizationsCommon();
+        organization.setShortName(shortName);
+        if(refName!=null)
+               organization.setRefName(refName);
+        if(longName!=null)
+               organization.setLongName(longName);
+        if(nameAdditions!=null)
+               organization.setNameAdditions(nameAdditions);
+        if(contactName!=null)
+               organization.setContactName(contactName);
+        if(foundingDate!=null)
+               organization.setFoundingDate(foundingDate);
+        if(dissolutionDate!=null)
+               organization.setDissolutionDate(dissolutionDate);
+        if(foundingPlace!=null)
+               organization.setFoundingPlace(foundingPlace);
+        if(function!=null)
+               organization.setFunction(function);
+        if(description!=null)
+               organization.setDescription(description);
         MultipartOutput multipart = new MultipartOutput();
-        OutputPart commonPart = multipart.addPart(organization, MediaType.APPLICATION_XML_TYPE);
+        OutputPart commonPart = multipart.addPart(organization,
+            MediaType.APPLICATION_XML_TYPE);
         commonPart.getHeaders().add("label", client.getItemCommonPartName());
 
         if(logger.isDebugEnabled()){
index 3104fbd378ee074b3c66927aacbfd934fe6ea382..23ef6fe9850a10914327c21344fb5e3c5315bcaa 100644 (file)
                 <!--  Common identifier -->
                 <xs:element name="csid" type="xs:string" />
                 
-                <!--  Vocabularyitem Information Group -->
-                <xs:element name="displayName" type="xs:string"/>
+                <!--  Organization Information Group -->
                 <xs:element name="refName" type="xs:string"/>
+                <xs:element name="shortName" type="xs:string"/>
                 <xs:element name="longName" type="xs:string"/>
+                                                               <xs:element name="nameAdditions" type="xs:string"/>
+                                                               <xs:element name="contactName" type="xs:string"/>
+                                                               <xs:element name="foundingDate" type="xs:string"/>
+                                                               <xs:element name="dissolutionDate" type="xs:string"/>
+                                                               <xs:element name="foundingPlace" type="xs:string"/>
+                                                               <xs:element name="function" type="xs:string"/>
                 <xs:element name="description" type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
index cc9d7bb24182f53f723fea93b3a76cde74a19397..736f7637df49f0f5767051455af23f9d96450751 100644 (file)
@@ -316,7 +316,7 @@ public class Sample {
     private MultipartOutput createOrganizationInstance(\r
                String displayName, String refName) {\r
        OrganizationsCommon organization = new OrganizationsCommon();\r
-       organization.setDisplayName(displayName);\r
+       organization.setShortName(displayName);\r
        organization.setRefName(refName);\r
         MultipartOutput multipart = new MultipartOutput();\r
         OutputPart commonPart = multipart.addPart(organization, MediaType.APPLICATION_XML_TYPE);\r