You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by mf...@apache.org on 2013/01/30 00:55:09 UTC
svn commit: r1440223 [1/3] - in /rave/trunk:
rave-components/rave-commons/src/main/java/org/apache/rave/persistence/jpa/util/
rave-components/rave-core/
rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/
rave-components/rave-cor...
Author: mfranklin
Date: Tue Jan 29 23:55:08 2013
New Revision: 1440223
URL: http://svn.apache.org/viewvc?rev=1440223&view=rev
Log:
Applied patch from Jason Letourneau for RAVE-865
Added:
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityEntryComponent.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityObjectComponent.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/MediaLinkComponent.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsEntry.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsItem.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsMediaLink.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsObject.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsEntryImpl.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsMediaLinkImpl.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsObjectImpl.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/ActivityStreamsRepository.java
rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/ModelUtil.java
rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/
rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/
rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/
rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsEntryTest.java
rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsMediaLinkTest.java
rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsObjectTest.java
rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/util/
rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/util/ModelUtilTest.java
rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaActivityStreamsEntry.java
rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaActivityStreamsMediaLink.java
rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaActivityStreamsObject.java
rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/conversion/JpaActivityStreamsEntryConverter.java
rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/conversion/JpaActivityStreamsMediaLinkConverter.java
rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/conversion/JpaActivityStreamsObjectConverter.java
rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/repository/impl/JpaActivityStreamsRepository.java
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/activities/
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/activities/model/
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/activities/model/impl/
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/activities/model/impl/JpaActivityStreamsEntryTest.java
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/activities/model/impl/JpaActivityStreamsMediaLinkTest.java
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/activities/model/impl/JpaActivityStreamsObjectTest.java
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/activities/repository/
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/activities/repository/JpaActivityEntryRepositoryTest.java
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/model/conversion/JpaActivityStreamsEntryConverterTest.java
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/model/conversion/JpaActivityStreamsMediaLinkConverterTest.java
rave/trunk/rave-components/rave-jpa/src/test/java/org/apache/rave/portal/model/conversion/JpaActivityStreamsObjectConverterTest.java
rave/trunk/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultActivityStreamsService.java
rave/trunk/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/util/
rave/trunk/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/util/ActivityConversionUtil.java
rave/trunk/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/service/DefaultActivityStreamsServiceTest.java
rave/trunk/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/util/
rave/trunk/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/java/org/apache/rave/opensocial/util/ActivityConversionUtilTest.java
Modified:
rave/trunk/rave-components/rave-commons/src/main/java/org/apache/rave/persistence/jpa/util/JpaUtil.java
rave/trunk/rave-components/rave-core/pom.xml
rave/trunk/rave-components/rave-core/src/main/resources/org/apache/rave/core-applicationContext.xml
rave/trunk/rave-components/rave-jpa/src/main/resources/META-INF/persistence.xml
rave/trunk/rave-components/rave-jpa/src/main/resources/org/apache/rave/persistence-applicationContext.xml
rave/trunk/rave-components/rave-mongodb/pom.xml
rave/trunk/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/main/java/org/apache/rave/opensocial/service/impl/DefaultPersonService.java
rave/trunk/rave-providers/rave-opensocial-provider/rave-opensocial-core/src/test/resources/rave-shindig-test-applicationContext.xml
Modified: rave/trunk/rave-components/rave-commons/src/main/java/org/apache/rave/persistence/jpa/util/JpaUtil.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-commons/src/main/java/org/apache/rave/persistence/jpa/util/JpaUtil.java?rev=1440223&r1=1440222&r2=1440223&view=diff
==============================================================================
--- rave/trunk/rave-components/rave-commons/src/main/java/org/apache/rave/persistence/jpa/util/JpaUtil.java (original)
+++ rave/trunk/rave-components/rave-commons/src/main/java/org/apache/rave/persistence/jpa/util/JpaUtil.java Tue Jan 29 23:55:08 2013
@@ -19,16 +19,15 @@
package org.apache.rave.persistence.jpa.util;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-
import org.apache.rave.exception.NotSupportedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
/**
* JPA utilities
*/
@@ -39,7 +38,7 @@ public class JpaUtil {
private static final int LARGE_PAGESIZE = 1000;
- private JpaUtil() {}
+ public JpaUtil() {}
/**
* Gets a single, unique result from the list
Modified: rave/trunk/rave-components/rave-core/pom.xml
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/pom.xml?rev=1440223&r1=1440222&r2=1440223&view=diff
==============================================================================
--- rave/trunk/rave-components/rave-core/pom.xml (original)
+++ rave/trunk/rave-components/rave-core/pom.xml Tue Jan 29 23:55:08 2013
@@ -103,6 +103,28 @@
<artifactId>json</artifactId>
</dependency>
+ <!-- GSON JSON library -->
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- Joda Time -->
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.0</version>
+ </dependency>
+
+ <!-- Google Collections -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>r09</version>
+ </dependency>
+
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityEntryComponent.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityEntryComponent.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityEntryComponent.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityEntryComponent.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.activities.specification;
+
+public final class ActivityEntryComponent {
+ public static final String ACTOR="actor";
+ public static final String BCC="bcc";
+ public static final String BTO="bto";
+ public static final String CC="cc";
+ public static final String CONTENT="content";
+ public static final String CONTEXT="context";
+ public static final String DUBLIN_CORE="dc";
+ public static final String END_TIME="endTime";
+ public static final String GENERATOR="generator";
+ public static final String GEOJSON="geojson";
+ public static final String ID="id";
+ public static final String ICON="icon";
+ public static final String IN_REPLY_TO="inReplyTo";
+ public static final String LINKED_DATA_FOR_JSON="ld";
+ public static final String LINKS="links";
+ public static final String LOCATION="location";
+ public static final String MOOD="mood";
+ public static final String ODATA="odata";
+ public static final String OBJECT="object";
+ public static final String OPENGRAPH="opengraph";
+ public static final String PRIORITY="priority";
+ public static final String PROVIDER="provider";
+ public static final String PUBLISHED="published";
+ public static final String RATING="rating";
+ public static final String RESULT="result";
+ public static final String SCHEMA_ORG="schema_org";
+ public static final String SOURCE="source";
+ public static final String START_TIME="startTime";
+ public static final String TAGS="tags";
+ public static final String TARGET="target";
+ public static final String TITLE="title";
+ public static final String TO="to";
+ public static final String URL="url";
+ public static final String UPDATED="updated";
+ public static final String VERB="verb";
+
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityObjectComponent.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityObjectComponent.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityObjectComponent.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/ActivityObjectComponent.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.activities.specification;
+
+public final class ActivityObjectComponent {
+ public static final String ALIAS="alias";
+ public static final String ATTACHMENTS="attachments";
+ public static final String ATTENDED_BY="attendedBy";
+ public static final String ATTENDING="attending";
+ public static final String AUTHOR="author";
+ public static final String CONTENT="content";
+ public static final String DISPLAY_NAME="displayName";
+ public static final String DOWNSTREAM_DUPLICATES="endTime";
+ public static final String DUBLIN_CORE="dc";
+ public static final String END_TIME="endTime";
+ public static final String FOLLOWERS="followers";
+ public static final String FOLLOWING="following";
+ public static final String FRIEND_REQUESTS="friend-requests";
+ public static final String FRIENDS="friends";
+ public static final String GEOJSON="geojson";
+ public static final String ID="id";
+ public static final String IMAGE="image";
+ public static final String INVITED="invited";
+ public static final String LIKES="likes";
+ public static final String LINKED_DATA_FOR_JSON="ld";
+ public static final String LINKS="links";
+ public static final String LOCATION="location";
+ public static final String MAYBE_ATTENDING="maybeAttending";
+ public static final String MEMBERS="members";
+ public static final String NOT_ATTENDED_BY="notAttendedBy";
+ public static final String MOOD="mood";
+ public static final String NOT_ATTENDING="notAttending";
+ public static final String ODATA="odata";
+ public static final String OBJECT_TYPE="objectType";
+ public static final String OPENGRAPH="opengraph";
+ public static final String PUBLISHED="published";
+ public static final String RATING="rating";
+ public static final String REPLIES="replies";
+ public static final String REVIEWS="reviews";
+ public static final String SAVES="saves";
+ public static final String SCHEMA_ORG="schema_org";
+ public static final String SHARES="shares";
+ public static final String SOURCE="source";
+ public static final String START_TIME="startTime";
+ public static final String SUMMARY="summary";
+ public static final String TAGS="tags";
+ public static final String URL="url";
+ public static final String UPDATED="updated";
+ public static final String UPSTREAM_DUPLICATES="upstreamDuplicates";
+
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/MediaLinkComponent.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/MediaLinkComponent.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/MediaLinkComponent.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/activities/specification/MediaLinkComponent.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.activities.specification;
+
+public final class MediaLinkComponent {
+ public static final String DURATION="duration";
+ public static final String HEIGHT="height";
+ public static final String URL="url";
+ public static final String WIDTH="width";
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsEntry.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsEntry.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsEntry.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsEntry.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,208 @@
+package org.apache.rave.portal.model;
+
+
+import java.util.Date;
+
+public interface ActivityStreamsEntry extends ActivityStreamsItem {
+
+ public ActivityStreamsObject getActor() ;
+
+
+ public void setActor(ActivityStreamsObject actor);
+
+
+ public String getContent();
+
+
+ public void setContent(String content) ;
+
+ public ActivityStreamsObject getGenerator() ;
+
+
+ public void setGenerator(ActivityStreamsObject generator) ;
+
+
+ public ActivityStreamsMediaLink getIcon();
+
+
+ public void setIcon(ActivityStreamsMediaLink icon) ;
+
+
+ public ActivityStreamsItem getObject() ;
+
+
+ public void setObject(ActivityStreamsObject object) ;
+
+
+ public ActivityStreamsObject getProvider();
+
+
+ public void setProvider(ActivityStreamsObject provider) ;
+
+
+ public ActivityStreamsObject getTarget() ;
+
+
+ public void setTarget(ActivityStreamsObject target) ;
+
+
+ public String getTitle() ;
+
+ /** {@inheritDoc} */
+ public void setTitle(String title) ;
+
+
+ public String getVerb() ;
+
+
+ public void setVerb(String verb) ;
+
+
+ public String getUserId() ;
+
+
+ public void setUserId(String userId) ;
+
+
+ public String getGroupId() ;
+
+
+ public void setGroupId(String groupId) ;
+
+ public String getAppId() ;
+
+
+ public void setAppId(String appId) ;
+
+
+ public String getBcc() ;
+
+
+ public void setBcc(String bcc) ;
+
+
+ public String getBto() ;
+
+
+ public void setBto(String bto) ;
+
+
+ public String getCc() ;
+
+
+ public void setCc(String cc) ;
+
+
+ public String getContext() ;
+
+
+ public void setContext(String context) ;
+
+
+ public String getDc() ;
+
+
+ public void setDc(String dc) ;
+
+
+ public Date getEndTime() ;
+
+
+ public void setEndTime(Date endTime) ;
+
+
+ public String getGeojson() ;
+
+
+ public void setGeojson(String geojson) ;
+
+
+ public String getInReplyTo() ;
+
+
+ public void setInReplyTo(String inReplyTo) ;
+
+
+ public String getLd() ;
+
+
+ public void setLd(String ld) ;
+
+
+ public String getLinks() ;
+
+
+ public void setLinks(String links) ;
+
+
+ public String getLocation() ;
+
+
+ public void setLocation(String location) ;
+
+
+ public String getMood() ;
+
+
+ public void setMood(String mood) ;
+
+
+ public String getOdata() ;
+
+
+ public void setOdata(String odata) ;
+
+
+ public String getOpengraph() ;
+
+
+ public void setOpengraph(String opengraph) ;
+
+
+ public String getPriority() ;
+
+
+ public void setPriority(String priority) ;
+
+
+ public String getRating() ;
+
+
+ public void setRating(String rating) ;
+
+
+ public String getResult() ;
+
+
+ public void setResult(String result) ;
+
+
+ public String getSchema_org() ;
+
+
+ public void setSchema_org(String schema_org) ;
+
+
+ public String getSource() ;
+
+
+ public void setSource(String source) ;
+
+
+ public Date getStartTime() ;
+
+
+ public void setStartTime(Date startTime) ;
+
+
+ public String getTags() ;
+
+
+ public void setTags(String tags) ;
+
+
+ public String getTo() ;
+
+
+ public void setTo(String to) ;
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsItem.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsItem.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsItem.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsItem.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.model;
+
+import java.util.Date;
+import java.util.HashMap;
+
+
+public interface ActivityStreamsItem {
+
+ public String getId();
+ public void setId(String id);
+ public Date getPublished();
+ public void setPublished(Date published);
+ public Date getUpdated();
+ public void setUpdated(Date updated);
+ public String getUrl();
+ public void setUrl(String url);
+ public String getObjectType();
+ public void setObjectType(String objectType);
+ public HashMap getExtensions();
+ public void setExtensions(HashMap extensions);
+ public HashMap getOpenSocial();
+ public void setOpenSocial(HashMap openSocial);
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsMediaLink.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsMediaLink.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsMediaLink.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsMediaLink.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,31 @@
+package org.apache.rave.portal.model;
+
+
+import java.util.HashMap;
+
+public interface ActivityStreamsMediaLink {
+
+
+ public Integer getDuration() ;
+
+ public void setDuration(Integer duration) ;
+
+ public Integer getHeight() ;
+
+ public void setHeight(Integer height);
+
+ public String getId();
+
+ public Integer getWidth() ;
+
+ public void setWidth(Integer width) ;
+
+ public void setUrl(String url) ;
+
+ public String getUrl() ;
+
+
+ public void setOpenSocial(HashMap social);
+ public HashMap getOpenSocial();
+
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsObject.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsObject.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsObject.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ActivityStreamsObject.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,174 @@
+package org.apache.rave.portal.model;
+
+import java.util.Date;
+import java.util.List;
+
+
+public interface ActivityStreamsObject extends ActivityStreamsItem {
+
+
+ public List<? extends ActivityStreamsObject> getAttachments() ;
+
+ public void setAttachments(List<? extends ActivityStreamsObject> attachments) ;
+
+ public ActivityStreamsObject getAuthor() ;
+
+
+ public void setAuthor(ActivityStreamsObject author) ;
+
+
+ public String getContent() ;
+
+
+ public void setContent(String content) ;
+
+
+ public String getDisplayName() ;
+
+
+ public void setDisplayName(String displayName) ;
+
+
+ public List<String> getDownstreamDuplicates() ;
+
+
+ public void setDownstreamDuplicates(List<String> downstreamDuplicates) ;
+
+
+ public ActivityStreamsMediaLink getImage() ;
+
+
+ public void setImage(ActivityStreamsMediaLink image) ;
+
+
+ public String getSummary() ;
+
+ public void setSummary(String summary) ;
+
+
+ public List<String> getUpstreamDuplicates() ;
+
+
+ public void setUpstreamDuplicates(List<String> upstreamDuplicates) ;
+
+ public String getAlias() ;
+
+ public void setAlias(String alias) ;
+
+ public String getAttendedBy() ;
+
+ public void setAttendedBy(String attendedBy) ;
+
+ public String getAttending() ;
+
+ public void setAttending(String attending) ;
+
+ public String getDc() ;
+
+ public void setDc(String dc) ;
+
+ public Date getEndTime() ;
+
+ public void setEndTime(Date endTime) ;
+
+ public String getFollowers() ;
+
+ public void setFollowers(String followers) ;
+
+ public String getFollowing() ;
+
+ public void setFollowing(String following) ;
+
+ public String getFriend_requests() ;
+
+ public void setFriend_requests(String friend_requests) ;
+
+ public String getFriends() ;
+
+ public void setFriends(String friends) ;
+
+ public String getGeojson() ;
+
+ public void setGeojson(String geojson) ;
+
+ public String getInvited() ;
+
+ public void setInvited(String invited) ;
+
+ public String getLikes() ;
+
+ public void setLikes(String likes) ;
+
+ public String getLd() ;
+
+ public void setLd(String ld) ;
+
+ public String getLinks() ;
+
+ public void setLinks(String links) ;
+
+ public String getLocation() ;
+
+ public void setLocation(String location) ;
+
+ public String getMaybeAttending() ;
+
+ public void setMaybeAttending(String maybeAttending) ;
+
+ public String getMembers() ;
+
+ public void setMembers(String members) ;
+
+ public String getNotAttendedBy() ;
+
+ public void setNotAttendedBy(String notAttendedBy) ;
+
+ public String getMood() ;
+
+ public void setMood(String mood) ;
+
+ public String getNotAttending() ;
+
+ public void setNotAttending(String notAttending) ;
+
+ public String getOdata() ;
+
+ public void setOdata(String odata) ;
+
+ public String getOpengraph() ;
+
+ public void setOpengraph(String opengraph) ;
+
+ public String getRating() ;
+
+ public void setRating(String rating) ;
+
+ public String getReplies() ;
+
+ public void setReplies(String replies) ;
+
+ public String getReviews() ;
+
+ public void setReviews(String reviews) ;
+
+ public String getSaves() ;
+
+ public void setSaves(String saves) ;
+
+ public String getSchema_org() ;
+
+ public void setSchema_org(String schema_org) ;
+
+ public String getShares() ;
+
+ public void setShares(String shares) ;
+
+ public String getSource() ;
+
+ public void setSource(String source) ;
+
+ public Date getStartTime() ;
+
+ public void setStartTime(Date startTime) ;
+
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsEntryImpl.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsEntryImpl.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsEntryImpl.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsEntryImpl.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,619 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.model.impl;
+
+
+import org.apache.rave.portal.model.ActivityStreamsEntry;
+import org.apache.rave.portal.model.ActivityStreamsItem;
+import org.apache.rave.portal.model.ActivityStreamsObject;
+import org.apache.rave.portal.model.ActivityStreamsMediaLink;
+
+import java.util.HashMap;
+import java.util.logging.Logger;
+import java.util.Date;
+
+/**
+ * A simple bean implementation of an ActivityStream Entry. See
+ * http://docs.oracle.com/javaee/6/tutorial/doc/bnbqa.html to finish annotating
+ * properly.
+ */
+
+public class ActivityStreamsEntryImpl implements ActivityStreamsEntry {
+
+ private static final long serialVersionUID = 1L;
+ private static Logger log = Logger.getLogger(ActivityStreamsEntryImpl.class.getName());
+
+
+ private String id;
+
+
+ private ActivityStreamsObject actor;
+
+
+ private String content;
+
+
+ private ActivityStreamsObject generator;
+
+
+ private ActivityStreamsMediaLink icon;
+
+
+ private ActivityStreamsItem object;
+
+
+ private ActivityStreamsObject provider;
+
+
+ private ActivityStreamsObject target;
+
+
+ private String title;
+
+
+ private String verb;
+
+ //The user who verb'd this activity
+
+ private String userId;
+
+ //If this activity was generated as part of a group, this indicates the group's id
+
+ private String groupId;
+
+ //The id of the application that published this activity
+
+ private String appId;
+
+
+ private String bcc;
+
+
+ private String bto;
+
+
+ private String cc;
+
+
+ private String context;
+
+
+ private String dc;
+
+
+ private Date endTime;
+
+
+ private String geojson;
+
+
+ private String inReplyTo;
+
+
+ private String ld;
+
+
+ private String links;
+
+
+ private String location;
+
+
+ private String mood;
+
+
+ private String odata;
+
+
+ private String opengraph;
+
+
+ private String priority;
+
+
+ private String rating;
+
+
+ private String result;
+
+
+ private String schema_org;
+
+
+ private String source;
+
+
+ private Date startTime;
+
+
+ private String tags;
+
+
+ private String to;
+
+ private Date published;
+
+
+ private Date updated;
+
+
+ private String url;
+
+
+ private String objectType;
+
+
+ private HashMap openSocial;
+
+
+ private HashMap extensions;
+
+ /**
+ * Create a new empty DeserializableActivityEntry
+ */
+ public ActivityStreamsEntryImpl() {
+ }
+
+ /** {@inheritDoc} */
+
+ public Date getPublished() {
+ return published;
+ }
+
+ /** {@inheritDoc} */
+ public void setPublished(Date published) {
+ this.published = published;
+ }
+
+ public Date getUpdated(){
+ return updated;
+ }
+
+ public void setUpdated(Date updated){
+ this.updated=updated;
+ }
+
+ public String getUrl(){
+ return this.url;
+ }
+
+ public void setUrl(String url){
+ this.url=url;
+ }
+
+ public String getObjectType(){
+ return this.objectType;
+ }
+
+ public void setObjectType(String objectType){
+ this.objectType=objectType;
+ }
+
+ /** {@inheritDoc} */
+
+ public HashMap getOpenSocial() {
+ return openSocial;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setOpenSocial(HashMap openSocial) {
+
+ this.openSocial = openSocial;
+ }
+
+ /** {@inheritDoc} */
+
+ public HashMap getExtensions() {
+ return extensions;
+ }
+
+ /** {@inheritDoc} */
+ public void setExtensions(HashMap extensions) {
+
+
+ this.extensions = extensions;
+ }
+
+
+
+
+
+ public ActivityStreamsObject getActor() {
+ return actor;
+ }
+
+ /** {@inheritDoc} */
+ public void setActor(ActivityStreamsObject actor) {
+ this.actor = actor;
+ }
+
+ /** {@inheritDoc} */
+ public String getContent() {
+ return content;
+ }
+
+ /** {@inheritDoc} */
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+
+ /** {@inheritDoc} */
+ public ActivityStreamsObject getGenerator() {
+ return generator;
+ }
+
+ /** {@inheritDoc} */
+ public void setGenerator(ActivityStreamsObject generator) {
+ this.generator = generator;
+ }
+
+ /** {@inheritDoc} */
+ public ActivityStreamsMediaLink getIcon() {
+ return icon;
+ }
+
+ /** {@inheritDoc} */
+ public void setIcon(ActivityStreamsMediaLink icon) {
+ this.icon = icon;
+ }
+
+ /** {@inheritDoc} */
+
+ public String getId() {
+ return id;
+ }
+
+ /** {@inheritDoc} */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /** {@inheritDoc} */
+ public ActivityStreamsItem getObject() {
+ return object;
+ }
+
+ /** {@inheritDoc} */
+ public void setObject(ActivityStreamsObject object) {
+ this.object = object;
+ }
+
+
+
+ /** {@inheritDoc} */
+ public ActivityStreamsObject getProvider() {
+ return provider;
+ }
+
+ /** {@inheritDoc} */
+ public void setProvider(ActivityStreamsObject provider) {
+ this.provider = provider;
+ }
+
+ /** {@inheritDoc} */
+ public ActivityStreamsObject getTarget() {
+ return target;
+ }
+
+ /** {@inheritDoc} */
+ public void setTarget(ActivityStreamsObject target) {
+ this.target = target;
+ }
+
+ /** {@inheritDoc} */
+
+ public String getTitle() {
+ return title;
+ }
+
+ /** {@inheritDoc} */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ /** {@inheritDoc} */
+
+ public String getVerb() {
+ return verb;
+ }
+
+ /** {@inheritDoc} */
+ public void setVerb(String verb) {
+ this.verb = verb;
+ }
+
+ /** {@inheritDoc} */
+ public String getUserId() {
+ return userId;
+ }
+
+ /** {@inheritDoc} */
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+
+ /** {@inheritDoc} */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /** {@inheritDoc} */
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+
+ /** {@inheritDoc} */
+ public String getAppId() {
+ return appId;
+ }
+
+ /** {@inheritDoc} */
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ /** {@inheritDoc} */
+ public String getBcc() {
+ return bcc;
+ }
+
+ /** {@inheritDoc} */
+ public void setBcc(String bcc) {
+ this.bcc = bcc;
+ }
+
+ /** {@inheritDoc} */
+ public String getBto() {
+ return bto;
+ }
+
+ /** {@inheritDoc} */
+ public void setBto(String bto) {
+ this.bto = bto;
+ }
+
+ /** {@inheritDoc} */
+ public String getCc() {
+ return cc;
+ }
+
+ /** {@inheritDoc} */
+ public void setCc(String cc) {
+ this.cc = cc;
+ }
+
+ /** {@inheritDoc} */
+ public String getContext() {
+ return context;
+ }
+
+ /** {@inheritDoc} */
+ public void setContext(String context) {
+ this.context = context;
+ }
+
+ /** {@inheritDoc} */
+ public String getDc() {
+ return dc;
+ }
+
+ /** {@inheritDoc} */
+ public void setDc(String dc) {
+ this.dc = dc;
+ }
+
+ /** {@inheritDoc} */
+ public Date getEndTime() {
+ return endTime;
+ }
+
+ /** {@inheritDoc} */
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ }
+
+ /** {@inheritDoc} */
+ public String getGeojson() {
+ return geojson;
+ }
+
+ /** {@inheritDoc} */
+ public void setGeojson(String geojson) {
+ this.geojson = geojson;
+ }
+
+ /** {@inheritDoc} */
+ public String getInReplyTo() {
+ return inReplyTo;
+ }
+
+ /** {@inheritDoc} */
+ public void setInReplyTo(String inReplyTo) {
+ this.inReplyTo = inReplyTo;
+ }
+
+ /** {@inheritDoc} */
+ public String getLd() {
+ return ld;
+ }
+
+ /** {@inheritDoc} */
+ public void setLd(String ld) {
+ this.ld = ld;
+ }
+
+ /** {@inheritDoc} */
+ public String getLinks() {
+ return links;
+ }
+
+ /** {@inheritDoc} */
+ public void setLinks(String links) {
+ this.links = links;
+ }
+
+ /** {@inheritDoc} */
+ public String getLocation() {
+ return location;
+ }
+
+ /** {@inheritDoc} */
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ /** {@inheritDoc} */
+ public String getMood() {
+ return mood;
+ }
+
+ /** {@inheritDoc} */
+ public void setMood(String mood) {
+ this.mood = mood;
+ }
+
+ /** {@inheritDoc} */
+ public String getOdata() {
+ return odata;
+ }
+
+ /** {@inheritDoc} */
+ public void setOdata(String odata) {
+ this.odata = odata;
+ }
+
+ /** {@inheritDoc} */
+ public String getOpengraph() {
+ return opengraph;
+ }
+
+ /** {@inheritDoc} */
+ public void setOpengraph(String opengraph) {
+ this.opengraph = opengraph;
+ }
+
+ /** {@inheritDoc} */
+ public String getPriority() {
+ return priority;
+ }
+
+ /** {@inheritDoc} */
+ public void setPriority(String priority) {
+ this.priority = priority;
+ }
+
+ /** {@inheritDoc} */
+ public String getRating() {
+ return rating;
+ }
+
+ /** {@inheritDoc} */
+ public void setRating(String rating) {
+ this.rating = rating;
+ }
+
+ /** {@inheritDoc} */
+ public String getResult() {
+ return result;
+ }
+
+ /** {@inheritDoc} */
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ /** {@inheritDoc} */
+ public String getSchema_org() {
+ return schema_org;
+ }
+
+ /** {@inheritDoc} */
+ public void setSchema_org(String schema_org) {
+ this.schema_org = schema_org;
+ }
+
+ /** {@inheritDoc} */
+ public String getSource() {
+ return source;
+ }
+
+ /** {@inheritDoc} */
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ /** {@inheritDoc} */
+ public Date getStartTime() {
+ return startTime;
+ }
+
+ /** {@inheritDoc} */
+ public void setStartTime(Date startTime) {
+ this.startTime = startTime;
+ }
+
+ /** {@inheritDoc} */
+ public String getTags() {
+ return tags;
+ }
+
+ /** {@inheritDoc} */
+ public void setTags(String tags) {
+ this.tags = tags;
+ }
+
+ /** {@inheritDoc} */
+ public String getTo() {
+ return to;
+ }
+
+ /** {@inheritDoc} */
+ public void setTo(String to) {
+ this.to = to;
+ }
+
+ /**
+ * Sorts ActivityEntries in ascending order based on publish date.
+ *
+ * @param that
+ * is the DeserializableActivityEntry to compare to this DeserializableActivityEntry
+ *
+ * @return int represents how the ActivityEntries compare
+ */
+
+ public int compareTo(ActivityStreamsEntry that) {
+ if (this.getPublished() == null && that.getPublished() == null) {
+ return 0; // both are null, equal
+ } else if (this.getPublished() == null) {
+ return -1; // this is null, comes before real date
+ } else if (that.getPublished() == null) {
+ return 1; // that is null, this comes after
+ } else { // compare publish dates in lexicographical order
+ return this.getPublished().compareTo(that.getPublished());
+ }
+ }
+
+
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsMediaLinkImpl.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsMediaLinkImpl.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsMediaLinkImpl.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsMediaLinkImpl.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,123 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.model.impl;
+
+
+import org.apache.rave.portal.model.ActivityStreamsMediaLink;
+
+import java.util.HashMap;
+
+
+
+public class ActivityStreamsMediaLinkImpl implements ActivityStreamsMediaLink{
+
+ private static final long serialVersionUID = 1L;
+
+ private Integer duration;
+
+ private Integer height;
+
+ private String url;
+
+ private Integer width;
+
+ private String id;
+
+ private HashMap openSocial;
+
+
+
+ /**
+ * Create a new MediaLink
+ */
+ public ActivityStreamsMediaLinkImpl() {
+ }
+
+ public String getId(){
+ return id;
+ }
+
+ /** {@inheritDoc} */
+
+ public Integer getDuration() {
+ return duration;
+ }
+
+ /** {@inheritDoc} */
+ public void setDuration(Integer duration) {
+ this.duration = duration;
+
+ }
+
+ /** {@inheritDoc} */
+
+ public Integer getHeight() {
+ return height;
+ }
+
+ /** {@inheritDoc} */
+ public void setHeight(Integer height) {
+ this.height = height;
+
+ }
+
+ /** {@inheritDoc} */
+
+ public String getUrl() {
+ return url;
+ }
+
+ /** {@inheritDoc} */
+ public void setUrl(String url) {
+ this.url = url;
+
+ }
+
+ /** {@inheritDoc} */
+
+ public Integer getWidth() {
+ return width;
+ }
+
+ /** {@inheritDoc} */
+ public void setWidth(Integer width) {
+ this.width = width;
+
+ }
+
+ /** {@inheritDoc} */
+
+ public HashMap getOpenSocial() {
+ return openSocial;
+ }
+
+ /** {@inheritDoc} */
+ public void setOpenSocial(HashMap openSocial) {
+ this.openSocial = openSocial;
+
+ }
+
+
+
+
+
+
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsObjectImpl.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsObjectImpl.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsObjectImpl.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/impl/ActivityStreamsObjectImpl.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,637 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.model.impl;
+
+import com.google.common.collect.Lists;
+import org.apache.rave.portal.model.ActivityStreamsMediaLink;
+import org.apache.rave.portal.model.ActivityStreamsObject;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+
+public class ActivityStreamsObjectImpl implements ActivityStreamsObject {
+
+ private static final long serialVersionUID = 1L;
+
+
+
+ private List<? extends ActivityStreamsObject> attachments;
+
+
+
+ private ActivityStreamsObject author;
+
+
+ private String content;
+
+
+ private String displayName;
+
+
+ private List<String> downstreamDuplicates;
+
+
+ private String id;
+
+ private ActivityStreamsMediaLink image;
+
+
+ private String summary;
+
+
+ private List<String> upstreamDuplicates;
+
+
+ private String alias;
+
+
+ private String attendedBy;
+
+
+ private String attending;
+
+
+ private String dc;
+
+
+ private Date endTime;
+
+
+ private String followers;
+
+
+ private String following;
+
+
+ private String friend_requests;
+
+
+ private String friends;
+
+
+ private String geojson;
+
+
+ private String invited;
+
+
+ private String likes;
+
+
+ private String ld;
+
+
+ private String links;
+
+
+ private String location;
+
+
+ private String maybeAttending;
+
+
+ private String members;
+
+
+ private String notAttendedBy;
+
+
+ private String mood;
+
+
+ private String notAttending;
+
+
+ private String odata;
+
+
+ private String opengraph;
+
+
+ private String rating;
+
+
+ private String replies;
+
+
+ private String reviews;
+
+
+ private String saves;
+
+
+ private String schema_org;
+
+
+ private String shares;
+
+
+ private String source;
+
+
+ private Date startTime;
+
+ private Date published;
+
+
+ private Date updated;
+
+
+ private String url;
+
+
+ private String objectType;
+
+
+ private HashMap openSocial;
+
+
+ private HashMap extensions;
+
+ /**
+ * Constructs an empty ActivityObject.
+ */
+ public ActivityStreamsObjectImpl() {
+ }
+
+
+
+ /** {@inheritDoc} */
+
+ public Date getPublished() {
+ return published;
+ }
+
+ /** {@inheritDoc} */
+ public void setPublished(Date published) {
+ this.published = published;
+ }
+
+ public Date getUpdated(){
+ return updated;
+ }
+
+ public void setUpdated(Date updated){
+ this.updated=updated;
+ }
+
+ public String getUrl(){
+ return this.url;
+ }
+
+ public void setUrl(String url){
+ this.url=url;
+ }
+
+ public String getObjectType(){
+ return this.objectType;
+ }
+
+ public void setObjectType(String objectType){
+ this.objectType=objectType;
+ }
+
+ /** {@inheritDoc} */
+
+ public HashMap getOpenSocial() {
+ return openSocial;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setOpenSocial(HashMap openSocial) {
+
+ this.openSocial = openSocial;
+ }
+
+ /** {@inheritDoc} */
+
+ public HashMap getExtensions() {
+ return extensions;
+ }
+
+ /** {@inheritDoc} */
+ public void setExtensions(HashMap extensions) {
+
+
+ this.extensions = extensions;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+
+ private List<? extends ActivityStreamsObject> getNativeAttachments() {
+ return attachments;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ private void setNativeAttachments(List<? extends ActivityStreamsObject> attachments) {
+ this.attachments = attachments;
+ }
+
+ public List<? extends ActivityStreamsObject> getAttachments() {
+ return this.attachments;
+ }
+
+ public void setAttachments(List<? extends ActivityStreamsObject> attachments) {
+ this.attachments = attachments;
+ }
+
+
+ /** {@inheritDoc} */
+
+ public String getId() {
+ return id;
+ }
+
+ /** {@inheritDoc} */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public ActivityStreamsObject getAuthor() {
+ return author;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAuthor(ActivityStreamsObject author) {
+ this.author = author;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public String getContent() {
+ return content;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public List<String> getDownstreamDuplicates() {
+ return downstreamDuplicates;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setDownstreamDuplicates(List<String> downstreamDuplicates) {
+ this.downstreamDuplicates = downstreamDuplicates;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public ActivityStreamsMediaLink getImage() {
+ return image;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setImage(ActivityStreamsMediaLink image) {
+ this.image = image;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public String getSummary() {
+ return summary;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public List<String> getUpstreamDuplicates() {
+ return upstreamDuplicates;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setUpstreamDuplicates(List<String> upstreamDuplicates) {
+ this.upstreamDuplicates = upstreamDuplicates;
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ public String getAttendedBy() {
+ return attendedBy;
+ }
+
+ public void setAttendedBy(String attendedBy) {
+ this.attendedBy = attendedBy;
+ }
+
+ public String getAttending() {
+ return attending;
+ }
+
+ public void setAttending(String attending) {
+ this.attending = attending;
+ }
+
+ public String getDc() {
+ return dc;
+ }
+
+ public void setDc(String dc) {
+ this.dc = dc;
+ }
+
+ public Date getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ }
+
+ public String getFollowers() {
+ return followers;
+ }
+
+ public void setFollowers(String followers) {
+ this.followers = followers;
+ }
+
+ public String getFollowing() {
+ return following;
+ }
+
+ public void setFollowing(String following) {
+ this.following = following;
+ }
+
+ public String getFriend_requests() {
+ return friend_requests;
+ }
+
+ public void setFriend_requests(String friend_requests) {
+ this.friend_requests = friend_requests;
+ }
+
+ public String getFriends() {
+ return friends;
+ }
+
+ public void setFriends(String friends) {
+ this.friends = friends;
+ }
+
+ public String getGeojson() {
+ return geojson;
+ }
+
+ public void setGeojson(String geojson) {
+ this.geojson = geojson;
+ }
+
+ public String getInvited() {
+ return invited;
+ }
+
+ public void setInvited(String invited) {
+ this.invited = invited;
+ }
+
+ public String getLikes() {
+ return likes;
+ }
+
+ public void setLikes(String likes) {
+ this.likes = likes;
+ }
+
+ public String getLd() {
+ return ld;
+ }
+
+ public void setLd(String ld) {
+ this.ld = ld;
+ }
+
+ public String getLinks() {
+ return links;
+ }
+
+ public void setLinks(String links) {
+ this.links = links;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public String getMaybeAttending() {
+ return maybeAttending;
+ }
+
+ public void setMaybeAttending(String maybeAttending) {
+ this.maybeAttending = maybeAttending;
+ }
+
+ public String getMembers() {
+ return members;
+ }
+
+ public void setMembers(String members) {
+ this.members = members;
+ }
+
+ public String getNotAttendedBy() {
+ return notAttendedBy;
+ }
+
+ public void setNotAttendedBy(String notAttendedBy) {
+ this.notAttendedBy = notAttendedBy;
+ }
+
+ public String getMood() {
+ return mood;
+ }
+
+ public void setMood(String mood) {
+ this.mood = mood;
+ }
+
+ public String getNotAttending() {
+ return notAttending;
+ }
+
+ public void setNotAttending(String notAttending) {
+ this.notAttending = notAttending;
+ }
+
+ public String getOdata() {
+ return odata;
+ }
+
+ public void setOdata(String odata) {
+ this.odata = odata;
+ }
+
+ public String getOpengraph() {
+ return opengraph;
+ }
+
+ public void setOpengraph(String opengraph) {
+ this.opengraph = opengraph;
+ }
+
+ public String getRating() {
+ return rating;
+ }
+
+ public void setRating(String rating) {
+ this.rating = rating;
+ }
+
+ public String getReplies() {
+ return replies;
+ }
+
+ public void setReplies(String replies) {
+ this.replies = replies;
+ }
+
+ public String getReviews() {
+ return reviews;
+ }
+
+ public void setReviews(String reviews) {
+ this.reviews = reviews;
+ }
+
+ public String getSaves() {
+ return saves;
+ }
+
+ public void setSaves(String saves) {
+ this.saves = saves;
+ }
+
+ public String getSchema_org() {
+ return schema_org;
+ }
+
+ public void setSchema_org(String schema_org) {
+ this.schema_org = schema_org;
+ }
+
+ public String getShares() {
+ return shares;
+ }
+
+ public void setShares(String shares) {
+ this.shares = shares;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public Date getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(Date startTime) {
+ this.startTime = startTime;
+ }
+
+
+
+ public List<ActivityStreamsObjectImpl> convertAll(List<ActivityStreamsObjectImpl> objects) {
+ List<ActivityStreamsObjectImpl> entity = Lists.newArrayList();
+ for(ActivityStreamsObjectImpl object : objects) {
+ entity.add(object);
+ }
+ return entity;
+ }
+
+
+
+
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/ActivityStreamsRepository.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/ActivityStreamsRepository.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/ActivityStreamsRepository.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/ActivityStreamsRepository.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.repository;
+
+import org.apache.rave.portal.model.ActivityStreamsEntry;
+
+import java.util.Collection;
+
+public interface ActivityStreamsRepository {
+
+
+
+ public <T extends ActivityStreamsEntry> T save(T e);
+
+ public Collection<? extends ActivityStreamsEntry> getAll();
+
+ public <T extends ActivityStreamsEntry> T getById(String id);
+
+ public Collection<? extends ActivityStreamsEntry> getByUserId(String id);
+
+ public <T extends ActivityStreamsEntry> void delete(T e);
+
+
+ public <T extends ActivityStreamsEntry> void deleteById(String id) ;
+}
Added: rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/ModelUtil.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/ModelUtil.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/ModelUtil.java (added)
+++ rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/util/ModelUtil.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.util;
+
+
+import org.joda.time.DateTime;
+import org.joda.time.format.DateTimeFormatter;
+import org.joda.time.format.ISODateTimeFormat;
+
+import java.util.Date;
+
+public class ModelUtil {
+
+ private ModelUtil() {}
+
+ public static Date stringToDate(String dateString){
+ DateTimeFormatter fmt = ISODateTimeFormat.dateTimeNoMillis();
+ return fmt.parseDateTime(dateString).toDate();
+ }
+
+ public static String dateToString(Date date){
+ DateTimeFormatter fmt = ISODateTimeFormat.dateTimeNoMillis();
+ DateTime dateTime = new DateTime(date);
+ return fmt.print(dateTime);
+ }
+}
Modified: rave/trunk/rave-components/rave-core/src/main/resources/org/apache/rave/core-applicationContext.xml
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/resources/org/apache/rave/core-applicationContext.xml?rev=1440223&r1=1440222&r2=1440223&view=diff
==============================================================================
--- rave/trunk/rave-components/rave-core/src/main/resources/org/apache/rave/core-applicationContext.xml (original)
+++ rave/trunk/rave-components/rave-core/src/main/resources/org/apache/rave/core-applicationContext.xml Tue Jan 29 23:55:08 2013
@@ -49,6 +49,7 @@
<context:component-scan base-package="org.apache.rave.portal.repository"/>
<context:component-scan base-package="org.apache.rave.portal.service"/>
<context:component-scan base-package="org.apache.rave.portal.security"/>
+ <context:component-scan base-package="org.apache.rave.portal.activities"/>
<!-- Password encoding -->
<bean class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" id="passwordEncoder">
Added: rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsEntryTest.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsEntryTest.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsEntryTest.java (added)
+++ rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsEntryTest.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.activities.model.impl;
+
+import org.apache.rave.portal.model.impl.ActivityStreamsEntryImpl;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+public class ActivityStreamsEntryTest {
+ public static ActivityStreamsEntryImpl testEntity() {
+ ActivityStreamsEntryImpl tst = new ActivityStreamsEntryImpl();
+ HashMap<String,String> hm = new HashMap<String,String>();
+ hm.put("TEST", "TEST");
+ hm.put("FOO", "BAR");
+ List<String> ls=new ArrayList<String>();
+ ls.add("faz");
+ ls.add("baz");
+ Date d = new Date(10000);
+
+ tst.setUrl("http://apache.org");
+ tst.setObjectType("COMMENT");
+ tst.setOpenSocial(null);
+ tst.setExtensions(hm);
+ tst.setId("ID_TST");
+ tst.setInReplyTo("REPLY_TO");
+ tst.setStartTime(d);
+ tst.setTo("TO_PERSON");
+ tst.setSource("SOURCE");
+
+ return tst;
+ }
+
+
+}
Added: rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsMediaLinkTest.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsMediaLinkTest.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsMediaLinkTest.java (added)
+++ rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsMediaLinkTest.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.activities.model.impl;
+
+import org.apache.rave.portal.model.impl.ActivityStreamsMediaLinkImpl;
+
+import java.util.HashMap;
+
+public class ActivityStreamsMediaLinkTest {
+ public static ActivityStreamsMediaLinkImpl testEntity() {
+ ActivityStreamsMediaLinkImpl tst = new ActivityStreamsMediaLinkImpl();
+ HashMap<String,String> hm = new HashMap<String,String>();
+ hm.put("OPEN", "SOCIAL");
+ hm.put("FOO", "BAR");
+ hm.put("FAZ", "BAZ");
+
+ tst.setDuration(2);
+ tst.setHeight(4);
+ tst.setUrl("http://eight");
+ tst.setWidth(16);
+
+
+ return tst;
+ }
+
+
+}
Added: rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsObjectTest.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsObjectTest.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsObjectTest.java (added)
+++ rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/model/impl/ActivityStreamsObjectTest.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.activities.model.impl;
+
+import org.apache.rave.portal.model.impl.ActivityStreamsObjectImpl;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.Date;
+
+import static org.junit.Assert.*;
+
+public class ActivityStreamsObjectTest {
+ public static ActivityStreamsObjectImpl testEntity() {
+ ActivityStreamsObjectImpl tst = new ActivityStreamsObjectImpl();
+ HashMap<String,String> hm = new HashMap<String,String>();
+ hm.put("TEST", "TEST");
+ hm.put("FOO", "BAR");
+ List<String> ls=new ArrayList<String>();
+ ls.add("faz");
+ ls.add("baz");
+ Date d = new Date(10000);
+
+ ActivityStreamsObjectImpl author = new ActivityStreamsObjectImpl();
+ author.setDisplayName("apache");
+ author.setContent("foobar");
+
+ tst.setUrl("http://apache.org");
+ tst.setObjectType("COMMENT");
+ tst.setOpenSocial(null);
+ tst.setExtensions(hm);
+ tst.setId("ID_TST");
+ tst.setAuthor(author);
+ tst.setDisplayName("name");
+ tst.setDownstreamDuplicates(ls);
+ tst.setInvited("invited set");
+ tst.setStartTime(d);
+
+ return tst;
+ }
+
+
+ @Test
+ public void convertAllTest() {
+ final int numToTest = 23;
+ List<ActivityStreamsObjectImpl> ll=new LinkedList<ActivityStreamsObjectImpl>();
+ ActivityStreamsObjectImpl tst = testEntity();
+ for(int i = 0; i < numToTest; i ++) {
+ ll.add(tst);
+ tst = testEntity();
+ }
+ List tstList = tst.convertAll(ll);
+ assertEquals(numToTest, tstList.size());
+ }
+}
Added: rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/util/ModelUtilTest.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/util/ModelUtilTest.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/util/ModelUtilTest.java (added)
+++ rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/activities/util/ModelUtilTest.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.activities.util;
+
+import org.apache.rave.portal.util.ModelUtil;
+import org.junit.Test;
+
+import java.util.Date;
+
+import static org.junit.Assert.*;
+
+public class ModelUtilTest {
+ @Test
+ public void stringToDateTest() {
+ Date d1 = new Date(1234567890);
+ String t = ModelUtil.dateToString(d1);
+ Date d2 = ModelUtil.stringToDate(t);
+
+ assertEquals(d1.toString(), d2.toString());
+ }
+
+}
Added: rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaActivityStreamsEntry.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaActivityStreamsEntry.java?rev=1440223&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaActivityStreamsEntry.java (added)
+++ rave/trunk/rave-components/rave-jpa/src/main/java/org/apache/rave/portal/model/JpaActivityStreamsEntry.java Tue Jan 29 23:55:08 2013
@@ -0,0 +1,657 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.model;
+
+import javax.persistence.*;
+import java.util.HashMap;
+import java.util.logging.Logger;
+import java.util.Date;
+
+import org.apache.rave.portal.model.impl.ActivityStreamsEntryImpl;
+import org.apache.rave.portal.model.impl.ActivityStreamsMediaLinkImpl;
+import org.apache.rave.portal.model.impl.ActivityStreamsObjectImpl;
+
+
+@Entity
+@Access(AccessType.FIELD)
+@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
+@Table(name = "activityentry_entityjpa")
+@SequenceGenerator(name="activityEntrySequence", sequenceName = "activity_entry_sequence")
+@NamedQueries({
+ @NamedQuery(name = JpaActivityStreamsEntry.FIND_ALL, query = "SELECT a FROM JpaActivityStreamsEntry a ORDER BY a.updated DESC"),
+ @NamedQuery(name = JpaActivityStreamsEntry.FIND_BY_ID, query = "SELECT a FROM JpaActivityStreamsEntry a WHERE a.id = :id"),
+ @NamedQuery(name = JpaActivityStreamsEntry.FIND_BY_USERID, query = "SELECT a FROM JpaActivityStreamsEntry a WHERE a.userId = :userId ORDER BY a.updated DESC"),
+ @NamedQuery(name = JpaActivityStreamsEntry.FIND_BY_GROUPID, query = "SELECT a FROM JpaActivityStreamsEntry a WHERE a.groupId = :groupId ORDER BY a.updated DESC"),
+ @NamedQuery(name = JpaActivityStreamsEntry.FIND_BY_APPID, query = "SELECT a FROM JpaActivityStreamsEntry a WHERE a.appId = :appId ORDER BY a.updated DESC")
+})
+public class JpaActivityStreamsEntry extends ActivityStreamsEntryImpl {
+
+ private static final long serialVersionUID = 1L;
+ private static Logger log = Logger.getLogger(JpaActivityStreamsEntry.class.getName());
+
+ public static final String FIND_BY_USERID = "JpaActivityStreamsEntry.findByUserId";
+ public static final String FIND_BY_ID = "JpaActivityStreamsEntry.findById";
+ public static final String FIND_ALL = "JpaActivityStreamsEntry.findAll";
+ public static final String FIND_BY_GROUPID = "JpaActivityStreamsEntry.findByGroupId";
+ public static final String FIND_BY_APPID = "JpaActivityStreamsEntry.findByAppId";
+
+
+ @Id
+ @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "activityEntrySequence")
+ private String id;
+
+
+ @ManyToOne(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
+ private ActivityStreamsObject actor;
+
+
+ @Basic
+ private String content;
+
+
+ @ManyToOne(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
+ private ActivityStreamsObject generator;
+
+
+ @OneToOne
+ private ActivityStreamsMediaLink icon;
+
+
+ @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+ private ActivityStreamsItem object;
+
+
+ @ManyToOne(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
+ private ActivityStreamsObject provider;
+
+
+ @ManyToOne(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
+ private ActivityStreamsObject target;
+
+
+ @Basic
+ private String title;
+
+
+ @Basic
+ private String verb;
+
+ //The user who verb'd this activity
+
+ @Basic
+ private String userId;
+
+ //If this activity was generated as part of a group, this indicates the group's id
+
+ @Basic
+ private String groupId;
+
+ //The id of the application that published this activity
+
+ @Basic
+ private String appId;
+
+
+ @Basic
+ private String bcc;
+
+
+ @Basic
+ private String bto;
+
+
+ @Basic
+ private String cc;
+
+
+ @Basic
+ private String context;
+
+
+ @Basic
+ private String dc;
+
+
+ @Basic
+ private Date endTime;
+
+
+ @Basic
+ private String geojson;
+
+
+ @Basic
+ private String inReplyTo;
+
+
+ @Basic
+ private String ld;
+
+
+ @Basic
+ private String links;
+
+
+ @Basic
+ private String location;
+
+
+ @Basic
+ private String mood;
+
+
+ @Basic
+ private String odata;
+
+
+ @Basic
+ private String opengraph;
+
+
+ @Basic
+ private String priority;
+
+
+ @Basic
+ private String rating;
+
+
+ @Basic
+ private String result;
+
+
+ @Basic
+ private String schema_org;
+
+
+ @Basic
+ private String source;
+
+
+ @Basic
+ private Date startTime;
+
+
+ @Basic
+ private String tags;
+
+
+ @Basic
+ private String to;
+
+
+ @Basic
+ @Temporal(javax.persistence.TemporalType.TIMESTAMP)
+ private Date published;
+
+
+ @Basic
+ @Temporal(javax.persistence.TemporalType.TIMESTAMP)
+ private Date updated;
+
+
+ @Basic
+ private String url;
+
+
+ @Basic
+ private String objectType;
+
+
+ @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+ private HashMap openSocial;
+
+
+ @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+ private HashMap extensions;
+
+
+ /**
+ * Create a new empty DeserializableActivityEntry
+ */
+ public JpaActivityStreamsEntry() {
+ }
+
+ /** {@inheritDoc} */
+
+ public Date getPublished() {
+ return published;
+ }
+
+ /** {@inheritDoc} */
+ public void setPublished(Date published) {
+ this.published = published;
+ }
+
+ public Date getUpdated(){
+ return updated;
+ }
+
+ public void setUpdated(Date updated){
+ this.updated=updated;
+ }
+
+ public String getUrl(){
+ return this.url;
+ }
+
+ public void setUrl(String url){
+ this.url=url;
+ }
+
+ public String getObjectType(){
+ return this.objectType;
+ }
+
+ public void setObjectType(String objectType){
+ this.objectType=objectType;
+ }
+
+ /** {@inheritDoc} */
+
+ public HashMap getOpenSocial() {
+ return openSocial;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setOpenSocial(HashMap openSocial) {
+
+ this.openSocial = openSocial;
+ }
+
+ /** {@inheritDoc} */
+
+ public HashMap getExtensions() {
+ return extensions;
+ }
+
+ /** {@inheritDoc} */
+ public void setExtensions(HashMap extensions) {
+
+
+ this.extensions = extensions;
+ }
+
+
+
+
+
+ public ActivityStreamsObject getActor() {
+ return actor;
+ }
+
+ /** {@inheritDoc} */
+ public void setActor(ActivityStreamsObject actor) {
+ this.actor = actor;
+ }
+
+ /** {@inheritDoc} */
+ public String getContent() {
+ return content;
+ }
+
+ /** {@inheritDoc} */
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+
+ /** {@inheritDoc} */
+ public ActivityStreamsObject getGenerator() {
+ return generator;
+ }
+
+ /** {@inheritDoc} */
+ public void setGenerator(ActivityStreamsObject generator) {
+ this.generator = generator;
+ }
+
+ /** {@inheritDoc} */
+ public ActivityStreamsMediaLink getIcon() {
+ return icon;
+ }
+
+ /** {@inheritDoc} */
+ public void setIcon(ActivityStreamsMediaLink icon) {
+ this.icon = icon;
+ }
+
+ /** {@inheritDoc} */
+
+ public String getId() {
+ return id;
+ }
+
+ /** {@inheritDoc} */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /** {@inheritDoc} */
+ public ActivityStreamsItem getObject() {
+ return object;
+ }
+
+ /** {@inheritDoc} */
+ public void setObject(ActivityStreamsItem object) {
+ this.object = object;
+ }
+
+
+
+ /** {@inheritDoc} */
+ public ActivityStreamsObject getProvider() {
+ return provider;
+ }
+
+ /** {@inheritDoc} */
+ public void setProvider(ActivityStreamsObject provider) {
+ this.provider = provider;
+ }
+
+ /** {@inheritDoc} */
+ public ActivityStreamsObject getTarget() {
+ return target;
+ }
+
+ /** {@inheritDoc} */
+ public void setTarget(ActivityStreamsObject target) {
+ this.target = target;
+ }
+
+ /** {@inheritDoc} */
+
+ public String getTitle() {
+ return title;
+ }
+
+ /** {@inheritDoc} */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ /** {@inheritDoc} */
+
+ public String getVerb() {
+ return verb;
+ }
+
+ /** {@inheritDoc} */
+ public void setVerb(String verb) {
+ this.verb = verb;
+ }
+
+ /** {@inheritDoc} */
+ public String getUserId() {
+ return userId;
+ }
+
+ /** {@inheritDoc} */
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+
+ /** {@inheritDoc} */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /** {@inheritDoc} */
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+
+ /** {@inheritDoc} */
+ public String getAppId() {
+ return appId;
+ }
+
+ /** {@inheritDoc} */
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ /** {@inheritDoc} */
+ public String getBcc() {
+ return bcc;
+ }
+
+ /** {@inheritDoc} */
+ public void setBcc(String bcc) {
+ this.bcc = bcc;
+ }
+
+ /** {@inheritDoc} */
+ public String getBto() {
+ return bto;
+ }
+
+ /** {@inheritDoc} */
+ public void setBto(String bto) {
+ this.bto = bto;
+ }
+
+ /** {@inheritDoc} */
+ public String getCc() {
+ return cc;
+ }
+
+ /** {@inheritDoc} */
+ public void setCc(String cc) {
+ this.cc = cc;
+ }
+
+ /** {@inheritDoc} */
+ public String getContext() {
+ return context;
+ }
+
+ /** {@inheritDoc} */
+ public void setContext(String context) {
+ this.context = context;
+ }
+
+ /** {@inheritDoc} */
+ public String getDc() {
+ return dc;
+ }
+
+ /** {@inheritDoc} */
+ public void setDc(String dc) {
+ this.dc = dc;
+ }
+
+ /** {@inheritDoc} */
+ public Date getEndTime() {
+ return endTime;
+ }
+
+ /** {@inheritDoc} */
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ }
+
+ /** {@inheritDoc} */
+ public String getGeojson() {
+ return geojson;
+ }
+
+ /** {@inheritDoc} */
+ public void setGeojson(String geojson) {
+ this.geojson = geojson;
+ }
+
+ /** {@inheritDoc} */
+ public String getInReplyTo() {
+ return inReplyTo;
+ }
+
+ /** {@inheritDoc} */
+ public void setInReplyTo(String inReplyTo) {
+ this.inReplyTo = inReplyTo;
+ }
+
+ /** {@inheritDoc} */
+ public String getLd() {
+ return ld;
+ }
+
+ /** {@inheritDoc} */
+ public void setLd(String ld) {
+ this.ld = ld;
+ }
+
+ /** {@inheritDoc} */
+ public String getLinks() {
+ return links;
+ }
+
+ /** {@inheritDoc} */
+ public void setLinks(String links) {
+ this.links = links;
+ }
+
+ /** {@inheritDoc} */
+ public String getLocation() {
+ return location;
+ }
+
+ /** {@inheritDoc} */
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ /** {@inheritDoc} */
+ public String getMood() {
+ return mood;
+ }
+
+ /** {@inheritDoc} */
+ public void setMood(String mood) {
+ this.mood = mood;
+ }
+
+ /** {@inheritDoc} */
+ public String getOdata() {
+ return odata;
+ }
+
+ /** {@inheritDoc} */
+ public void setOdata(String odata) {
+ this.odata = odata;
+ }
+
+ /** {@inheritDoc} */
+ public String getOpengraph() {
+ return opengraph;
+ }
+
+ /** {@inheritDoc} */
+ public void setOpengraph(String opengraph) {
+ this.opengraph = opengraph;
+ }
+
+ /** {@inheritDoc} */
+ public String getPriority() {
+ return priority;
+ }
+
+ /** {@inheritDoc} */
+ public void setPriority(String priority) {
+ this.priority = priority;
+ }
+
+ /** {@inheritDoc} */
+ public String getRating() {
+ return rating;
+ }
+
+ /** {@inheritDoc} */
+ public void setRating(String rating) {
+ this.rating = rating;
+ }
+
+ /** {@inheritDoc} */
+ public String getResult() {
+ return result;
+ }
+
+ /** {@inheritDoc} */
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ /** {@inheritDoc} */
+ public String getSchema_org() {
+ return schema_org;
+ }
+
+ /** {@inheritDoc} */
+ public void setSchema_org(String schema_org) {
+ this.schema_org = schema_org;
+ }
+
+ /** {@inheritDoc} */
+ public String getSource() {
+ return source;
+ }
+
+ /** {@inheritDoc} */
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ /** {@inheritDoc} */
+ public Date getStartTime() {
+ return startTime;
+ }
+
+ /** {@inheritDoc} */
+ public void setStartTime(Date startTime) {
+ this.startTime = startTime;
+ }
+
+ /** {@inheritDoc} */
+ public String getTags() {
+ return tags;
+ }
+
+ /** {@inheritDoc} */
+ public void setTags(String tags) {
+ this.tags = tags;
+ }
+
+ /** {@inheritDoc} */
+ public String getTo() {
+ return to;
+ }
+
+ /** {@inheritDoc} */
+ public void setTo(String to) {
+ this.to = to;
+ }
+
+
+
+}