]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6375: There seems to be a bug in Nuxeo 6 when it tries to return a property...
authorremillet <remillet@yahoo.com>
Mon, 9 Mar 2015 21:52:07 +0000 (14:52 -0700)
committerremillet <remillet@yahoo.com>
Mon, 9 Mar 2015 21:52:07 +0000 (14:52 -0700)
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java
services/contact/client/src/main/java/org/collectionspace/services/client/ContactClientUtils.java

index 39060c28d12d6a7d965986b7605b8a658a092b4b..68389c8249457afe216ff9a665fb2518d852090c 100644 (file)
@@ -822,6 +822,10 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
        } catch(ClassCastException cce) {
                throw new RuntimeException("Problem retrieving property {"+xpath+"} as String. Not a String property?"
                                +cce.getLocalizedMessage());
+       } catch(NullPointerException npe) {
+               // Getting here because of a bug in Nuxeo when value in repository is unknown/empty/null
+               logger.warn(String.format("Nuxeo repo unexpectedly returned an Null Pointer Exception when asked for the value of {%s}.",
+                               xpath));
        } catch(Exception e) {
                throw new RuntimeException("Unknown problem retrieving property {"+xpath+"}."
                                +e.getLocalizedMessage());
index 4ad1c158ea4622cb1260ae8d80d42e451387d8a1..3d2c07c36e87e4b4959772515c1ef8f0628570db 100644 (file)
@@ -9,6 +9,8 @@ import org.collectionspace.services.contact.AddressGroupList;
 import org.collectionspace.services.contact.ContactsCommon;
 import org.collectionspace.services.contact.EmailGroup;
 import org.collectionspace.services.contact.EmailGroupList;
+import org.collectionspace.services.contact.TelephoneNumberGroup;
+import org.collectionspace.services.contact.TelephoneNumberGroupList;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -49,6 +51,14 @@ public class ContactClientUtils {
         contact.setInAuthority(inAuthority);
         contact.setInItem(inItem);
         
+        TelephoneNumberGroupList telephoneNumberGroupList = new TelephoneNumberGroupList();
+        List<TelephoneNumberGroup> telephoneGroups = telephoneNumberGroupList.getTelephoneNumberGroup();
+        TelephoneNumberGroup telephoneNumberGroup = new TelephoneNumberGroup();
+        telephoneNumberGroup.setTelephoneNumber("510-555-1212");
+        telephoneNumberGroup.setTelephoneNumberType("local");
+        telephoneGroups.add(telephoneNumberGroup);
+        //contact.setTelephoneNumberGroupList(telephoneNumberGroupList);
+        
         EmailGroupList emailGroupList = new EmailGroupList();
         List<EmailGroup> emailGroups = emailGroupList.getEmailGroup();
         EmailGroup emailGroup = new EmailGroup();