abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1173209 [33/49] - in /abdera/abdera2: ./ .settings/ activities/ activities/src/ activities/src/main/ activities/src/main/java/ activities/src/main/java/org/ activities/src/main/java/org/apache/ activities/src/main/java/org/apache/abdera2/ ...
Date Tue, 20 Sep 2011 15:57:20 GMT
Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssContent.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssContent.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssContent.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssContent.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import javax.activation.DataHandler;
+import javax.activation.MimeType;
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.model.Content;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+
+public class RssContent extends ElementWrapper implements Content {
+
+    public RssContent(Element internal) {
+        super(internal);
+    }
+
+    public RssContent(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public Type getContentType() {
+        return Type.HTML;
+    }
+
+    public DataHandler getDataHandler() {
+        return null;
+    }
+
+    public MimeType getMimeType() {
+        return null;
+    }
+
+    public IRI getResolvedSrc() {
+        return null;
+    }
+
+    public IRI getSrc() {
+        return null;
+    }
+
+    public String getValue() {
+        return getText();
+    }
+
+    public <T extends Element> T getValueElement() {
+        return null;
+    }
+
+    public String getWrappedValue() {
+        return getText();
+    }
+
+    public Content setContentType(Type type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setDataHandler(DataHandler dataHandler) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setMimeType(String type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setSrc(String src) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setValue(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public <T extends Element> Content setValueElement(T value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setWrappedValue(String wrappedValue) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssContent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssDateTime.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssDateTime.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssDateTime.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssDateTime.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.DateTime;
+import org.apache.abdera2.model.DateTimeWrapper;
+import org.apache.abdera2.model.Element;
+
+public class RssDateTime extends DateTimeWrapper implements DateTime {
+
+    private static String[] masks =
+        {"EEE, dd MMM yyyy HH:mm:ss z", "dd MMM yyyy HH:mm z", "dd MMM yyyy", "-yy-MM-dd", "-yy-MM", "-yymm",
+         "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd'T'HH:mm:ss.SSSz", "yyyy-MM-dd't'HH:mm:ss.SSSz", // invalid
+         "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "yyyy-MM-dd't'HH:mm:ss.SSS'z'", // invalid
+         "yyyy-MM-dd'T'HH:mm:ssz", "yyyy-MM-dd't'HH:mm:ssz", // invalid
+         "yyyy-MM-dd'T'HH:mm:ss'Z'", "yyyy-MM-dd't'HH:mm:ss'Z'", // invalid
+         "yyyy-MM-dd't'HH:mm:ss'z'", // invalid
+         "yyyy-MM-dd'T'HH:mm:ss'z'", // invalid
+         "yyyy-MM-dd'T'HH:mm:ss'z'", // invalid
+         "yyyy-MM-dd'T'HH:mmz", // invalid
+         "yyyy-MM-dd't'HH:mmz", // invalid
+         "yyyy-MM-dd'T'HH:mm'Z'", // invalid
+         "yyyy-MM-dd't'HH:mm'z'", // invalid
+         "yyyy-MM-dd", "yyyy-MM", "yyyyMMdd", "yyMMdd", "yyyy"};
+
+    public RssDateTime(Element internal) {
+        super(internal);
+    }
+
+    public RssDateTime(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    @Override
+    public org.apache.abdera2.common.date.DateTime getValue() {
+        return parse(getText());
+    }
+
+    @Override
+    public DateTime setCalendar(Calendar date) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    @Override
+    public DateTime setDate(Date date) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    @Override
+    public DateTime setString(String date) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    @Override
+    public DateTime setTime(long date) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    @Override
+    public DateTime setValue(org.apache.abdera2.common.date.DateTime dateTime) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    private org.apache.abdera2.common.date.DateTime parse(String value) {
+        for (String mask : masks) {
+            try {
+                SimpleDateFormat sdf = new SimpleDateFormat(mask);
+                sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
+                Date d = sdf.parse(value);
+                return new org.apache.abdera2.common.date.DateTime(d);
+            } catch (Exception e) {
+            }
+        }
+        return null;
+    }
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssDateTime.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssEnclosure.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssEnclosure.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssEnclosure.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssEnclosure.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import java.util.List;
+
+import javax.activation.MimeType;
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ExtensibleElement;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+import org.apache.abdera2.model.Link;
+
+public class RssEnclosure extends ExtensibleElementWrapper implements Link {
+
+    public RssEnclosure(Element internal) {
+        super(internal);
+    }
+
+    public RssEnclosure(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public IRI getHref() {
+        String url = getAttributeValue("url");
+        return (url != null) ? new IRI(url) : null;
+    }
+
+    public String getHrefLang() {
+        return null;
+    }
+
+    public long getLength() {
+        String l = getAttributeValue("length");
+        return (l != null) ? Integer.parseInt(l) : -1;
+    }
+
+    public MimeType getMimeType() {
+        try {
+            String type = getAttributeValue("type");
+            return (type != null) ? new MimeType(type) : null;
+        } catch (javax.activation.MimeTypeParseException e) {
+            throw new org.apache.abdera2.common.mediatype.MimeTypeParseException(e);
+        }
+    }
+
+    public String getRel() {
+        return "enclosure";
+    }
+
+    public IRI getResolvedHref() {
+        return getHref();
+    }
+
+    public String getTitle() {
+        return null;
+    }
+
+    public Link setHref(String href) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+    
+    public Link setHref(IRI href) {
+      throw new UnsupportedOperationException("Modifications are not allowed");
+  }
+
+    public Link setHrefLang(String lang) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setLength(long length) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setMimeType(String type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setRel(String rel) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setTitle(String title) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public <T extends ExtensibleElement> T addExtension(Element extension) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public <T extends Element> T addExtension(QName qname) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public <T extends Element> T addExtension(String namespace, String localPart, String prefix) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Element addSimpleExtension(QName qname, String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Element addSimpleExtension(String namespace, String localPart, String prefix, String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public <T extends Element> T getExtension(QName qname) {
+        return null;
+    }
+
+    public <T extends Element> T getExtension(Class<T> _class) {
+        return null;
+    }
+
+    public List<Element> getExtensions() {
+        return null;
+    }
+
+    public List<Element> getExtensions(String uri) {
+        return null;
+    }
+
+    public <T extends Element> List<T> getExtensions(QName qname) {
+        return null;
+    }
+
+    public String getSimpleExtension(QName qname) {
+        return null;
+    }
+
+    public String getSimpleExtension(String namespace, String localPart, String prefix) {
+        return null;
+    }
+
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssEnclosure.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssExtensionFactory.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssExtensionFactory.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssExtensionFactory.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssExtensionFactory.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import org.apache.abdera2.common.anno.Namespace;
+import org.apache.abdera2.factory.AbstractExtensionFactory;
+import static org.apache.abdera2.ext.rss.RssConstants.*;
+
+@Namespace({"",ENC_NS,DC_NS,RDF_NS,RSS1_NS})
+public class RssExtensionFactory extends AbstractExtensionFactory {
+
+    public RssExtensionFactory() {
+        addMimeType(QNAME_RSS, RSS_MEDIATYPE);
+        addMimeType(QNAME_RDF, RDF_MEDIATYPE);
+        addImpl(QNAME_RSS, RssFeed.class);
+        addImpl(QNAME_RDF, RssFeed.class);
+        addImpl(QNAME_CHANNEL, RssChannel.class);
+        addImpl(QNAME_RDF_CHANNEL, RssChannel.class);
+        addImpl(QNAME_ITEM, RssItem.class);
+        addImpl(QNAME_RDF_ITEM, RssItem.class);
+        addImpl(QNAME_LINK, RssLink.class);
+        addImpl(QNAME_RDF_LINK, RssLink.class);
+        addImpl(QNAME_TITLE, RssText.class);
+        addImpl(QNAME_RDF_TITLE, RssText.class);
+        addImpl(QNAME_DC_TITLE, RssText.class);
+        addImpl(QNAME_DESCRIPTION, RssText.class);
+        addImpl(QNAME_RDF_DESCRIPTION, RssText.class);
+        addImpl(QNAME_DC_DESCRIPTION, RssText.class);
+        addImpl(QNAME_COPYRIGHT, RssText.class);
+        addImpl(QNAME_DC_RIGHTS, RssText.class);
+        addImpl(QNAME_MANAGINGEDITOR, RssPerson.class);
+        addImpl(QNAME_MANAGINGEDITOR2, RssPerson.class);
+        addImpl(QNAME_DC_CREATOR, RssPerson.class);
+        addImpl(QNAME_DC_CONTRIBUTOR, RssPerson.class);
+        addImpl(QNAME_WEBMASTER, RssPerson.class);
+        addImpl(QNAME_WEBMASTER2, RssPerson.class);
+        addImpl(QNAME_PUBDATE, RssDateTime.class);
+        addImpl(QNAME_PUBDATE2, RssDateTime.class);
+        addImpl(QNAME_LASTBUILDDATE, RssDateTime.class);
+        addImpl(QNAME_LASTBUILDDATE2, RssDateTime.class);
+        addImpl(QNAME_DC_DATE, RssDateTime.class);
+        addImpl(QNAME_CATEGORY, RssCategory.class);
+        addImpl(QNAME_DC_SUBJECT, RssCategory.class);
+        addImpl(QNAME_GENERATOR, RssGenerator.class);
+        addImpl(QNAME_DOCS, RssLink.class);
+        addImpl(QNAME_CLOUD, RssCloud.class);
+        addImpl(QNAME_TTL, RssText.class);
+        addImpl(QNAME_IMAGE, RssImage.class);
+        addImpl(QNAME_RDF_IMAGE, RssImage.class);
+        addImpl(QNAME_TEXTINPUT, RssTextInput.class);
+        addImpl(QNAME_TEXTINPUT2, RssTextInput.class);
+        addImpl(QNAME_SKIPHOURS, RssSkipHours.class);
+        addImpl(QNAME_SKIPHOURS2, RssSkipHours.class);
+        addImpl(QNAME_SKIPDAYS, RssSkipDays.class);
+        addImpl(QNAME_SKIPDAYS2, RssSkipDays.class);
+        addImpl(QNAME_URL, RssUriElement.class);
+        addImpl(QNAME_RDF_URL, RssUriElement.class);
+        addImpl(QNAME_AUTHOR, RssPerson.class);
+        addImpl(QNAME_ENCLOSURE, RssEnclosure.class);
+        addImpl(QNAME_GUID, RssGuid.class);
+        addImpl(QNAME_DC_IDENTIFIER, RssGuid.class);
+        addImpl(QNAME_COMMENTS, RssLink.class);
+        addImpl(QNAME_SOURCE, RssSource.class);
+        addImpl(QNAME_DC_SOURCE, RssSource.class);
+        addImpl(QNAME_CONTENT_ENCODED, RssContent.class);
+    }
+
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssExtensionFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssFeed.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssFeed.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssFeed.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssFeed.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,584 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.common.selector.Selector;
+import org.apache.abdera2.model.Category;
+import org.apache.abdera2.model.Collection;
+import org.apache.abdera2.model.DateTime;
+import org.apache.abdera2.model.Div;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.Entry;
+import org.apache.abdera2.model.ExtensibleElement;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+import org.apache.abdera2.model.Feed;
+import org.apache.abdera2.model.Generator;
+import org.apache.abdera2.model.IRIElement;
+import org.apache.abdera2.model.Link;
+import org.apache.abdera2.model.Person;
+import org.apache.abdera2.model.Source;
+import org.apache.abdera2.model.Text;
+import org.apache.abdera2.model.Text.Type;
+
+@SuppressWarnings("unchecked")
+public class RssFeed extends ExtensibleElementWrapper implements Feed {
+
+    public RssFeed(Element internal) {
+        super(internal);
+    }
+
+    public RssFeed(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    private RssChannel getChannel() {
+        RssChannel c = super.getExtension(RssConstants.QNAME_CHANNEL);
+        if (c == null)
+            c = super.getExtension(RssConstants.QNAME_RDF_CHANNEL);
+        return c;
+    }
+
+    public Feed addEntry(Entry entry) {
+        getChannel().addEntry(entry);
+        return this;
+    }
+
+    public Entry addEntry() {
+        return getChannel().addEntry();
+    }
+
+    public Source getAsSource() {
+        throw new UnsupportedOperationException("Converting to source is not supported");
+    }
+
+    public List<Entry> getEntries() {
+        return getChannel().getEntries();
+    }
+
+    public Entry getEntry(String id) {
+        return getChannel().getEntry(id);
+    }
+
+    public Feed insertEntry(Entry entry) {
+        getChannel().insertEntry(entry);
+        return this;
+    }
+
+    public Entry insertEntry() {
+        return getChannel().insertEntry();
+    }
+
+    public Feed sortEntries(Comparator<Entry> comparator) {
+        getChannel().sortEntries(comparator);
+        return this;
+    }
+
+    public Feed sortEntriesByEdited(boolean new_first) {
+        getChannel().sortEntriesByEdited(new_first);
+        return this;
+    }
+
+    public Feed sortEntriesByUpdated(boolean new_first) {
+        getChannel().sortEntriesByUpdated(new_first);
+        return this;
+    }
+
+    public <T extends Source> T addAuthor(Person person) {
+        getChannel().addAuthor(person);
+        return (T)this;
+    }
+
+    public Person addAuthor(String name) {
+        return getChannel().addAuthor(name);
+    }
+
+    public Person addAuthor(String name, String email, String iri) {
+        return getChannel().addAuthor(name, email, iri);
+    }
+
+    public <T extends Source> T addCategory(Category category) {
+        getChannel().addCategory(category);
+        return (T)this;
+    }
+
+    public Category addCategory(String term) {
+        return getChannel().addCategory(term);
+    }
+
+    public Category addCategory(String scheme, String term, String label) {
+        return getChannel().addCategory(scheme, term, label);
+    }
+
+    public <T extends Source> T addContributor(Person person) {
+        throw new UnsupportedOperationException("Contributor's are not supported");
+    }
+
+    public Person addContributor(String name) {
+        throw new UnsupportedOperationException("Contributor's are not supported");
+    }
+
+    public Person addContributor(String name, String email, String iri) {
+        throw new UnsupportedOperationException("Contributor's are not supported");
+    }
+
+    public <T extends Source> T addLink(Link link) {
+        getChannel().addLink(link);
+        return (T)this;
+    }
+
+    public Link addLink(String href) {
+        return getChannel().addLink(href);
+    }
+
+    public Link addLink(String href, String rel) {
+        return getChannel().addLink(href, rel);
+    }
+
+    public Link addLink(String href, String rel, String type, String title, String hreflang, long length) {
+        return getChannel().addLink(href, rel, type, title, hreflang, length);
+    }
+
+    public Link getAlternateLink() {
+        return getChannel().getAlternateLink();
+    }
+
+    public Link getAlternateLink(String type, String hreflang) {
+        return getChannel().getAlternateLink(type, hreflang);
+    }
+
+    public IRI getAlternateLinkResolvedHref() {
+        return getChannel().getAlternateLinkResolvedHref();
+    }
+
+    public IRI getAlternateLinkResolvedHref(String type, String hreflang) {
+        return getChannel().getAlternateLinkResolvedHref(type, hreflang);
+    }
+
+    public Person getAuthor() {
+        return getChannel().getAuthor();
+    }
+
+    public List<Person> getAuthors() {
+        return getChannel().getAuthors();
+    }
+
+    public List<Category> getCategories() {
+        return getChannel().getCategories();
+    }
+
+    public List<Category> getCategories(String scheme) {
+        return getChannel().getCategories(scheme);
+    }
+
+    public Collection getCollection() {
+        // TODO: should I support this?
+        return null;
+    }
+
+    public List<Person> getContributors() {
+        return getChannel().getContributors();
+    }
+
+    public Generator getGenerator() {
+        return getChannel().getGenerator();
+    }
+
+    public IRI getIcon() {
+        return getChannel().getIcon();
+    }
+
+    public IRIElement getIconElement() {
+        return getChannel().getIconElement();
+    }
+
+    public IRI getId() {
+        return getChannel().getId();
+    }
+
+    public IRIElement getIdElement() {
+        return getChannel().getIdElement();
+    }
+
+    public Link getLink(String rel) {
+        return getChannel().getLink(rel);
+    }
+
+    public IRI getLinkResolvedHref(String rel) {
+        return getChannel().getLinkResolvedHref(rel);
+    }
+
+    public List<Link> getLinks() {
+        return getChannel().getLinks();
+    }
+
+    public List<Link> getLinks(String rel) {
+        return getChannel().getLinks(rel);
+    }
+
+    public List<Link> getLinks(String... rel) {
+        return getChannel().getLinks(rel);
+    }
+
+    public IRI getLogo() {
+        return getChannel().getLogo();
+    }
+
+    public IRIElement getLogoElement() {
+        return getChannel().getLogoElement();
+    }
+
+    public String getRights() {
+        return getChannel().getRights();
+    }
+
+    public Text getRightsElement() {
+        return getChannel().getRightsElement();
+    }
+
+    public Type getRightsType() {
+        return getChannel().getRightsType();
+    }
+
+    public Link getSelfLink() {
+        return getChannel().getSelfLink();
+    }
+
+    public IRI getSelfLinkResolvedHref() {
+        return getChannel().getSelfLinkResolvedHref();
+    }
+
+    public String getSubtitle() {
+        return getChannel().getSubtitle();
+    }
+
+    public Text getSubtitleElement() {
+        return getChannel().getSubtitleElement();
+    }
+
+    public Type getSubtitleType() {
+        return getChannel().getSubtitleType();
+    }
+
+    public String getTitle() {
+        return getChannel().getTitle();
+    }
+
+    public Text getTitleElement() {
+        return getChannel().getTitleElement();
+    }
+
+    public Type getTitleType() {
+        return getChannel().getTitleType();
+    }
+
+    public Date getUpdated() {
+        return getChannel().getUpdated();
+    }
+
+    public DateTime getUpdatedElement() {
+        return getChannel().getUpdatedElement();
+    }
+
+    public String getUpdatedString() {
+        return getChannel().getUpdatedString();
+    }
+
+    public Date getPublished() {
+        return getChannel().getPublished();
+    }
+
+    public DateTime getPublisheddElement() {
+        return getChannel().getPublishedElement();
+    }
+
+    public String getPublishedString() {
+        return getChannel().getPublishedString();
+    }
+
+    public IRIElement newId() {
+        return getChannel().newId();
+    }
+
+    public <T extends Source> T setCollection(Collection collection) {
+        throw new UnsupportedOperationException("Collection is not supported");
+    }
+
+    public <T extends Source> T setGenerator(Generator generator) {
+        getChannel().setGenerator(generator);
+        return (T)this;
+    }
+
+    public Generator setGenerator(String iri, String version, String value) {
+        return getChannel().setGenerator(iri, version, value);
+    }
+
+    public IRIElement setIcon(String iri) {
+        return getChannel().setIcon(iri);
+    }
+
+    public <T extends Source> T setIconElement(IRIElement iri) {
+        getChannel().setIconElement(iri);
+        return (T)this;
+    }
+
+    public IRIElement setId(String id) {
+        return getChannel().setId(id);
+    }
+
+    public IRIElement setId(String id, boolean normalize) {
+        return getChannel().setId(id, normalize);
+    }
+
+    public <T extends Source> T setIdElement(IRIElement id) {
+        getChannel().setIdElement(id);
+        return (T)this;
+    }
+
+    public IRIElement setLogo(String iri) {
+        return getChannel().setLogo(iri);
+    }
+
+    public <T extends Source> T setLogoElement(IRIElement iri) {
+        getChannel().setLogoElement(iri);
+        return (T)this;
+    }
+
+    public Text setRights(String value) {
+        return getChannel().setRights(value);
+    }
+
+    public Text setRights(String value, Type type) {
+        return getChannel().setRights(value, type);
+    }
+
+    public Text setRights(Div value) {
+        return getChannel().setRights(value);
+    }
+
+    public Text setRightsAsHtml(String value) {
+        return getChannel().setRightsAsHtml(value);
+    }
+
+    public Text setRightsAsXhtml(String value) {
+        return getChannel().setRightsAsXhtml(value);
+    }
+
+    public <T extends Source> T setRightsElement(Text text) {
+        getChannel().setRightsElement(text);
+        return (T)this;
+    }
+
+    public Text setSubtitle(String value) {
+        return getChannel().setSubtitle(value);
+    }
+
+    public Text setSubtitle(String value, Type type) {
+        return getChannel().setSubtitle(value, type);
+    }
+
+    public Text setSubtitle(Div value) {
+        return getChannel().setSubtitle(value);
+    }
+
+    public Text setSubtitleAsHtml(String value) {
+        return getChannel().setSubtitleAsHtml(value);
+    }
+
+    public Text setSubtitleAsXhtml(String value) {
+        return getChannel().setSubtitleAsXhtml(value);
+    }
+
+    public <T extends Source> T setSubtitleElement(Text text) {
+        getChannel().setSubtitleElement(text);
+        return (T)this;
+    }
+
+    public Text setTitle(String value) {
+        return getChannel().setTitle(value);
+    }
+
+    public Text setTitle(String value, Type type) {
+        return getChannel().setTitle(value, type);
+    }
+
+    public Text setTitle(Div value) {
+        return getChannel().setTitle(value);
+    }
+
+    public Text setTitleAsHtml(String value) {
+        return getChannel().setTitleAsHtml(value);
+    }
+
+    public Text setTitleAsXhtml(String value) {
+        return getChannel().setTitleAsXhtml(value);
+    }
+
+    public <T extends Source> T setTitleElement(Text text) {
+        getChannel().setTitleElement(text);
+        return (T)this;
+    }
+
+    public DateTime setUpdated(Date value) {
+        return getChannel().setUpdated(value);
+    }
+
+    public DateTime setUpdated(String value) {
+        return getChannel().setUpdated(value);
+    }
+
+    public <T extends Source> T setUpdatedElement(DateTime dateTime) {
+        getChannel().setUpdatedElement(dateTime);
+        return (T)this;
+    }
+
+    public <T extends ExtensibleElement> T addExtension(Element extension) {
+        getChannel().addExtension(extension);
+        return (T)this;
+    }
+
+    public <T extends Element> T addExtension(QName qname) {
+        return (T)getChannel().addExtension(qname);
+    }
+
+    public <T extends Element> T addExtension(String namespace, String localPart, String prefix) {
+        return (T)getChannel().addExtension(namespace, localPart, prefix);
+    }
+
+    public Element addSimpleExtension(QName qname, String value) {
+        return getChannel().addSimpleExtension(qname, value);
+    }
+
+    public Element addSimpleExtension(String namespace, String localPart, String prefix, String value) {
+        return getChannel().addSimpleExtension(namespace, localPart, prefix, value);
+    }
+
+    public <T extends Element> T getExtension(QName qname) {
+        return (T)getChannel().getExtension(qname);
+    }
+
+    public <T extends Element> T getExtension(Class<T> _class) {
+        return getChannel().getExtension(_class);
+    }
+
+    public List<Element> getExtensions() {
+        return getChannel().getExtensions();
+    }
+
+    public List<Element> getExtensions(String uri) {
+        return getChannel().getExtensions(uri);
+    }
+
+    public <T extends Element> List<T> getExtensions(QName qname) {
+        return getChannel().getExtensions(qname);
+    }
+
+    public String getSimpleExtension(QName qname) {
+        return getChannel().getSimpleExtension(qname);
+    }
+
+    public String getSimpleExtension(String namespace, String localPart, String prefix) {
+        return getChannel().getSimpleExtension(namespace, localPart, prefix);
+    }
+
+    public String getAttributeValue(String name) {
+        return getChannel().getAttributeValue(name);
+    }
+
+    public String getAttributeValue(QName qname) {
+        return getChannel().getAttributeValue(qname);
+    }
+
+    public List<QName> getAttributes() {
+        return getChannel().getAttributes();
+    }
+
+    public List<QName> getExtensionAttributes() {
+        return getChannel().getExtensionAttributes();
+    }
+
+    public String getLanguage() {
+        return getChannel().getLanguage();
+    }
+
+    public <T extends Element> T removeAttribute(QName qname) {
+        getChannel().removeAttribute(qname);
+        return (T)this;
+    }
+
+    public <T extends Element> T setAttributeValue(String name, String value) {
+        getChannel().setAttributeValue(name, value);
+        return (T)this;
+    }
+
+    public <T extends Element> T setAttributeValue(QName qname, String value) {
+        getChannel().setAttributeValue(qname, value);
+        return (T)this;
+    }
+
+    public <T extends Element> T setBaseUri(IRI base) {
+        // throw new UnsupportedOperationException("Setting the base uri with xml:base is not supported");
+        return (T)this;
+    }
+
+    public <T extends Element> T setBaseUri(String base) {
+        // throw new UnsupportedOperationException("Setting the base uri with xml:base is not supported");
+        return (T)this;
+    }
+
+    public <T extends Element> T setLanguage(String language) {
+        getChannel().setLanguage(language);
+        return (T)this;
+    }
+
+    public String getVersion() {
+        return super.getAttributeValue("version");
+    }
+
+    public Feed getAsFeed() {
+        throw new UnsupportedOperationException("Converting to feed is not supported");
+    }
+
+    public List<Person> getAuthors(Selector selector) {
+      return getChannel().getAuthors(selector);
+    }
+
+    public List<Category> getCategories(Selector selector) {
+      return getChannel().getCategories(selector);
+    }
+
+    public List<Person> getContributors(Selector selector) {
+      return getChannel().getContributors(selector);
+    }
+
+    public List<Link> getLinks(Selector selector) {
+      return getChannel().getLinks(selector);
+    }
+
+    public List<Entry> getEntries(Selector selector) {
+      return getChannel().getEntries(selector);
+    }
+
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssFeed.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGenerator.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGenerator.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGenerator.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGenerator.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import org.apache.abdera2.model.Generator;
+
+public class RssGenerator extends ElementWrapper implements Generator {
+
+    public RssGenerator(Element internal) {
+        super(internal);
+    }
+
+    public RssGenerator(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public IRI getResolvedUri() {
+        return null;
+    }
+
+    public IRI getUri() {
+        return null;
+    }
+
+    public String getVersion() {
+        return null;
+    }
+
+    public Generator setUri(String uri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Generator setVersion(String version) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGuid.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGuid.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGuid.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGuid.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import java.util.List;
+
+import javax.activation.MimeType;
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ExtensibleElement;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+import org.apache.abdera2.model.IRIElement;
+import org.apache.abdera2.model.Link;
+
+public class RssGuid extends ExtensibleElementWrapper implements IRIElement, Link {
+
+    public RssGuid(Element internal) {
+        super(internal);
+    }
+
+    public RssGuid(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public IRI getResolvedValue() {
+        return getValue();
+    }
+
+    public IRI getValue() {
+        String t = getText();
+        return (t != null) ? new IRI(t) : null;
+    }
+
+    public IRIElement setNormalizedValue(String iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public IRIElement setValue(String iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public boolean isPermalink() {
+        String v = getAttributeValue("isPermaLink");
+        if (v == null)
+            getAttributeValue("ispermalink");
+        return (v.equalsIgnoreCase("true") || v.equalsIgnoreCase("yes"));
+    }
+
+    public IRI getHref() {
+        return getValue();
+    }
+
+    public String getHrefLang() {
+        return null;
+    }
+
+    public long getLength() {
+        return -1;
+    }
+
+    public MimeType getMimeType() {
+        return null;
+    }
+
+    public String getRel() {
+        return Link.REL_ALTERNATE;
+    }
+
+    public IRI getResolvedHref() {
+        return getValue();
+    }
+
+    public String getTitle() {
+        return null;
+    }
+
+    public Link setHref(String href) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+    
+    public Link setHref(IRI href) {
+      throw new UnsupportedOperationException("Modifications are not allowed");
+  }
+
+    public Link setHrefLang(String lang) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setLength(long length) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setMimeType(String type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setRel(String rel) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setTitle(String title) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public <T extends ExtensibleElement> T addExtension(Element extension) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public <T extends Element> T addExtension(QName qname) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public <T extends Element> T addExtension(String namespace, String localPart, String prefix) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Element addSimpleExtension(QName qname, String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Element addSimpleExtension(String namespace, String localPart, String prefix, String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public <T extends Element> T getExtension(QName qname) {
+        return null;
+    }
+
+    public <T extends Element> T getExtension(Class<T> _class) {
+        return null;
+    }
+
+    public List<Element> getExtensions() {
+        return null;
+    }
+
+    public List<Element> getExtensions(String uri) {
+        return null;
+    }
+
+    public <T extends Element> List<T> getExtensions(QName qname) {
+        return null;
+    }
+
+    public String getSimpleExtension(QName qname) {
+        return null;
+    }
+
+    public String getSimpleExtension(String namespace, String localPart, String prefix) {
+        return null;
+    }
+
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssGuid.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssImage.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssImage.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssImage.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssImage.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+import org.apache.abdera2.model.IRIElement;
+import org.apache.abdera2.model.Link;
+import org.apache.abdera2.model.Text;
+
+public class RssImage extends ExtensibleElementWrapper implements IRIElement {
+
+    public RssImage(Element internal) {
+        super(internal);
+    }
+
+    public RssImage(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public IRI getResolvedValue() {
+        return getValue();
+    }
+
+    public IRI getValue() {
+        IRIElement iri = getExtension(RssConstants.QNAME_URL);
+        if (iri == null) {
+            iri = getExtension(RssConstants.QNAME_RDF_URL);
+        }
+        if (iri == null) {
+            String t = getAttributeValue(RssConstants.QNAME_RDF_ABOUT);
+            if (t != null)
+                return new IRI(t);
+        }
+        return (iri != null) ? iri.getValue() : null;
+    }
+
+    public IRIElement setNormalizedValue(String iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public IRIElement setValue(String iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public String getTitle() {
+        Text text = getExtension(RssConstants.QNAME_TITLE);
+        if (text == null)
+            text = getExtension(RssConstants.QNAME_RDF_TITLE);
+        return (text != null) ? text.getValue() : null;
+    }
+
+    public String getDescription() {
+        Text text = getExtension(RssConstants.QNAME_DESCRIPTION);
+        if (text == null)
+            text = getExtension(RssConstants.QNAME_RDF_DESCRIPTION);
+        return (text != null) ? text.getValue() : null;
+    }
+
+    public IRI getLink() {
+        Link link = getExtension(RssConstants.QNAME_LINK);
+        if (link == null)
+            link = getExtension(RssConstants.QNAME_RDF_LINK);
+        return (link != null) ? link.getHref() : null;
+    }
+
+    public int getWidth() {
+        String w = getSimpleExtension(RssConstants.QNAME_WIDTH);
+        return (w != null) ? Integer.parseInt(w) : -1;
+    }
+
+    public int getHeight() {
+        String w = getSimpleExtension(RssConstants.QNAME_HEIGHT);
+        return (w != null) ? Integer.parseInt(w) : -1;
+    }
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssImage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssItem.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssItem.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssItem.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssItem.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,695 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.List;
+
+import javax.activation.DataHandler;
+import javax.activation.MimeType;
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.common.Constants;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.common.selector.Selector;
+import org.apache.abdera2.model.Category;
+import org.apache.abdera2.model.Content;
+import org.apache.abdera2.model.Control;
+import org.apache.abdera2.model.DateTime;
+import org.apache.abdera2.model.Div;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementIterator;
+import org.apache.abdera2.model.Entry;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+import org.apache.abdera2.model.ElementList;
+import org.apache.abdera2.model.IRIElement;
+import org.apache.abdera2.model.Link;
+import org.apache.abdera2.model.Person;
+import org.apache.abdera2.model.Source;
+import org.apache.abdera2.model.Text;
+import org.apache.abdera2.model.Content.Type;
+import org.apache.abdera2.parser.axiom.FOMElement;
+
+public class RssItem extends ExtensibleElementWrapper implements Entry, IRIElement {
+
+    public RssItem(Element internal) {
+        super(internal);
+    }
+
+    public RssItem(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public Entry addAuthor(Person person) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Person addAuthor(String name) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Person addAuthor(String name, String email, String uri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry addCategory(Category category) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Category addCategory(String term) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Category addCategory(String scheme, String term, String label) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry addContributor(Person person) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Person addContributor(String name) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Person addContributor(String name, String email, String uri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry addLink(Link link) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link addLink(String href) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link addLink(String href, String rel) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link addLink(String href, String rel, String type, String title, String hreflang, long length) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link getAlternateLink() {
+        Link link = getExtension(RssConstants.QNAME_LINK);
+        if (link == null)
+            link = getExtension(RssConstants.QNAME_RDF_LINK);
+        if (link == null) {
+            IRIElement guid = getIdElement();
+            if (guid != null && guid instanceof RssGuid && ((RssGuid)guid).isPermalink())
+                return (Link)guid;
+        }
+        return link;
+    }
+
+    public Link getAlternateLink(String type, String hreflang) {
+        return getAlternateLink();
+    }
+
+    public IRI getAlternateLinkResolvedHref() {
+        Link link = getAlternateLink();
+        return (link != null) ? link.getResolvedHref() : null;
+    }
+
+    public IRI getAlternateLinkResolvedHref(String type, String hreflang) {
+        return getAlternateLinkResolvedHref();
+    }
+
+    public Person getAuthor() {
+        Person person = getExtension(RssConstants.QNAME_AUTHOR);
+        if (person == null)
+            person = getExtension(RssConstants.QNAME_DC_CREATOR);
+        return person;
+    }
+
+    public List<Person> getAuthors() {
+        List<Person> people = getExtensions(RssConstants.QNAME_AUTHOR);
+        if (people == null || people.size() == 0)
+            people = getExtensions(RssConstants.QNAME_DC_CREATOR);
+        return people;
+    }
+
+    public List<Category> getCategories() {
+        List<Category> cats = getExtensions(RssConstants.QNAME_CATEGORY);
+        if (cats == null || cats.size() == 0)
+            cats = getExtensions(RssConstants.QNAME_DC_SUBJECT);
+        return cats;
+    }
+
+    public List<Category> getCategories(String scheme) {
+        return (scheme != null) ? new ElementList<Category>(new ElementIterator<Category>(getInternal(), RssCategory.class,
+                                                                               new QName("domain"), scheme, null))
+            : getCategories();
+    }
+
+    public String getContent() {
+        Content content = getContentElement();
+        if (content == null)
+            return getSummary();
+        return content.getValue();
+    }
+
+    public Content getContentElement() {
+        Content content = getExtension(RssConstants.QNAME_CONTENT_ENCODED);
+        // what else to return other than content:encoded and possibly atom:content?
+        if (content == null)
+            content = getExtension(Constants.CONTENT);
+        return content;
+    }
+
+    public MimeType getContentMimeType() {
+        return null;
+    }
+
+    public IRI getContentSrc() {
+        return null;
+    }
+
+    public InputStream getContentStream() throws IOException {
+        return null;
+    }
+
+    public Type getContentType() {
+        Content content = getContentElement();
+        if (content == null) {
+            Text text = getSummaryElement();
+            switch (text.getTextType()) {
+                case TEXT:
+                    return Content.Type.TEXT;
+                case HTML:
+                    return Content.Type.HTML;
+                case XHTML:
+                    return Content.Type.XHTML;
+                default:
+                    return Content.Type.HTML;
+            }
+        } else {
+            return content.getContentType();
+        }
+    }
+
+    public List<Person> getContributors() {
+        List<Person> people = getExtensions(RssConstants.QNAME_DC_CONTRIBUTOR);
+        return people;
+    }
+
+    public Control getControl(boolean create) {
+        return null;
+    }
+
+    public Control getControl() {
+        return null;
+    }
+
+    public Link getEditLink() {
+        return null;
+    }
+
+    public IRI getEditLinkResolvedHref() {
+        return null;
+    }
+
+    public Link getEditMediaLink() {
+        return null;
+    }
+
+    public Link getEditMediaLink(String type, String hreflang) {
+        return null;
+    }
+
+    public IRI getEditMediaLinkResolvedHref() {
+        return null;
+    }
+
+    public IRI getEditMediaLinkResolvedHref(String type, String hreflang) {
+        return null;
+    }
+
+    public Date getEdited() {
+        return null;
+    }
+
+    public DateTime getEditedElement() {
+        return null;
+    }
+
+    public Link getEnclosureLink() {
+        return getExtension(RssConstants.QNAME_ENCLOSURE);
+    }
+
+    public IRI getEnclosureLinkResolvedHref() {
+        Link link = getEnclosureLink();
+        return (link != null) ? link.getHref() : null;
+    }
+
+    public IRI getId() {
+        IRIElement iri = getIdElement();
+        return (iri != null) ? iri.getValue() : null;
+    }
+
+    public IRIElement getIdElement() {
+        IRIElement id = getExtension(RssConstants.QNAME_GUID);
+        if (id == null)
+            id = getExtension(RssConstants.QNAME_DC_IDENTIFIER);
+        if (id == null && this.getQName().equals(RssConstants.QNAME_RDF_ITEM))
+            return this;
+        return id;
+    }
+
+    public Link getLink(String rel) {
+        if (rel.equals(Link.REL_ALTERNATE) || 
+            rel.equals(Link.Helper.getRelEquiv(Link.REL_ALTERNATE))) {
+            RssGuid guid = (RssGuid)getIdElement();
+            if (guid != null && guid.isPermalink())
+                return guid;
+            return getAlternateLink();
+        }
+        List<Link> links = FOMElement.getLinks(getInternal(), rel);
+        return (links != null && links.size() > 0) ? links.get(0) : null;
+    }
+
+    public IRI getLinkResolvedHref(String rel) {
+        Link link = getLink(rel);
+        return (link != null) ? link.getResolvedHref() : null;
+    }
+
+    public List<Link> getLinks() {
+        return getExtensions(Constants.LINK);
+    }
+
+    public List<Link> getLinks(String rel) {
+        return FOMElement.getLinks(getInternal(), rel);
+    }
+
+    public List<Link> getLinks(String... rel) {
+        return FOMElement.getLinks(getInternal(), rel);
+    }
+
+    public Date getPublished() {
+        DateTime dt = getPublishedElement();
+        return (dt != null) ? dt.getDate() : null;
+    }
+
+    public DateTime getPublishedElement() {
+        DateTime dt = getExtension(RssConstants.QNAME_PUBDATE);
+        if (dt == null)
+            dt = getExtension(RssConstants.QNAME_PUBDATE2);
+        if (dt == null)
+            dt = getExtension(RssConstants.QNAME_DC_DATE);
+        return dt;
+    }
+
+    public String getRights() {
+        Text text = getRightsElement();
+        return (text != null) ? text.getValue() : null;
+    }
+
+    public Text getRightsElement() {
+        Element el = getParentElement();
+        if (el instanceof RssChannel)
+            return ((RssChannel)el).getRightsElement();
+        else if (el instanceof RssFeed)
+            return ((RssFeed)el).getRightsElement();
+        Text text = getExtension(RssConstants.QNAME_DC_RIGHTS);
+        return text;
+    }
+
+    public org.apache.abdera2.model.Text.Type getRightsType() {
+        Text text = getRightsElement();
+        return (text != null) ? text.getTextType() : null;
+    }
+
+    public Link getSelfLink() {
+        return getLink("self");
+    }
+
+    public IRI getSelfLinkResolvedHref() {
+        Link link = getSelfLink();
+        return (link != null) ? link.getResolvedHref() : null;
+    }
+
+    public Source getSource() {
+        Source source = getExtension(RssConstants.QNAME_SOURCE);
+        if (source == null)
+            getExtension(RssConstants.QNAME_DC_SOURCE);
+        return source;
+    }
+
+    public String getSummary() {
+        Text text = getSummaryElement();
+        return (text != null) ? text.getValue() : null;
+    }
+
+    public Text getSummaryElement() {
+        Text text = getExtension(RssConstants.QNAME_DESCRIPTION);
+        if (text == null)
+            text = getExtension(RssConstants.QNAME_RDF_DESCRIPTION);
+        if (text == null)
+            text = getExtension(RssConstants.QNAME_DC_DESCRIPTION);
+        return text;
+    }
+
+    public org.apache.abdera2.model.Text.Type getSummaryType() {
+        Text text = getSummaryElement();
+        return (text != null) ? text.getTextType() : null;
+    }
+
+    public String getTitle() {
+        Text text = getTitleElement();
+        return (text != null) ? text.getValue() : null;
+    }
+
+    public Text getTitleElement() {
+        Text text = getExtension(RssConstants.QNAME_TITLE);
+        if (text == null)
+            text = getExtension(RssConstants.QNAME_RDF_TITLE);
+        if (text == null)
+            text = getExtension(RssConstants.QNAME_DC_TITLE);
+        return text;
+    }
+
+    public org.apache.abdera2.model.Text.Type getTitleType() {
+        Text text = getTitleElement();
+        return (text != null) ? text.getTextType() : null;
+    }
+
+    public Date getUpdated() {
+        return getPublished();
+    }
+
+    public DateTime getUpdatedElement() {
+        return getPublishedElement();
+    }
+
+    public boolean isDraft() {
+        return false;
+    }
+
+    public IRIElement newId() {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(String value, Type type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(Element value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(Element element, String mediaType) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(DataHandler dataHandler) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(DataHandler dataHandler, String mediatype) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(InputStream inputStream) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(InputStream inputStream, String mediatype) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(String value, String mediatype) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContent(IRI uri, String mediatype) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContentAsHtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Content setContentAsXhtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setContentElement(Content content) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setControl(Control control) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setDraft(boolean draft) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public DateTime setEdited(Date value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public DateTime setEdited(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void setEditedElement(DateTime modified) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public IRIElement setId(String id) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public IRIElement setId(String id, boolean normalize) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setIdElement(IRIElement id) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public DateTime setPublished(Date value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public DateTime setPublished(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setPublishedElement(DateTime dateTime) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setRights(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setRights(String value, org.apache.abdera2.model.Text.Type type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setRights(Div value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setRightsAsHtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setRightsAsXhtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setRightsElement(Text text) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setSource(Source source) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSummary(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSummary(String value, org.apache.abdera2.model.Text.Type type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSummary(Div value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSummaryAsHtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSummaryAsXhtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setSummaryElement(Text text) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setTitle(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setTitle(String value, org.apache.abdera2.model.Text.Type type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setTitle(Div value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setTitleAsHtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setTitleAsXhtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setTitleElement(Text title) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public DateTime setUpdated(Date value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public DateTime setUpdated(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry setUpdatedElement(DateTime updated) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link getComments() {
+        return getExtension(RssConstants.QNAME_COMMENTS);
+    }
+
+    public IRI getResolvedValue() {
+        return getValue();
+    }
+
+    public IRI getValue() {
+        String about = getAttributeValue(RssConstants.QNAME_RDF_ABOUT);
+        return (about != null) ? new IRI(about) : null;
+    }
+
+    public IRIElement setNormalizedValue(String iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public IRIElement setValue(String iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Control addControl() {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public List<Person> getAuthors(Selector selector) {
+      List<Person> people = getExtensions(RssConstants.QNAME_AUTHOR,selector);
+      if (people == null || people.size() == 0)
+          people = getExtensions(RssConstants.QNAME_DC_CREATOR,selector);
+      return people;
+    }
+
+    public List<Category> getCategories(Selector selector) {
+      List<Category> cats = getExtensions(RssConstants.QNAME_CATEGORY,selector);
+      if (cats == null || cats.size() == 0)
+          cats = getExtensions(RssConstants.QNAME_DC_SUBJECT,selector);
+      return cats;
+    }
+
+    public List<Person> getContributors(Selector selector) {
+      return getExtensions(RssConstants.QNAME_DC_CONTRIBUTOR,selector);
+    }
+
+    public List<Link> getLinks(Selector selector) {
+      return getExtensions(Constants.LINK,selector);
+    }
+    
+    public Person getAuthorInherited() {
+      Person person = getAuthor();
+      if (person == null) {
+        Source source = getSource();
+        if (source == null) {
+          Element parent = getParentElement();
+          if (parent != null && parent instanceof Source)
+            source = (Source) parent;
+        }
+        if (source != null)
+          person = source.getAuthor();
+      }
+      return person;
+    }
+    
+    @SuppressWarnings("unused")
+    private boolean is_empty(List<?> list) {
+      if (list == null) return true;
+      for (Object o : list)
+        return false;
+      return true;
+    }
+    
+    public List<Person> getAuthorsInherited() {
+      List<Person>list = getAuthors();
+      if (is_empty(list)) {
+        Source source = getSource();
+        if (source == null) {
+          Element parent = getParentElement();
+          if (parent != null && parent instanceof Source)
+            source = (Source) parent;
+        }
+        if (source != null)
+          list = source.getAuthors();
+      }
+      return list;
+    }
+    
+    public List<Person> getAuthorsInherited(Selector selector) {
+      List<Person>list = getAuthors(selector);
+      if (is_empty(list)) {
+        Source source = getSource();
+        if (source == null) {
+          Element parent = getParentElement();
+          if (parent != null && parent instanceof Source)
+            source = (Source) parent;
+        }
+        if (source != null)
+          list = source.getAuthors(selector);
+      }
+      return list;
+    }
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssItem.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssLink.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssLink.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssLink.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssLink.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import javax.activation.MimeType;
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+import org.apache.abdera2.model.Link;
+
+public class RssLink extends ExtensibleElementWrapper implements Link {
+
+    public RssLink(Element internal) {
+        super(internal);
+    }
+
+    public RssLink(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public IRI getHref() {
+        String txt = getText();
+        return (txt != null) ? new IRI(txt) : null;
+    }
+
+    public String getHrefLang() {
+        return null;
+    }
+
+    public long getLength() {
+        return -1;
+    }
+
+    public MimeType getMimeType() {
+        return null;
+    }
+
+    public String getRel() {
+        QName qname = getQName();
+        if (qname.equals(RssConstants.QNAME_DOCS)) {
+            return "docs";
+        } else if (qname.equals(RssConstants.QNAME_COMMENTS)) {
+            return "comments";
+        } else {
+            return Link.REL_ALTERNATE;
+        }
+    }
+
+    public IRI getResolvedHref() {
+        return getHref();
+    }
+
+    public String getTitle() {
+        return null;
+    }
+
+    public Link setHref(String href) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+    
+    public Link setHref(IRI href) {
+      throw new UnsupportedOperationException("Modifications are not allowed");
+  }
+
+    public Link setHrefLang(String lang) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setLength(long length) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setMimeType(String type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setRel(String rel) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Link setTitle(String title) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssLink.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssPerson.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssPerson.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssPerson.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssPerson.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.IRIElement;
+import org.apache.abdera2.model.Person;
+import org.apache.abdera2.model.PersonWrapper;
+
+public class RssPerson extends PersonWrapper implements Person {
+
+    static String EMAIL_PATTERN =
+        "(([a-zA-Z0-9\\_\\-\\.\\+]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?))(\\?subject=\\S+)?";
+
+    private String email = null;
+    private String name = null;
+
+    public RssPerson(Element internal) {
+        super(internal);
+
+        Pattern p = Pattern.compile(EMAIL_PATTERN);
+
+        String t = getText();
+        Matcher m = p.matcher(t);
+        if (m.find()) {
+            email = m.group(0);
+            name =
+                t.replaceAll(email, "").replaceAll("[\\(\\)\\<\\>]", "").replaceAll("mailto:", "")
+                    .replaceAll("\\&lt\\;", "").replaceAll("\\&gt\\;", "").trim();
+        }
+
+    }
+
+    public RssPerson(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    @Override
+    public String getEmail() {
+        return email;
+    }
+
+    @Override
+    public Element getEmailElement() {
+        return null;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public Element getNameElement() {
+        return null;
+    }
+
+    @Override
+    public IRI getUri() {
+        return null;
+    }
+
+    @Override
+    public IRIElement getUriElement() {
+        return null;
+    }
+
+    @Override
+    public Element setEmail(String email) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    @Override
+    public Person setEmailElement(Element element) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    @Override
+    public Element setName(String name) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    @Override
+    public Person setNameElement(Element element) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    @Override
+    public IRIElement setUri(String uri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    @Override
+    public Person setUriElement(IRIElement element) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssPerson.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipDays.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipDays.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipDays.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipDays.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+
+public class RssSkipDays extends ExtensibleElementWrapper {
+
+    public RssSkipDays(Element internal) {
+        super(internal);
+    }
+
+    public RssSkipDays(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public enum Day {
+        MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
+    }
+
+    public boolean skip(Day day) {
+        List<Element> days = getExtensions(RssConstants.QNAME_DAY);
+        for (Element d : days) {
+            try {
+                Day check = Day.valueOf(d.getText().toUpperCase());
+                if (d.equals(check))
+                    return true;
+            } catch (Exception e) {
+            }
+        }
+        return false;
+    }
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipDays.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipHours.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipHours.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipHours.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipHours.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.rss;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+
+public class RssSkipHours extends ExtensibleElementWrapper {
+
+    public RssSkipHours(Element internal) {
+        super(internal);
+    }
+
+    public RssSkipHours(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public boolean skip(int hour) {
+        List<Element> hours = getExtensions(RssConstants.QNAME_HOUR);
+        for (Element h : hours) {
+            try {
+                int check = Integer.parseInt(h.getText());
+                if (check == hour)
+                    return true;
+            } catch (Exception e) {
+            }
+        }
+        return false;
+    }
+}

Propchange: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssSkipHours.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message