use of org.intabulas.sandler.elements.Link in project jspwiki by apache.
the class AtomAPIServlet method listBlogs.
/**
* Creates and outputs a full list of all available blogs
*/
private Feed listBlogs() throws ProviderException, IOException {
Collection pages = m_engine.getPageManager().getAllPages();
Feed feed = SyndicationFactory.newSyndicationFeed();
feed.setTitle("List of blogs at this site");
feed.setModified(new Date());
for (Iterator i = pages.iterator(); i.hasNext(); ) {
WikiPage p = (WikiPage) i.next();
//
// List only weblogs
// FIXME: Unfortunately, a weblog is not known until it has
// been executed once, because plugins are off during
// the initial startup phase.
//
log.debug(p.getName() + " = " + p.getAttribute(WeblogPlugin.ATTR_ISWEBLOG));
if (!("true".equals(p.getAttribute(WeblogPlugin.ATTR_ISWEBLOG))))
continue;
String encodedName = TextUtil.urlEncodeUTF8(p.getName());
WikiContext context = new WikiContext(m_engine, p);
String title = TextUtil.replaceEntities(org.apache.wiki.rss.Feed.getSiteName(context));
Link postlink = createLink("service.post", m_engine.getBaseURL() + "atom/" + encodedName, title);
Link editlink = createLink("service.edit", m_engine.getBaseURL() + "atom/" + encodedName, title);
Link feedlink = createLink("service.feed", m_engine.getBaseURL() + "atom.jsp?page=" + encodedName, title);
feed.addLink(postlink);
feed.addLink(feedlink);
feed.addLink(editlink);
}
return feed;
}
Aggregations