]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-1043: Contact schema changed to conform to latest 'Limited for Release 0.4...
authorAron Roberts <aron@socrates.berkeley.edu>
Tue, 23 Feb 2010 05:34:53 +0000 (05:34 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Tue, 23 Feb 2010 05:34:53 +0000 (05:34 +0000)
services/contact/3rdparty/nuxeo-platform-cs-contact/src/main/resources/OSGI-INF/layouts-contrib.xml
services/contact/3rdparty/nuxeo-platform-cs-contact/src/main/resources/schemas/contacts_common.xsd
services/contact/client/src/main/java/org/collectionspace/services/client/ContactClientUtils.java
services/contact/client/src/test/java/org/collectionspace/services/client/test/ContactServiceTest.java
services/contact/jaxb/src/main/java/org/collectionspace/services/contact/ContactJAXBSchema.java
services/contact/jaxb/src/main/java/org/collectionspace/services/contact/ContactListItemJAXBSchema.java
services/contact/jaxb/src/main/resources/contacts-common.xsd
services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactDocumentModelHandler.java

index ae32eb0e5e574a942fcccb1e8016f77149380a89..5f31f0f17cacf9eba249bbff4a8829de8b913d37 100644 (file)
@@ -6,48 +6,91 @@
     point="layouts">
 
     <layout name="contact">
+
       <templates>
         <template mode="any">/layouts/layout_default_template.xhtml</template>
       </templates>
       <rows>
-        <row><widget>addressType1</widget></row>
-        <row><widget>addressText1</widget></row>
-        <row><widget>postcode</widget></row>
+        <row><widget>addressType</widget></row>
+        <row><widget>addressPlace</widget></row>
+        <row><widget>email</widget></row>
+        <row><widget>telephoneNumber</widget></row>
+        <row><widget>faxNumber</widget></row>
+        <row><widget>notes</widget></row>
       </rows>
-      
-      <widget name="addressText1" type="text">
+
+      <widget name="addressType" type="text">
+        <labels>
+          <label mode="any">addressType</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="contacts_common">addressType</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+
+      <widget name="addressPlace" type="text">
+        <labels>
+          <label mode="any">addressPlace</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="contacts_common">addressPlace</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+
+      <widget name="email" type="text">
         <labels>
-          <label mode="any">addressText1</label>
+          <label mode="any">email</label>
         </labels>
         <translated>true</translated>
         <fields>
-          <field schema="contacts_common">addressText1</field>
+          <field schema="contacts_common">email</field>
         </fields>
         <properties widgetMode="edit">
           <property name="styleClass">dataInputText</property>
         </properties>
       </widget>
-      
-      <widget name="postcode" type="text">
+
+      <widget name="telephoneNumber" type="text">
         <labels>
-          <label mode="any">postcode</label>
+          <label mode="any">telephoneNumber</label>
         </labels>
         <translated>true</translated>
         <fields>
-          <field schema="contacts_common">postcode</field>
+          <field schema="contacts_common">telephoneNumber</field>
         </fields>
         <properties widgetMode="edit">
           <property name="styleClass">dataInputText</property>
         </properties>
       </widget>
-      
-      <widget name="addressType1" type="text">
+
+      <widget name="faxNumber" type="text">
+        <labels>
+          <label mode="any">faxNumber</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="contacts_common">faxNumber</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+
+      <widget name="notes" type="text">
         <labels>
-          <label mode="any">addressType1</label>
+          <label mode="any">notes</label>
         </labels>
         <translated>true</translated>
         <fields>
-          <field schema="contacts_common">addressType1</field>
+          <field schema="contacts_common">notes</field>
         </fields>
         <properties widgetMode="edit">
           <property name="styleClass">dataInputText</property>
index 1addb001f67f1e2a67d06f992ed18bca9ab3dac6..a52400b11823e3bfa84cb92393db69483fabdb30 100644 (file)
     xmlns="http://collectionspace.org/contact/"
     targetNamespace="http://collectionspace.org/contact/"
     version="0.1">
-    
-    <!-- Note: the following is currently a representative subset -->
-    <!-- of the full Address Information schema specified at -->
-    <!-- http://wiki.collectionspace.org/display/collectionspace/Contact+Information+Schema -->
-    <!-- as this schema is still in flux. -->
-
-   <!-- The use of numbered field names, below, is an expedient for -->
-    <!-- release 0.5 ("Jupiter").  This will be handled instead in future -->
-    <!-- releases via the standard scalar repeatability methods; e.g. -->
-    <!-- minOccurs="{minValue}" maxOccurs="unbounded" attributes. -->
 
-    <!-- Initially, in release 0.5, this entire group will be repeatable, -->
-    <!-- as a result of Contact records being made a repeatable -->
-    <!-- sub-resource of Person and Organization. -->
     <xs:element name="csid" type="xs:string" />
     <xs:element name="inAuthority" type="xs:string" />
     <xs:element name="inItem" type="xs:string" />
-    <xs:element name="addressType1" type="xs:string"/>
-    <xs:element name="addressType2" type="xs:string"/>
-    <xs:element name="addressType3" type="xs:string"/>
-    <xs:element name="addressText1" type="xs:string"/>
-    <xs:element name="addressText2" type="xs:string"/>
-    <xs:element name="addressText3" type="xs:string"/>
-    <xs:element name="postcode1" type="xs:string"/>
-    <xs:element name="postcode2" type="xs:string"/>
-    <xs:element name="postcode3" type="xs:string"/>
-    <xs:element name="email1" type="xs:string"/>
-    <xs:element name="email2" type="xs:string"/>
-    <xs:element name="email3" type="xs:string"/>
-    <xs:element name="telephoneNumber1" type="xs:string"/>
-    <xs:element name="telephoneNumber2" type="xs:string"/>
-    <xs:element name="telephoneNumber3" type="xs:string"/>
-    <xs:element name="faxNumber1" type="xs:string"/>
-    <xs:element name="faxNumber2" type="xs:string"/>
-    <xs:element name="faxNumber3" type="xs:string"/>
+    <xs:element name="addressType" type="xs:string"/>
+    <xs:element name="addressPlace" type="xs:string"/>
+    <xs:element name="email" type="xs:string"/>
+    <xs:element name="telephoneNumber" type="xs:string"/>
+    <xs:element name="faxNumber" type="xs:string"/>
     <xs:element name="notes" type="xs:string"/>
     
 </xs:schema>
index 30c2d3182b3bb4f5744fd24a9d5d7deceee154c5..01a6755b1d7cf31bdba8341ec7604ddd1eed9946 100644 (file)
@@ -16,14 +16,14 @@ public class ContactClientUtils {
         LoggerFactory.getLogger(ContactClientUtils.class);
 
     public static MultipartOutput createContactInstance(String identifier, String headerLabel) {
-        String inAuthority = "";
-        String inItem = "";
+        final String inAuthority = "";
+        final String inItem = "";
         return createContactInstance(
             inAuthority,
             inItem,
-            "addressText1-" + identifier,
-            "postcode-" + identifier,
-            "addressType1-" + identifier,
+            "addressType-" + identifier,
+            "addressPlace-" + identifier,
+            "emakl-" + identifier,
             headerLabel);
     }
 
@@ -32,21 +32,21 @@ public class ContactClientUtils {
         return createContactInstance(
             inAuthority,
             inItem,
-            "addressText1-" + identifier,
-            "postcode-" + identifier,
-            "addressType1-" + identifier,
+            "addressType-" + identifier,
+            "addressPlace-" + identifier,
+            "emakl-" + identifier,
             headerLabel);
     }
 
     public static MultipartOutput createContactInstance(
-        String inAuthority, String inItem, String addressText,
-        String postcode, String addressType, String headerLabel) {
+        String inAuthority, String inItem, String addressType,
+        String addressPlace, String email, String headerLabel) {
         ContactsCommon contact = new ContactsCommon();
         contact.setInAuthority(inAuthority);
         contact.setInItem(inItem);
-        contact.setAddressText1(addressText);
-        contact.setPostcode1(postcode);
-        contact.setAddressType1(addressType);
+        contact.setAddressType(addressType);
+        contact.setAddressPlace(addressPlace);
+        contact.setEmail(email);
         MultipartOutput multipart = new MultipartOutput();
         OutputPart commonPart =
             multipart.addPart(contact, MediaType.APPLICATION_XML_TYPE);
index 91b5e6fa2bceaf4ef7c0ed367395170abbc718ba..17ab7ffc8226bd8d9e73c2b792438d08328faeee 100644 (file)
@@ -305,7 +305,7 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
                 logger.debug(testName + ": list-item[" + i + "] csid=" +
                         item.getCsid());
                 logger.debug(testName + ": list-item[" + i + "] objectNumber=" +
-                        item.getAddressText1());
+                        item.getAddressPlace());
                 logger.debug(testName + ": list-item[" + i + "] URI=" +
                         item.getUri());
                 i++;
@@ -344,8 +344,9 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         Assert.assertNotNull(contact);
 
         // Update the content of this resource.
-        contact.setAddressText1("updated-" + contact.getAddressText1());
-        contact.setPostcode1("updated-" + contact.getPostcode1());
+        contact.setAddressType("updated-" + contact.getAddressType());
+        contact.setAddressPlace("updated-" + contact.getAddressPlace());
+        contact.setEmail("updated-" + contact.getEmail());
         if(logger.isDebugEnabled()){
             logger.debug("to be updated object");
             logger.debug(objectAsXmlString(contact, ContactsCommon.class));
@@ -372,8 +373,8 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
                         client.getCommonPartName(), ContactsCommon.class);
         Assert.assertNotNull(updatedContact);
 
-        Assert.assertEquals(updatedContact.getPostcode1(),
-                contact.getPostcode1(),
+        Assert.assertEquals(updatedContact.getEmail(),
+                contact.getEmail(),
                 "Data in updated object did not match submitted data.");
 
     }
index 6af5c448d2f7d921e65c9e862e213cf7fd42a954..c9ad9a449c1aa50c8911656026b2070dbf102390 100644 (file)
@@ -11,24 +11,11 @@ public interface ContactJAXBSchema {
        final static String CSID = "csid";
        final static String IN_AUTHORITY = "inAuthority";
         final static String IN_ITEM ="inItem";
-       final static String ADDRESS_TYPE1 = "addressType1";
-       final static String ADDRESS_TYPE2 = "addressType2";
-       final static String ADDRESS_TYPE3 = "addressType3";
-       final static String ADDRESS_TEXT1 = "addressText1";
-       final static String ADDRESS_TEXT2 = "addressText2";
-       final static String ADDRESS_TEXT3 = "addressText3";
-       final static String POSTCODE1 = "postcode1";
-       final static String POSTCODE2 = "postcode2";
-       final static String POSTCODE3 = "postcode3";
-       final static String EMAIL1 = "email1";
-        final static String EMAIL2 = "email2";
-        final static String EMAIL3 = "email3";
-       final static String TELEPHONE_NUMBER1 = "telephoneNumber1";
-        final static String TELEPHONE_NUMBER2 = "telephoneNumber2";
-        final static String TELEPHONE_NUMBER3 = "telephoneNumber3";
-       final static String FAX_NUMBER1 = "faxNumber1";
-       final static String FAX_NUMBER2 = "faxNumber2";
-       final static String FAX_NUMBER3 = "faxNumber3";
+       final static String ADDRESS_TYPE = "addressType";
+       final static String ADDRESS_PLACE = "addressPlace";
+       final static String EMAIL = "email";
+       final static String TELEPHONE_NUMBER = "telephoneNumber";
+       final static String FAX_NUMBER = "faxNumber";
        final static String NOTES = "notes";
 }
 
index 5b29dc035f40e130b1b4b2f14dc8bac2ee610244..535aa483da7525090a1e1b63f2ee1a0fbb077c42 100644 (file)
@@ -1,10 +1,7 @@
 package org.collectionspace.services.contact;
 
 public interface ContactListItemJAXBSchema {
-    // TODO Revisit which information unit(s) should be returned
-    // in each entry, in a list of contact information.
-    // Should this be addressText or some other unit(s)?
-       final static String ADDRESS_TEXT1 = "addressText1";
+       final static String ADDRESS_PLACE = "addressPlace";
        final static String CSID = "csid";
        final static String URI = "url";
 }
index 1d1c312e31192b5bdc8c629b6bdeec57b7483f14..dd669e7d1e4a8d939b7c0ba4d5ce8529ec0101cd 100644 (file)
 -->
 <!-- See http://wiki.collectionspace.org/display/collectionspace/Contact+Schema -->    
     
-    <!-- contact  -->
-    
-    <!-- Note: the following is currently a representative subset -->
-    <!-- of the full Address Information schema specified at -->
-    <!-- http://wiki.collectionspace.org/display/collectionspace/Contact+Information+Schema -->
-    <!-- as this schema is still in flux. -->
-
-    <!-- The use of numbered field names, below, is an expedient for -->
-    <!-- release 0.5 ("Jupiter").  This will be handled instead in future -->
-    <!-- releases via the standard scalar repeatability methods; e.g. -->
-    <!-- minOccurs="{minValue}" maxOccurs="unbounded" attributes. -->
-
-    <!-- Initially, in release 0.5, this entire group will be repeatable, -->
-    <!-- as a result of Contact records being made a repeatable -->
-    <!-- sub-resource of Person and Organization. -->
     <xs:element name="contacts_common">
         <xs:complexType>
             <xs:sequence>
                 <xs:element name="csid" type="xs:string" />
                 <xs:element name="inAuthority" type="xs:string" />
                 <xs:element name="inItem" type="xs:string" />
-                <xs:element name="addressType1" type="xs:string"/>
-                <xs:element name="addressType2" type="xs:string"/>
-                <xs:element name="addressType3" type="xs:string"/>
-                <xs:element name="addressText1" type="xs:string"/>
-                <xs:element name="addressText2" type="xs:string"/>
-                <xs:element name="addressText3" type="xs:string"/>
-                <xs:element name="postcode1" type="xs:string"/>
-                <xs:element name="postcode2" type="xs:string"/>
-                <xs:element name="postcode3" type="xs:string"/>
-                <xs:element name="email1" type="xs:string"/>
-                <xs:element name="email2" type="xs:string"/>
-                <xs:element name="email3" type="xs:string"/>
-                <xs:element name="telephoneNumber1" type="xs:string"/>
-                <xs:element name="telephoneNumber2" type="xs:string"/>
-                <xs:element name="telephoneNumber3" type="xs:string"/>
-                <xs:element name="faxNumber1" type="xs:string"/>
-                <xs:element name="faxNumber2" type="xs:string"/>
-                <xs:element name="faxNumber3" type="xs:string"/>
+                <xs:element name="addressType" type="xs:string"/>
+                <xs:element name="addressPlace" type="xs:string"/>
+                <xs:element name="email" type="xs:string"/>
+                <xs:element name="telephoneNumber" type="xs:string"/>
+                <xs:element name="faxNumber" type="xs:string"/>
                 <xs:element name="notes" type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
@@ -76,7 +48,7 @@
                 <xs:element name="contact-list-item" maxOccurs="unbounded">
                     <xs:complexType>
                         <xs:sequence>
-                            <xs:element name="addressText1" type="xs:string"
+                            <xs:element name="addressPlace" type="xs:string"
                                 minOccurs="1" />
                             <!-- uri to retrive contact details -->
                             <xs:element name="uri" type="xs:anyURI"
index af72072b32f95ab944460dd13ff927092e7988c6..0149e4cfd053648e55211f492b6793bb757d8db5 100644 (file)
@@ -139,9 +139,9 @@ public class ContactDocumentModelHandler
             ContactListItem clistItem = new ContactListItem();
             // TODO Revisit which information unit(s) should be returned
             // in each entry, in a list of contact information.
-            // Should this be AddressText1 or some other unit(s)?
-            clistItem.setAddressText1((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
-                    ContactJAXBSchema.ADDRESS_TEXT1));
+            // See CSPACE-1018
+            clistItem.setAddressPlace((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
+                    ContactJAXBSchema.ADDRESS_PLACE));
             String id = NuxeoUtils.extractId(docModel.getPathAsString());
             clistItem.setUri(getServiceContextPath() + id);
             clistItem.setCsid(id);