abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1173209 [4/49] - in /abdera/abdera2: ./ .settings/ activities/ activities/src/ activities/src/main/ activities/src/main/java/ activities/src/main/java/org/ activities/src/main/java/org/apache/ activities/src/main/java/org/apache/abdera2/ a...
Date Tue, 20 Sep 2011 15:57:20 GMT
Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import java.util.Date;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.activities.model.Collection;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("event")
+public class EventObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -7607925831414516450L;
+  public static final String ATTENDING = "attending";
+  public static final String ENDTIME = "endTime";
+  public static final String MAYBEATTENDING = "maybeAttending";
+  public static final String NOTATTENDING = "notAttending";
+  public static final String STARTTIME = "startTime";
+  
+  public EventObject() {
+  }
+  
+  public EventObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  protected Collection<ASObject> getcol(String name, boolean create) {
+    Collection<ASObject> col = getProperty(name);
+    if (col == null && create) {
+      col = new Collection<ASObject>();
+      setProperty(name,col);
+    }
+    return col;
+  }
+  
+  public Collection<ASObject> getAttending() {
+    return getcol(ATTENDING,false);
+  }
+  
+  public Collection<ASObject> getAttending(boolean create) {
+    return getcol(ATTENDING,create);
+  }
+  
+  public void setAttending(Collection<ASObject> attending) {
+    setProperty(ATTENDING, attending);
+  }
+  
+  public Date getEndTime() {
+    return getProperty(ENDTIME);
+  }
+  
+  public void setEndTime(Date endTime) {
+    setProperty(ENDTIME, endTime);
+  }
+  
+  public Collection<ASObject> getMaybeAttending() {
+    return getcol(MAYBEATTENDING,false);
+  }
+  
+  public Collection<ASObject> getMaybeAttending(boolean create) {
+    return getcol(MAYBEATTENDING,create);
+  }
+  
+  public void setMaybeAttending(Collection<ASObject> maybeAttending) {
+    setProperty(MAYBEATTENDING, maybeAttending);
+  }
+  
+  public Collection<ASObject> getNotAttending() {
+    return getcol(NOTATTENDING,false);
+  }
+  
+  public Collection<ASObject> getNotAttending(boolean create) {
+    return getcol(NOTATTENDING,create);
+  }
+  
+  public void setNotAttending(Collection<ASObject> notAttending) {
+    setProperty(NOTATTENDING, notAttending);
+  }
+  
+  public Date getStartTime() {
+    return getProperty(STARTTIME);
+  }
+  
+  public void setStartTime(Date startTime) {
+    setProperty(STARTTIME, startTime);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+import org.apache.abdera2.common.iri.IRI;
+
+@Name("file")
+public class FileObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -5449136149228249949L;
+  public static final String FILEURL = "fileUrl";
+  
+  public FileObject() {
+  }
+  
+  public FileObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  public IRI getFileUrl() {
+    return getProperty(FILEURL);
+  }
+  
+  public void setFileUrl(IRI fileUrl) {
+    setProperty(FILEURL, fileUrl);
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("group")
+public class GroupObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -8735573352110428150L;
+  
+  public GroupObject() {}
+  
+  public GroupObject(String displayName) {
+    setDisplayName(displayName);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.activities.model.MediaLink;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("image")
+public class ImageObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = 2130182696482757451L;
+  public static final String FULLIMAGE = "fullImage";
+  
+  public ImageObject() {}
+  
+  public ImageObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  public MediaLink getFullImage() {
+    return getProperty(FULLIMAGE);
+  }
+  
+  public void setFullImage(MediaLink fullImage) {
+    setProperty(FULLIMAGE, fullImage);
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASBase;
+import org.apache.abdera2.activities.model.MediaLink;
+
+public class Mood extends ASBase {
+
+  private static final long serialVersionUID = -3361108212621494744L;
+  public static final String IMAGE = "image";
+  public static final String DISPLAYNAME = "displayName";
+  
+  public Mood() {}
+  
+  public Mood(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  public String getDisplayName() {
+    return getProperty(DISPLAYNAME);
+  }
+  
+  public void setDisplayName(String displayName) {
+    setProperty(DISPLAYNAME, displayName);
+  }
+  
+  public MediaLink getImage() {
+    return getProperty(IMAGE);
+  }
+  
+  public void setImage(MediaLink image) {
+    setProperty(IMAGE, image);
+  }
+  
+  public String toString() {
+    return getDisplayName();
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,83 @@
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.iri.IRI;
+
+@org.apache.abdera2.common.anno.Name("name")
+public class NameObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = 5503270370616022868L;
+
+  public NameObject() {
+    super();
+  }
+
+  public String getFamilyName() {
+    return getProperty("familyName");
+  }
+  
+  public void setFamilyName(String val) {
+    setProperty("familyName", val);
+  }
+  
+  public String getFormatted() {
+    return getProperty("formatted");
+  }
+  
+  public void setFormatted(String val) {
+    setProperty("formatted", val);
+  }
+  
+  public String getGivenName() {
+    return getProperty("givenName");
+  }
+  
+  public void setGivenName(String val) {
+    setProperty("givenName", val);
+  }
+  
+  public String getHonorificPrefix() {
+    return getProperty("honorificPrefix");
+  }
+  
+  public void setHonorificPrefix(String val) {
+    setProperty("honorificPrefix", val);
+  }
+  
+  public String getHonorificSuffix() {
+    return getProperty("honorificSuffix");
+  }
+  
+  public void setHonorificSuffix(String val) {
+    setProperty("honorificSuffix", val);
+  }
+  
+  public String getMiddleName() {
+    return getProperty("middleName");
+  }
+  
+  public void setMiddleName(String val) {
+    setProperty("middleName", val);
+  }
+  
+  public String getPronunciation() {
+    return getProperty("pronunciation");
+  }
+  
+  public void setPronunciation(String val) {
+    setProperty("pronunciation", val);
+  }
+  
+  public IRI getPronunciationUrl() {
+    return getProperty("pronunciationUrl");
+  }
+  
+  public void setPronunciationUrl(IRI val) {
+    setProperty("pronunciationUrl", val);
+  }
+  
+  public void setPronunciationUrl(String val) {
+    setPronunciationUrl(new IRI(val));
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("note")
+public class NoteObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -1394391975713468634L;
+  
+  public NoteObject() {}
+  
+  public NoteObject(String displayName) {
+    setDisplayName(displayName);
+  }  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,126 @@
+package org.apache.abdera2.activities.model.objects;
+
+import java.util.Date;
+
+import org.apache.abdera2.activities.io.gson.Properties;
+import org.apache.abdera2.activities.io.gson.Property;
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+import org.apache.abdera2.common.iri.IRI;
+
+@Name("organization")
+@Properties({
+  @Property(name="webpage",to=IRI.class),
+  @Property(name="endDate",to=Date.class),
+  @Property(name="startDate",to=Date.class)
+})
+public class OrganizationObject extends ASObject {
+
+  private static final long serialVersionUID = -6983890349791967283L;
+
+  public OrganizationObject() {}
+  
+  public OrganizationObject(String displayName) {
+    super(displayName);
+  }
+  
+  public Address getAddress() {
+    return getProperty("address");
+  }
+  
+  public void setAddress(Address address) {
+    setProperty("address", address);
+  }
+  
+  public String getDepartment() {
+    return getProperty("department");
+  }
+  
+  public void setDepartment(String dept) {
+    setProperty("department", dept);
+  }
+ 
+  public String getDescription() {
+    return getProperty("description");
+  }
+  
+  public void setDescription(String description) {
+    setProperty("description", description);
+  }
+  
+  public Date getEndDate() {
+    return getProperty("endDate");
+  }
+  
+  public void setEndDate(Date date) {
+    setProperty("endDate", date);
+  }
+  
+  public String getField() {
+    return getProperty("field");
+  }
+  
+  public void setField(String field) {
+    setProperty("field", field);
+  }
+  
+  public String getName() {
+    return getProperty("name");
+  }
+  
+  public void setName(String name) {
+    setProperty("name", name);
+  }
+  
+  public String getSalary() {
+    return getProperty("salary");
+  }
+  
+  public void setSalary(String salary) {
+    setProperty("salary", salary);
+  }
+  
+  public Date getStartDate() {
+    return getProperty("startDate");
+  }
+  
+  public void setStartDate(Date date) {
+    setProperty("startDate", date);
+  }
+  
+  public String getSubfield() {
+    return getProperty("subfield");
+  }
+  
+  public void setSubfield(String val) {
+    setProperty("subfield", val);
+  }
+  
+  public String getTitle() {
+    return getProperty("title");
+  }
+  
+  public void setTitle(String title) {
+    setProperty("title", title);
+  }
+  
+  public String getType() {
+    return getProperty("type");
+  }
+  
+  public void setType(String type) {
+    setProperty("type", type);
+  }
+  
+  public IRI getWebpage() {
+    return getProperty("webpage");
+  }
+  
+  public void setWebpage(IRI val) {
+    setProperty("webpage", val);
+  }
+  
+  public void setWebpage(String val) {
+    setWebpage(new IRI(val));
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,288 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.abdera2.activities.io.gson.Properties;
+import org.apache.abdera2.activities.io.gson.Property;
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+import org.apache.abdera2.common.iri.IRI;
+
+@Name("person")
+@Properties({
+  @Property(name="profileUrl",to=IRI.class),
+  @Property(name="thumbnailUrl",to=IRI.class),
+  @Property(name="urls",to=IRI.class),
+  @Property(name="name",to=NameObject.class),
+  @Property(name="preferredName",to=NameObject.class),
+  @Property(name="nativeName",to=NameObject.class),
+  @Property(name="alternateNames",to=NameObject.class),
+  @Property(name="accounts",to=AccountObject.class),
+  @Property(name="addresses",to=Address.class),
+  @Property(name="organizations",to=OrganizationObject.class)
+})
+public class PersonObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = 5240611684336430061L;
+  
+  public PersonObject() { }
+  
+  public PersonObject(String displayName) {
+    setDisplayName(displayName);
+  }
+
+  public String getAboutMe() {
+    return getProperty("aboutMe");
+  }
+  
+  public void setAboutMe(String val) {
+    setProperty("aboutMe", val);
+  }
+  
+  public String getContactPreference() {
+    return getProperty("contactPreference");
+  }
+  
+  public void setContactPreference(String val) {
+    setProperty("contactPreference", val);
+  }
+  
+  public String getDn() {
+    return getProperty("dn");
+  }
+  
+  public void setDn(String val) {
+    setProperty("dn", val);
+  }
+  
+  public String getPreferredUsername() {
+    return getProperty("preferredUsername");
+  }
+  
+  public void setPreferredUsername(String val) {
+    setProperty("preferredUsername", val);
+  }
+  
+  public IRI getProfileUrl() {
+    return getProperty("profileUrl");
+  }
+  
+  public void setProfileUrl(IRI iri) {
+    setProperty("profileUrl", iri);
+  }
+  
+  public void setProfileUrl(String iri) {
+    setProfileUrl(new IRI(iri));
+  }
+  
+  public String getStatus() {
+    return getProperty("status");
+  }
+  
+  public void setStatus(String status) {
+    setProperty("status", status);
+  }
+  
+  public IRI getThumbnailUrl() {
+    return getProperty("thumbnailUrl");
+  }
+  
+  public void setThumbnailUrl(IRI iri) {
+    setProperty("thumbnailUrl", iri);
+  }
+  
+  public void setThumbnailUrl(String iri) {
+    setThumbnailUrl(new IRI(iri));
+  }
+  
+  public String getUtcOffset() {
+    return getProperty("utcOffset");
+  }
+  
+  public void setUtcOffset(String val) {
+    setProperty("utfOffset",val);
+  }
+  
+  public NameObject getName() {
+    return getProperty("name");
+  }
+  
+  public void setName(NameObject name) {
+    setProperty("name", name);
+  }
+  
+  public NameObject getNativeName() {
+    return getProperty("nativeName");
+  }
+  
+  public void setNativeName(NameObject name) {
+    setProperty("nativeName", name);
+  }
+  
+  public NameObject getPreferredName() {
+    return getProperty("preferredName");
+  }
+  
+  public void setPreferredName(NameObject name) {
+    setProperty("preferredName", name);
+  }
+  
+  public Iterable<NameObject> getAlternateNames() {
+    return getProperty("alternateNames");
+  }
+  
+  public void setAlternateNames(Set<NameObject> set) {
+    setProperty("alternateNames", set);
+  }
+  
+  public void addAlternateName(NameObject name) {
+    Set<NameObject> list = getProperty("alternateNames");
+    if (list == null) {
+      list = new HashSet<NameObject>();
+      setProperty("alternateNames",list);
+    }
+    list.add(name);
+  }
+  
+  public Iterable<String> getEmails() {
+    return getProperty("emails");
+  }
+  
+  public void setEmails(Set<String> set) {
+    setProperty("emails", set);
+  }
+  
+  public void addEmail(String email) {
+    Set<String> list = getProperty("email");
+    if (list == null) {
+      list = new HashSet<String>();
+      setProperty("emails",list);
+    }
+    list.add(email);
+  }
+  
+  public Iterable<String> getIms() {
+    return getProperty("ims");
+  }
+  
+  public void setIms(Set<String> set) {
+    setProperty("ims", set);
+  }
+  
+  public void addIm(String im) {
+    Set<String> list = getProperty("ims");
+    if (list == null) {
+      list = new HashSet<String>();
+      setProperty("ims",list);
+    }
+    list.add(im);
+  }
+  
+  public Iterable<String> getPhoneNumbers() {
+    return getProperty("phoneNumbers");
+  }
+  
+  public void setPhoneNumbers(Set<String> set) {
+    setProperty("phoneNumbers", set);
+  }
+  
+  public void addPhoneNumber(String phoneNumber) {
+    Set<String> list = getProperty("phoneNumbers");
+    if (list == null) {
+      list = new HashSet<String>();
+      setProperty("phoneNumbers",list);
+    }
+    list.add(phoneNumber);
+  }
+  
+  public Iterable<IRI> getUrls() {
+    return getProperty("urls");
+  }
+  
+  public void setUrls(Set<IRI> set) {
+    setProperty("urls", set);
+  }
+  
+  public void addUrl(IRI url) {
+    Set<IRI> list = getProperty("urls");
+    if (list == null) {
+      list = new HashSet<IRI>();
+      setProperty("urls",list);
+    }
+    list.add(url);
+  }
+  
+  public void addUrl(String url) {
+    addUrl(new IRI(url));
+  }
+  
+  public Iterable<Address> getAddresses() {
+    return getProperty("addresses");
+  }
+  
+  public void setAddresses(Set<Address> set) {
+    setProperty("addresses", set);
+  }
+  
+  public void addAddress(Address address) {
+    Set<Address> list = getProperty("addresses");
+    if (list == null) {
+      list = new HashSet<Address>();
+      setProperty("addresses",list);
+    }
+    list.add(address);
+  }
+  
+  public Iterable<AccountObject> getAccounts() {
+    return getProperty("accounts");
+  }
+  
+  public void setAccounts(Set<AccountObject> set) {
+    setProperty("accounts", set);
+  }
+  
+  public void addAccount(AccountObject service) {
+    Set<ServiceObject> list = getProperty("accounts");
+    if (list == null) {
+      list = new HashSet<ServiceObject>();
+      setProperty("accounts",list);
+    }
+    list.add(service);
+  }
+  
+  public Iterable<OrganizationObject> getOrganizations() {
+    return getProperty("organizations");
+  }
+  
+  public void setOrganizations(Set<OrganizationObject> set) {
+    setProperty("organizations", set);
+  }
+  
+  public void addOrganization(OrganizationObject org) {
+    Set<OrganizationObject> list = getProperty("organizations");
+    if (list == null) {
+      list = new HashSet<OrganizationObject>();
+      setProperty("organizations",list);
+    }
+    list.add(org);
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("place")
+public class PlaceObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -8556845441567764050L;
+  public static final String POSITION = "position";
+  public static final String ADDRESS = "address";
+  
+  public PlaceObject() {}
+  
+  public PlaceObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  public String getPosition() {
+    return getProperty(POSITION);
+  }
+  
+  public void setPosition(String position) {
+    setProperty(POSITION, position);
+  }
+  
+  public Address getAddress() {
+    return getProperty(ADDRESS);
+  }
+  
+  public void setAddress(Address address) {
+    setProperty(ADDRESS, address);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.activities.model.MediaLink;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("product")
+public class ProductObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = 8485599939786580223L;
+  public static final String FULLIMAGE = "fullImage";
+  
+  public ProductObject() {}
+  
+  public ProductObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  public MediaLink getFullImage() {
+    return getProperty(FULLIMAGE);
+  }
+  
+  public void setFullImage(MediaLink fullImage) {
+    setProperty(FULLIMAGE, fullImage);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("question")
+public class QuestionObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -691354277218118929L;
+  public static final String OPTIONS = "options";
+  
+  public QuestionObject() {}
+
+  public QuestionObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  public Iterable<ASObject> getOptions() {
+    return getProperty(OPTIONS);
+  }
+  
+  public void setOptions(Set<ASObject> options) {
+    setProperty(OPTIONS, options);
+    
+  }
+  
+  public void addOption(ASObject option) {
+    Set<ASObject> list = getProperty(OPTIONS);
+    if (list == null) {
+      list = new HashSet<ASObject>();
+      setProperty(OPTIONS, list);
+    }
+    list.add(option); 
+  }
+
+}
+

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("review")
+public class ReviewObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -6860912447124744192L;
+  
+  public ReviewObject() {}
+  
+  public ReviewObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("service")
+public class ServiceObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -2801393062155634922L;
+  
+  public ServiceObject() {}
+  
+  public ServiceObject(String displayName) {
+    setDisplayName(displayName);
+  }  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.activities.model.MediaLink;
+import org.apache.abdera2.common.anno.Name;
+@Name("video")
+public class VideoObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = 5394642824444623984L;
+  public static final String EMBEDCODE = "embedCode";
+  public static final String STREAM = "stream";
+  
+  public VideoObject() {}
+  
+  public VideoObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  public String getEmbedCode() {
+    return getProperty(EMBEDCODE);
+  }
+  
+  public void setEmbedCode(String embedCode) {
+    setProperty(EMBEDCODE, embedCode);
+  }
+  
+  public MediaLink getStream() {
+    return getProperty(STREAM);
+  }
+  
+  public void setStream(MediaLink stream) {
+    setProperty(STREAM, stream);
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesCollectionAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesCollectionAdapter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesCollectionAdapter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesCollectionAdapter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+import java.io.IOException;
+import java.util.Date;
+
+import org.apache.abdera2.activities.model.ASBase;
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.activities.model.Collection;
+import org.apache.abdera2.activities.model.objects.PersonObject;
+import org.apache.abdera2.activities.model.objects.ServiceObject;
+import org.apache.abdera2.common.protocol.AbstractCollectionAdapter;
+import org.apache.abdera2.common.protocol.CollectionAdapter;
+import org.apache.abdera2.common.protocol.CollectionInfo;
+import org.apache.abdera2.common.protocol.RequestContext;
+import org.apache.abdera2.common.protocol.ResponseContext;
+import org.apache.abdera2.common.protocol.ResponseContextException;
+
+@SuppressWarnings("unchecked")
+public abstract class AbstractActivitiesCollectionAdapter
+  extends AbstractCollectionAdapter
+  implements CollectionAdapter, 
+             CollectionInfo {
+
+  public String[] getAccepts(RequestContext request) {
+    return new String[] {"application/json"};
+  }
+  
+  protected <S extends ResponseContext>S buildCreateEntryResponse(String link, ASBase base) {
+    ActivitiesResponseContext<ASBase> rc = 
+      new ActivitiesResponseContext<ASBase>(base);
+    rc.setLocation(link);
+    rc.setContentLocation(rc.getLocation().toString());
+    rc.setEntityTag(AbstractActivitiesProvider.calculateEntityTag(base));
+    rc.setStatus(201);
+    return (S)rc;
+  }
+
+  protected <S extends ResponseContext>S buildGetEntryResponse(RequestContext request, ASObject base)
+      throws ResponseContextException {
+      base.setSource(createSourceObject(request));
+      ActivitiesResponseContext<ASObject> rc = 
+        new ActivitiesResponseContext<ASObject>(base);
+      rc.setEntityTag(AbstractActivitiesProvider.calculateEntityTag(base));
+      return (S)rc;
+  }
+
+  protected <S extends ResponseContext>S buildGetFeedResponse(Collection<ASObject> collection) {
+      ActivitiesResponseContext<Collection<ASObject>> rc = 
+        new ActivitiesResponseContext<Collection<ASObject>>(collection);
+      rc.setEntityTag(AbstractActivitiesProvider.calculateEntityTag(collection));
+      return (S)rc;
+  }
+
+  protected ServiceObject createSourceObject(RequestContext request) throws ResponseContextException {
+    ServiceObject object = new ServiceObject();
+    object.setDisplayName(getTitle(request));
+    object.setId(getId(request));
+    PersonObject personObject = new PersonObject();
+    personObject.setDisplayName(getAuthor(request));
+    object.setProperty("author", personObject);
+    return object;
+  }
+  
+  /**
+   * Create the base feed for the requested collection.
+   */
+  protected Collection<ASObject> createCollectionBase(RequestContext request) throws ResponseContextException {
+      Collection<ASObject> collection = 
+        new Collection<ASObject>();
+      collection.setProperty("id", getId(request));
+      collection.setProperty("title", getTitle(request));
+      collection.setProperty("updated", new Date());  
+      PersonObject personObject = new PersonObject();
+      personObject.setDisplayName(getAuthor(request));
+      collection.setProperty("author", personObject);
+      return collection;
+  }
+
+  protected ASObject getEntryFromRequest(RequestContext request) throws ResponseContextException {
+      ASObject object;
+      try {
+          ActivitiesRequestContext context = (ActivitiesRequestContext) request;
+          object = context.getEntity();
+      } catch (IOException e) {
+          throw new ResponseContextException(500, e);
+      }
+      return object;
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesCollectionAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesProvider.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesProvider.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesProvider.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.abdera2.activities.model.ASBase;
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.activities.model.Activity;
+import org.apache.abdera2.activities.model.Collection;
+import org.apache.abdera2.activities.model.TypeAdapter;
+import org.apache.abdera2.common.date.DateTime;
+import org.apache.abdera2.common.http.EntityTag;
+import org.apache.abdera2.common.mediatype.MimeTypeHelper;
+import org.apache.abdera2.common.protocol.BaseProvider;
+import org.apache.abdera2.common.protocol.CollectionRequestProcessor;
+import org.apache.abdera2.common.protocol.EntryRequestProcessor;
+import org.apache.abdera2.common.protocol.RequestContext;
+import org.apache.abdera2.common.protocol.ResponseContext;
+import org.apache.abdera2.common.protocol.TargetType;
+
+public abstract class AbstractActivitiesProvider 
+  extends BaseProvider
+  implements ActivitiesProvider {
+
+  protected Set<TypeAdapter<?>> typeAdapters = new HashSet<TypeAdapter<?>>();
+  
+  protected AbstractActivitiesProvider() {
+    this.requestProcessors.put(
+      TargetType.TYPE_COLLECTION, 
+      new CollectionRequestProcessor() {
+        protected boolean isAcceptableItemType(RequestContext context) {
+          return MimeTypeHelper.isMatch(
+            context.getContentType().toString(), 
+            "application/json");
+        }        
+      });
+    this.requestProcessors.put(
+      TargetType.TYPE_ENTRY, 
+      new EntryRequestProcessor());
+  }
+  
+  public void addTypeAdapter(TypeAdapter<?> typeAdapter) {
+    typeAdapters.add(typeAdapter);
+  }
+  
+  public void removeTypeAdapter(TypeAdapter<?> typeAdapter) {
+    typeAdapters.remove(typeAdapter);
+  }
+  
+  public Set<TypeAdapter<?>> getTypeAdapters() {
+    return typeAdapters;
+  }
+  
+  @SuppressWarnings("unchecked")
+  public <S extends ResponseContext> S createErrorResponse(
+    int code,
+    String message, 
+    Throwable t) {
+      ErrorObject errorObject = new ErrorObject();
+      errorObject.setDisplayName(message);
+      errorObject.setCode(code);
+      ActivitiesResponseContext<ErrorObject> rc = 
+        new ActivitiesResponseContext<ErrorObject>(errorObject);
+      rc.setStatus(code);
+      rc.setStatusText(message);
+      return (S)rc;
+  }
+
+  @Override
+  public <S extends ResponseContext> S process(RequestContext request) {
+    return super.process(
+      request instanceof ActivitiesRequestContext?
+        request:
+        new ActivitiesRequestContext(request));
+  }
+
+  public static EntityTag calculateEntityTag(ASBase base) {
+    String id = null;
+    String modified = null;
+    if (base instanceof Activity) {
+        Activity ac = (Activity)base;
+        id = ac.getId();
+        modified = DateTime.format(ac.getUpdated() != null ? ac.getUpdated() : ac.getPublished());
+    } else if (base instanceof Collection) {
+        Collection<?> col = (Collection<?>)base;
+        id = col.getProperty("id");
+        if (id == null) id = java.util.UUID.randomUUID().toString();
+        modified = col.getProperty("updated");
+    } else if (base instanceof ASObject) {
+        ASObject as = (ASObject)base;
+        id = as.getId().toString();
+        modified = DateTime.format(as.getUpdated() != null ? as.getUpdated() : as.getPublished());
+    }
+    if (modified == null) modified = DateTime.formatNow();
+    return EntityTag.generate(id, modified);
+  }
+  
+  public static String getEditUriFromEntry(ASObject object) {
+    String editLink = object.getProperty("editLink");
+    return editLink;
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.abdera2.activities.model.TypeAdapter;
+import org.apache.abdera2.common.mediatype.MimeTypeHelper;
+import org.apache.abdera2.common.protocol.AbstractWorkspaceProvider;
+import org.apache.abdera2.common.protocol.CollectionRequestProcessor;
+import org.apache.abdera2.common.protocol.EntryRequestProcessor;
+import org.apache.abdera2.common.protocol.Provider;
+import org.apache.abdera2.common.protocol.RequestContext;
+import org.apache.abdera2.common.protocol.ResponseContext;
+import org.apache.abdera2.common.protocol.TargetType;
+import org.apache.abdera2.common.protocol.WorkspaceManager;
+
+public abstract class AbstractActivitiesWorkspaceProvider 
+  extends AbstractWorkspaceProvider
+  implements Provider, 
+             WorkspaceManager,
+             ActivitiesProvider {
+  
+  protected Set<TypeAdapter<?>> typeAdapters = new HashSet<TypeAdapter<?>>();
+  
+  protected AbstractActivitiesWorkspaceProvider() {
+    this.requestProcessors.put(TargetType.TYPE_COLLECTION, 
+        new CollectionRequestProcessor() {
+          protected boolean isAcceptableItemType(RequestContext context) {
+            return MimeTypeHelper.isMatch(
+                context.getContentType().toString(), 
+                "application/json");
+          }
+    });
+    this.requestProcessors.put(TargetType.TYPE_ENTRY, new EntryRequestProcessor());
+  }
+  
+  public void addTypeAdapter(TypeAdapter<?> typeAdapter) {
+    typeAdapters.add(typeAdapter);
+  }
+  
+  public void removeTypeAdapter(TypeAdapter<?> typeAdapter) {
+    typeAdapters.remove(typeAdapter);
+  }
+  
+  public Set<TypeAdapter<?>> getTypeAdapters() {
+    return typeAdapters;
+  }
+  
+  @SuppressWarnings("unchecked")
+  public <S extends ResponseContext> S createErrorResponse(
+    int code,
+    String message, 
+    Throwable t) {
+      ErrorObject errorObject = new ErrorObject();
+      errorObject.setDisplayName(message);
+      errorObject.setCode(code);
+      ActivitiesResponseContext<ErrorObject> rc = 
+        new ActivitiesResponseContext<ErrorObject>(errorObject);
+      rc.setStatus(code);
+      rc.setStatusText(message);
+      return (S)rc;
+  }
+  
+  @Override
+  public <S extends ResponseContext> S process(RequestContext request) {
+    return super.process(
+      request instanceof ActivitiesRequestContext?
+        request:
+        new ActivitiesRequestContext(request));
+  }
+}
\ No newline at end of file

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/AbstractActivitiesWorkspaceProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesProvider.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesProvider.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesProvider.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+import java.util.Set;
+
+import org.apache.abdera2.activities.model.TypeAdapter;
+import org.apache.abdera2.common.protocol.Provider;
+
+public interface ActivitiesProvider extends Provider {
+
+  void addTypeAdapter(TypeAdapter<?> typeAdapter);
+  
+  void removeTypeAdapter(TypeAdapter<?> typeAdapter);
+  
+  Set<TypeAdapter<?>> getTypeAdapters();
+  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesRequestContext.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesRequestContext.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesRequestContext.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesRequestContext.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.activation.MimeType;
+
+import org.apache.abdera2.activities.model.ASBase;
+import org.apache.abdera2.activities.model.IO;
+import org.apache.abdera2.activities.model.TypeAdapter;
+import org.apache.abdera2.common.protocol.BaseRequestContextWrapper;
+import org.apache.abdera2.common.protocol.RequestContext;
+
+public class ActivitiesRequestContext extends BaseRequestContextWrapper {
+
+  private ASBase entity = null;
+  
+  public ActivitiesRequestContext(RequestContext request) {
+    super(request);
+  }
+
+  public IO getIO(TypeAdapter<?>... adapters) {
+    
+    ActivitiesProvider provider = getProvider();
+    Set<TypeAdapter<?>> as = 
+      new HashSet<TypeAdapter<?>>(provider.getTypeAdapters());
+    for (TypeAdapter<?> ta : adapters)
+      as.add(ta);
+    return IO.get(as.toArray(new TypeAdapter[as.size()]));
+  }
+  
+  @SuppressWarnings("unchecked")
+  public <T extends ASBase>T getEntity() throws IOException {
+    try {
+    if (entity == null) {
+      Reader reader = getReader();
+      if (reader != null)
+        entity = getIO().read(reader);
+      else // try input stream, but this should've worked
+        entity = getIO().read(getInputStream(), "UTF-8");
+    }
+    } catch (Throwable t) {
+      t.printStackTrace();
+    }
+    setDocProperties(entity);
+    return (T)entity;
+  }
+  
+  private void setDocProperties(ASBase base) {
+    String etag = getHeader("ETag");
+    if (etag != null)
+        base.setEntityTag(etag);
+    Date lm = getDateHeader("Last-Modified");
+    if (lm != null)
+        base.setLastModified(lm);
+    MimeType mt = getContentType();
+    if (mt != null)
+        base.setContentType(mt.toString());
+    String language = getContentLanguage();
+    if (language != null)
+        base.setLanguage(language);
+    String slug = getSlug();
+    if (slug != null)
+        base.setSlug(slug);
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesRequestContext.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.activation.MimeType;
+
+import org.apache.abdera2.activities.model.ASBase;
+import org.apache.abdera2.common.protocol.AbstractResponseContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class ActivitiesResponseContext<T extends ASBase>    
+  extends AbstractResponseContext  {
+  
+  private final static Log log = LogFactory.getLog(ActivitiesResponseContext.class);
+  
+  private final T base;
+  private final boolean chunked;
+  
+  public ActivitiesResponseContext(T base) {
+    this(base, true);
+  }
+  
+  public ActivitiesResponseContext(T base, boolean chunked) {
+    log.debug(String.format("Entity: %s", base.toString()));
+    log.debug(String.format("Chunked? %s", chunked));
+    this.base = base;
+    setStatus(200);
+    setStatusText("OK");
+    this.chunked = chunked;
+    try {
+        MimeType type = getContentType();
+        String charset = type.getParameter("charset");
+        if (charset == null)
+          type.setParameter("charset", "UTF-8");
+        setContentType(type.toString());
+    } catch (Exception e) {
+    }
+    log.debug(String.format("Content-Type: %s", getContentType()));
+  }
+   
+  public T getEntity() {
+    return base;
+  }
+
+  public boolean hasEntity() {
+    return (base != null);
+  }
+
+  public void writeTo(java.io.Writer javaWriter) throws IOException {
+    log.debug("Writing...");
+    if (hasEntity())
+      base.writeTo(javaWriter);
+  }
+
+  public void writeTo(OutputStream out) throws IOException {
+    log.debug("Writing...");
+    if (hasEntity())
+      base.writeTo(out);
+  }
+
+  public MimeType getContentType() {
+    try {
+      return new MimeType("application/json");
+    } catch (Throwable t) {
+      throw new RuntimeException(t); // won't happen
+    }
+  }
+
+  public long getContentLength() {
+    long len = super.getContentLength();
+    if (hasEntity() && len == -1 && !chunked) {
+        try {
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            base.writeTo(out);
+            len = out.size();
+            super.setContentLength(len);
+        } catch (Exception e) {
+        }
+    }
+    log.debug(String.format("Content-Length: %d", len));
+    return len;
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesResponseContext.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesServiceManager.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesServiceManager.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesServiceManager.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesServiceManager.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+import java.util.Map;
+
+import org.apache.abdera2.activities.model.IO;
+import org.apache.abdera2.activities.model.TypeAdapter;
+import org.apache.abdera2.common.Discover;
+import org.apache.abdera2.common.Localizer;
+import org.apache.abdera2.common.protocol.AbstractServiceManager;
+import org.apache.abdera2.common.protocol.Provider;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * The ServiceManager is used by the AbderaServlet to bootstrap the server 
+ * instance. There should be little to no reason why an end user would need 
+ * to use this class directly.
+ */
+public class ActivitiesServiceManager
+  extends AbstractServiceManager<Provider> {
+
+    private final static Log log = LogFactory.getLog(ActivitiesServiceManager.class);
+
+    public ActivitiesServiceManager() {}
+
+    public static IO getIO(TypeAdapter<?>... adapters) {
+      return IO.get(adapters);
+    }
+    
+    public Provider newProvider(Map<String, String> properties) {
+        String instance = properties.get(PROVIDER);
+        if (instance == null)
+            instance = DefaultActivitiesProvider.class.getName();
+        log.debug(Localizer.sprintf("CREATING.NEW.INSTANCE", "Provider"));
+        Provider provider = Discover.locate(Provider.class, instance);
+        log.debug(Localizer.sprintf("INITIALIZING.INSTANCE", "Provider"));
+        provider.init(properties);
+        return provider;
+    }
+    
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ActivitiesServiceManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/DefaultActivitiesProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/DefaultActivitiesProvider.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/DefaultActivitiesProvider.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/DefaultActivitiesProvider.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+import java.util.Collection;
+
+import javax.security.auth.Subject;
+
+import org.apache.abdera2.common.misc.Resolver;
+import org.apache.abdera2.common.protocol.DefaultWorkspaceManager;
+import org.apache.abdera2.common.protocol.Request;
+import org.apache.abdera2.common.protocol.RequestContext;
+import org.apache.abdera2.common.protocol.RouteManager;
+import org.apache.abdera2.common.protocol.Target;
+import org.apache.abdera2.common.protocol.TargetBuilder;
+import org.apache.abdera2.common.protocol.TargetType;
+import org.apache.abdera2.common.protocol.WorkspaceInfo;
+import org.apache.abdera2.common.protocol.WorkspaceManager;
+
+public class DefaultActivitiesProvider
+  extends AbstractActivitiesProvider {
+
+  protected WorkspaceManager workspaceManager;
+  protected Resolver<Target,RequestContext> targetResolver;
+  protected Resolver<Subject,Request> subjectResolver;
+  protected TargetBuilder<?> targetBuilder;
+  protected RouteManager<TargetType,RequestContext> routeManager;
+  
+  public DefaultActivitiesProvider() {
+    this("/");
+  }
+  
+  @SuppressWarnings({ "unchecked", "rawtypes" })
+  public DefaultActivitiesProvider(String base) {
+    if (base == null) base = "/";
+    workspaceManager = new DefaultWorkspaceManager();
+    routeManager =
+        new RouteManager()
+          .addRoute("stream", base + ":stream", TargetType.TYPE_COLLECTION)
+          .addRoute("activity", base + ":stream/:activity", TargetType.TYPE_ENTRY)
+        ;
+    targetBuilder = routeManager;
+    targetResolver = routeManager;
+  }
+  
+  @SuppressWarnings("rawtypes")
+  public RouteManager getRouteManager() {
+      return routeManager;
+  }
+
+  protected Resolver<Target,RequestContext> getTargetResolver(RequestContext request) {
+      return targetResolver;
+  }
+
+  public void setTargetResolver(Resolver<Target,RequestContext> targetResolver) {
+      this.targetResolver = targetResolver;
+  }
+
+  protected Resolver<Subject,Request> getSubjectResolver(RequestContext request) {
+      return subjectResolver;
+  }
+
+  public void setSubjectResolver(Resolver<Subject,Request> subjectResolver) {
+      this.subjectResolver = subjectResolver;
+  }
+
+  public Resolver<Target,RequestContext> getTargetResolver() {
+      return targetResolver;
+  }
+
+  public Resolver<Subject,Request> getSubjectResolver() {
+      return subjectResolver;
+  }
+
+  protected WorkspaceManager getWorkspaceManager(RequestContext request) {
+      return getWorkspaceManager();
+  }
+
+  public WorkspaceManager getWorkspaceManager() {
+      return workspaceManager;
+  }
+
+  public void setWorkspaceManager(WorkspaceManager workspaceManager) {
+      this.workspaceManager = workspaceManager;
+  }
+
+  @SuppressWarnings("rawtypes")
+  public TargetBuilder getTargetBuilder() {
+      return (TargetBuilder)targetBuilder;
+  }
+
+  public void setTargetBuilder(TargetBuilder<?> targetBuilder) {
+      this.targetBuilder = targetBuilder;
+  }
+
+  public void addWorkspace(WorkspaceInfo workspace) {
+      ((DefaultWorkspaceManager)getWorkspaceManager()).addWorkspace(workspace);
+  }
+
+  public void addWorkspaces(Collection<WorkspaceInfo> workspaces) {
+      for (WorkspaceInfo w : workspaces) {
+          ((DefaultWorkspaceManager)getWorkspaceManager()).addWorkspace(w);
+      }
+  }
+
+  @SuppressWarnings("rawtypes")
+  protected TargetBuilder getTargetBuilder(Request request) {
+      return (TargetBuilder)targetBuilder;
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/DefaultActivitiesProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ErrorObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ErrorObject.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ErrorObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ErrorObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+import org.apache.abdera2.activities.io.gson.Properties;
+import org.apache.abdera2.activities.io.gson.Property;
+import org.apache.abdera2.activities.model.ASObject;
+
+@Properties(
+@Property(name="code",to=Integer.class)
+)
+public class ErrorObject extends ASObject {
+  private static final long serialVersionUID = 2361855511692036786L;
+  public static final String TYPE = "error";
+  public ErrorObject() {
+    super(TYPE);
+  }  
+  public ErrorObject(String displayName) {
+    super(TYPE);
+    setDisplayName(displayName);
+  }
+  public String getObjectType() {
+    return TYPE;
+  }
+  public void setObjectType(String objectType) {
+    throw new IllegalStateException();
+  }
+  public int getCode() {
+    return (Integer)getProperty("code");
+  }
+  public void setCode(int code) {
+    setProperty("code",code);
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ErrorObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  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.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.protocol;
+
+public class ProtocolException extends RuntimeException {
+
+    private static final long serialVersionUID = 1017447143200419489L;
+    private final ErrorObject error;
+
+    public ProtocolException(ErrorObject error) {
+        super(String.format("%d::%s",error.getCode(),error.getDisplayName()));
+        this.error = error;
+    }
+
+    public ProtocolException(int code, String message) {
+        super(String.format("%d::%s",code,message));
+        this.error = new ErrorObject();
+        error.setDisplayName(message);
+        error.setCode(code);
+    }
+
+    public ErrorObject getError() {
+        return error;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        String message = error != null ? error.getDisplayName() : null;
+        int code = error != null ? error.getCode() : 0;
+        result = prime * result + ((message == null) ? 0 : message.hashCode());
+        result = prime * result + code;
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        final ProtocolException other = (ProtocolException)obj;
+        String message = error != null ? error.getDisplayName() : null;
+        int code = error != null ? error.getCode() : 0;
+        String omessage = other.error != null ? other.error.getDisplayName() : null;
+        int ocode = other.error != null ? other.error.getCode() : 0;
+        if (message == null) {
+            if (omessage != null)
+                return false;
+        } else if (!message.equals(omessage))
+            return false;
+        if (code != ocode)
+            return false;
+        return true;
+    }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/protocol/ProtocolException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message