+ formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword();
+
+ templateFactory = new DefaultTemplateFactory();
+ templateFactory.addAccessor(Object.class, new ReflectionAccessor());
+ templateFactory.addAccessor(Collection.class, new CollectionAccessor());
+ templateFactory.addAccessor(Sone.class, new SoneAccessor(getCore()));
+ templateFactory.addAccessor(Post.class, new PostAccessor(getCore(), templateFactory));
+ templateFactory.addAccessor(Reply.class, new ReplyAccessor(getCore(), templateFactory));
+ templateFactory.addAccessor(Album.class, new AlbumAccessor());
+ templateFactory.addAccessor(Identity.class, new IdentityAccessor(getCore()));
+ templateFactory.addAccessor(NotificationManager.class, new NotificationManagerAccessor());
+ templateFactory.addFilter("date", new DateFilter());
+ templateFactory.addFilter("l10n", new L10nFilter(getL10n()));
+ templateFactory.addFilter("substring", new SubstringFilter());
+ templateFactory.addFilter("xml", new XmlFilter());
+ templateFactory.addFilter("change", new RequestChangeFilter());
+ templateFactory.addFilter("match", new MatchFilter());
+ templateFactory.addFilter("css", new CssClassNameFilter());
+ templateFactory.addPlugin("getpage", new GetPagePlugin());
+ templateFactory.addPlugin("paginate", new PaginationPlugin());
+ templateFactory.setTemplateProvider(new ClassPathTemplateProvider(templateFactory));
+ templateFactory.addTemplateObject("formPassword", formPassword);
+
+ /* create notifications. */
+ Template newSoneNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newSoneNotification.html"));
+ newSoneNotification = new ListNotification<Sone>("new-sone-notification", "sones", newSoneNotificationTemplate);
+
+ Template newPostNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newPostNotification.html"));
+ newPostNotification = new ListNotification<Post>("new-post-notification", "posts", newPostNotificationTemplate);
+
+ Template newReplyNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newReplyNotification.html"));
+ newReplyNotification = new ListNotification<Reply>("new-replies-notification", "replies", newReplyNotificationTemplate);
+
+ Template rescuingSonesTemplate = templateFactory.createTemplate(createReader("/templates/notify/rescuingSonesNotification.html"));
+ rescuingSonesNotification = new ListNotification<Sone>("sones-being-rescued-notification", "sones", rescuingSonesTemplate);
+
+ Template sonesRescuedTemplate = templateFactory.createTemplate(createReader("/templates/notify/sonesRescuedNotification.html"));
+ sonesRescuedNotification = new ListNotification<Sone>("sones-rescued-notification", "sones", sonesRescuedTemplate);
+
+ Template lockedSonesTemplate = templateFactory.createTemplate(createReader("/templates/notify/lockedSonesNotification.html"));
+ lockedSonesNotification = new ListNotification<Sone>("sones-locked-notification", "sones", lockedSonesTemplate);
+
+ Template newVersionTemplate = templateFactory.createTemplate(createReader("/templates/notify/newVersionNotification.html"));
+ newVersionNotification = new TemplateNotification("new-version-notification", newVersionTemplate);