From: David ‘Bombe’ Roden Date: Wed, 13 Oct 2010 14:13:33 +0000 (+0200) Subject: Implement page deletion. X-Git-Tag: 0.1-RC1~467 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d4c71f70fc4fa669b418adabf5d5e8dd3677042d;p=Sone.git Implement page deletion. --- diff --git a/src/main/java/net/pterodactylus/sone/web/DeleteSonePage.java b/src/main/java/net/pterodactylus/sone/web/DeleteSonePage.java index 4cccc63..4e63278 100644 --- a/src/main/java/net/pterodactylus/sone/web/DeleteSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/DeleteSonePage.java @@ -17,6 +17,8 @@ package net.pterodactylus.sone.web; +import net.pterodactylus.sone.data.Sone; +import net.pterodactylus.sone.web.page.Page.Request.Method; import net.pterodactylus.util.template.Template; /** @@ -50,6 +52,13 @@ public class DeleteSonePage extends SoneTemplatePage { @Override protected void processTemplate(Request request, Template template) throws RedirectException { super.processTemplate(request, template); + if (request.getMethod() == Method.POST) { + if (request.getHttpRequest().isPartSet("deleteSone")) { + Sone currentSone = getCurrentSone(request.getToadletContext()); + webInterface.core().deleteSone(currentSone); + } + throw new RedirectException("index.html"); + } } //