String baseSiteURL = baseURL + "/page/";
// get list of all enabled and active weblogs
Iterator websites =
roller.getUserManager().getWebsites(null, Boolean.TRUE, Boolean.TRUE).iterator();
while (websites.hasNext()) {
WebsiteData website = (WebsiteData)websites.next();
StringBuffer sitesb = new StringBuffer();
sitesb.append(baseSiteURL);
sitesb.append(website.getHandle());
String siteUrl = sitesb.toString();
StringBuffer feedsb = new StringBuffer();
feedsb.append(baseFeedURL);
feedsb.append(website.getHandle());
String feedUrl = feedsb.toString();
liveUserFeeds.add(feedUrl);
PlanetSubscriptionData sub =
planet.getSubscription(feedUrl);
if (sub == null) {
logger.info("ADDING feed: "+feedUrl);
sub = new PlanetSubscriptionData();
sub.setTitle(website.getName());
sub.setFeedUrl(feedUrl);
sub.setSiteUrl(siteUrl);
sub.setAuthor(website.getHandle());
planet.saveSubscription(sub);
group.addSubscription(sub);
} else {
sub.setTitle(website.getName());
sub.setAuthor(website.getHandle());
planet.saveSubscription(sub);
}
}
planet.saveGroup(group);
roller.flush();