Actually fix backup function.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 21 Oct 2010 18:15:14 +0000 (20:15 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 21 Oct 2010 18:15:14 +0000 (20:15 +0200)
src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java
src/main/java/net/pterodactylus/sone/web/WebInterface.java
src/main/resources/templates/backup.xml

index c39bd8a..dc00e4b 100644 (file)
@@ -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 {
index 9ea4a7a..a7d714e 100644 (file)
@@ -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());
 
index 7e04792..7ad2cc3 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <sone>
 
-       <name></name>
-       <requestUri></requestUri>
-       <insertUri></insertUri>
+       <name><% currentSone.name|xml></name>
+       <requestUri><% currentSone.requestUri|xml></requestUri>
+       <insertUri><% currentSone.insertUri|xml></insertUri>
 
 </sone>