From: David ‘Bombe’ Roden Date: Thu, 21 Oct 2010 18:15:14 +0000 (+0200) Subject: Actually fix backup function. X-Git-Tag: 0.1-RC1~107 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9dfc07276c481b67c9b8f935cfeeeef18da80a14;p=Sone.git Actually fix backup function. --- 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>