You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@abdera.apache.org by jm...@apache.org on 2006/09/13 17:37:41 UTC
svn commit: r443000 - in /incubator/abdera/java/trunk:
core/src/main/java/org/apache/abdera/model/Collection.java
parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
Author: jmsnell
Date: Wed Sep 13 08:37:41 2006
New Revision: 443000
URL: http://svn.apache.org/viewvc?view=rev&rev=443000
Log:
Provide a addCategories(String href) method to make it easier to add Out Of Line
Categories doc references (per Draft -10)
Modified:
incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java
incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java?view=diff&rev=443000&r1=442999&r2=443000
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java Wed Sep 13 08:37:41 2006
@@ -22,14 +22,11 @@
import java.util.List;
import javax.activation.MimeType;
-import javax.activation.MimeTypeParseException;
/**
* <p>Represents an collection element in an Atom Publishing Protocol
* introspection document.</p>
*
- * <p>Per APP Draft-08:</p>
- *
* <pre>
* The "app:collection" describes an Atom Protocol collection. One
* child element is defined here for app:collection: "app:member-type".
@@ -37,9 +34,9 @@
* appCollection =
* element app:collection {
* appCommonAttributes,
- * attribute title { text },
* attribute href { text },
- * ( appAccept
+ * ( atomTitle
+ * & appAccept
* & extensionElement* )
* }
* </pre>
@@ -57,46 +54,25 @@
Text getTitleElement();
- /**
- * APP Draft-08: The app:collection element MUST contain a "href"
- * attribute, whose value gives the IRI of the collection.
- */
URI getHref() throws URISyntaxException;
URI getResolvedHref() throws URISyntaxException;
- /**
- * APP Draft-08: The app:collection element MUST contain a "href"
- * attribute, whose value gives the IRI of the collection.
- * @throws URISyntaxException
- */
void setHref(String href) throws URISyntaxException;
- /**
- * PaceMediaEntries5 (proposed change to APP Draft-08)
- */
String[] getAccept() ;
- /**
- * PaceMediaEntries5 (proposed change to APP Draft-08)
- */
void setAccept(String... mediaRanges);
- /**
- * Returns true if the collection accepts the specified media type
- * @throws MimeTypeParseException
- * @throws javax.activation.MimeTypeParseException
- */
boolean accepts(String mediaType);
- /**
- * Returns true if the collection accepts the specified media type
- */
boolean accepts(MimeType mediaType);
List<Categories> getCategories();
Categories addCategories();
+
+ Categories addCategories(String href) throws URISyntaxException;
void addCategories(Categories categories);
Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java?view=diff&rev=443000&r1=442999&r2=443000
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java Wed Sep 13 08:37:41 2006
@@ -183,6 +183,15 @@
}
public Categories addCategories(
+ String href)
+ throws URISyntaxException {
+ Categories cats = ((FOMFactory)factory).newCategories();
+ cats.setHref(href);
+ addCategories(cats);
+ return cats;
+ }
+
+ public Categories addCategories(
List<Category> categories,
boolean fixed,
String scheme)