roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r529497 - in /roller/trunk/src/org/apache/roller/webservices/atomprotocol: Collection.java RollerAtomHandler.java Workspace.java
Date Tue, 17 Apr 2007 06:11:07 GMT
Author: snoopdave
Date: Mon Apr 16 23:11:04 2007
New Revision: 529497

URL: http://svn.apache.org/viewvc?view=rev&rev=529497
Log:
- Removing namespaces from APP service doc elements
- Fixing resource collections

Modified:
    roller/trunk/src/org/apache/roller/webservices/atomprotocol/Collection.java
    roller/trunk/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java
    roller/trunk/src/org/apache/roller/webservices/atomprotocol/Workspace.java

Modified: roller/trunk/src/org/apache/roller/webservices/atomprotocol/Collection.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/webservices/atomprotocol/Collection.java?view=diff&rev=529497&r1=529496&r2=529497
==============================================================================
--- roller/trunk/src/org/apache/roller/webservices/atomprotocol/Collection.java (original)
+++ roller/trunk/src/org/apache/roller/webservices/atomprotocol/Collection.java Mon Apr 16
23:11:04 2007
@@ -141,27 +141,27 @@
         title.setText(collection.getTitle());
         element.addContent(title);
         if (collection.getTitleType() != null && !collection.getTitleType().equals("TEXT"))
{
-            element.setAttribute("type", collection.getTitleType(), AtomService.ATOM_FORMAT);
+            element.setAttribute("type", collection.getTitleType()); //, AtomService.ATOM_FORMAT);
         }
                     
         // Loop to create <app:categories> elements            
         for (Iterator it = collection.getCategories().iterator(); it.hasNext();) {
             Categories cats = (Categories)it.next();
             Element catsElem = new Element("categories", AtomService.ATOM_PROTOCOL);
-            catsElem.setAttribute("fixed", cats.isFixed() ? "yes" : "no", AtomService.ATOM_PROTOCOL);
+            catsElem.setAttribute("fixed", cats.isFixed() ? "yes" : "no"); //, AtomService.ATOM_PROTOCOL);
             if (cats.getScheme() != null) {
-                catsElem.setAttribute("scheme", cats.getScheme(), AtomService.ATOM_PROTOCOL);
+                catsElem.setAttribute("scheme", cats.getScheme()); //, AtomService.ATOM_PROTOCOL);
             }
             // Loop to create <atom:category> elements
             for (Iterator catIter = cats.getCategories().iterator(); catIter.hasNext();)
{
                 Category cat = (Category) catIter.next();
                 Element catElem = new Element("category", AtomService.ATOM_FORMAT);
-                catElem.setAttribute("term", cat.getTerm(), AtomService.ATOM_FORMAT);
+                catElem.setAttribute("term", cat.getTerm()); //, AtomService.ATOM_FORMAT);
                 if (cat.getScheme() != null) { // optional
-                    catElem.setAttribute("scheme", cat.getScheme(), AtomService.ATOM_FORMAT);
+                    catElem.setAttribute("scheme", cat.getScheme()); //, AtomService.ATOM_FORMAT);
                 }
                 if (cat.getLabel() != null) { // optional
-                    catElem.setAttribute("label", cat.getLabel(), AtomService.ATOM_FORMAT);
+                    catElem.setAttribute("label", cat.getLabel()); //, AtomService.ATOM_FORMAT);
                 }
                 catsElem.addContent(catElem);
             }

Modified: roller/trunk/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java?view=diff&rev=529497&r1=529496&r2=529497
==============================================================================
--- roller/trunk/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java (original)
+++ roller/trunk/src/org/apache/roller/webservices/atomprotocol/RollerAtomHandler.java Mon
Apr 16 23:11:04 2007
@@ -406,8 +406,6 @@
             if (!canView(website)) {
                 throw new AtomNotAuthorizedException("Not authorized to access website");
             }
-            FileManager fmgr = roller.getFileManager();
-            ThemeResource[] files = fmgr.getFiles(website, path);
                         
             Feed feed = new Feed();
             feed.setId(URLUtilities.getAtomProtocolURL(true)
@@ -420,6 +418,9 @@
             link.setType("text/html");
             feed.setAlternateLinks(Collections.singletonList(link));
 
+            FileManager fmgr = roller.getFileManager();
+            ThemeResource[] files = fmgr.getFiles(website, path);
+
             SortedSet sortedSet = new TreeSet(new Comparator() {
                 public int compare(Object o1, Object o2) {
                     ThemeResource f1 = (ThemeResource)o1;
@@ -433,12 +434,14 @@
                 }               
             });
                                     
-            List atomEntries = new ArrayList();
-            if (files != null && start < files.length) {                   
+            if (files != null && start < files.length) {  
+                for (int j=0; j<files.length; j++) {
+                    sortedSet.add(files[j]);
+                }
                 int count = 0;
-                ThemeResource[] sortedArray = (ThemeResource[])sortedSet.toArray(new ThemeResource[sortedSet.size()]);
-                for (int i=start; i<(start + max) && i<(sortedArray.length);
i++) {
-                    Entry entry = createAtomResourceEntry(website, sortedArray[i]);
+                List atomEntries = new ArrayList();
+                for (int i=start; i<(start + max) && i<(sortedSet.size());
i++) {
+                    Entry entry = createAtomResourceEntry(website, files[i]);
                     atomEntries.add(entry);
                     if (count == 0) {
                         // first entry is most recent

Modified: roller/trunk/src/org/apache/roller/webservices/atomprotocol/Workspace.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/webservices/atomprotocol/Workspace.java?view=diff&rev=529497&r1=529496&r2=529497
==============================================================================
--- roller/trunk/src/org/apache/roller/webservices/atomprotocol/Workspace.java (original)
+++ roller/trunk/src/org/apache/roller/webservices/atomprotocol/Workspace.java Mon Apr 16
23:11:04 2007
@@ -119,7 +119,7 @@
         title.setText(space.getTitle());
         element.addContent(title);
         if (space.getTitleType() != null && !space.getTitleType().equals("TEXT"))
{
-            element.setAttribute("type", space.getTitleType(), AtomService.ATOM_FORMAT);
+            title.setAttribute("type", space.getTitleType()); //, AtomService.ATOM_FORMAT);
         }
         
         Iterator iter = space.getCollections().iterator();



Mime
View raw message