From d4c71f70fc4fa669b418adabf5d5e8dd3677042d Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 13 Oct 2010 16:13:33 +0200 Subject: [PATCH] Implement page deletion. --- src/main/java/net/pterodactylus/sone/web/DeleteSonePage.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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"); + } } // -- 2.7.4