From 9dfc07276c481b67c9b8f935cfeeeef18da80a14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 21 Oct 2010 20:15:14 +0200 Subject: [PATCH] Actually fix backup function. --- src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java | 1 + src/main/java/net/pterodactylus/sone/web/WebInterface.java | 2 ++ src/main/resources/templates/backup.xml | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java b/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java index c39bd8a..dc00e4b 100644 --- a/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java +++ b/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java @@ -52,6 +52,7 @@ public class BackupProfilePage extends SoneTemplatePage { @Override public Response handleRequest(Request request) { StringWriter stringWriter = new StringWriter(); + template.set("currentSone", getCurrentSone(request.getToadletContext())); try { template.render(stringWriter); } finally { diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 9ea4a7a..a7d714e 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -50,6 +50,7 @@ import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateException; import net.pterodactylus.util.template.TemplateFactory; import net.pterodactylus.util.template.TemplateProvider; +import net.pterodactylus.util.template.XmlFilter; import freenet.clients.http.SessionManager; import freenet.clients.http.ToadletContainer; import freenet.l10n.BaseL10n; @@ -153,6 +154,7 @@ public class WebInterface extends AbstractService { templateFactory.addFilter("date", new DateFilter()); templateFactory.addFilter("l10n", new L10nFilter(l10n())); templateFactory.addFilter("substring", new SubstringFilter()); + templateFactory.addFilter("xml", new XmlFilter()); templateFactory.setTemplateProvider(new ClassPathTemplateProvider(templateFactory)); templateFactory.addTemplateObject("formPassword", sonePlugin.pluginRespirator().getToadletContainer().getFormPassword()); diff --git a/src/main/resources/templates/backup.xml b/src/main/resources/templates/backup.xml index 7e04792..7ad2cc3 100644 --- a/src/main/resources/templates/backup.xml +++ b/src/main/resources/templates/backup.xml @@ -1,8 +1,8 @@ - - - + <% currentSone.name|xml> + <% currentSone.requestUri|xml> + <% currentSone.insertUri|xml> -- 2.7.4