abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r438314 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/factory/ core/src/main/java/org/apache/abdera/model/ core/src/main/java/org/apache/abdera/util/ parser/src/main/java/org/apache/abdera/parser/stax/
Date Wed, 30 Aug 2006 00:41:56 GMT
Author: jmsnell
Date: Tue Aug 29 17:41:55 2006
New Revision: 438314

URL: http://svn.apache.org/viewvc?rev=438314&view=rev
Log:
The latest consensus call round introduced a new app:modified element to augment
the atom:updated element.  

The short story is: the value of atom:updated may not change when an entry in an 
APP collection is modified, depending on whether or not the server considers the 
modification to be significant.  The app:modified element, on the other hand, if
used must be changed for every modification, whether it is considered to be a 
significant change or not.

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Constants.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java?rev=438314&r1=438313&r2=438314&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java
Tue Aug 29 17:41:55 2006
@@ -168,6 +168,16 @@
   DateTime newUpdated(Element parent);
 
   /**
+   * Create a new app:modified element
+   */
+  DateTime newModified();
+  
+  /**
+   * create a new app:modified element as a child of the given Element
+   */
+  DateTime newModified(Element parent);
+  
+  /**
    * Create a new DateTime element with the given QName as a child of the given Element.
    */
   DateTime newDateTime(QName qname, Element parent);

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?rev=438314&r1=438313&r2=438314&view=diff
==============================================================================
--- 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 Tue
Aug 29 17:41:55 2006
@@ -540,6 +540,20 @@
   DateTime setUpdated(String value);
   
   /**
+   * APP Introduces a new app:modified element whose value changes 
+   * every time the entry is updated
+   */
+  DateTime getModifiedElement();
+  
+  void setModifiedElement(DateTime modified);
+  
+  Date getModified();
+  
+  DateTime setModified(Date value);
+  
+  DateTime setModified(String value);
+  
+  /**
    * Returns this entries Atom Publishing Protocol control element
    */
   Control getControl();

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Constants.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Constants.java?rev=438314&r1=438313&r2=438314&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Constants.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/Constants.java Tue
Aug 29 17:41:55 2006
@@ -63,6 +63,7 @@
   public static final String LN_SUMMARY           = "summary";
   public static final String LN_TITLE             = "title";
   public static final String LN_UPDATED           = "updated";
+  public static final String LN_MODIFIED          = "modified";
   public static final String LN_TERM              = "term";
   public static final String LN_SCHEME            = "scheme";
   public static final String LN_LABEL             = "label";
@@ -108,6 +109,7 @@
   public static final QName SUMMARY               = new QName(ATOM_NS, LN_SUMMARY, PREFIX);
   public static final QName TITLE                 = new QName(ATOM_NS, LN_TITLE, PREFIX);
   public static final QName UPDATED               = new QName(ATOM_NS, LN_UPDATED, PREFIX);
+  public static final QName MODIFIED              = new QName(APP_NS, LN_MODIFIED, "app");
   public static final QName ENTRY                 = new QName(ATOM_NS, LN_ENTRY, PREFIX);
   public static final QName TERM                  = new QName(LN_TERM);
   public static final QName SCHEME                = new QName(LN_SCHEME);

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?rev=438314&r1=438313&r2=438314&view=diff
==============================================================================
--- 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
Tue Aug 29 17:41:55 2006
@@ -607,6 +607,47 @@
     return setUpdated((value != null) ? AtomDate.valueOf(value) : null);
   }
 
+  public DateTime getModifiedElement() {
+    return (DateTime)getFirstChildWithName(MODIFIED);
+  }
+
+  public void setModifiedElement(DateTime updated) {
+    if (updated != null)
+      _setChild(MODIFIED, (OMElement)updated);
+    else 
+      _removeChildren(MODIFIED, false);
+  }
+
+  public Date getModified() {
+    DateTime dte = getModifiedElement();
+    return (dte != null) ? dte.getDate() : null;
+  }
+  
+  private DateTime setModified(AtomDate value) {
+    if (value == null) {
+      _removeChildren(MODIFIED, false);
+      return null;
+    }
+    DateTime dte = getModifiedElement();
+    if (dte != null) {
+      dte.setValue(value);
+      return dte;
+    } else {
+      FOMFactory fomfactory = (FOMFactory) factory;
+      DateTime dt = fomfactory.newModified(this);
+      dt.setValue(value);
+      return dt;
+    }
+  }
+  
+  public DateTime setModified(Date value) {
+    return setModified((value != null) ? AtomDate.valueOf(value) : null);
+  }
+  
+  public DateTime setModified(String value) {
+    return setUpdated((value != null) ? AtomDate.valueOf(value) : null);
+  }
+  
   public Control getControl() {
     return (Control)getFirstChildWithName(CONTROL);
   }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java?rev=438314&r1=438313&r2=438314&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
Tue Aug 29 17:41:55 2006
@@ -489,6 +489,14 @@
     return newDateTime(Constants.UPDATED, parent);
   }
 
+  public DateTime newModified() {
+    return newModified(null);
+  }
+  
+  public DateTime newModified(Element parent) {
+    return newDateTime(Constants.MODIFIED, parent);
+  }
+
   public IRI newIcon() {
     return newIcon(null);
   }
@@ -702,6 +710,8 @@
         element = new FOMDiv(qname.getLocalPart(), namespace, parent, factory);
       } else if (CATEGORIES.equals(qname)) {
         element = new FOMCategories(qname.getLocalPart(), namespace, parent, factory);
+      } else if (MODIFIED.equals(qname)) {
+        element = new FOMDateTime(qname.getLocalPart(), namespace, parent, factory);
       } else if (parent instanceof ExtensibleElement || 
                  parent instanceof Document) {
         element = (OMElement) newExtensionElement(qname, parent);
@@ -774,6 +784,8 @@
       element = (OMElement) newDiv(qname, parent, builder);
     } else if (CATEGORIES.equals(qname)) {
       element = (OMElement) newCategories(qname, parent, builder);
+    } else if (MODIFIED.equals(qname)) {
+      element = (OMElement) newDateTimeElement(qname, parent, builder);
     } else if (parent instanceof ExtensibleElement || parent instanceof Document) {
       element = (OMElement) newExtensionElement(qname, parent, builder);
     }



Mime
View raw message