From 4c06511fe563c66fb73cd55dd7ef6135d9ac0fce Mon Sep 17 00:00:00 2001
From: kebernet The "audio" Object type represents audio content.
* The "event" object type represents an event that occurs in a
+ * certain place during a particular interval of time.
+ * The object type URL for the "event" object type is http://activitystrea.ms/schema/1.0/event.
+ * An event has the following additional components:
+ * Location is a concept which can be used inside the atom:entry
+ * level, atom:author and activity:object. Location can be specified
+ * via geographic coordinates, a street address, a free-form location
+ * name or a combination of these. Geographic coordinates should be
+ * included as a geo:point element as described by the GeoRSS
+ * specification. Addresses should be included using a poco:address
+ * element defined at Portable Contacts specification. The entry level
+ * location represents the location of the author at the time the
+ * activity was performed. The author level location represents the
+ * primary location of the author. Finally, the location within other
+ * objects represents the physical location of those objects. All
+ * location fields are optional. For free form addresses use the
+ * poco:formatted field.
+ * Figure 1 (Location Example)
+ *
+ *
+ * @author robert.cooper
+ */
+public class Event extends ActivityObject {
+
+ @Override
+ public String getTypeIRI() {
+ return "http://activitystrea.ms/schema/1.0/event";
+ }
+
+}
diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/HasLocation.java b/src/main/java/org/rometools/feed/module/activitystreams/types/HasLocation.java
new file mode 100644
index 0000000..2ec3ec8
--- /dev/null
+++ b/src/main/java/org/rometools/feed/module/activitystreams/types/HasLocation.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2011 robert.cooper.
+ *
+ * Licensed 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.
+ * under the License.
+ */
+
+package org.rometools.feed.module.activitystreams.types;
+
+import org.rometools.feed.module.georss.GeoRSSModule;
+import org.rometools.feed.module.portablecontacts.ContactModule;
+
+/**
+ *
+ *
+ *
+ *
<entry> + * <id>tag:world:activity:1212121212121</id> + * <title>Rob liked Goldeberg's Deli</title> + * <author> + * <name>Rob Dolin</name> + * <id>tag:world:person:1212121212121</id> + * <link rel="alternate" type="text/html" href="http://robdolin.com" /> + * <poco:address> + * <poco:locality>Marina del Rey</poco:locality> + * <poco:region>CA</poco:region> + * <poco:postalCode>90292</poco:postalCode> + * <poco:country>US</poco:country> + * </poco:address> + * </author> + * <activity:object> + * <activity:object-type>http://activitystrea.ms/schema/1.0/place</object-type> + * <id>tag:world:place:1212121212121</id> + * <title>Goldberg's Deli</title> + * <link rel="alternate" type="text/html" href="http://www.deli.com" /> + * <geo:point>33.9777 -118.4351</geo:point> + * <poco:address> + * <poco:streetAddress>14016 Bora Bora Way</poco:streetAddress> + * <poco:locality>Marina del Rey</poco:locality> + * <poco:region>CA</poco:region> + * <poco:postalCode>90292</poco:postalCode> + * <poco:country>US</poco:country> + * </poco:address> + * </activity:object> + * <geo:point>33.9777 -119.4351</geo:point> + * <activity:verb>http://activitystrea.ms/schema/1.0/like</activity:verb> + *</entry>
+ *
Figure 1: Location Example |
Mood describes the mood of the user when the activity was + * performed. This is usually collected via an extra field in the user + * interface used to perform the activity. For the purpose of this + * schema, a mood is a freeform, short mood keyword or phrase along + * with an optional mood icon image. + *
+ *Moods are included via a mood element in the namespace http://activitystrea.ms/context/. + *
+ *The content of the mood element is the mood keyword or + * phrase. + *
+ *The mood element may have an optional icon + * attribute which contains the URL of a mood icon image. The mood icon + * image SHOULD be small and appropriate to be displayed alongside the + * mood keyword at a normal text size. + *
+ * @author robert.cooper + */ +public class Mood { + private String iconUrl; + private String text; + + /** + * Set the value of iconUrl + * + * @param newiconUrl new value of iconUrl + */ + public void setIconUrl(String newiconUrl) { + this.iconUrl = newiconUrl; + } + + /** + * Get the value of iconUrl + * + * @return the value of iconUrl + */ + public String getIconUrl() { + return this.iconUrl; + } + + /** + * Set the value of text + * + * @param newtext new value of text + */ + public void setText(String newtext) { + this.text = newtext; + } + + /** + * Get the value of text + * + * @return the value of text + */ + public String getText() { + return this.text; + } +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Photo.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Photo.java new file mode 100644 index 0000000..6f57edb --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Photo.java @@ -0,0 +1,55 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.activitystreams.types; + +/** + *The "photo" object type represents a graphical still image. + *
+ *The "photo" Object type is identified by the URI http://activitystrea.ms/schema/1.0/photo. + *
+ *A photo has the following additional components: + *
+ * + *+ * @author robert.cooper + */ +public class Photo extends ActivityObject { + + @Override + public String getTypeIRI() { + return "http://activitystrea.ms/schema/1.0/photo"; + } + + + +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/PhotoAlbum.java b/src/main/java/org/rometools/feed/module/activitystreams/types/PhotoAlbum.java new file mode 100644 index 0000000..2e4e2a1 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/PhotoAlbum.java @@ -0,0 +1,47 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.activitystreams.types; + +/** + *+ *
- Thumbnail
+ *- A link to a thumbnail version of the + * image. Represented by the Representative Image component of the + * base Object Construct. Processors MAY ignore thumbnails that are + * of an inappropriate size for their user interface. + *
+ *- Larger Image
+ *- A Media Link Construct linking to a + * larger -- ideally, full-size -- version of the photo intended + * for standalone viewing. Represented in JSON as a property named + * fullImage whose value is a JSON + * object with properties as defined in [TODO: xref the JSON + * serialization of a Media Link Construct]. + *
+ *
The "photo album" object type represents a collection of + * images. + *
+ *The "photo album" object type is identified by the URI http://activitystrea.ms/schema/1.0/photo-album. + *
+ *The photo album has the following additional components: + *
+ * + *+ * @author robert.cooper + */ +public class PhotoAlbum extends ActivityObject { + + @Override + public String getTypeIRI() { + return "http://activitystrea.ms/schema/1.0/photo-album"; + } + +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Place.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Place.java new file mode 100644 index 0000000..4d650b0 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Place.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.activitystreams.types; + +/** + *+ *
- Preview Image Link
+ *- A Media Link Construct + * describing an image file that can be used as a preview image for + * the album. Represented by the Representative Image component of + * the base Object Construct. Processors MAY ignore thumbnails that + * are of an inappropriate size for their user interface. + *
+ *
The "place" object type represents a location on Earth. + *
+ *The "place" object type is identified by the URI http://activitystrea.ms/schema/1.0/place. + *
+ *A place has the following additional components: + *
+ * + *+ * @author robert.cooper + */ +public class Place extends ActivityObject { + + @Override + public String getTypeIRI() { + return "http://activitystrea.ms/schema/1.0/place"; + } + +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Playlist.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Playlist.java new file mode 100644 index 0000000..dfea5e8 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Playlist.java @@ -0,0 +1,38 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.activitystreams.types; + +/** + * + *+ *
- Latitude
+ *- The latitude of the place as a point on + * Earth. Represented in JSON as a property named latitude whose value is a JSON number + * containing a decimal representation of the latitude in + * degrees. + *
+ *- Longitude
+ *- The longitude of the place as a point on + * Earth. Represented in JSON as a property named longitude whose value is a JSON number + * containing a decimal representation of the longitude in + * degrees. + *
+ *
The "playlist" object type represents an ordered list of + * time-based media items, such as video and audio objects. + *
+ *The "playlist" object type is identified by the URI http://activitystrea.ms/schema/1.0/playlist. + *
+ *A playlist has no additional components. + *
+ * @author robert.cooper + */ +public class Playlist extends ActivityObject { + + @Override + public String getTypeIRI() { + return "http://activitystrea.ms/schema/1.0/playlist"; + } + +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Product.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Product.java new file mode 100644 index 0000000..efee22d --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Product.java @@ -0,0 +1,54 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.activitystreams.types; + +/** + *The "product" object type represents a commercial good or + * service. + *
+ *The "product" object type is identified by the URI http://activitystrea.ms/schema/1.0/product. + *
+ *A product has the following additional components: + *
+ * + *+ * @author robert.cooper + */ +public class Product extends ActivityObject { + + @Override + public String getTypeIRI() { + return "http://activitystrea.ms/schema/1.0/product"; + } + +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Review.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Review.java new file mode 100644 index 0000000..06df4b8 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Review.java @@ -0,0 +1,69 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.activitystreams.types; + +/** + *+ *
- Thumbnail
+ *- A link to a thumbnail-sized image that + * contains a photo of the product. Represented by the + * Representative Image component of the base Object Construct. + * Processors MAY ignore thumbnails that are of an inappropriate + * size for their user interface. + *
+ *- Larger Image
+ *- A Media Link Construct linking to a + * larger -- ideally, full-size -- version of the photo of the + * product. Represented in JSON as a property named fullImage whose value is a JSON object with + * properties as defined in [TODO: xref the JSON serialization of a + * Media Link Construct]. + *
+ *
The "review" object type represents a primarily prose-based + * commentary on another object. + *
+ *The "review" object type is identified by the URI http://activitystrea.ms/schema/1.0/review. + *
+ *A review has the following additional components: + *
+ * + *+ * @author robert.cooper + */ +public class Review extends ActivityObject { + + @Override + public String getTypeIRI() { + return "http://activitystrea.ms/schema/1.0/review"; + } + +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Service.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Service.java new file mode 100644 index 0000000..b7d5584 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Service.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.activitystreams.types; + +/** + *+ *
- Title
+ *- The title of the review. Represented by the + * Name component of the base Object Construct. Many systems do not + * have the concept of a title for a review; such systems MUST omit + * the Name component. Processors SHOULD refer to such reviews as + * simply being "a review", with appropriate localization, if they + * are to be described in a sentence. + *
+ *- Content
+ *- The content of the comment. Represented in + * JSON as a property called content + * whose value is a JSON string containing a fragment of HTML that + * represents the content. Publishers SHOULD include any markup + * necessary to achieve a similar presentation to that on the + * publisher's own HTML pages, including any links that the service + * automatically adds. Processors MAY remove all HTML markup and + * consider the comment to be plain text. + *
+ *- Reviewed Object
+ *- The Object Construct representing + * the item that this review applies to. Represented as the In + * Reply To Object component of the base Object Construct. + *
+ *- Rating
+ *- A rating for the item, given as a number + * between 1.0 and 5.0 inclusive with one decimal place of + * precision. Represented in JSON as a property called rating whose value is a JSON number giving + * the rating. + *
+ *
The "service" Object type represents a website, personal website + * or blog, business, brand, or other entity that performs some kind of + * work for other entities, people, or services, or acts as kind of + * container for other objects. + *
+ *The "service" Object type is identified by the URI http://activitystrea.ms/schema/1.0/service. + *
+ *A service has the following additional components: + *
+ * + *+ * @author robert.cooper + */ +public class Service extends ActivityObject { + + @Override + public String getTypeIRI() { + return "http://activitystrea.ms/schema/1.0/service"; + } + +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Song.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Song.java new file mode 100644 index 0000000..d6be3ef --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Song.java @@ -0,0 +1,62 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ +package org.rometools.feed.module.activitystreams.types; + + +/** + *+ *
- icon
+ *- A Media Link Construct representing a link to + * a small image representing the service. Represented in JSON as a + * property named icon whose value is a + * JSON object with properties as defined in [TODO: xref the JSON + * serialization of a Media Link Construct]. The linked image MUST + * have an aspect ratio of one (horizontal) to one (vertical) and + * SHOULD be suitable for presentation at a small size. + *
+ *
The "song" Object type represents a song or a recording of a + * song. + *
+ *Objects of type Song might contain information about the song or + * recording, or they might contain some representation of the + * recording itself. In the latter case, the song SHOULD also be + * annotated with the "audio" object type as described in Section 3.2.2 (Audio) and use its properties. This type should only + * be used when the publisher can guarantee that the object is a song + * rather than merely a generic audio stream. + *
+ *The Object type URL for the "song" Object type is http://activitystrea.ms/schema/1.0/song. + *
+ *A song has no additional components. + *
+ * @author robert.cooper + */ +public class Song extends ActivityObject { + private Audio audio; + + /** + * Set the value of audio + * + * @param newaudio new value of audio + */ + public void setAudio(Audio newaudio) { + this.audio = newaudio; + } + + /** + * Get the value of audio + * + * @return the value of audio + */ + public Audio getAudio() { + return this.audio; + } + + @Override + public String getTypeIRI() { + return "http://activitystrea.ms/schema/1.0/song"; + } +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Status.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Status.java new file mode 100644 index 0000000..7636474 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Status.java @@ -0,0 +1,46 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.activitystreams.types; + +/** + *The "status" Object type represents a human-readable update of + * the author's situation, mood, location or other status. + *
+ *A status is similar in structure to a note, but carries the + * additional meaning that the content is primarily describing + * something its author is doing, feeling or experiencing. + *
+ *A consumers MAY consider the content of the most recent status + * object it encountered to be the user's current status, unless the + * most recent status update is old. When a status becomes too old is + * not defined by this specification. + *
+ *The "status" object type is identified by the URI http://activitystrea.ms/schema/1.0/status. + *
+ *A status has the same components as a note. + *
+ * @author robert.cooper + */ +public class Status extends ActivityObject { + + @Override + public String getTypeIRI() { + return "http://activitystrea.ms/schema/1.0/status"; + } + +} diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Verb.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Verb.java index e6b1454..9f2b0f3 100644 --- a/src/main/java/org/rometools/feed/module/activitystreams/types/Verb.java +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Verb.java @@ -10,15 +10,12 @@ * 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 + * See the icense for the specific language governing permissions and * limitations under the License. * under the License. */ package org.rometools.feed.module.activitystreams.types; -import java.util.HashMap; -import java.util.Map; - /** * @@ -129,9 +126,61 @@ public enum Verb { * * The "update" Verb is identified by the URI http://activitystrea.ms/schema/1.0/update. */ - UPDATE("http://activitystrea.ms/schema/1.0/update"); + UPDATE("http://activitystrea.ms/schema/1.0/update"), + /** + * + *The "positive RSVP" verb indicates that the actor has made a + * positive RSVP for the object. This specification only defines the + * meaning of this verb when its object is an event (see Section 4.2.1 (Event)), though implementors SHOULD be prepared to + * handle other object types as meaning MAY be provided by extension + * specifications. + *
+ *The use of this Verb is only appropriate when the RSVP was + * created by an explicit action by the actor. It is not appropriate to + * use this verb when a user has been added as an attendee by an event + * organiser or administrator. + *
+ *The verb URI for the "positive RSVP" Verb is http://activitystrea.ms/schema/1.0/rsvp-yes. + *
+ */ + RSVP_YES("http://activitystrea.ms/schema/1.0/rsvp-yes"), + /** + *The "possible RSVP" verb indicates that the actor has made a + * possible RSVP for the object. This specification only defines the + * meaning of this verb when its object is an event (see Section 4.2.1 (Event)), though implementors SHOULD be prepared to + * handle other object types as meaning MAY be provided by extension + * specifications. + *
+ *The use of this Verb is only appropriate when the RSVP was + * created by an explicit action by the actor. It is not appropriate to + * use this verb when a user has been added as an attendee by an event + * organiser or administrator. + *
+ *The verb URI for the "possible RSVP" Verb is http://activitystrea.ms/schema/1.0/rsvp-maybe. + *
+ */ + RSVP_MAYBE("http://activitystrea.ms/schema/1.0/rsvp-maybe"), + /** + *The "negative RSVP" verb indicates that the actor has made a + * negative RSVP for the object. This specification only defines the + * meaning of this verb when its object is an event (see Section 4.2.1 (Event)), though implementors SHOULD be prepared to + * handle other object types as meaning MAY be provided by extension + * specifications. + *
+ *The use of this Verb is only appropriate when the RSVP was + * created by an explicit action by the actor. It is not appropriate to + * use this verb when a user has been added as an attendee by an event + * organiser or administrator. + *
+ *The verb URI for the "negative RSVP" Verb is http://activitystrea.ms/schema/1.0/rsvp-no. + *
+ */ + RSVP_NO("http://activitystrea.ms/schema/1.0/rsvp-no"); private final String iri; + /** + * @param iri + */ Verb(final String iri){ this.iri = iri; } @@ -140,7 +189,11 @@ public enum Verb { public String toString(){ return iri; } - + /** + * + * @param iri + * @return + */ public static Verb fromIRI(String iri){ for(Verb v: Verb.values()){ if(v.toString().equals(iri)){ diff --git a/src/main/java/org/rometools/feed/module/activitystreams/types/Video.java b/src/main/java/org/rometools/feed/module/activitystreams/types/Video.java new file mode 100644 index 0000000..4044c86 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/activitystreams/types/Video.java @@ -0,0 +1,48 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.activitystreams.types; + +/** + *The "video" Object type represents video content, which usually + * consists of a motion picture track and an audio track. + *
+ *The "video" Object type is identified by the URI http://activitystrea.ms/schema/1.0/video. + *
+ *A video has the following additional components: + *
+ * + *+ * @author robert.cooper + */ +public class Video { + +} diff --git a/src/main/java/org/rometools/feed/module/atomthread/ThreadModule.java b/src/main/java/org/rometools/feed/module/atomthread/ThreadModule.java new file mode 100644 index 0000000..37ef9d3 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/atomthread/ThreadModule.java @@ -0,0 +1,26 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.atomthread; + +/** + * + * @author robert.cooper + */ +public interface ThreadModule { + +} diff --git a/src/main/java/org/rometools/feed/module/atomthread/package.html b/src/main/java/org/rometools/feed/module/atomthread/package.html new file mode 100644 index 0000000..9bedc75 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/atomthread/package.html @@ -0,0 +1 @@ +http://www.ietf.org/rfc/rfc4685.txt diff --git a/src/main/java/org/rometools/feed/module/base/CustomTagsImpl.java b/src/main/java/org/rometools/feed/module/base/CustomTagsImpl.java index a4b5677..40263e7 100644 --- a/src/main/java/org/rometools/feed/module/base/CustomTagsImpl.java +++ b/src/main/java/org/rometools/feed/module/base/CustomTagsImpl.java @@ -20,6 +20,7 @@ package org.rometools.feed.module.base; +import com.sun.syndication.feed.CopyFrom; import java.util.ArrayList; import java.util.List; @@ -43,11 +44,12 @@ public class CustomTagsImpl implements CustomTags { this.values = values; } - public void copyFrom(Object object) { + public void copyFrom(CopyFrom object) { CustomTags ct = (CustomTags) object; this.values = new ArrayList( ct.getValues() ); } + @Override public Object clone() { CustomTagsImpl cti = new CustomTagsImpl(); cti.values = new ArrayList( this.values ); diff --git a/src/main/java/org/rometools/feed/module/base/GoogleBaseImpl.java b/src/main/java/org/rometools/feed/module/base/GoogleBaseImpl.java index 2a6e00e..ab89e2f 100644 --- a/src/main/java/org/rometools/feed/module/base/GoogleBaseImpl.java +++ b/src/main/java/org/rometools/feed/module/base/GoogleBaseImpl.java @@ -38,6 +38,7 @@ */ package org.rometools.feed.module.base; +import com.sun.syndication.feed.CopyFrom; import com.sun.syndication.feed.impl.EqualsBean; import org.rometools.feed.module.base.types.CloneableType; @@ -1102,6 +1103,7 @@ public class GoogleBaseImpl implements GoogleBase { } //TODO: Finish + @Override public Object clone() throws CloneNotSupportedException { try { GoogleBaseImpl gbi = new GoogleBaseImpl(); @@ -1114,7 +1116,7 @@ public class GoogleBaseImpl implements GoogleBase { } } - public void copyFrom(Object obj) { + public void copyFrom(CopyFrom obj) { if(!(obj instanceof GoogleBase)) { return; } diff --git a/src/main/java/org/rometools/feed/module/cc/CreativeCommonsImpl.java b/src/main/java/org/rometools/feed/module/cc/CreativeCommonsImpl.java index a559c50..b4d3f70 100644 --- a/src/main/java/org/rometools/feed/module/cc/CreativeCommonsImpl.java +++ b/src/main/java/org/rometools/feed/module/cc/CreativeCommonsImpl.java @@ -40,6 +40,7 @@ package org.rometools.feed.module.cc; +import com.sun.syndication.feed.CopyFrom; import com.sun.syndication.feed.impl.EqualsBean; import com.sun.syndication.feed.impl.ToStringBean; import org.rometools.feed.module.cc.types.License; @@ -95,7 +96,7 @@ public class CreativeCommonsImpl implements CreativeCommons { return clone; } - public void copyFrom(Object object) { + public void copyFrom(CopyFrom object) { CreativeCommons source = (CreativeCommons) object; this.setAllLicenses( (License[]) arrayCopy( source.getAllLicenses() )); this.setLicenses( source.getLicenses() ); diff --git a/src/main/java/org/rometools/feed/module/itunes/AbstractITunesObject.java b/src/main/java/org/rometools/feed/module/itunes/AbstractITunesObject.java index d80a527..637a23b 100644 --- a/src/main/java/org/rometools/feed/module/itunes/AbstractITunesObject.java +++ b/src/main/java/org/rometools/feed/module/itunes/AbstractITunesObject.java @@ -40,6 +40,8 @@ */ package org.rometools.feed.module.itunes; +import com.sun.syndication.feed.CopyFrom; + /** @@ -75,7 +77,7 @@ public abstract class AbstractITunesObject implements ITunes, java.lang.Cloneabl * Defined by the ROME module API * @param obj Object to copy from */ - public abstract void copyFrom(Object obj); + public abstract void copyFrom(CopyFrom obj); /** * Defined by the ROME API diff --git a/src/main/java/org/rometools/feed/module/itunes/EntryInformationImpl.java b/src/main/java/org/rometools/feed/module/itunes/EntryInformationImpl.java index a4b1e2f..5631842 100644 --- a/src/main/java/org/rometools/feed/module/itunes/EntryInformationImpl.java +++ b/src/main/java/org/rometools/feed/module/itunes/EntryInformationImpl.java @@ -40,6 +40,7 @@ */ package org.rometools.feed.module.itunes; +import com.sun.syndication.feed.CopyFrom; import org.rometools.feed.module.itunes.types.Duration; @@ -77,7 +78,7 @@ public class EntryInformationImpl extends AbstractITunesObject implements EntryI * Defined by the ROME module API * @param obj Object to copy from */ - public void copyFrom(Object obj) { + public void copyFrom(CopyFrom obj) { EntryInformationImpl info = (EntryInformationImpl) obj; this.setAuthor(info.getAuthor()); this.setBlock(info.getBlock()); diff --git a/src/main/java/org/rometools/feed/module/itunes/FeedInformationImpl.java b/src/main/java/org/rometools/feed/module/itunes/FeedInformationImpl.java index a07c146..134f8fb 100644 --- a/src/main/java/org/rometools/feed/module/itunes/FeedInformationImpl.java +++ b/src/main/java/org/rometools/feed/module/itunes/FeedInformationImpl.java @@ -40,10 +40,10 @@ * */ package org.rometools.feed.module.itunes; +import com.sun.syndication.feed.CopyFrom; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.logging.Logger; @@ -137,7 +137,7 @@ public class FeedInformationImpl extends AbstractITunesObject implements FeedInf * Required by the ROME API * @param obj object to copy property values from */ - public void copyFrom(Object obj) { + public void copyFrom(CopyFrom obj) { FeedInformationImpl info = (FeedInformationImpl) obj; this.setAuthor(info.getAuthor()); this.setBlock(info.getBlock()); diff --git a/src/main/java/org/rometools/feed/module/mediarss/MediaModuleImpl.java b/src/main/java/org/rometools/feed/module/mediarss/MediaModuleImpl.java index fa2f9c0..db88921 100644 --- a/src/main/java/org/rometools/feed/module/mediarss/MediaModuleImpl.java +++ b/src/main/java/org/rometools/feed/module/mediarss/MediaModuleImpl.java @@ -22,6 +22,7 @@ */ package org.rometools.feed.module.mediarss; +import com.sun.syndication.feed.CopyFrom; import java.io.Serializable; import com.sun.syndication.feed.module.ModuleImpl; @@ -102,7 +103,7 @@ public class MediaModuleImpl extends ModuleImpl implements MediaModule, Serializ return m; } - public void copyFrom(Object obj) { + public void copyFrom(CopyFrom obj) { MediaModule m = (MediaModule) obj; this.metadata = (Metadata) m.getMetadata().clone(); this.player = m.getPlayer(); diff --git a/src/main/java/org/rometools/feed/module/photocast/PhotocastModuleImpl.java b/src/main/java/org/rometools/feed/module/photocast/PhotocastModuleImpl.java index c50386b..98c8ce3 100644 --- a/src/main/java/org/rometools/feed/module/photocast/PhotocastModuleImpl.java +++ b/src/main/java/org/rometools/feed/module/photocast/PhotocastModuleImpl.java @@ -43,6 +43,7 @@ package org.rometools.feed.module.photocast; +import com.sun.syndication.feed.CopyFrom; import com.sun.syndication.feed.impl.EqualsBean; import com.sun.syndication.feed.impl.ToStringBean; import org.rometools.feed.module.photocast.types.Metadata; @@ -106,7 +107,7 @@ public class PhotocastModuleImpl implements PhotocastModule { this.metadata = metadata; } - public void copyFrom(Object obj) { + public void copyFrom(CopyFrom obj) { PhotocastModule pm = (PhotocastModule) obj; this.setPhotoDate((pm.getPhotoDate() == null) ? null : (Date) pm.getPhotoDate() diff --git a/src/main/java/org/rometools/feed/module/portablecontacts/ContactModule.java b/src/main/java/org/rometools/feed/module/portablecontacts/ContactModule.java new file mode 100644 index 0000000..934f6c9 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/portablecontacts/ContactModule.java @@ -0,0 +1,26 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.portablecontacts; + +/** + * + * @author robert.cooper + */ +public interface ContactModule { + +} diff --git a/src/main/java/org/rometools/feed/module/portablecontacts/types/Address.java b/src/main/java/org/rometools/feed/module/portablecontacts/types/Address.java new file mode 100644 index 0000000..2ee2b90 --- /dev/null +++ b/src/main/java/org/rometools/feed/module/portablecontacts/types/Address.java @@ -0,0 +1,26 @@ +/* + * Copyright 2011 robert.cooper. + * + * Licensed 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. + * under the License. + */ + +package org.rometools.feed.module.portablecontacts.types; + +/** + * + * @author robert.cooper + */ +public class Address { + +} diff --git a/src/main/java/org/rometools/feed/module/sle/SimpleListExtensionImpl.java b/src/main/java/org/rometools/feed/module/sle/SimpleListExtensionImpl.java index 3a4ea94..bb22956 100644 --- a/src/main/java/org/rometools/feed/module/sle/SimpleListExtensionImpl.java +++ b/src/main/java/org/rometools/feed/module/sle/SimpleListExtensionImpl.java @@ -17,6 +17,7 @@ */ package org.rometools.feed.module.sle; +import com.sun.syndication.feed.CopyFrom; import com.sun.syndication.feed.module.ModuleImpl; import org.rometools.feed.module.sle.types.Group; import org.rometools.feed.module.sle.types.Sort; @@ -94,7 +95,7 @@ public class SimpleListExtensionImpl extends ModuleImpl implements SimpleListExt * * @param obj the instance to copy properties from. */ - public void copyFrom(Object obj) { + public void copyFrom(CopyFrom obj) { SimpleListExtension sle = (SimpleListExtension) obj; this.setGroupFields((Group[]) sle.getGroupFields().clone()); this.setSortFields((Sort[]) sle.getSortFields().clone()); diff --git a/src/main/java/org/rometools/feed/module/sle/SleEntryImpl.java b/src/main/java/org/rometools/feed/module/sle/SleEntryImpl.java index 7dca996..3195448 100644 --- a/src/main/java/org/rometools/feed/module/sle/SleEntryImpl.java +++ b/src/main/java/org/rometools/feed/module/sle/SleEntryImpl.java @@ -17,13 +17,13 @@ */ package org.rometools.feed.module.sle; +import com.sun.syndication.feed.CopyFrom; import com.sun.syndication.feed.impl.ObjectBean; import org.rometools.feed.module.sle.io.*; import org.rometools.feed.module.sle.io.LabelNamespaceElement; import org.rometools.feed.module.sle.types.EntryValue; import org.rometools.feed.module.sle.types.Group; import org.rometools.feed.module.sle.types.Sort; -import org.jdom.Namespace; /**This is a parse only module that holds the values of enternal fields declared in the SLE module. * These will not be persisted on an output() call, nor will changing a value here change a @@ -123,7 +123,7 @@ public class SleEntryImpl implements SleEntry { * * @param obj the instance to copy properties from. */ - public void copyFrom(Object obj) { + public void copyFrom(CopyFrom obj) { SleEntry entry = (SleEntry) obj; this.setGroupValues((EntryValue[]) entry.getGroupValues().clone()); this.setSortValues((EntryValue[]) entry.getSortValues().clone()); diff --git a/src/test/resources/xml/lr.xml.output b/src/test/resources/xml/lr.xml.output index bf8ee1d..45bfb0b 100644 --- a/src/test/resources/xml/lr.xml.output +++ b/src/test/resources/xml/lr.xml.output @@ -25,6 +25,8 @@+ *
- Video Stream Link
+ *- A Media Link Construct linking + * to the video content itself. Represented in JSON as a property + * called stream whose value is a JSON + * object with properties as defined in [TODO: xref the JSON + * serialization of a Media Link Construct] + *
+ *- Embed Code
+ *- An HTML fragment that, when embedded in + * an HTML page, will provide an interactive player UI for the + * video stream. Represented in JSON as a property called embedCode whose value is a JSON string + * containing the fragment of HTML. + *
+ *