rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject svn commit: r1206991 - in /incubator/rave/trunk/rave-shindig/src: main/java/org/apache/rave/opensocial/model/ main/java/org/apache/rave/opensocial/service/impl/ main/resources/META-INF/ test/java/org/apache/rave/opensocial/service/
Date Mon, 28 Nov 2011 06:34:39 GMT
Author: mfranklin
Date: Mon Nov 28 06:34:39 2011
New Revision: 1206991

URL: http://svn.apache.org/viewvc?rev=1206991&view=rev
Log:
Removed classes from rave-shindig that are no longer used (Supports RAVE-347)

Removed:
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/BodyType.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Name.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Person.java
Modified:
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java
    incubator/rave/trunk/rave-shindig/src/main/resources/META-INF/persistence.xml
    incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java?rev=1206991&r1=1206990&r2=1206991&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java
(original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java
Mon Nov 28 06:34:39 2011
@@ -35,8 +35,10 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
+import static org.apache.rave.util.CollectionUtils.getSingleValue;
+
 /**
- * Wraps a {@link org.apache.rave.opensocial.model.Person} model object and returns values
only if
+ * Wraps a {@link org.apache.rave.portal.model.Person} model object and returns values only
if
  * the field set contains the requested field
  * <p/>
  * Usage of this wrapper is made possible by Shindig's use of a getter based serialization
model
@@ -56,9 +58,9 @@ public class FieldRestrictingPerson impl
     public FieldRestrictingPerson(org.apache.rave.portal.model.Person internal, Set<String>
fields) {
         this.internal = internal;
         this.fields = fields;
-        if(internal != null && internal.getProperties() != null) {
-            this.propertyMap = createPropertyMap(internal.getProperties());
-        }
+        this.propertyMap = internal != null && internal.getProperties() != null ?
+                createPropertyMap(internal.getProperties()) :
+                new HashMap<String, List<PersonProperty>>();
     }
 
     //REQUIRED FIELD
@@ -516,8 +518,7 @@ public class FieldRestrictingPerson impl
 
     @Override
     public Url getProfileSong() {
-        PersonProperty property = CollectionUtils.getSingleValue(getFromProperties(Field.PROFILE_SONG));
-        return convertToUrl(property);
+        return displayField(Field.PROFILE_SONG) ? convertToUrl(getSingleValue(getFromProperties(Field.PROFILE_SONG)))
: null;
     }
 
     @Override
@@ -527,8 +528,7 @@ public class FieldRestrictingPerson impl
 
     @Override
     public Url getProfileVideo() {
-        PersonProperty property = CollectionUtils.getSingleValue(getFromProperties(Field.PROFILE_VIDEO));
-        return property == null ? null :convertToUrl(property);
+        return displayField(Field.PROFILE_SONG) ? convertToUrl(getSingleValue(getFromProperties(Field.PROFILE_VIDEO)))
: null;
     }
 
     @Override

Modified: incubator/rave/trunk/rave-shindig/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/resources/META-INF/persistence.xml?rev=1206991&r1=1206990&r2=1206991&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/resources/META-INF/persistence.xml (original)
+++ incubator/rave/trunk/rave-shindig/src/main/resources/META-INF/persistence.xml Mon Nov
28 06:34:39 2011
@@ -30,8 +30,6 @@
       <class>org.apache.rave.portal.model.Address</class>
       <class>org.apache.rave.opensocial.model.Account</class>
       <class>org.apache.rave.opensocial.model.Address</class>
-      <class>org.apache.rave.opensocial.model.BodyType</class>
-      <class>org.apache.rave.opensocial.model.Name</class>
       <class>org.apache.rave.opensocial.model.Organization</class>
       <class>org.apache.rave.opensocial.model.ApplicationData</class>
       <class>org.apache.rave.opensocial.repository.impl.JpaApplicationDataRepository$JpaSerializableApplicationData</class>

Modified: incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java?rev=1206991&r1=1206990&r2=1206991&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java
(original)
+++ incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java
Mon Nov 28 06:34:39 2011
@@ -357,6 +357,12 @@ public class FieldRestrictingPersonTest 
     }
 
     @Test
+    public void getProfileSong_notset() {
+        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.BOOKS));
+        assertThat(p.getProfileSong(), is(nullValue()));
+    }
+
+    @Test
     public void getProfileVideo_set() {
         Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.PROFILE_VIDEO));
         assertThat(p.getProfileVideo(), is(nullValue()));



Mime
View raw message