abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r443088 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/model/Entry.java parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
Date Wed, 13 Sep 2006 19:32:24 GMT
Author: jmsnell
Date: Wed Sep 13 12:32:23 2006
New Revision: 443088

URL: http://svn.apache.org/viewvc?view=rev&rev=443088
Log:
Provide convenience methods for setting an entry as a draft per APP Draft -10 section 12.1.1

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java?view=diff&rev=443088&r1=443087&r2=443088
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java Wed
Sep 13 12:32:23 2006
@@ -571,6 +571,16 @@
   void setControl(Control control);
   
   /**
+   * Sets whether or not this entry is a draft
+   */
+  void setDraft(boolean draft);
+  
+  /**
+   * Returns true if this entry is a draft
+   */
+  boolean isDraft();
+  
+  /**
    * Returns the first link with the specified rel attribute value
    */
   Link getLink(String rel);

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java?view=diff&rev=443088&r1=443087&r2=443088
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
Wed Sep 13 12:32:23 2006
@@ -790,4 +790,20 @@
     Link link = getEditMediaLink(type, hreflang);
     return (link != null) ? link.getResolvedHref() : null;
   }
+  
+  public void setDraft(boolean draft) {
+    Control control = getControl();
+    if (control == null && draft) {
+      control = ((FOMFactory)factory).newControl(this);
+    }
+    if (control != null) control.setDraft(draft);
+  }
+  
+  /**
+   * Returns true if this entry is a draft
+   */
+  public boolean isDraft() {
+    Control control = getControl();
+    return (control != null) ? control.isDraft() : false;
+  }
 }



Mime
View raw message