You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2006/03/10 19:51:45 UTC

svn commit: r384890 - /incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java

Author: snoopdave
Date: Fri Mar 10 10:51:43 2006
New Revision: 384890

URL: http://svn.apache.org/viewcvs?rev=384890&view=rev
Log:
Set author for entries in APP Atom feeds as suggested by Jeff Blattman

Modified:
    incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java

Modified: incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java?rev=384890&r1=384889&r2=384890&view=diff
==============================================================================
--- incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java (original)
+++ incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java Fri Mar 10 10:51:43 2006
@@ -24,6 +24,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
+import java.util.Collections;
 
 import javax.servlet.http.HttpServletRequest;
 
@@ -47,6 +48,7 @@
 import com.sun.syndication.feed.atom.Entry;
 import com.sun.syndication.feed.atom.Feed;
 import com.sun.syndication.feed.atom.Link;
+import com.sun.syndication.feed.atom.Person;
 import javax.activation.FileTypeMap;
 import org.roller.RollerException;
 import org.roller.config.RollerConfig;
@@ -562,7 +564,7 @@
     }
     
     /**
-     * Return true if user is allowed to create/edit entries and resources in weblog.
+     * Return true if user is allowed to create/edit weblog entries and file uploads in a website.
      */
     private boolean canEdit(WebsiteData website) {
         try {
@@ -701,12 +703,17 @@
         contents.add(content);
         
         String absUrl = mRollerContext.getAbsoluteContextUrl(mRequest);
-        
         atomEntry.setId(        absUrl + entry.getPermaLink());
         atomEntry.setTitle(     entry.getTitle());
         atomEntry.setContents(  contents);
         atomEntry.setPublished( entry.getPubTime());
-        atomEntry.setUpdated(   entry.getUpdateTime());
+        atomEntry.setUpdated(   entry.getUpdateTime());        
+
+        UserData creator = entry.getCreator();        
+        Person author = new Person();
+        author.setName(         creator.getUserName());   
+        author.setEmail(        creator.getEmailAddress());                        
+        atomEntry.setAuthors(   Collections.singletonList(author));
         
         List categories = new ArrayList();
         Category atomCat = new Category();