WeblogEntryData current, String catName, int maxEntries, boolean next)
throws RollerException {
if (catName != null && catName.trim().equals("/")) {
catName = null;
}
Junction conjunction = Expression.conjunction();
conjunction.add(Expression.eq("website", current.getWebsite()));
conjunction.add(Expression.eq("status", WeblogEntryData.PUBLISHED));
if (next) {
conjunction.add(Expression.gt("pubTime", current.getPubTime()));
} else {
conjunction.add(Expression.lt("pubTime", current.getPubTime()));
}
if (catName != null) {
WeblogCategoryData category =
getWeblogCategoryByPath(current.getWebsite(), null, catName);
if (category != null) {
conjunction.add(Expression.eq("category", category));
} else {
throw new RollerException("Cannot find category: "+catName);
}
}