X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreateSonePage.java;h=46302b033e4ec8e00af2bc83b0b3ad714e4a4960;hb=d53a79eeb9531a08173431ce2ba19156eeca4a0c;hp=d55624f98bf2da40dbe8cf307e9ef0104c5158e4;hpb=2c5b76a2fbce16ef33f079a3de9ae9fc9a9d30b8;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java b/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java index d55624f..46302b0 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java @@ -30,6 +30,7 @@ import net.pterodactylus.sone.data.Sone; 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; @@ -93,10 +94,10 @@ public class CreateSonePage extends SoneTemplatePage { * {@inheritDoc} */ @Override - protected void processTemplate(Request request, Template template) throws RedirectException { - super.processTemplate(request, template); - List ownIdentitiesWithoutSone = getOwnIdentitiesWithoutSone(webInterface.core()); - template.set("identitiesWithoutSone", ownIdentitiesWithoutSone); + protected void processTemplate(Request request, DataProvider dataProvider) throws RedirectException { + super.processTemplate(request, dataProvider); + List ownIdentitiesWithoutSone = getOwnIdentitiesWithoutSone(webInterface.getCore()); + dataProvider.set("identitiesWithoutSone", ownIdentitiesWithoutSone); if (request.getMethod() == Method.POST) { String id = request.getHttpRequest().getPartAsStringFailsafe("identity", 44); OwnIdentity selectedIdentity = null; @@ -107,12 +108,11 @@ public class CreateSonePage extends SoneTemplatePage { } } 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 */