import net.pterodactylus.sone.freenet.wot.OwnIdentity;
import net.pterodactylus.sone.web.page.Page.Request.Method;
import net.pterodactylus.util.logging.Logging;
+import net.pterodactylus.util.template.DataProvider;
import net.pterodactylus.util.template.Template;
import freenet.clients.http.ToadletContext;
* {@inheritDoc}
*/
@Override
- protected void processTemplate(Request request, Template template) throws RedirectException {
- super.processTemplate(request, template);
- List<OwnIdentity> ownIdentitiesWithoutSone = getOwnIdentitiesWithoutSone(webInterface.core());
- template.set("identitiesWithoutSone", ownIdentitiesWithoutSone);
+ protected void processTemplate(Request request, DataProvider dataProvider) throws RedirectException {
+ super.processTemplate(request, dataProvider);
+ List<OwnIdentity> ownIdentitiesWithoutSone = getOwnIdentitiesWithoutSone(webInterface.getCore());
+ dataProvider.set("identitiesWithoutSone", ownIdentitiesWithoutSone);
if (request.getMethod() == Method.POST) {
String id = request.getHttpRequest().getPartAsStringFailsafe("identity", 44);
OwnIdentity selectedIdentity = null;
}
}
if (selectedIdentity == null) {
- template.set("errorNoIdentity", true);
+ dataProvider.set("errorNoIdentity", true);
return;
}
/* create Sone. */
- webInterface.core().getIdentityManager().addContext(selectedIdentity, "Sone");
- Sone sone = webInterface.core().createSone(selectedIdentity);
+ Sone sone = webInterface.getCore().createSone(selectedIdentity);
if (sone == null) {
logger.log(Level.SEVERE, "Could not create Sone for OwnIdentity: %s", selectedIdentity);
/* TODO - go somewhere else */