roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r398435 - in /incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol: AtomServlet.java PubControlModule.java PubControlModuleGenerator.java PubControlModuleImpl.java PubControlModuleParser.java RollerAtomHandler.java
Date Sun, 30 Apr 2006 20:52:03 GMT
Author: snoopdave
Date: Sun Apr 30 13:52:01 2006
New Revision: 398435

URL: http://svn.apache.org/viewcvs?rev=398435&view=rev
Log:
Use boolean for Pub Control type and be lenient about Atom categories

Modified:
    incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/AtomServlet.java
    incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModule.java
    incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleGenerator.java
    incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleImpl.java
    incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleParser.java
    incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/RollerAtomHandler.java

Modified: incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/AtomServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/AtomServlet.java?rev=398435&r1=398434&r2=398435&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/AtomServlet.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/AtomServlet.java
Sun Apr 30 13:52:01 2006
@@ -184,7 +184,7 @@
                     writer.close(); 
                 } else if (handler.isMediaCollectionURI(pathInfo)) {
                     // get incoming file name from HTTP header
-                    String name = req.getHeader("Name");
+                    String name = req.getHeader("Title");
                     
                     // hand input stream of to hander to post file
                     Entry resource = handler.postMedia(

Modified: incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModule.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModule.java?rev=398435&r1=398434&r2=398435&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModule.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModule.java
Sun Apr 30 13:52:01 2006
@@ -20,6 +20,6 @@
 
 public interface PubControlModule extends Module {
     public static final String URI = "http://purl.org/atom/app#";
-    public Boolean getDraft();
-    public void setDraft(Boolean draft);
+    public boolean getDraft();
+    public void setDraft(boolean draft);
 }

Modified: incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleGenerator.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleGenerator.java?rev=398435&r1=398434&r2=398435&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleGenerator.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleGenerator.java
Sun Apr 30 13:52:01 2006
@@ -48,12 +48,10 @@
 
     public void generate(Module module, Element element) {
         PubControlModule m = (PubControlModule)module;
-        if (m.getDraft() != null) {
-            String draft = m.getDraft().booleanValue() ? "yes" : "no";
-            Element control = new Element("control", PUBCONTROL_NS);
-            control.addContent(generateSimpleElement("draft", draft));
-            element.addContent(control);
-        }
+        String draft = m.getDraft() ? "yes" : "no";
+        Element control = new Element("control", PUBCONTROL_NS);
+        control.addContent(generateSimpleElement("draft", draft));
+        element.addContent(control);
     }
 
     protected Element generateSimpleElement(String name, String value)  {

Modified: incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleImpl.java?rev=398435&r1=398434&r2=398435&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleImpl.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleImpl.java
Sun Apr 30 13:52:01 2006
@@ -19,15 +19,15 @@
 import com.sun.syndication.feed.module.ModuleImpl;
 
 public class PubControlModuleImpl extends ModuleImpl implements PubControlModule {
-    private Boolean _draft;
+    private boolean _draft = false;
 
     public PubControlModuleImpl() {
         super(PubControlModule.class,PubControlModule.URI);
     }
-    public Boolean getDraft() {
+    public boolean getDraft() {
         return _draft;
     }
-    public void setDraft(Boolean draft) {
+    public void setDraft(boolean draft) {
         _draft = draft;
     }
     public Class getInterface() {

Modified: incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleParser.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleParser.java?rev=398435&r1=398434&r2=398435&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleParser.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/PubControlModuleParser.java
Sun Apr 30 13:52:01 2006
@@ -38,11 +38,11 @@
         if (e != null) {
             Element draftElem = e.getChild("draft", getContentNamespace());
             if (draftElem != null) {
-                if ("yes".equals(draftElem.getText())) m.setDraft(Boolean.TRUE); 
-                if ("no".equals(draftElem.getText())) m.setDraft(Boolean.FALSE);        
       
+                if ("yes".equals(draftElem.getText())) m.setDraft(true); 
+                if ("no".equals(draftElem.getText())) m.setDraft(false);                
             }
         }
-        return m.getDraft()!=null ? m : null;
+        return m;
     }
 }
 

Modified: incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/RollerAtomHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/RollerAtomHandler.java?rev=398435&r1=398434&r2=398435&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/RollerAtomHandler.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/webservices/atomprotocol/RollerAtomHandler.java
Sun Apr 30 13:52:01 2006
@@ -803,7 +803,7 @@
                
         PubControlModule control = 
             (PubControlModule)entry.getModule("http://purl.org/atom/app#");
-        if (control!=null && control.getDraft()!=null && control.getDraft().booleanValue())
{
+        if (control!=null && control.getDraft()) {
             rollerEntry.setStatus(WeblogEntryData.DRAFT);
         } else {
             rollerEntry.setStatus(WeblogEntryData.PUBLISHED);
@@ -815,12 +815,17 @@
         if (categories != null && categories.size() > 0) {
             for (int i=0; i<categories.size(); i++) {
                 Category cat = (Category)categories.get(i);
-                WeblogCategoryData rollerCat =
-                    mRoller.getWeblogManager().getWeblogCategoryByPath(
-                    website, cat.getTerm());
-                if (rollerCat != null) {
-                    rollerEntry.setCategory(rollerCat);
-                    break;
+                // Caller has no way of knowing our categories, so be lenient here
+                String catString = cat.getTerm() != null ? cat.getTerm() : cat.getLabel();
+                if (catString != null) {
+                    WeblogCategoryData rollerCat =
+                        mRoller.getWeblogManager().getWeblogCategoryByPath(
+                        website, catString);
+                    if (rollerCat != null) {
+                        // Found a valid category, so break out
+                        rollerEntry.setCategory(rollerCat);
+                        break;
+                    }
                 }
             }
         } else {



Mime
View raw message