You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ja...@apache.org on 2014/01/08 16:25:54 UTC
[38/51] [abbrv] [partial] MARMOTTA-397: Reorganized and renamed
Marmotta Sesame Tools
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS10Generator.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS10Generator.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS10Generator.java
new file mode 100644
index 0000000..9ffdc7d
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS10Generator.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ */
+package com.sun.syndication.io.impl;
+
+import com.sun.syndication.feed.rss.Description;
+import com.sun.syndication.feed.rss.Item;
+import com.sun.syndication.feed.rss.Channel;
+import com.sun.syndication.io.FeedException;
+import org.jdom2.Element;
+import org.jdom2.Namespace;
+
+import java.util.List;
+
+/**
+ * Feed Generator for RSS 1.0
+ * <p/>
+ *
+ * @author Elaine Chien
+ *
+ */
+
+public class RSS10Generator extends RSS090Generator {
+
+ private static final String RSS_URI = "http://purl.org/rss/1.0/";
+ private static final Namespace RSS_NS = Namespace.getNamespace(RSS_URI);
+
+ public RSS10Generator() {
+ super("rss_1.0");
+ }
+
+ protected RSS10Generator(String feedType) {
+ super(feedType);
+ }
+
+ protected Namespace getFeedNamespace() {
+ return RSS_NS;
+ }
+
+ protected void populateChannel(Channel channel,Element eChannel) {
+ super.populateChannel(channel,eChannel);
+ if (channel.getUri() != null) {
+ eChannel.setAttribute("about", channel.getUri(), getRDFNamespace());
+ }
+ List items = channel.getItems();
+ if (items.size()>0) {
+ Element eItems = new Element("items",getFeedNamespace());
+ Element eSeq = new Element("Seq",getRDFNamespace());
+ for (int i=0;i<items.size();i++) {
+ Item item = (Item) items.get(i);
+ Element eLi = new Element("li",getRDFNamespace());
+ String uri = item.getUri();
+ if (uri!=null) {
+ eLi.setAttribute("resource",uri,getRDFNamespace());
+ }
+ eSeq.addContent(eLi);
+ }
+ eItems.addContent(eSeq);
+ eChannel.addContent(eItems);
+ }
+ }
+
+ protected void populateItem(Item item, Element eItem, int index) {
+ super.populateItem(item,eItem, index);
+ String link = item.getLink();
+ String uri = item.getUri();
+
+ if (uri != null) {
+ eItem.setAttribute("about", uri, getRDFNamespace());
+ } else if (link != null) {
+ eItem.setAttribute("about", link, getRDFNamespace());
+ }
+
+ Description description = item.getDescription();
+ if (description!=null) {
+ eItem.addContent(generateSimpleElement("description", description.getValue()));
+ }
+ if (item.getModule(getContentNamespace().getURI()) == null && item.getContent() != null) {
+ Element elem = new Element("encoded", getContentNamespace());
+ elem.addContent(item.getContent().getValue());
+ eItem.addContent(elem);
+ }
+ }
+
+ protected void checkChannelConstraints(Element eChannel) throws FeedException {
+ checkNotNullAndLength(eChannel,"title", 0, -1);
+ checkNotNullAndLength(eChannel,"description", 0, -1);
+ checkNotNullAndLength(eChannel,"link", 0, -1);
+ }
+
+ protected void checkImageConstraints(Element eImage) throws FeedException {
+ checkNotNullAndLength(eImage,"title", 0, -1);
+ checkNotNullAndLength(eImage,"url", 0, -1);
+ checkNotNullAndLength(eImage,"link", 0, -1);
+ }
+
+ protected void checkTextInputConstraints(Element eTextInput) throws FeedException {
+ checkNotNullAndLength(eTextInput,"title", 0, -1);
+ checkNotNullAndLength(eTextInput,"description", 0, -1);
+ checkNotNullAndLength(eTextInput,"name", 0, -1);
+ checkNotNullAndLength(eTextInput,"link", 0, -1);
+ }
+
+ protected void checkItemsConstraints(Element parent) throws FeedException {
+ }
+
+ protected void checkItemConstraints(Element eItem) throws FeedException {
+ checkNotNullAndLength(eItem,"title", 0, -1);
+ checkNotNullAndLength(eItem,"link", 0, -1);
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS10Parser.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS10Parser.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS10Parser.java
new file mode 100644
index 0000000..0547211
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS10Parser.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ */
+package com.sun.syndication.io.impl;
+
+import com.sun.syndication.feed.WireFeed;
+import com.sun.syndication.feed.rss.Channel;
+import com.sun.syndication.feed.rss.Content;
+import com.sun.syndication.feed.rss.Description;
+import com.sun.syndication.feed.rss.Item;
+import org.jdom2.Document;
+import org.jdom2.Element;
+import org.jdom2.Namespace;
+
+import java.util.List;
+
+/**
+ */
+public class RSS10Parser extends RSS090Parser {
+
+ private static final String RSS_URI = "http://purl.org/rss/1.0/";
+ private static final Namespace RSS_NS = Namespace.getNamespace(RSS_URI);
+
+ public RSS10Parser() {
+ this("rss_1.0", RSS_NS);
+ }
+
+ protected RSS10Parser(String type, Namespace ns) {
+ super(type, ns);
+ }
+
+ /**
+ * Indicates if a JDom document is an RSS instance that can be parsed with the parser.
+ * <p/>
+ * It checks for RDF ("http://www.w3.org/1999/02/22-rdf-syntax-ns#") and
+ * RSS ("http://purl.org/rss/1.0/") namespaces being defined in the root element.
+ *
+ * @param document document to check if it can be parsed with this parser implementation.
+ * @return <b>true</b> if the document is RSS1., <b>false</b> otherwise.
+ */
+ public boolean isMyType(Document document) {
+ boolean ok = false;
+
+ Element rssRoot = document.getRootElement();
+ Namespace defaultNS = rssRoot.getNamespace();
+ List additionalNSs = rssRoot.getAdditionalNamespaces();
+
+ ok = defaultNS!=null && defaultNS.equals(getRDFNamespace());
+ if (ok) {
+ if (additionalNSs==null) {
+ ok = false;
+ }
+ else {
+ ok = false;
+ for (int i=0;!ok && i<additionalNSs.size();i++) {
+ ok = getRSSNamespace().equals(additionalNSs.get(i));
+ }
+ }
+ }
+ return ok;
+ }
+
+ /**
+ * Returns the namespace used by RSS elements in document of the RSS 1.0
+ * <P>
+ *
+ * @return returns "http://purl.org/rss/1.0/".
+ */
+ protected Namespace getRSSNamespace() {
+ return Namespace.getNamespace(RSS_URI);
+ }
+
+ /**
+ * Parses an item element of an RSS document looking for item information.
+ * <p/>
+ * It first invokes super.parseItem and then parses and injects the description property if present.
+ * <p/>
+ *
+ * @param rssRoot the root element of the RSS document in case it's needed for context.
+ * @param eItem the item element to parse.
+ * @return the parsed RSSItem bean.
+ */
+ protected Item parseItem(Element rssRoot,Element eItem) {
+ Item item = super.parseItem(rssRoot,eItem);
+ Element e = eItem.getChild("description", getRSSNamespace());
+ if (e!=null) {
+ item.setDescription(parseItemDescription(rssRoot,e));
+ }
+ Element ce = eItem.getChild("encoded", getContentNamespace());
+ if (ce != null) {
+ Content content = new Content();
+ content.setType(Content.HTML);
+ content.setValue(ce.getText());
+ item.setContent(content);
+ }
+
+ String uri = eItem.getAttributeValue("about", getRDFNamespace());
+ if (uri != null) {
+ item.setUri(uri);
+ }
+
+ return item;
+ }
+
+ protected WireFeed parseChannel(Element rssRoot) {
+ Channel channel = (Channel) super.parseChannel(rssRoot);
+
+ Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
+ String uri = eChannel.getAttributeValue("about", getRDFNamespace());
+ if (uri != null) {
+ channel.setUri(uri);
+ }
+
+ return channel;
+ }
+
+ protected Description parseItemDescription(Element rssRoot,Element eDesc) {
+ Description desc = new Description();
+ desc.setType("text/plain");
+ desc.setValue(eDesc.getText());
+ return desc;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20Generator.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20Generator.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20Generator.java
new file mode 100644
index 0000000..14e23ab
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20Generator.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ */
+package com.sun.syndication.io.impl;
+
+import com.sun.syndication.feed.rss.Category;
+import com.sun.syndication.feed.rss.Channel;
+import com.sun.syndication.feed.rss.Guid;
+import com.sun.syndication.feed.rss.Item;
+import org.jdom2.Element;
+
+import java.util.List;
+
+
+/**
+ * Feed Generator for RSS 2.0
+ * <p/>
+ *
+ * @author Elaine Chien
+ *
+ */
+
+public class RSS20Generator extends RSS094Generator {
+
+ public RSS20Generator() {
+ this("rss_2.0","2.0");
+ }
+
+ protected RSS20Generator(String feedType,String version) {
+ super(feedType,version);
+ }
+
+ protected void populateChannel(Channel channel,Element eChannel) {
+ super.populateChannel(channel,eChannel);
+
+ String generator = channel.getGenerator();
+ if (generator != null) {
+ eChannel.addContent(generateSimpleElement("generator", generator));
+ }
+
+ int ttl = channel.getTtl();
+ if (ttl>-1) {
+ eChannel.addContent(generateSimpleElement("ttl", String.valueOf(ttl)));
+ }
+
+ List categories = channel.getCategories();
+ for(int i = 0; i < categories.size(); i++) {
+ eChannel.addContent(generateCategoryElement((Category)categories.get(i)));
+ }
+
+ }
+
+ public void populateItem(Item item, Element eItem, int index) {
+ super.populateItem(item,eItem, index);
+
+ Element eDescription = eItem.getChild("description",getFeedNamespace());
+ if (eDescription != null) eDescription.removeAttribute("type");
+
+ String author = item.getAuthor();
+ if (author != null) {
+ eItem.addContent(generateSimpleElement("author", author));
+ }
+
+ String comments = item.getComments();
+ if (comments != null) {
+ eItem.addContent(generateSimpleElement("comments", comments));
+ }
+
+ Guid guid = item.getGuid();
+ if (guid != null) {
+ Element eGuid = generateSimpleElement("guid",guid.getValue());
+ if (!guid.isPermaLink()) {
+ eGuid.setAttribute("isPermaLink", "false");
+ }
+ eItem.addContent(eGuid);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20Parser.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20Parser.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20Parser.java
new file mode 100644
index 0000000..e3e6e66
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20Parser.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ */
+package com.sun.syndication.io.impl;
+
+import com.sun.syndication.feed.rss.Description;
+import org.jdom2.Attribute;
+import org.jdom2.Document;
+import org.jdom2.Element;
+
+/**
+ */
+public class RSS20Parser extends RSS094Parser {
+
+ public RSS20Parser() {
+ this("rss_2.0");
+ }
+
+ protected RSS20Parser(String type) {
+ super(type);
+ }
+
+ protected String getRSSVersion() {
+ return "2.0";
+ }
+
+ protected boolean isHourFormat24(Element rssRoot) {
+ return false;
+ }
+
+ protected Description parseItemDescription(Element rssRoot,Element eDesc) {
+ Description desc = super.parseItemDescription(rssRoot,eDesc);
+ desc.setType("text/html"); // change as per https://rome.dev.java.net/issues/show_bug.cgi?id=26
+ return desc;
+ }
+
+ public boolean isMyType(Document document) {
+ boolean ok;
+ Element rssRoot = document.getRootElement();
+ ok = rssRoot.getName().equals("rss");
+ if (ok) {
+ ok = false;
+ Attribute version = rssRoot.getAttribute("version");
+ if (version!=null) {
+ // At this point, as far ROME is concerned RSS 2.0, 2.00 and
+ // 2.0.X are all the same, so let's use startsWith for leniency.
+ ok = version.getValue().startsWith(getRSSVersion());
+ }
+ }
+ return ok;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20wNSParser.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20wNSParser.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20wNSParser.java
new file mode 100644
index 0000000..d981f0f
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/RSS20wNSParser.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ */
+package com.sun.syndication.io.impl;
+
+import org.jdom2.Document;
+import org.jdom2.Element;
+import org.jdom2.Namespace;
+import com.sun.syndication.feed.WireFeed;
+
+
+/**
+ * To address issue with certain feeds (brought up by Charles Miller):
+ *
+ * "During the debacle that was the rollout of RSS2.0, this namespace was tried,
+ * and even appeared in Dave Winer's Scripting News feed for a while. It was
+ * then withdrawn, but the wonderful thing about standards is the moment you
+ * roll one out, even if it's marked as unfinished and subject to change,
+ * someone will end up stuck with it forever."
+ *
+ * Note that there is not counter part on the generator, we only generate the final RSS2
+ *
+ */
+public class RSS20wNSParser extends RSS20Parser {
+ private static String RSS20_URI = "http://backend.userland.com/rss2";
+
+ public RSS20wNSParser() {
+ this("rss_2.0wNS");
+ }
+
+ protected RSS20wNSParser(String type) {
+ super(type);
+ }
+
+ public boolean isMyType(Document document) {
+ Element rssRoot = document.getRootElement();
+ Namespace defaultNS = rssRoot.getNamespace();
+ boolean ok = defaultNS!=null && defaultNS.equals(getRSSNamespace());
+ if (ok) {
+ ok = super.isMyType(document);
+ }
+ return ok;
+ }
+
+ protected Namespace getRSSNamespace() {
+ return Namespace.getNamespace(RSS20_URI);
+ }
+
+ /**
+ * After we parse the feed we put "rss_2.0" in it (so converters and generators work)
+ * this parser is a phantom.
+ *
+ */
+ protected WireFeed parseChannel(Element rssRoot) {
+ WireFeed wFeed = super.parseChannel(rssRoot);
+ wFeed.setFeedType("rss_2.0");
+ return wFeed;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/SyModuleGenerator.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/SyModuleGenerator.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/SyModuleGenerator.java
new file mode 100644
index 0000000..e432e1a
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/SyModuleGenerator.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ */
+package com.sun.syndication.io.impl;
+
+import com.sun.syndication.feed.module.Module;
+import com.sun.syndication.feed.module.SyModule;
+import com.sun.syndication.io.ModuleGenerator;
+import org.jdom2.Element;
+import org.jdom2.Namespace;
+
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
+
+/**
+ * Feed Generator for SY ModuleImpl
+ * <p/>
+ *
+ * @author Elaine Chien
+ *
+ */
+
+public class SyModuleGenerator implements ModuleGenerator {
+
+ private static final String SY_URI = "http://purl.org/rss/1.0/modules/syndication/";
+ private static final Namespace SY_NS = Namespace.getNamespace("sy", SY_URI);
+
+ private static final Set NAMESPACES;
+
+ static {
+ Set nss = new HashSet();
+ nss.add(SY_NS);
+ NAMESPACES = Collections.unmodifiableSet(nss);
+ }
+
+ public String getNamespaceUri() {
+ return SY_URI;
+ }
+
+ /**
+ * Returns a set with all the URIs (JDOM Namespace elements) this module generator uses.
+ * <p/>
+ * It is used by the the feed generators to add their namespace definition in
+ * the root element of the generated document (forward-missing of Java 5.0 Generics).
+ * <p/>
+ *
+ * @return a set with all the URIs (JDOM Namespace elements) this module generator uses.
+ */
+ public Set getNamespaces() {
+ return NAMESPACES;
+ }
+
+ public void generate(Module module, Element element) {
+
+ SyModule syModule = (SyModule)module;
+
+ if (syModule.getUpdatePeriod() != null) {
+ Element updatePeriodElement = new Element("updatePeriod", SY_NS);
+ updatePeriodElement.addContent(syModule.getUpdatePeriod());
+ element.addContent(updatePeriodElement);
+ }
+
+ Element updateFrequencyElement = new Element("updateFrequency", SY_NS);
+ updateFrequencyElement.addContent(String.valueOf(syModule.getUpdateFrequency()));
+ element.addContent(updateFrequencyElement);
+
+ if (syModule.getUpdateBase() != null) {
+ Element updateBaseElement = new Element("updateBase", SY_NS);
+ updateBaseElement.addContent(DateParser.formatW3CDateTime(syModule.getUpdateBase()));
+ element.addContent(updateBaseElement);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/SyModuleParser.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/SyModuleParser.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/SyModuleParser.java
new file mode 100644
index 0000000..ac1961a
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/SyModuleParser.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ */
+package com.sun.syndication.io.impl;
+
+import com.sun.syndication.feed.module.Module;
+import com.sun.syndication.feed.module.SyModule;
+import com.sun.syndication.feed.module.SyModuleImpl;
+import com.sun.syndication.io.ModuleParser;
+import org.jdom2.Element;
+import org.jdom2.Namespace;
+
+/**
+ */
+public class SyModuleParser implements ModuleParser {
+ public String getNamespaceUri() {
+ return SyModule.URI;
+ }
+
+ private Namespace getDCNamespace() {
+ return Namespace.getNamespace(SyModule.URI);
+ }
+
+ public Module parse(Element syndRoot) {
+ boolean foundSomething = false;
+ SyModule sm = new SyModuleImpl();
+
+ Element e = syndRoot.getChild("updatePeriod",getDCNamespace());
+ if (e!=null) {
+ foundSomething = true;
+ sm.setUpdatePeriod(e.getText());
+ }
+ e = syndRoot.getChild("updateFrequency",getDCNamespace());
+ if (e!=null) {
+ foundSomething = true;
+ sm.setUpdateFrequency(Integer.parseInt(e.getText().trim()));
+ }
+ e = syndRoot.getChild("updateBase",getDCNamespace());
+ if (e!=null) {
+ foundSomething = true;
+ sm.setUpdateBase(DateParser.parseDate(e.getText()));
+ }
+ return (foundSomething) ? sm : null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/XmlFixerReader.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/XmlFixerReader.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/XmlFixerReader.java
new file mode 100644
index 0000000..88a98b2
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/com/sun/syndication/io/impl/XmlFixerReader.java
@@ -0,0 +1,652 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.
+ *
+ * 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.
+ *
+ */
+package com.sun.syndication.io.impl;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+/**
+ * @author Alejandro Abdelnur
+ */
+public class XmlFixerReader extends Reader {
+
+ protected Reader in;
+
+ public XmlFixerReader(Reader in) {
+ super(in);
+ this.in = in;
+ _buffer = new StringBuffer();
+ _state = 0;
+ }
+
+ private boolean trimmed;
+ private StringBuffer _buffer;
+ private int _bufferPos;
+ private int _state = 0;
+
+ private boolean trimStream() throws IOException {
+ boolean hasContent = true;
+ int state = 0;
+ boolean loop;
+ int c;
+ do {
+ switch (state) {
+ case 0:
+ c = in.read();
+ if (c==-1) {
+ loop = false;
+ hasContent = false;
+ }
+ else
+ if (c==' ' || c=='\n' || c=='\r' || c=='\t') {
+ loop = true;
+ }
+ else
+ if (c=='<') {
+ state = 1;
+ _buffer.setLength(0);
+ _bufferPos = 0;
+ _buffer.append((char)c);
+ loop = true;
+ }
+ else {
+ _buffer.setLength(0);
+ _bufferPos = 0;
+ _buffer.append((char)c);
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ break;
+ case 1:
+ c = in.read();
+ if (c==-1) {
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ else
+ if (c!='!') {
+ _buffer.append((char)c);
+ _state = 3;
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ else {
+ _buffer.append((char)c);
+ state = 2;
+ loop = true;
+ }
+ break;
+ case 2:
+ c = in.read();
+ if (c==-1) {
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ else
+ if (c=='-') {
+ _buffer.append((char)c);
+ state = 3;
+ loop = true;
+ }
+ else {
+ _buffer.append((char)c);
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ break;
+ case 3:
+ c = in.read();
+ if (c==-1) {
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ else
+ if (c=='-') {
+ _buffer.append((char)c);
+ state = 4;
+ loop = true;
+ }
+ else {
+ _buffer.append((char)c);
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ break;
+ case 4:
+ c = in.read();
+ if (c==-1) {
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ else
+ if (c!='-') {
+ _buffer.append((char)c);
+ loop = true;
+ }
+ else {
+ _buffer.append((char)c);
+ state = 5;
+ loop = true;
+ }
+ break;
+ case 5:
+ c = in.read();
+ if (c==-1) {
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ else
+ if (c!='-') {
+ _buffer.append((char)c);
+ loop = true;
+ state = 4;
+ }
+ else {
+ _buffer.append((char)c);
+ state = 6;
+ loop = true;
+ }
+ break;
+ case 6:
+ c = in.read();
+ if (c==-1) {
+ loop = false;
+ hasContent = true;
+ _state = 3;
+ }
+ else
+ if (c!='>') {
+ _buffer.append((char)c);
+ loop = true;
+ state = 4;
+ }
+ else {
+ _buffer.setLength(0);
+ state = 0;
+ loop = true;
+ }
+ break;
+ default:
+ throw new IOException("It shouldn't happen");
+ }
+ } while (loop);
+ return hasContent;
+ }
+
+ public int read() throws IOException {
+ boolean loop;
+ if (!trimmed) { // trims XML stream
+ trimmed = true;
+ if (!trimStream()) {
+ return -1;
+ }
+ }
+ int c;
+ do { // converts literal entities to coded entities
+ switch (_state) {
+ case 0: // reading chars from stream
+ c = in.read();
+ if (c>-1) {
+ if (c=='&') {
+ _state = 1;
+ _buffer.setLength(0);
+ _bufferPos = 0;
+ _buffer.append((char)c);
+ _state = 1;
+ loop = true;
+ }
+ else {
+ loop = false;
+ }
+ }
+ else {
+ loop = false;
+ }
+ break;
+ case 1: // reading entity from stream
+ c = in.read();
+ if (c>-1) {
+ if (c==';') {
+ _buffer.append((char)c);
+ _state = 2;
+ loop = true;
+ }
+ else
+ if ((c>='a' && c<='z') || (c>='A' && c<='Z') || (c=='#') || (c>='0' && c<='9')) {
+ _buffer.append((char)c);
+ loop = true;
+ }
+ else {
+ // no ';' to match the '&' lets just make the '&'
+ // a legal xml character entity '&'
+ _buffer.insert(1, "amp;");
+ _buffer.append((char)c);
+ _state = 3;
+ loop = true;
+ }
+ }
+ else {
+ // no ';' to match the '&' lets just make the '&'
+ // a legal xml character entity '&'
+ _buffer.insert(1, "amp;");
+ _state = 3;
+ loop = true;
+ }
+ break;
+ case 2: // replacing entity
+ c = 0;
+ String literalEntity = _buffer.toString();
+ String codedEntity = (String) CODED_ENTITIES.get(literalEntity);
+ if (codedEntity!=null) {
+ _buffer.setLength(0);
+ _buffer.append(codedEntity);
+ } // else we leave what was in the stream
+ _state = 3;
+ loop = true;
+ break;
+ case 3: // consuming buffer
+ if (_bufferPos<_buffer.length()) {
+ c = _buffer.charAt(_bufferPos++);
+ loop = false;
+ }
+ else {
+ c = 0;
+ _state = 0;
+ loop = true;
+ }
+ break;
+ default:
+ throw new IOException("It shouldn't happen");
+ }
+ } while (loop);
+ return c;
+ }
+
+ public int read(char[] buffer,int offset,int len) throws IOException {
+ int charsRead = 0;
+ int c = read();
+ if (c==-1) {
+ return -1;
+ }
+ buffer[offset+(charsRead++)] = (char) c;
+ while (charsRead<len && (c=read())>-1) {
+ buffer[offset+(charsRead++)] = (char) c;
+ }
+ return charsRead;
+ }
+
+ public long skip(long n) throws IOException {
+ if (n==0) {
+ return 0;
+ }
+ else
+ if (n<0) {
+ throw new IllegalArgumentException("'n' cannot be negative");
+ }
+ int c = read();
+ long counter = 1;
+ while (c>-1 && counter<n) {
+ c = read();
+ counter++;
+ }
+ return counter;
+ }
+
+ public boolean ready() throws IOException {
+ return (_state!=0) || in.ready();
+ }
+
+ public boolean markSupported() {
+ return false;
+ }
+
+ public void mark(int readAheadLimit) throws IOException {
+ throw new IOException("Stream does not support mark");
+ }
+
+ public void reset() throws IOException {
+ throw new IOException("Stream does not support mark");
+ }
+
+ public void close() throws IOException {
+ in.close();
+ }
+
+ private static Map CODED_ENTITIES = new HashMap();
+
+ static {
+ // note: refer to Character entity references in HTML 4
+ // at http://www.w3.org/TR/REC-html40/sgml/entities.html
+
+ // Character entity set.
+ // HTMLlat1 "-//W3C//ENTITIES Latin 1//EN//HTML"
+
+ CODED_ENTITIES.put(" ", " ");
+ CODED_ENTITIES.put("¡", "¡");
+ CODED_ENTITIES.put("¢", "¢");
+ CODED_ENTITIES.put("£", "£");
+ CODED_ENTITIES.put("¤","¤");
+ CODED_ENTITIES.put("¥", "¥");
+ CODED_ENTITIES.put("¦","¦");
+ CODED_ENTITIES.put("§", "§");
+ CODED_ENTITIES.put("¨", "¨");
+ CODED_ENTITIES.put("©", "©");
+ CODED_ENTITIES.put("ª", "ª");
+ CODED_ENTITIES.put("«", "«");
+ CODED_ENTITIES.put("¬", "¬");
+ CODED_ENTITIES.put("­", "­");
+ CODED_ENTITIES.put("®", "®");
+ CODED_ENTITIES.put("¯", "¯");
+ CODED_ENTITIES.put("°", "°");
+ CODED_ENTITIES.put("±","±");
+ CODED_ENTITIES.put("²", "²");
+ CODED_ENTITIES.put("³", "³");
+ CODED_ENTITIES.put("´", "´");
+ CODED_ENTITIES.put("µ", "µ");
+ CODED_ENTITIES.put("¶", "¶");
+ CODED_ENTITIES.put("·","·");
+ CODED_ENTITIES.put("¸", "¸");
+ CODED_ENTITIES.put("¹", "¹");
+ CODED_ENTITIES.put("º", "º");
+ CODED_ENTITIES.put("»", "»");
+ CODED_ENTITIES.put("¼","¼");
+ CODED_ENTITIES.put("½","½");
+ CODED_ENTITIES.put("¾","¾");
+ CODED_ENTITIES.put("¿","¿");
+ CODED_ENTITIES.put("À","À");
+ CODED_ENTITIES.put("Á","Á");
+ CODED_ENTITIES.put("Â", "Â");
+ CODED_ENTITIES.put("Ã","Ã");
+ CODED_ENTITIES.put("Ä", "Ä");
+ CODED_ENTITIES.put("Å", "Å");
+ CODED_ENTITIES.put("Æ", "Æ");
+ CODED_ENTITIES.put("Ç","Ç");
+ CODED_ENTITIES.put("È","È");
+ CODED_ENTITIES.put("É","É");
+ CODED_ENTITIES.put("Ê", "Ê");
+ CODED_ENTITIES.put("Ë", "Ë");
+ CODED_ENTITIES.put("Ì","Ì");
+ CODED_ENTITIES.put("Í","Í");
+ CODED_ENTITIES.put("Î", "Î");
+ CODED_ENTITIES.put("Ï", "Ï");
+ CODED_ENTITIES.put("Ð", "Ð");
+ CODED_ENTITIES.put("Ñ","Ñ");
+ CODED_ENTITIES.put("Ò","Ò");
+ CODED_ENTITIES.put("Ó","Ó");
+ CODED_ENTITIES.put("Ô", "Ô");
+ CODED_ENTITIES.put("Õ","Õ");
+ CODED_ENTITIES.put("Ö", "Ö");
+ CODED_ENTITIES.put("×", "×");
+ CODED_ENTITIES.put("Ø","Ø");
+ CODED_ENTITIES.put("Ù","Ù");
+ CODED_ENTITIES.put("Ú","Ú");
+ CODED_ENTITIES.put("Û", "Û");
+ CODED_ENTITIES.put("Ü", "Ü");
+ CODED_ENTITIES.put("Ý","Ý");
+ CODED_ENTITIES.put("Þ", "Þ");
+ CODED_ENTITIES.put("ß", "ß");
+ CODED_ENTITIES.put("à","à");
+ CODED_ENTITIES.put("á","á");
+ CODED_ENTITIES.put("â", "â");
+ CODED_ENTITIES.put("ã","ã");
+ CODED_ENTITIES.put("ä", "ä");
+ CODED_ENTITIES.put("å", "å");
+ CODED_ENTITIES.put("æ", "æ");
+ CODED_ENTITIES.put("ç","ç");
+ CODED_ENTITIES.put("è","è");
+ CODED_ENTITIES.put("é","é");
+ CODED_ENTITIES.put("ê", "ê");
+ CODED_ENTITIES.put("ë", "ë");
+ CODED_ENTITIES.put("ì","ì");
+ CODED_ENTITIES.put("í","í");
+ CODED_ENTITIES.put("î", "î");
+ CODED_ENTITIES.put("ï", "ï");
+ CODED_ENTITIES.put("ð", "ð");
+ CODED_ENTITIES.put("ñ","ñ");
+ CODED_ENTITIES.put("ò","ò");
+ CODED_ENTITIES.put("ó","ó");
+ CODED_ENTITIES.put("ô", "ô");
+ CODED_ENTITIES.put("õ","õ");
+ CODED_ENTITIES.put("ö", "ö");
+ CODED_ENTITIES.put("÷","÷");
+ CODED_ENTITIES.put("ø","ø");
+ CODED_ENTITIES.put("ù","ù");
+ CODED_ENTITIES.put("ú","ú");
+ CODED_ENTITIES.put("û", "û");
+ CODED_ENTITIES.put("ü", "ü");
+ CODED_ENTITIES.put("ý","ý");
+ CODED_ENTITIES.put("þ", "þ");
+ CODED_ENTITIES.put("ÿ", "ÿ");
+
+ // Mathematical, Greek and Symbolic characters for HTML.
+ // HTMLsymbol "-//W3C//ENTITIES Symbols//EN//HTML"
+
+ CODED_ENTITIES.put("ƒ", "ƒ");
+ CODED_ENTITIES.put("Α", "Α");
+ CODED_ENTITIES.put("Β", "Β");
+ CODED_ENTITIES.put("Γ", "Γ");
+ CODED_ENTITIES.put("Δ", "Δ");
+ CODED_ENTITIES.put("Ε", "Ε");
+ CODED_ENTITIES.put("Ζ", "Ζ");
+ CODED_ENTITIES.put("Η", "Η");
+ CODED_ENTITIES.put("Θ", "Θ");
+ CODED_ENTITIES.put("Ι", "Ι");
+ CODED_ENTITIES.put("Κ", "Κ");
+ CODED_ENTITIES.put("Λ", "Λ");
+ CODED_ENTITIES.put("Μ", "Μ");
+ CODED_ENTITIES.put("Ν", "Ν");
+ CODED_ENTITIES.put("Ξ", "Ξ");
+ CODED_ENTITIES.put("Ο", "Ο");
+ CODED_ENTITIES.put("Π", "Π");
+ CODED_ENTITIES.put("Ρ", "Ρ");
+ CODED_ENTITIES.put("Σ", "Σ");
+ CODED_ENTITIES.put("Τ", "Τ");
+ CODED_ENTITIES.put("Υ", "Υ");
+ CODED_ENTITIES.put("Φ", "Φ");
+ CODED_ENTITIES.put("Χ", "Χ");
+ CODED_ENTITIES.put("Ψ", "Ψ");
+ CODED_ENTITIES.put("Ω", "Ω");
+ CODED_ENTITIES.put("α", "α");
+ CODED_ENTITIES.put("β", "β");
+ CODED_ENTITIES.put("γ", "γ");
+ CODED_ENTITIES.put("δ", "δ");
+ CODED_ENTITIES.put("ε", "ε");
+ CODED_ENTITIES.put("ζ", "ζ");
+ CODED_ENTITIES.put("η", "η");
+ CODED_ENTITIES.put("θ", "θ");
+ CODED_ENTITIES.put("ι", "ι");
+ CODED_ENTITIES.put("κ", "κ");
+ CODED_ENTITIES.put("λ", "λ");
+ CODED_ENTITIES.put("μ", "μ");
+ CODED_ENTITIES.put("ν", "ν");
+ CODED_ENTITIES.put("ξ", "ξ");
+ CODED_ENTITIES.put("ο", "ο");
+ CODED_ENTITIES.put("π", "π");
+ CODED_ENTITIES.put("ρ", "ρ");
+ CODED_ENTITIES.put("ς", "ς");
+ CODED_ENTITIES.put("σ", "σ");
+ CODED_ENTITIES.put("τ", "τ");
+ CODED_ENTITIES.put("υ", "υ");
+ CODED_ENTITIES.put("φ", "φ");
+ CODED_ENTITIES.put("χ", "χ");
+ CODED_ENTITIES.put("ψ", "ψ");
+ CODED_ENTITIES.put("ω", "ω");
+ CODED_ENTITIES.put("ϑ", "ϑ");
+ CODED_ENTITIES.put("ϒ", "ϒ");
+ CODED_ENTITIES.put("ϖ", "ϖ");
+ CODED_ENTITIES.put("•", "•");
+ CODED_ENTITIES.put("…", "…");
+ CODED_ENTITIES.put("′", "′");
+ CODED_ENTITIES.put("″", "″");
+ CODED_ENTITIES.put("‾", "‾");
+ CODED_ENTITIES.put("⁄", "⁄");
+ CODED_ENTITIES.put("℘", "℘");
+ CODED_ENTITIES.put("ℑ", "ℑ");
+ CODED_ENTITIES.put("ℜ", "ℜ");
+ CODED_ENTITIES.put("™", "™");
+ CODED_ENTITIES.put("ℵ", "ℵ");
+ CODED_ENTITIES.put("←", "←");
+ CODED_ENTITIES.put("↑", "↑");
+ CODED_ENTITIES.put("→", "→");
+ CODED_ENTITIES.put("↓", "↓");
+ CODED_ENTITIES.put("↔", "↔");
+ CODED_ENTITIES.put("↵", "↵");
+ CODED_ENTITIES.put("⇐", "⇐");
+ CODED_ENTITIES.put("⇑", "⇑");
+ CODED_ENTITIES.put("⇒", "⇒");
+ CODED_ENTITIES.put("⇓", "⇓");
+ CODED_ENTITIES.put("⇔", "⇔");
+ CODED_ENTITIES.put("∀", "∀");
+ CODED_ENTITIES.put("∂", "∂");
+ CODED_ENTITIES.put("∃", "∃");
+ CODED_ENTITIES.put("∅", "∅");
+ CODED_ENTITIES.put("∇", "∇");
+ CODED_ENTITIES.put("∈", "∈");
+ CODED_ENTITIES.put("∉", "∉");
+ CODED_ENTITIES.put("∋", "∋");
+ CODED_ENTITIES.put("∏", "∏");
+ CODED_ENTITIES.put("∑", "∑");
+ CODED_ENTITIES.put("−", "−");
+ CODED_ENTITIES.put("∗", "∗");
+ CODED_ENTITIES.put("√", "√");
+ CODED_ENTITIES.put("∝", "∝");
+ CODED_ENTITIES.put("∞", "∞");
+ CODED_ENTITIES.put("∠", "∠");
+ CODED_ENTITIES.put("∧", "∧");
+ CODED_ENTITIES.put("∨", "∨");
+ CODED_ENTITIES.put("∩", "∩");
+ CODED_ENTITIES.put("∪", "∪");
+ CODED_ENTITIES.put("∫", "∫");
+ CODED_ENTITIES.put("∴", "∴");
+ CODED_ENTITIES.put("∼", "∼");
+ CODED_ENTITIES.put("≅", "≅");
+ CODED_ENTITIES.put("≈", "≈");
+ CODED_ENTITIES.put("≠", "≠");
+ CODED_ENTITIES.put("≡", "≡");
+ CODED_ENTITIES.put("≤", "≤");
+ CODED_ENTITIES.put("≥", "≥");
+ CODED_ENTITIES.put("⊂", "⊂");
+ CODED_ENTITIES.put("⊃", "⊃");
+ CODED_ENTITIES.put("⊄", "⊄");
+ CODED_ENTITIES.put("⊆", "⊆");
+ CODED_ENTITIES.put("⊇", "⊇");
+ CODED_ENTITIES.put("⊕", "⊕");
+ CODED_ENTITIES.put("⊗", "⊗");
+ CODED_ENTITIES.put("⊥", "⊥");
+ CODED_ENTITIES.put("⋅", "⋅");
+ CODED_ENTITIES.put("⌈", "⌈");
+ CODED_ENTITIES.put("⌉", "⌉");
+ CODED_ENTITIES.put("⌊", "⌊");
+ CODED_ENTITIES.put("⌋", "⌋");
+ CODED_ENTITIES.put("⟨", "〈");
+ CODED_ENTITIES.put("⟩", "〉");
+ CODED_ENTITIES.put("◊", "◊");
+ CODED_ENTITIES.put("♠", "♠");
+ CODED_ENTITIES.put("♣", "♣");
+ CODED_ENTITIES.put("♥", "♥");
+ CODED_ENTITIES.put("♦", "♦");
+
+ // Special characters for HTML.
+ // HTMLspecial "-//W3C//ENTITIES Special//EN//HTML"
+
+ CODED_ENTITIES.put(""", """);
+ CODED_ENTITIES.put("&", "&");
+ CODED_ENTITIES.put("<", "<");
+ CODED_ENTITIES.put(">", ">");
+ CODED_ENTITIES.put("Œ", "Œ");
+ CODED_ENTITIES.put("œ", "œ");
+ CODED_ENTITIES.put("Š", "Š");
+ CODED_ENTITIES.put("š", "š");
+ CODED_ENTITIES.put("Ÿ", "Ÿ");
+ CODED_ENTITIES.put("ˆ", "ˆ");
+ CODED_ENTITIES.put("˜", "˜");
+ CODED_ENTITIES.put(" ", " ");
+ CODED_ENTITIES.put(" ", " ");
+ CODED_ENTITIES.put(" ", " ");
+ CODED_ENTITIES.put("‌", "‌");
+ CODED_ENTITIES.put("‍", "‍");
+ CODED_ENTITIES.put("‎", "‎");
+ CODED_ENTITIES.put("‏", "‏");
+ CODED_ENTITIES.put("–", "–");
+ CODED_ENTITIES.put("—", "—");
+ CODED_ENTITIES.put("‘", "‘");
+ CODED_ENTITIES.put("’", "’");
+ CODED_ENTITIES.put("‚", "‚");
+ CODED_ENTITIES.put("“", "“");
+ CODED_ENTITIES.put("”", "”");
+ CODED_ENTITIES.put("„", "„");
+ CODED_ENTITIES.put("†", "†");
+ CODED_ENTITIES.put("‡", "‡");
+ CODED_ENTITIES.put("‰", "‰");
+ CODED_ENTITIES.put("‹", "‹");
+ CODED_ENTITIES.put("›", "›");
+ CODED_ENTITIES.put("€", "€");
+ }
+
+ //
+ // It shouldn't be here but well, just reusing the CODED_ENTITIES Map :)
+ //
+
+ private static Pattern ENTITIES_PATTERN = Pattern.compile( "&[A-Za-z^#]+;" );
+
+
+ public String processHtmlEntities(String s) {
+ if (s.indexOf('&')==-1) {
+ return s;
+ }
+ StringBuffer sb = new StringBuffer(s.length());
+ int pos = 0;
+ while (pos<s.length()) {
+ String chunck = s.substring(pos);
+ Matcher m = ENTITIES_PATTERN.matcher(chunck);
+ if (m.find()) {
+ int b = pos + m.start();
+ int e = pos + m.end();
+ if (b>pos) {
+ sb.append(s.substring(pos,b));
+ pos = b;
+ }
+ chunck = s.substring(pos,e);
+ String codedEntity = (String) CODED_ENTITIES.get(chunck);
+ if (codedEntity==null) {
+ codedEntity = chunck;
+ }
+ sb.append(codedEntity);
+ pos = e;
+ }
+ else {
+ sb.append(chunck);
+ pos += chunck.length();
+ }
+ }
+ return sb.toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/ActivityStreamModule.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/ActivityStreamModule.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/ActivityStreamModule.java
new file mode 100644
index 0000000..7151995
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/ActivityStreamModule.java
@@ -0,0 +1,43 @@
+/*
+ * 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;
+
+import org.rometools.feed.module.activitystreams.types.ActivityObject;
+import org.rometools.feed.module.activitystreams.types.Mood;
+import org.rometools.feed.module.activitystreams.types.Verb;
+
+/**
+ *
+ * @author robert.cooper
+ */
+public interface ActivityStreamModule {
+
+ public Verb getVerb();
+ public void setVerb(Verb verb);
+
+ public ActivityObject getObject();
+ public void setObject(ActivityObject object);
+
+ public ActivityObject getTarget();
+ public void setTarget(ActivityObject object);
+
+ public Mood getMood();
+ public void setMood(Mood mood);
+
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/ActivityStreamModuleImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/ActivityStreamModuleImpl.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/ActivityStreamModuleImpl.java
new file mode 100644
index 0000000..f56bcb9
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/ActivityStreamModuleImpl.java
@@ -0,0 +1,83 @@
+/*
+ * 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;
+
+import org.rometools.feed.module.activitystreams.types.ActivityObject;
+import org.rometools.feed.module.activitystreams.types.Mood;
+import org.rometools.feed.module.activitystreams.types.Verb;
+
+
+/**
+ *
+ * @author robert.cooper
+ */
+public class ActivityStreamModuleImpl implements ActivityStreamModule {
+ private ActivityObject object;
+ private Verb verb;
+
+ /**
+ * Set the value of object
+ *
+ * @param newobject new value of object
+ */
+ public void setObject(ActivityObject newobject) {
+ this.object = newobject;
+ }
+
+ /**
+ * Get the value of object
+ *
+ * @return the value of object
+ */
+ public ActivityObject getObject() {
+ return this.object;
+ }
+
+ /**
+ * Set the value of verb
+ *
+ * @param newverb new value of verb
+ */
+ public void setVerb(Verb newverb) {
+ this.verb = newverb;
+ }
+
+ /**
+ * Get the value of verb
+ *
+ * @return the value of verb
+ */
+ public Verb getVerb() {
+ return this.verb;
+ }
+
+ public ActivityObject getTarget() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void setTarget(ActivityObject object) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public Mood getMood() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void setMood(Mood mood) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/package.html
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/package.html b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/package.html
new file mode 100644
index 0000000..ed15c92
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/package.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+http://activitystrea.ms/schema/1.0/activity-schema-02.html
+http://activitystrea.ms/spec/1.0/atom-activity-02.html
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/ActivityObject.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/ActivityObject.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/ActivityObject.java
new file mode 100644
index 0000000..5b40c67
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/ActivityObject.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;
+
+import com.sun.syndication.feed.atom.Entry;
+import org.rometools.feed.module.georss.GeoRSSModule;
+import org.rometools.feed.module.portablecontacts.ContactModule;
+/**
+ *
+ * @author robert.cooper
+ */
+public abstract class ActivityObject extends Entry implements HasLocation {
+
+
+ public abstract String getTypeIRI();
+
+ public GeoRSSModule getLocation() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void setLocation(GeoRSSModule location) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public ContactModule getAddress(){
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void setAddress(ContactModule address){
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Article.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Article.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Article.java
new file mode 100644
index 0000000..c094a77
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Article.java
@@ -0,0 +1,53 @@
+/*
+ * 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;
+
+
+/**
+ * <p>The "article" Object type indicates that the Object is an
+ * article, such as a news article, a knowledge base entry, or other
+ * similar construct.
+ *</p>
+ *<p>Articles generally consist of paragraphs of text, in some cases
+ * incorporating embedded media such as photos and inline hyperlinks to
+ * other resources.
+ *</p>
+ *<p>The "Article" Object type is identified by the URL <tt>http://activitystrea.ms/schema/1.0/article</tt>.
+ *</p>
+ *<p>An article has the following additional components:
+ *</p>
+ *<p></p>
+ *<blockquote class="text"><dl>
+ *<dt>Name</dt>
+ *<dd>The title of the article. Represented by the
+ * Name component of the base Object Construct.
+ *</dd>
+ *<dt>Content</dt>
+ *<dd>The main body content of the article.
+ * Represented in JSON as a property called <tt>content</tt>
+ * whose value is a JSON string containing a fragment of HTML that
+ * represents the content.
+ *</dd>
+ *</dl></blockquote>
+ * @author robert.cooper
+ */
+public class Article extends ActivityObject {
+ @Override
+ public String getTypeIRI() {
+ return "http://activitystrea.ms/schema/1.0/article";
+ }
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Audio.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Audio.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Audio.java
new file mode 100644
index 0000000..102bfb3
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Audio.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;
+
+
+/**
+ * <p>The "audio" Object type represents audio content.
+ *</p>
+ *<p>The "audio" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/audio</tt>.
+ *</p>
+ *<p>An audio has the following additional components:
+ *</p>
+ *<p></p>
+ *<blockquote class="text"><dl>
+ *<dt>Audio Stream Link</dt>
+ *<dd>A Media Link Construct linking
+ * to the audio content itself. Represented in JSON as a property
+ * called <tt>stream</tt> whose value is a JSON
+ * object with properties as defined in [TODO: xref the JSON
+ * serialization of a Media Link Construct]
+ *</dd>
+ *<dt>Embed Code</dt>
+ *<dd>An HTML fragment that, when embedded in
+ * an HTML page, will provide an interactive player UI for the
+ * audio stream. Represented in JSON as a property called <tt>embedCode</tt> whose value is a JSON string
+ * containing the fragment of HTML.
+ *</dd>
+ *</dl>
+ * @author robert.cooper
+ */
+public class Audio extends ActivityObject {
+ private String embedCode;
+ private String streamLink;
+
+ /**
+ * Set the value of embedCode
+ *
+ * @param newembedCode new value of embedCode
+ */
+ public void setEmbedCode(String newembedCode) {
+ this.embedCode = newembedCode;
+ }
+
+ /**
+ * Get the value of embedCode
+ *
+ * @return the value of embedCode
+ */
+ public String getEmbedCode() {
+ return this.embedCode;
+ }
+
+ /**
+ * Set the value of streamLink
+ *
+ * @param newstreamLink new value of streamLink
+ */
+ public void setStreamLink(String newstreamLink) {
+ this.streamLink = newstreamLink;
+ }
+
+ /**
+ * Get the value of streamLink
+ *
+ * @return the value of streamLink
+ */
+ public String getStreamLink() {
+ return this.streamLink;
+ }
+
+ @Override
+ public String getTypeIRI() {
+ return "http://activitystrea.ms/schema/1.0/audio";
+ }
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Bookmark.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Bookmark.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Bookmark.java
new file mode 100644
index 0000000..ce6e9bc
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Bookmark.java
@@ -0,0 +1,119 @@
+/*
+ * 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 com.sun.syndication.feed.atom.Link;
+
+
+/**
+ * <p>The "bookmark" Object type represents a pointer to some URL --
+ * typically a web page. In most cases, a bookmark is specific to a
+ * given user and contains metadata chosen by that user. Bookmark
+ * Objects are similar in principle to the concept of bookmarks or
+ * favorites in a web browser. A bookmark represents a pointer to the
+ * URL, not the URL or the associated resource itself.
+ *</p>
+ *<p>When dealing with bookmarks it is important to note the
+ * distinction between the title, description, and URL of the bookmark
+ * itself and the title, content, and URL of the resource that is the
+ * target of the bookmark. In some implementations these MAY be the
+ * same, but bookmark managers often allow a user to edit the title and
+ * description of his or her own bookmarks to differ from the metadata
+ * on the target itself.
+ *</p>
+ *<p>Some implementations refer to this Object type as a "link". This
+ * specification uses the term "bookmark" to avoid confusion with the
+ * general concept of hyperlinks which apply to all Object types.
+ *</p>
+ *<p>Since bookmarks are often specific to a particular user, even
+ * though multiple users might have bookmarks pointing at the same
+ * resource, it is appropriate to use the "post" Verb to describe the
+ * publication of such a bookmark. The "mark as favorite" Verb SHOULD
+ * be used when a user flags another user's bookmark as being a
+ * favorite without creating his own bookmark, or when a user flags his
+ * own bookmark as being a favorite as a special classification within
+ * his own bookmark collection.
+ *</p>
+ *<p>The "bookmark" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/bookmark</tt>.
+ *</p>
+ *<p>A bookmark has the following additional components:
+ *</p>
+ *<p></p>
+ *<blockquote class="text"><dl>
+ *<dt>Title</dt>
+ *<dd>The title of the bookmark, as entered by the
+ * user who created the bookmark. Represented by the Name component
+ * of the base Object Construct. Publishers MAY use the title of
+ * the target resource as a default for this property where a user
+ * hasn't entered a customized value.
+ *</dd>
+ *<dt>Target URL</dt>
+ *<dd>The URL of the item that is the target
+ * of the bookmark. Represented in JSON by a property called <tt>targetUrl</tt> whose value is a JSON string
+ * containing the target URL.
+ *</dd>
+ *<dt>Thumbnail</dt>
+ *<dd>The URL and metadata for a thumbnail
+ * version of the page. 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.
+ *</dd>
+ *</dl></blockquote>
+ * @author robert.cooper
+ */
+public class Bookmark extends ActivityObject {
+
+ @Override
+ public String getTypeIRI() {
+ return "http://activitystrea.ms/schema/1.0/bookmark";
+ }
+
+
+
+
+ /**
+ * Get the value of thumbnail
+ *
+ * @return the value of thumbnail
+ */
+ public Link getThumbnail() {
+ return this.findRelatedLink("thumbnail");
+ }
+
+ /**
+ * Set the value of thumbnail
+ *
+ * @param newthumbnail new value of thumbnail
+ */
+ public void setThumbnail(Link newthumbnail) {
+ Link old = null;
+ for(Link l : this.getOtherLinks()){
+ if("thumbnail".equals(l.getRel())){
+ old = l;
+ break;
+ }
+ }
+ if(old != null){
+ this.getOtherLinks().remove(old);
+ newthumbnail.setRel("thumbnail");
+ }
+ this.getOtherLinks().add(newthumbnail);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Comment.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Comment.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Comment.java
new file mode 100644
index 0000000..0e5cfe0
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Comment.java
@@ -0,0 +1,61 @@
+/*
+ * 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;
+
+/**
+ * <p>The "comment" object type represents a textual response to
+ * another object.
+ *</p>
+ *<p>The comment object type MUST NOT be used for other kinds of
+ * replies, such as video replies or reviews.
+ *</p>
+ *<p>The "comment" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/comment</tt>.
+ *</p>
+ *<p>A comment has the following additional components:
+ *</p>
+ *<p></p>
+ *<blockquote class="text"><dl>
+ *<dt>Subject</dt>
+ *<dd>The subject of the comment. Represented by
+ * the Name component of the base Object Construct. Many systems do
+ * not have the concept of a title or subject for a comment; such
+ * systems MUST omit the Name component. Processors SHOULD refer to
+ * such comments as simply being "a comment", with appropriate
+ * localization, if they are to be described in a sentence.
+ *</dd>
+ *<dt>Content</dt>
+ *<dd>The content of the comment. Represented in
+ * JSON as a property called <tt>content</tt>
+ * 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.
+ *</dd>
+ *</dl></blockquote>
+ * @author robert.cooper
+ */
+public class Comment extends ActivityObject {
+
+ @Override
+ public String getTypeIRI() {
+ return "http://activitystrea.ms/schema/1.0/comment";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Event.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Event.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Event.java
new file mode 100644
index 0000000..4d9bed7
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Event.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;
+
+/**
+ * <p>The "event" object type represents an event that occurs in a
+ * certain place during a particular interval of time.
+ *</p>
+ *<p>The object type URL for the "event" object type is <tt>http://activitystrea.ms/schema/1.0/event</tt>.
+ *</p>
+ *<p>An event has the following additional components:
+ *</p>
+ *<p></p>
+ *<blockquote class="text"><dl>
+ *<dt>Start Date and Time</dt>
+ *<dd>The date and time that the
+ * event begins. Represented in JSON as a property called <tt>startTime</tt> whose value is JSON string
+ * containing a W3CDTF timestamp. [TODO: Reference W3CDTF spec.]
+ * [TODO: Include prose describing how to represent just a date vs.
+ * a date and time.]
+ *</dd>
+ *<dt>End Date and Time</dt>
+ *<dd>The date and time that the event
+ * ends. Represented in JSON as a property called <tt>endTime</tt> whose value is JSON string
+ * containing a W3CDTF timestamp. [TODO: Reference W3CDTF spec.]
+ * [TODO: Include prose describing how to represent just a date vs.
+ * a date and time.]
+ *</dd>
+ *</dl></blockquote>
+ *
+ * @author robert.cooper
+ */
+public class Event extends ActivityObject {
+
+ @Override
+ public String getTypeIRI() {
+ return "http://activitystrea.ms/schema/1.0/event";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/File.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/File.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/File.java
new file mode 100644
index 0000000..7d07359
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/File.java
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+/**
+ * <p>The "file" Object type represents some document or other file
+ * with no additional machine-readable semantics.
+ *</p>
+ *<p>It is intended that this type be used as a base type for other
+ * Objects that manifest as files, so that additional semantics can be
+ * added while providing a fallback ability for clients that do not
+ * support the more specific Object type.
+ *</p>
+ *<p>The "file" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/file</tt>.
+ *</p>
+ *<p>A file has the following additional components:
+ *</p>
+ *<p></p>
+ *<blockquote class="text"><dl>
+ *<dt>Associated File URL</dt>
+ *<dd>The URL of the file described
+ * by this Object Construct. Represented in JSON by a property
+ * called <tt>fileUrl</tt> whose value is a JSON
+ * string containing the URL.
+ *</dd>
+ *<dt>File MIME Type</dt>
+ *<dd>The MIME type of the file described
+ * by this Object Construct. Represented in JSON by a property
+ * called <tt>mimeType</tt> whose value is a
+ * JSON string containing the MIME type.
+ *</dd>
+ *</dl></blockquote>
+ * @author robert.cooper
+ */
+public class File extends ActivityObject {
+
+ @Override
+ public String getTypeIRI() {
+ return "http://activitystrea.ms/schema/1.0/file";
+ }
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Folder.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Folder.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Folder.java
new file mode 100644
index 0000000..c5dca30
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Folder.java
@@ -0,0 +1,49 @@
+/*
+ * 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;
+
+/**
+ * <p>The "folder" object type represents a collection of files or
+ * media objects. This is similar to the "photo album" object type, but
+ * not specifically representing a collection of "photos."
+ *</p>
+ *<p>The "folder" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/folder</tt>.
+ *</p>
+ *<p>A folder has the following additional components:
+ *</p>
+ *<p></p>
+ *<blockquote class="text"><dl>
+ *<dt>Preview Image Link</dt>
+ *<dd>A Media Link Construct
+ * describing an image file that can be used as a preview image for
+ * the folder. 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.
+ *</dd>
+ *</dl></blockquote>
+ * @author robert.cooper
+ */
+public class Folder extends ActivityObject{
+
+ @Override
+ public String getTypeIRI() {
+ return "http://activitystrea.ms/schema/1.0/folder";
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/00c22e7c/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Group.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Group.java b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Group.java
new file mode 100644
index 0000000..663848e
--- /dev/null
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/src/ext/java/org/rometools/feed/module/activitystreams/types/Group.java
@@ -0,0 +1,32 @@
+/*
+ * 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;
+
+/**
+ * <p>The "group" Object type represents a social networking group. A
+ * group is a collection of people which people can join and leave.
+ *</p>
+ *<p>The "group" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/group</tt>.
+ *</p>
+ *<p>A group has no additional components.
+
+ * @author robert.cooper
+ */
+public class Group {
+
+}