abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1173209 [32/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/media/MediaCategory.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCategory.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCategory.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCategory.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,63 @@
+/*
+ * 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.media;
+
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.common.iri.IRI;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_CATEGORY, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaCategory extends ElementWrapper {
+
+    public MediaCategory(Element internal) {
+        super(internal);
+    }
+
+    public MediaCategory(Factory factory) {
+        super(factory, CATEGORY);
+    }
+
+    public IRI getScheme() {
+        String scheme = getAttributeValue("scheme");
+        return (scheme != null) ? new IRI(scheme) : null;
+    }
+
+    public void setScheme(String scheme) {
+        if (scheme != null)
+            setAttributeValue("scheme", (new IRI(scheme)).toString());
+        else
+            removeAttribute(SCHEME);
+    }
+
+    public String getLabel() {
+        return getAttributeValue("label");
+    }
+
+    public void setLabel(String label) {
+        if (label != null)
+            setAttributeValue("label", label);
+        else
+            removeAttribute(LABEL);
+    }
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaConstants.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaConstants.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaConstants.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaConstants.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,84 @@
+/*
+ * 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.media;
+
+import javax.xml.namespace.QName;
+
+public interface MediaConstants {
+
+    public enum Type {
+        PLAIN, HTML
+    }
+
+    public enum Algo {
+        SHA1, MD5
+    }
+
+    public enum Relationship {
+        ALLOW, DENY
+    }
+
+    public enum RestrictionType {
+        COUNTRY, URI
+    }
+
+    public enum Medium {
+        IMAGE, AUDIO, VIDEO, DOCUMENT, EXECUTABLE
+    }
+
+    public enum Expression {
+        FULL, SAMPLE, NONSTOP
+    }
+
+    public static final String MEDIA_NS = "http://search.yahoo.com/mrss/";
+    public static final String MEDIA_PREFIX = "media";
+    public static final String LN_GROUP = "group";
+    public static final String LN_CONTENT = "content";
+    public static final String LN_ADULT = "adult";
+    public static final String LN_RATING = "rating";
+    public static final String LN_TITLE = "title";
+    public static final String LN_DESCRIPTION = "description";
+    public static final String LN_KEYWORDS = "keywords";
+    public static final String LN_THUMBNAIL = "thumbnail";
+    public static final String LN_CATEGORY = "category";
+    public static final String LN_HASH = "hash";
+    public static final String LN_PLAYER = "player";
+    public static final String LN_CREDIT = "credit";
+    public static final String LN_COPYRIGHT = "copyright";
+    public static final String LN_TEXT = "text";
+    public static final String LN_RESTRICTION = "restriction";
+
+    public static final QName GROUP = new QName(MEDIA_NS, LN_GROUP, MEDIA_PREFIX);
+    public static final QName CONTENT = new QName(MEDIA_NS, LN_CONTENT, MEDIA_PREFIX);
+    public static final QName ADULT = new QName(MEDIA_NS, LN_ADULT, MEDIA_PREFIX);
+    public static final QName RATING = new QName(MEDIA_NS, LN_RATING, MEDIA_PREFIX);
+    public static final QName TITLE = new QName(MEDIA_NS, LN_TITLE, MEDIA_PREFIX);
+    public static final QName DESCRIPTION = new QName(MEDIA_NS, LN_DESCRIPTION, MEDIA_PREFIX);
+    public static final QName KEYWORDS = new QName(MEDIA_NS, LN_KEYWORDS, MEDIA_PREFIX);
+    public static final QName THUMBNAIL = new QName(MEDIA_NS, LN_THUMBNAIL, MEDIA_PREFIX);
+    public static final QName CATEGORY = new QName(MEDIA_NS, LN_CATEGORY, MEDIA_PREFIX);
+    public static final QName HASH = new QName(MEDIA_NS, LN_HASH, MEDIA_PREFIX);
+    public static final QName PLAYER = new QName(MEDIA_NS, LN_PLAYER, MEDIA_PREFIX);
+    public static final QName CREDIT = new QName(MEDIA_NS, LN_CREDIT, MEDIA_PREFIX);
+    public static final QName COPYRIGHT = new QName(MEDIA_NS, LN_COPYRIGHT, MEDIA_PREFIX);
+    public static final QName TEXT = new QName(MEDIA_NS, LN_TEXT, MEDIA_PREFIX);
+    public static final QName RESTRICTION = new QName(MEDIA_NS, LN_RESTRICTION, MEDIA_PREFIX);
+
+    public static final QName SCHEME = new QName("scheme");
+    public static final QName LABEL = new QName("label");
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaContent.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaContent.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaContent.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaContent.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,208 @@
+/*
+ * 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.media;
+
+import javax.activation.MimeType;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.common.iri.IRI;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_CONTENT, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaContent extends ExtensibleElementWrapper {
+
+    public MediaContent(Element internal) {
+        super(internal);
+    }
+
+    public MediaContent(Factory factory) {
+        super(factory, CONTENT);
+    }
+
+    public IRI getUrl() {
+        String url = getAttributeValue("url");
+        return (url != null) ? new IRI(url) : null;
+    }
+
+    public void setUrl(String url) {
+        if (url != null)
+            setAttributeValue("url", (new IRI(url)).toString());
+        else
+            removeAttribute("url");
+    }
+
+    public long getFilesize() {
+        String size = getAttributeValue("filesize");
+        return (size != null) ? Long.parseLong(size) : -1;
+    }
+
+    public void setFilesize(long size) {
+        if (size > -1)
+            setAttributeValue("filesize", String.valueOf(size));
+        else
+            removeAttribute("filesize");
+    }
+
+    public MimeType getType() {
+        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 void setType(String type) {
+        if (type != null)
+            setAttributeValue("type", type);
+        else
+            removeAttribute("type");
+    }
+
+    public Medium getMedium() {
+        String medium = getAttributeValue("medium");
+        return (medium != null) ? Medium.valueOf(medium.toUpperCase()) : null;
+    }
+
+    public void setMedium(Medium medium) {
+        if (medium != null)
+            setAttributeValue("medium", medium.name().toLowerCase());
+        else
+            removeAttribute("medium");
+    }
+
+    public boolean isDefault() {
+        String def = getAttributeValue("isDefault");
+        return (def != null) ? def.equalsIgnoreCase("true") : false;
+    }
+
+    public Expression getExpression() {
+        String exp = getAttributeValue("expression");
+        return (exp != null) ? Expression.valueOf(exp.toUpperCase()) : null;
+    }
+
+    public void setExpression(Expression exp) {
+        if (exp != null)
+            setAttributeValue("expression", exp.name().toLowerCase());
+        else
+            removeAttribute("expression");
+    }
+
+    public int getBitrate() {
+        String bitrate = getAttributeValue("bitrate");
+        return (bitrate != null) ? Integer.parseInt(bitrate) : -1;
+    }
+
+    public void setBitrate(int bitrate) {
+        if (bitrate > -1)
+            setAttributeValue("bitrate", String.valueOf(bitrate));
+        else
+            removeAttribute("bitrate");
+    }
+
+    public int getFramerate() {
+        String framerate = getAttributeValue("framerate");
+        return (framerate != null) ? Integer.parseInt(framerate) : -1;
+    }
+
+    public void setFramerate(int framerate) {
+        if (framerate > -1)
+            setAttributeValue("framerate", String.valueOf(framerate));
+        else
+            removeAttribute("framerate");
+    }
+
+    public double getSamplingRate() {
+        String rate = getAttributeValue("samplingrate");
+        return (rate != null) ? Double.parseDouble(rate) : -1;
+    }
+
+    public void setSamplingRate(double samplingrate) {
+        if (samplingrate > Double.parseDouble("-1"))
+            setAttributeValue("samplingrate", String.valueOf(samplingrate));
+        else
+            removeAttribute("samplingrate");
+    }
+
+    public int getChannels() {
+        String c = getAttributeValue("channels");
+        return (c != null) ? Integer.parseInt(c) : -1;
+    }
+
+    public void setChannels(int channels) {
+        if (channels > -1)
+            setAttributeValue("channels", String.valueOf(channels));
+        else
+            removeAttribute("channels");
+    }
+
+    public int getDuration() {
+        String c = getAttributeValue("duration");
+        return (c != null) ? Integer.parseInt(c) : -1;
+    }
+
+    public void setDuration(int duration) {
+        if (duration > -1)
+            setAttributeValue("duration", String.valueOf(duration));
+        else
+            removeAttribute("duration");
+    }
+
+    public int getWidth() {
+        String width = getAttributeValue("width");
+        return (width != null) ? Integer.parseInt(width) : -1;
+    }
+
+    public void setWidth(int width) {
+        if (width > -1) {
+            setAttributeValue("width", String.valueOf(width));
+        } else {
+            removeAttribute("width");
+        }
+    }
+
+    public int getHeight() {
+        String height = getAttributeValue("height");
+        return (height != null) ? Integer.parseInt(height) : -1;
+    }
+
+    public void setHeight(int height) {
+        if (height > -1) {
+            setAttributeValue("height", String.valueOf(height));
+        } else {
+            removeAttribute("height");
+        }
+    }
+
+    public String getLang() {
+        return getAttributeValue("lang");
+    }
+
+    public void setLang(String lang) {
+        if (lang != null)
+            setAttributeValue("lang", lang);
+        else
+            removeAttribute("lang");
+    }
+
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCopyright.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCopyright.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCopyright.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCopyright.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,51 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.common.iri.IRI;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_COPYRIGHT, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaCopyright extends ElementWrapper {
+
+    public MediaCopyright(Element internal) {
+        super(internal);
+    }
+
+    public MediaCopyright(Factory factory) {
+        super(factory, MediaConstants.COPYRIGHT);
+    }
+
+    public IRI getUrl() {
+        String url = getAttributeValue("url");
+        return (url != null) ? new IRI(url) : null;
+    }
+
+    public void setUrl(String url) {
+        if (url != null)
+            setAttributeValue("url", (new IRI(url)).toString());
+        else
+            removeAttribute("url");
+    }
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCredit.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCredit.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCredit.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaCredit.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,64 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.common.iri.IRI;
+
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_CREDIT, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaCredit extends ElementWrapper {
+
+    public MediaCredit(Element internal) {
+        super(internal);
+    }
+
+    public MediaCredit(Factory factory) {
+        super(factory, MediaConstants.CREDIT);
+    }
+
+    public IRI getScheme() {
+        String scheme = getAttributeValue("scheme");
+        return (scheme != null) ? new IRI(scheme) : null;
+    }
+
+    public void setScheme(String scheme) {
+        if (scheme != null)
+            setAttributeValue("scheme", (new IRI(scheme)).toString());
+        else
+            removeAttribute("scheme");
+    }
+
+    public String getRole() {
+        return getAttributeValue("role");
+    }
+
+    public void setRole(String role) {
+        if (role != null)
+            setAttributeValue("role", role);
+        else
+            removeAttribute("role");
+    }
+
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaDescription.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaDescription.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaDescription.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaDescription.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,56 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_DESCRIPTION, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaDescription extends ElementWrapper {
+
+    public MediaDescription(Element internal) {
+        super(internal);
+    }
+
+    public MediaDescription(Factory factory) {
+        super(factory, MediaConstants.DESCRIPTION);
+    }
+
+    public void setType(MediaConstants.Type type) {
+        switch (type) {
+            case PLAIN:
+                setAttributeValue("type", "plain");
+                break;
+            case HTML:
+                setAttributeValue("type", "html");
+                break;
+            default:
+                removeAttribute("type");
+        }
+    }
+
+    public MediaConstants.Type getType() {
+        String type = getAttributeValue("type");
+        return (type != null) ? MediaConstants.Type.valueOf(type.toUpperCase()) : null;
+    }
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaExtensionFactory.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaExtensionFactory.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaExtensionFactory.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaExtensionFactory.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.ext.media;
+
+import org.apache.abdera2.common.anno.Namespace;
+import org.apache.abdera2.factory.AbstractExtensionFactory;
+import org.apache.abdera2.factory.AbstractExtensionFactory.Impls;
+import org.apache.abdera2.factory.AbstractExtensionFactory.Impl;
+
+@SuppressWarnings("deprecation")
+@Namespace(MediaConstants.MEDIA_NS)
+@Impls(
+  {
+    @Impl(MediaAdult.class),
+    @Impl(MediaCategory.class),
+    @Impl(MediaContent.class),
+    @Impl(MediaCopyright.class),
+    @Impl(MediaCredit.class),
+    @Impl(MediaDescription.class),
+    @Impl(MediaGroup.class),
+    @Impl(MediaHash.class),
+    @Impl(MediaKeywords.class),
+    @Impl(MediaPlayer.class),
+    @Impl(MediaRating.class),
+    @Impl(MediaRestriction.class),
+    @Impl(MediaText.class),
+    @Impl(MediaThumbnail.class),
+    @Impl(MediaTitle.class)
+  }
+)
+public final class MediaExtensionFactory 
+  extends AbstractExtensionFactory implements MediaConstants {
+
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaGroup.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaGroup.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaGroup.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaGroup.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,40 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_GROUP, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaGroup extends ExtensibleElementWrapper {
+
+    public MediaGroup(Element internal) {
+        super(internal);
+    }
+
+    public MediaGroup(Factory factory) {
+        super(factory, MediaConstants.GROUP);
+    }
+
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaHash.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaHash.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaHash.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaHash.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,65 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_HASH, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaHash extends ElementWrapper {
+
+    public MediaHash(Element internal) {
+        super(internal);
+    }
+
+    public MediaHash(Factory factory) {
+        super(factory, MediaConstants.HASH);
+    }
+
+    public MediaConstants.Algo getAlgorithm() {
+        String algo = getAttributeValue("algo");
+        if (algo == null)
+            return null;
+        if (algo.equalsIgnoreCase("sha-1"))
+            return MediaConstants.Algo.SHA1;
+        if (algo.equalsIgnoreCase("md5"))
+            return MediaConstants.Algo.MD5;
+        return null;
+    }
+
+    public void setAlgorithm(MediaConstants.Algo algorithm) {
+        switch (algorithm) {
+            case SHA1:
+                setAttributeValue("algo", "sha-1");
+                break;
+            case MD5:
+                setAttributeValue("algo", "md5");
+                break;
+            default:
+                removeAttribute("algo");
+        }
+    }
+
+    // TODO: Helper methods for calculating the hash
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaKeywords.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaKeywords.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaKeywords.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaKeywords.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,39 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_KEYWORDS, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaKeywords extends ElementWrapper {
+
+    public MediaKeywords(Element internal) {
+        super(internal);
+    }
+
+    public MediaKeywords(Factory factory) {
+        super(factory, MediaConstants.KEYWORDS);
+    }
+
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaPlayer.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaPlayer.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaPlayer.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaPlayer.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,79 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.common.iri.IRI;
+
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_PLAYER, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaPlayer extends ElementWrapper {
+
+    public MediaPlayer(Element internal) {
+        super(internal);
+    }
+
+    public MediaPlayer(Factory factory) {
+        super(factory, MediaConstants.PLAYER);
+    }
+
+    public IRI getUrl() {
+        String url = getAttributeValue("url");
+        return (url != null) ? new IRI(url) : null;
+    }
+
+    public void setUrl(String url) {
+        if (url != null) {
+            setAttributeValue("url", (new IRI(url)).toString());
+        } else {
+            removeAttribute("url");
+        }
+    }
+
+    public int getWidth() {
+        String width = getAttributeValue("width");
+        return (width != null) ? Integer.parseInt(width) : -1;
+    }
+
+    public void setWidth(int width) {
+        if (width > -1) {
+            setAttributeValue("width", String.valueOf(width));
+        } else {
+            removeAttribute("width");
+        }
+    }
+
+    public int getHeight() {
+        String height = getAttributeValue("height");
+        return (height != null) ? Integer.parseInt(height) : -1;
+    }
+
+    public void setHeight(int height) {
+        if (height > -1) {
+            setAttributeValue("height", String.valueOf(height));
+        } else {
+            removeAttribute("height");
+        }
+    }
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaRating.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaRating.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaRating.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaRating.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,62 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.common.iri.IRI;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_RATING, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaRating extends ElementWrapper {
+
+    public MediaRating(Element internal) {
+        super(internal);
+    }
+
+    public MediaRating(Factory factory) {
+        super(factory, MediaConstants.RATING);
+    }
+
+    public IRI getScheme() {
+        String scheme = getAttributeValue("scheme");
+        return (scheme != null) ? new IRI(scheme) : null;
+    }
+
+    public void setScheme(String scheme) {
+        setAttributeValue("scheme", (new IRI(scheme)).toString());
+    }
+
+    public void setAdult(boolean adult) {
+        try {
+            setScheme("urn:simple");
+            setText(adult ? "adult" : "nonadult");
+        } catch (Exception e) {
+        }
+    }
+
+    public boolean isAdult() {
+        String scheme = getAttributeValue("scheme");
+        String text = getText();
+        return scheme.equals("urn:simple") && "adult".equalsIgnoreCase(text);
+    }
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaRestriction.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaRestriction.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaRestriction.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaRestriction.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,74 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_RESTRICTION, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaRestriction extends ElementWrapper {
+
+    public MediaRestriction(Element internal) {
+        super(internal);
+    }
+
+    public MediaRestriction(Factory factory) {
+        super(factory, MediaConstants.RESTRICTION);
+    }
+
+    public void setRelationship(MediaConstants.Relationship type) {
+        switch (type) {
+            case ALLOW:
+                setAttributeValue("relationship", "allow");
+                break;
+            case DENY:
+                setAttributeValue("relationship", "deny");
+                break;
+            default:
+                removeAttribute("relationship");
+        }
+    }
+
+    public MediaConstants.Relationship getRelationship() {
+        String rel = getAttributeValue("relationship");
+        return (rel != null) ? MediaConstants.Relationship.valueOf(rel.toUpperCase()) : null;
+    }
+
+    public void setType(MediaConstants.RestrictionType type) {
+        switch (type) {
+            case COUNTRY:
+                setAttributeValue("type", "country");
+                break;
+            case URI:
+                setAttributeValue("type", "uri");
+                break;
+            default:
+                removeAttribute("type");
+        }
+    }
+
+    public MediaConstants.RestrictionType getType() {
+        String type = getAttributeValue("type");
+        return (type != null) ? MediaConstants.RestrictionType.valueOf(type.toUpperCase()) : null;
+    }
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaText.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaText.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaText.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaText.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,89 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_TEXT, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaText extends ElementWrapper {
+
+    public MediaText(Element internal) {
+        super(internal);
+    }
+
+    public MediaText(Factory factory) {
+        super(factory, MediaConstants.TEXT);
+    }
+
+    public void setType(MediaConstants.Type type) {
+        switch (type) {
+            case PLAIN:
+                setAttributeValue("type", "plain");
+                break;
+            case HTML:
+                setAttributeValue("type", "html");
+                break;
+            default:
+                removeAttribute("type");
+        }
+    }
+
+    public MediaConstants.Type getType() {
+        String type = getAttributeValue("type");
+        return (type != null) ? MediaConstants.Type.valueOf(type.toUpperCase()) : null;
+    }
+
+    public String getLang() {
+        return getAttributeValue("lang");
+    }
+
+    public void setLang(String lang) {
+        if (lang != null)
+            setAttributeValue("lang", lang);
+        else
+            removeAttribute("lang");
+    }
+
+    public String getStart() {
+        return getAttributeValue("start");
+    }
+
+    public void setStart(String start) {
+        if (start != null)
+            setAttributeValue("start", start);
+        else
+            removeAttribute("start");
+    }
+
+    public String getEnd() {
+        return getAttributeValue("end");
+    }
+
+    public void setEnd(String end) {
+        if (end != null)
+            setAttributeValue("end", end);
+        else
+            removeAttribute("end");
+    }
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaThumbnail.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaThumbnail.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaThumbnail.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaThumbnail.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,90 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.common.iri.IRI;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_THUMBNAIL, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaThumbnail extends ElementWrapper {
+
+    public MediaThumbnail(Element internal) {
+        super(internal);
+    }
+
+    public MediaThumbnail(Factory factory) {
+        super(factory, MediaConstants.THUMBNAIL);
+    }
+
+    public IRI getUrl() {
+        String url = getAttributeValue("url");
+        return (url != null) ? new IRI(url) : null;
+    }
+
+    public void setUrl(String url) {
+        if (url != null) {
+            setAttributeValue("url", (new IRI(url)).toString());
+        } else {
+            removeAttribute("url");
+        }
+    }
+
+    public int getWidth() {
+        String width = getAttributeValue("width");
+        return (width != null) ? Integer.parseInt(width) : -1;
+    }
+
+    public void setWidth(int width) {
+        if (width > -1) {
+            setAttributeValue("width", String.valueOf(width));
+        } else {
+            removeAttribute("width");
+        }
+    }
+
+    public int getHeight() {
+        String height = getAttributeValue("height");
+        return (height != null) ? Integer.parseInt(height) : -1;
+    }
+
+    public void setHeight(int height) {
+        if (height > -1) {
+            setAttributeValue("height", String.valueOf(height));
+        } else {
+            removeAttribute("height");
+        }
+    }
+
+    public String getTime() {
+        return getAttributeValue("time");
+    }
+
+    public void setTime(String time) {
+        if (time != null)
+            setAttributeValue("time", time);
+        else
+            removeAttribute("time");
+    }
+
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaTitle.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaTitle.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaTitle.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/media/MediaTitle.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,57 @@
+/*
+ * 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.media;
+
+import org.apache.abdera2.common.anno.QName;
+import org.apache.abdera2.factory.Factory;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import static org.apache.abdera2.ext.media.MediaConstants.*;
+
+@QName(value=LN_TITLE, 
+    ns=MEDIA_NS,
+    pfx=MEDIA_PREFIX)
+public class MediaTitle extends ElementWrapper {
+
+    public MediaTitle(Element internal) {
+        super(internal);
+    }
+
+    public MediaTitle(Factory factory) {
+        super(factory, MediaConstants.TITLE);
+    }
+
+    public void setType(MediaConstants.Type type) {
+        switch (type) {
+            case PLAIN:
+                setAttributeValue("type", "plain");
+                break;
+            case HTML:
+                setAttributeValue("type", "html");
+                break;
+            default:
+                removeAttribute("type");
+        }
+    }
+
+    public MediaConstants.Type getType() {
+        String type = getAttributeValue("type");
+        return (type != null) ? MediaConstants.Type.valueOf(type.toUpperCase()) : null;
+    }
+
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssCategory.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssCategory.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssCategory.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssCategory.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,114 @@
+/*
+ * 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.common.iri.IRI;
+import org.apache.abdera2.model.Category;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ExtensibleElement;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+
+public class RssCategory extends ExtensibleElementWrapper implements Category {
+
+    public RssCategory(Element internal) {
+        super(internal);
+    }
+
+    public RssCategory(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public String getLabel() {
+        return null;
+    }
+
+    public IRI getScheme() {
+        String domain = this.getAttributeValue("domain");
+        return (domain != null) ? new IRI(this.getAttributeValue("domain")) : null;
+    }
+
+    public String getTerm() {
+        return getText();
+    }
+
+    public Category setLabel(String label) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Category setScheme(String scheme) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Category setTerm(String term) {
+        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/RssCategory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssChannel.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssChannel.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssChannel.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssChannel.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,592 @@
+/*
+ * 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.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.abdera2.Abdera;
+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.DateTime;
+import org.apache.abdera2.model.Div;
+import org.apache.abdera2.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+import org.apache.abdera2.model.Entry;
+import org.apache.abdera2.model.ExtensibleElement;
+import org.apache.abdera2.model.ExtensibleElementWrapper;
+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.Text;
+import org.apache.abdera2.model.Text.Type;
+import org.apache.abdera2.model.ElementIterator;
+import org.apache.abdera2.model.ElementList;
+import org.apache.abdera2.parser.axiom.FOMElement;
+import org.apache.abdera2.xpath.XPath;
+import org.apache.abdera2.xpath.XPathException;
+
+public class RssChannel extends ExtensibleElementWrapper {
+
+    public RssChannel(Element internal) {
+        super(internal);
+    }
+
+    public RssChannel(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public void addEntry(Entry entry) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry addEntry() {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public List<Entry> getEntries() {
+      return getEntries(null);
+    }
+    
+    public List<Entry> getEntries(Selector selector) {
+        QName qname = getQName();
+        if (qname.getNamespaceURI().equals(RssConstants.RSS1_NS) && qname.getLocalPart().equals("channel")) {
+            List<Entry> entries = new ArrayList<Entry>();
+            ExtensibleElement items = getExtension(RssConstants.QNAME_RDF_ITEMS);
+            if (items != null) {
+                ExtensibleElement se = items.getExtension(RssConstants.QNAME_RDF_SEQ);
+                if (se != null) {
+                    List<Element> seq = se.getExtensions(RssConstants.QNAME_RDF_LI);
+                    for (Element el : seq) {
+                        String res = el.getAttributeValue("resource");
+                        if (res != null) {
+                            String path = "//rss:item[@rdf:about='" + res + "']";
+                            Element entryel = null;
+                            try {
+                                entryel = locate(path);
+                            } catch (Exception e) {
+                            }
+                            if (entryel != null) {
+                                // TODO:fix this.. entryel should already be an RssItem
+                              RssItem ri = entryel instanceof RssItem ? (RssItem)entryel : new RssItem(entryel);
+                              if (selector == null || selector.select(ri))
+                                entries.add(ri);
+                            }
+                        }
+                    }
+                }
+            }
+            return entries;
+        } else {
+            return getExtensions(RssConstants.QNAME_ITEM,selector);
+        }
+    }
+
+    public Entry getEntry(String id) {
+        if (id == null)
+            return null;
+        List<Entry> l = getEntries();
+        for (Entry e : l) {
+            IRI eid = e.getId();
+            if (eid != null && eid.equals(new IRI(id)))
+                return e;
+        }
+        return null;
+    }
+
+    public void insertEntry(Entry entry) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Entry insertEntry() {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void sortEntries(Comparator<Entry> comparator) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void sortEntriesByEdited(boolean new_first) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void sortEntriesByUpdated(boolean new_first) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void 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 iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void 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 void 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);
+        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_MANAGINGEDITOR);
+        if (person == null)
+            person = getExtension(RssConstants.QNAME_DC_CREATOR);
+        return person;
+    }
+
+    public List<Person> getAuthors() {
+        List<Person> people = getExtensions(RssConstants.QNAME_MANAGINGEDITOR);
+        if (people == null || people.size() == 0)
+            people = getExtensions(RssConstants.QNAME_DC_CREATOR);
+        return people;
+    }
+
+    public List<Person> getAuthors(Selector selector) {
+      List<Person> people = getExtensions(RssConstants.QNAME_MANAGINGEDITOR,selector);
+      if (people == null || people.size() == 0)
+          people = getExtensions(RssConstants.QNAME_DC_CREATOR,selector);
+      return people;
+    }
+    
+    public List<Person> getContributors() {
+        List<Person> people = getExtensions(RssConstants.QNAME_DC_CONTRIBUTOR);
+        return people;
+    }
+    
+    public List<Person> getContributors(Selector selector) {
+      return getExtensions(RssConstants.QNAME_DC_CONTRIBUTOR, selector);
+    }
+
+    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(Selector selector) {
+      List<Category> cats = getExtensions(RssConstants.QNAME_CATEGORY, selector);
+      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 Generator getGenerator() {
+        return getExtension(RssConstants.QNAME_GENERATOR);
+    }
+
+    public IRI getIcon() {
+        IRIElement iri = getIconElement();
+        return (iri != null) ? iri.getValue() : null;
+    }
+
+    public IRIElement getIconElement() {
+        return getLogoElement();
+    }
+
+    public IRI getId() {
+        IRIElement id = getIdElement();
+        return (id != null) ? id.getValue() : null;
+    }
+
+    public IRIElement getIdElement() {
+        return getExtension(RssConstants.QNAME_DC_IDENTIFIER);
+    }
+
+    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(Selector selector) {
+      return getExtensions(Constants.LINK, selector);
+    }
+
+    public List<Link> getLinks(String rel) {
+        return FOMElement.getLinks(getInternal(), rel);
+    }
+
+    public List<Link> getLinks(String... rel) {
+        return FOMElement.getLinks(getInternal(), rel);
+    }
+
+    public IRI getLogo() {
+        IRIElement iri = getLogoElement();
+        return (iri != null) ? iri.getValue() : null;
+    }
+
+    public IRIElement getLogoElement() {
+
+        IRIElement iri = getExtension(RssConstants.QNAME_IMAGE);
+        if (iri == null) {
+            Element image = getExtension(RssConstants.QNAME_RDF_IMAGE);
+            if (image != null) {
+                String id = image.getAttributeValue(RssConstants.QNAME_RDF_RESOURCE);
+                if (id != null) {
+                    String path = "//rss:image[@rdf:about='" + id + "']";
+                    Element res = null;
+                    try {
+                        res = locate(path);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    if (res != null) {
+                        // TODO: Need to fix
+                        return new RssImage(res);
+                    }
+                } else {
+                    return (IRIElement)image;
+                }
+            }
+
+        }
+        return iri;
+    }
+
+    public String getRights() {
+        Text text = getRightsElement();
+        return (text != null) ? text.getValue() : null;
+    }
+
+    public Text getRightsElement() {
+        Text text = getExtension(RssConstants.QNAME_COPYRIGHT);
+        if (text == null)
+            text = getExtension(RssConstants.QNAME_DC_RIGHTS);
+        return text;
+    }
+
+    public 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 String getSubtitle() {
+        Text text = getSubtitleElement();
+        return (text != null) ? text.getValue() : null;
+    }
+
+    public Text getSubtitleElement() {
+        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 Type getSubtitleType() {
+        Text text = getSubtitleElement();
+        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 Type getTitleType() {
+        Text text = getTitleElement();
+        return (text != null) ? text.getTextType() : null;
+    }
+
+    public Date getUpdated() {
+        DateTime dt = getUpdatedElement();
+        return (dt != null) ? dt.getDate() : null;
+    }
+
+    public DateTime getUpdatedElement() {
+        DateTime dt = getExtension(RssConstants.QNAME_LASTBUILDDATE);
+        if (dt == null)
+            dt = getExtension(RssConstants.QNAME_LASTBUILDDATE2);
+        if (dt == null)
+            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 getUpdatedString() {
+        DateTime dt = getUpdatedElement();
+        return (dt != null) ? dt.getString() : null;
+    }
+
+    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 getPublishedString() {
+        DateTime dt = getPublishedElement();
+        return (dt != null) ? dt.getString() : null;
+    }
+
+    public IRIElement newId() {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void setGenerator(Generator generator) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Generator setGenerator(String iri, String version, String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public IRIElement setIcon(String iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void setIconElement(IRIElement iri) {
+        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 void setIdElement(IRIElement id) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public IRIElement setLogo(String iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void setLogoElement(IRIElement iri) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setRights(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setRights(String value, 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 void setRightsElement(Text text) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSubtitle(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSubtitle(String value, Type type) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSubtitle(Div value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSubtitleAsHtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public Text setSubtitleAsXhtml(String value) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public void setSubtitleElement(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, 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 void setTitleElement(Text text) {
+        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 void setUpdatedElement(DateTime dateTime) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    public String getLanguage() {
+        String lang = getSimpleExtension(RssConstants.QNAME_LANGUAGE);
+        if (lang == null)
+            lang = getSimpleExtension(RssConstants.QNAME_DC_LANGUAGE);
+        return lang;
+    }
+
+    public <T extends Element> T setLanguage(String language) {
+        throw new UnsupportedOperationException("Modifications are not allowed");
+    }
+
+    private Element locate(String path) throws XPathException {
+        Abdera abdera = this.getFactory().getAbdera();
+        XPath xpath = abdera.getXPath();
+        Map<String, String> ns = xpath.getDefaultNamespaces();
+        ns.put("rdf", RssConstants.RDF_NS);
+        ns.put("rss", RssConstants.RSS1_NS);
+        Element el = getDocument().getRoot();
+        if (el instanceof ElementWrapper) {
+            el = ((ElementWrapper)el).getInternal();
+        }
+        return (Element)xpath.selectSingleNode(path, el, ns);
+    }
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssCloud.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssCloud.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssCloud.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssCloud.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,56 @@
+/*
+ * 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.model.Element;
+import org.apache.abdera2.model.ElementWrapper;
+
+public class RssCloud extends ElementWrapper {
+
+    public RssCloud(Element internal) {
+        super(internal);
+    }
+
+    public RssCloud(Factory factory, QName qname) {
+        super(factory, qname);
+    }
+
+    public String getDomain() {
+        return getAttributeValue("domain");
+    }
+
+    public int getPort() {
+        String v = getAttributeValue("port");
+        return (v != null) ? Integer.parseInt(v) : -1;
+    }
+
+    public String getPath() {
+        return getAttributeValue("path");
+    }
+
+    public String getRegisterProcedure() {
+        return getAttributeValue("registerProcedure");
+    }
+
+    public String getProtocol() {
+        return getAttributeValue("protocol");
+    }
+}

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

Added: abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssConstants.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssConstants.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssConstants.java (added)
+++ abdera/abdera2/ext/src/main/java/org/apache/abdera2/ext/rss/RssConstants.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,106 @@
+/*
+ * 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;
+
+public interface RssConstants {
+
+    public static final String RSS_MEDIATYPE = "application/rss+xml";
+    public static final String RDF_MEDIATYPE = "application/rdf+xml";
+
+    public static final String ENC_NS = "http://purl.org/rss/1.0/modules/content/";
+    public static final String RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+    public static final String RSS1_NS = "http://purl.org/rss/1.0/";
+    public static final String DC_NS = "http://purl.org/dc/elements/1.1/";
+
+    public static final QName QNAME_RDF = new QName(RDF_NS, "RDF");
+    public static final QName QNAME_RDF_CHANNEL = new QName(RSS1_NS, "channel");
+    public static final QName QNAME_RDF_TITLE = new QName(RSS1_NS, "title");
+    public static final QName QNAME_RDF_LINK = new QName(RSS1_NS, "link");
+    public static final QName QNAME_RDF_DESCRIPTION = new QName(RSS1_NS, "description");
+    public static final QName QNAME_RDF_ITEM = new QName(RSS1_NS, "item");
+    public static final QName QNAME_RDF_IMAGE = new QName(RSS1_NS, "image");
+    public static final QName QNAME_RDF_SEQ = new QName(RDF_NS, "Seq");
+    public static final QName QNAME_RDF_LI = new QName(RDF_NS, "li");
+    public static final QName QNAME_RDF_RESOURCE = new QName(RDF_NS, "resource");
+    public static final QName QNAME_RDF_ABOUT = new QName(RDF_NS, "about");
+    public static final QName QNAME_RDF_URL = new QName(RSS1_NS, "url");
+    public static final QName QNAME_RDF_ITEMS = new QName(RSS1_NS, "items");
+
+    public static final QName QNAME_RSS = new QName("rss");
+    public static final QName QNAME_CHANNEL = new QName("channel");
+    public static final QName QNAME_ITEM = new QName("item");
+    public static final QName QNAME_LINK = new QName("link");
+    public static final QName QNAME_TITLE = new QName("title");
+    public static final QName QNAME_DESCRIPTION = new QName("description");
+    public static final QName QNAME_LANGUAGE = new QName("language");
+    public static final QName QNAME_COPYRIGHT = new QName("copyright");
+    public static final QName QNAME_MANAGINGEDITOR = new QName("managingEditor");
+    public static final QName QNAME_MANAGINGEDITOR2 = new QName("managingeditor");
+    public static final QName QNAME_WEBMASTER = new QName("webMaster");
+    public static final QName QNAME_WEBMASTER2 = new QName("webmaster");
+    public static final QName QNAME_PUBDATE = new QName("pubDate");
+    public static final QName QNAME_PUBDATE2 = new QName("pubdate");
+    public static final QName QNAME_LASTBUILDDATE = new QName("lastBuildDate");
+    public static final QName QNAME_LASTBUILDDATE2 = new QName("lastbuilddate");
+    public static final QName QNAME_CATEGORY = new QName("category");
+    public static final QName QNAME_GENERATOR = new QName("generator");
+    public static final QName QNAME_DOCS = new QName("docs");
+    public static final QName QNAME_CLOUD = new QName("cloud");
+    public static final QName QNAME_TTL = new QName("ttl");
+    public static final QName QNAME_IMAGE = new QName("image");
+    public static final QName QNAME_RATING = new QName("rating");
+    public static final QName QNAME_TEXTINPUT = new QName("textInput");
+    public static final QName QNAME_TEXTINPUT2 = new QName("textinput");
+    public static final QName QNAME_SKIPHOURS = new QName("skipHours");
+    public static final QName QNAME_SKIPHOURS2 = new QName("skiphours");
+    public static final QName QNAME_SKIPDAYS = new QName("skipDays");
+    public static final QName QNAME_SKIPDAYS2 = new QName("skipdays");
+    public static final QName QNAME_AUTHOR = new QName("author");
+    public static final QName QNAME_ENCLOSURE = new QName("enclosure");
+    public static final QName QNAME_GUID = new QName("guid");
+    public static final QName QNAME_COMMENTS = new QName("comments");
+    public static final QName QNAME_SOURCE = new QName("source");
+
+    public static final QName QNAME_URL = new QName("url");
+    public static final QName QNAME_WIDTH = new QName("width");
+    public static final QName QNAME_HEIGHT = new QName("height");
+    public static final QName QNAME_DAY = new QName("day");
+    public static final QName QNAME_HOUR = new QName("hour");
+    public static final QName QNAME_NAME = new QName("name");
+
+    public static final QName QNAME_CONTENT_ENCODED = new QName(ENC_NS, "encoded");
+
+    public static final QName QNAME_DC_TITLE = new QName(DC_NS, "title");
+    public static final QName QNAME_DC_CREATOR = new QName(DC_NS, "creator");
+    public static final QName QNAME_DC_SUBJECT = new QName(DC_NS, "subject");
+    public static final QName QNAME_DC_DESCRIPTION = new QName(DC_NS, "description");
+    public static final QName QNAME_DC_PUBLISHER = new QName(DC_NS, "publisher");
+    public static final QName QNAME_DC_CONTRIBUTOR = new QName(DC_NS, "contributor");
+    public static final QName QNAME_DC_DATE = new QName(DC_NS, "date");
+    public static final QName QNAME_DC_TYPE = new QName(DC_NS, "type");
+    public static final QName QNAME_DC_FORMAT = new QName(DC_NS, "format");
+    public static final QName QNAME_DC_IDENTIFIER = new QName(DC_NS, "identifier");
+    public static final QName QNAME_DC_SOURCE = new QName(DC_NS, "source");
+    public static final QName QNAME_DC_LANGUAGE = new QName(DC_NS, "language");
+    public static final QName QNAME_DC_RELATION = new QName(DC_NS, "relation");
+    public static final QName QNAME_DC_COVERAGE = new QName(DC_NS, "covrerage");
+    public static final QName QNAME_DC_RIGHTS = new QName(DC_NS, "rights");
+
+}

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



Mime
View raw message