final List<WikiPage> pages = wiki.getPagesByDate();
Translator translator = Util.createPackageTranslator(WikiPageChangeOrCreateNotificationHandler.class, locale);
TitleItem title = getTitleItem(p, translator);
si = new SubscriptionInfo(title, null);
SubscriptionListItem subListItem;
for (Iterator<WikiPage> it = pages.listIterator(); it.hasNext();) {
WikiPage element = it.next();
// do only show entries newer then the ones already seen
Date modDate = new Date(element.getModificationTime());
logDebug("modDate=" + modDate + " ; compareDate=" + compareDate, null);
if (modDate.after(compareDate)) {
if((element.getPageName().startsWith("O_") || element.getPageName().startsWith(WikiPage.WIKI_MENU_PAGE)) &&
(element.getModifyAuthor() <= 0)) {
//theses pages are created sometimes automatically. Check if this is the case
continue;
}
//build Businesscontrol-Path
String bControlString = businessControlString + element.getPageName() + "]";
String urlToSend = null;
if(p.getBusinessPath() != null) {
urlToSend = NotificationHelper.getURLFromBusinessPathString(p, bControlString);
}
// string[] gets filled into translation key by adding {0...n} to
// the string
Identity ident = ManagerFactory.getManager().loadIdentityByKey(Long.valueOf(element.getModifyAuthor()));
String desc = translator.translate("notifications.entry", new String[] { element.getPageName(), NotificationHelper.getFormatedName(ident)});
subListItem = new SubscriptionListItem(desc, urlToSend, modDate, CSS_CLASS_WIKI_PAGE_CHANGED_ICON);
si.addSubscriptionListItem(subListItem);
} else {
//there are no more new pages so we stop here
break;
}