X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreateSonePage.java;h=46302b033e4ec8e00af2bc83b0b3ad714e4a4960;hp=1c16d311b8750a9e5061c183fb45702c66b46008;hb=f4ea1e1b3526175e255831c975d6eea813589f25;hpb=bd2cbb229f68fb2535cf6010befa9c4a276d2ee6 diff --git a/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java b/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java index 1c16d31..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); + protected void processTemplate(Request request, DataProvider dataProvider) throws RedirectException { + super.processTemplate(request, dataProvider); List ownIdentitiesWithoutSone = getOwnIdentitiesWithoutSone(webInterface.getCore()); - template.set("identitiesWithoutSone", ownIdentitiesWithoutSone); + dataProvider.set("identitiesWithoutSone", ownIdentitiesWithoutSone); if (request.getMethod() == Method.POST) { String id = request.getHttpRequest().getPartAsStringFailsafe("identity", 44); OwnIdentity selectedIdentity = null; @@ -107,11 +108,10 @@ public class CreateSonePage extends SoneTemplatePage { } } if (selectedIdentity == null) { - template.set("errorNoIdentity", true); + dataProvider.set("errorNoIdentity", true); return; } /* create Sone. */ - webInterface.getCore().getIdentityManager().addContext(selectedIdentity, "Sone"); Sone sone = webInterface.getCore().createSone(selectedIdentity); if (sone == null) { logger.log(Level.SEVERE, "Could not create Sone for OwnIdentity: %s", selectedIdentity);