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/02/21 16:04:20 UTC
svn commit: r379477 -
/incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java
Author: snoopdave
Date: Tue Feb 21 07:04:18 2006
New Revision: 379477
URL: http://svn.apache.org/viewcvs?rev=379477&view=rev
Log:
Fixing next links in Atom protocol collections
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=379477&r1=379476&r2=379477&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 Tue Feb 21 07:04:18 2006
@@ -216,15 +216,14 @@
WeblogEntryData rollerEntry = (WeblogEntryData)iter.next();
atomEntries.add(createAtomEntry(rollerEntry));
}
- if (count > max) { // add next link
+ List links = new ArrayList();
+ if (entries.size() > max) { // add next link
int nextOffset = start + max;
String url = absUrl + "/app/" + website.getHandle() + "/entries/" + nextOffset;
Link nextLink = new Link();
nextLink.setRel("next");
nextLink.setHref(url);
- List next = new ArrayList();
- next.add(nextLink);
- feed.setOtherLinks(next);
+ links.add(nextLink);
}
if (start > 0) { // add previous link
int prevOffset = start > max ? start - max : 0;
@@ -232,10 +231,9 @@
Link prevLink = new Link();
prevLink.setRel("previous");
prevLink.setHref(url);
- List prev = new ArrayList();
- prev.add(prevLink);
- feed.setOtherLinks(prev);
+ links.add(prevLink);
}
+ if (links.size() > 0) feed.setOtherLinks(links);
feed.setEntries(atomEntries);
return feed;
}