From 7bb372a4dcd7ba15992d54c36e17255b61fafcc5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 5 Nov 2010 15:48:10 +0100 Subject: [PATCH] Remove backup and key display. --- .../pterodactylus/sone/web/BackupProfilePage.java | 67 ---------------------- .../net/pterodactylus/sone/web/WebInterface.java | 2 - src/main/resources/templates/backup.xml | 61 -------------------- src/main/resources/templates/editProfile.html | 24 -------- 4 files changed, 154 deletions(-) delete mode 100644 src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java delete mode 100644 src/main/resources/templates/backup.xml diff --git a/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java b/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java deleted file mode 100644 index cca5df1..0000000 --- a/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Sone - BackupProfilePage.java - Copyright © 2010 David Roden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.pterodactylus.sone.web; - -import java.io.StringWriter; - -import net.pterodactylus.util.io.Closer; -import net.pterodactylus.util.template.Template; - -/** - * This page lets the user store a backup file containing the settings of the - * logged in Sone. - * - * @author David ‘Bombe’ Roden - */ -public class BackupProfilePage extends SoneTemplatePage { - - /** - * Creates a new “backup profile” page. - * - * @param template - * The template to render - * @param webInterface - * The Sone web interface - */ - public BackupProfilePage(Template template, WebInterface webInterface) { - super("backupProfile.html", template, "Page.BackupProfile.Title", webInterface, true); - } - - // - // TEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - public Response handleRequest(Request request) { - StringWriter stringWriter = new StringWriter(); - template.set("currentSone", getCurrentSone(request.getToadletContext())); - try { - template.render(stringWriter); - } finally { - Closer.close(stringWriter); - } - - Response response = new Response(200, "OK", "text/xml; charset=utf-8", stringWriter.toString()); - response.setHeader("Content-Disposition", "attachment; filename=Sone_" + getCurrentSone(request.getToadletContext()).getName() + ".xml"); - return response; - } - -} diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 725b47b..c0d903a 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -198,7 +198,6 @@ public class WebInterface { Template createPostTemplate = templateFactory.createTemplate(createReader("/templates/createPost.html")); Template createReplyTemplate = templateFactory.createTemplate(createReader("/templates/createReply.html")); Template editProfileTemplate = templateFactory.createTemplate(createReader("/templates/editProfile.html")); - Template backupProfileTemplate = templateFactory.createTemplate(createReader("/templates/backup.xml")); Template viewSoneTemplate = templateFactory.createTemplate(createReader("/templates/viewSone.html")); Template viewPostTemplate = templateFactory.createTemplate(createReader("/templates/viewPost.html")); Template likePostTemplate = templateFactory.createTemplate(createReader("/templates/like.html")); @@ -219,7 +218,6 @@ public class WebInterface { pageToadlets.add(pageToadletFactory.createPageToadlet(new CreateSonePage(createSoneTemplate, this), "CreateSone")); pageToadlets.add(pageToadletFactory.createPageToadlet(new KnownSonesPage(knownSonesTemplate, this), "KnownSones")); pageToadlets.add(pageToadletFactory.createPageToadlet(new EditProfilePage(editProfileTemplate, this), "EditProfile")); - pageToadlets.add(pageToadletFactory.createPageToadlet(new BackupProfilePage(backupProfileTemplate, this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new CreatePostPage(createPostTemplate, this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new CreateReplyPage(createReplyTemplate, this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new ViewSonePage(viewSoneTemplate, this))); diff --git a/src/main/resources/templates/backup.xml b/src/main/resources/templates/backup.xml deleted file mode 100644 index 5591e7c..0000000 --- a/src/main/resources/templates/backup.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - <% currentSone.id|xml> - - <% currentSone.requestUri|xml> - <% currentSone.insertUri|xml> - - - <% currentSone.profile.firstName|xml> - <% currentSone.profile.middleName|xml> - <% currentSone.profile.lastName|xml> - <% currentSone.profile.birthDay|xml> - <% currentSone.profile.birthMonth|xml> - <% currentSone.profile.birthYear|xml> - - - - <%foreach currentSone.posts post> - - <% post.id|xml> - - <% post.text|xml> - - <%/foreach> - - - - <%foreach currentSone.replies reply> - - <% reply.id> - <% reply.post.id|xml> - - <% reply.text|xml> - - <%/foreach> - - - - <%foreach currentSone.likedPostIds postId> - <% postId|xml> - <%/foreach> - - - - <%foreach currentSone.likedReplyIds replyId> - <% replyId|xml> - <%/foreach> - - - - <%foreach currentSone.friends friend> - - <% friend.id|xml> - <% friend.requestUri|xml> - <% friend.name|xml> - - <%/foreach> - - - diff --git a/src/main/resources/templates/editProfile.html b/src/main/resources/templates/editProfile.html index 0760525..edc3b38 100644 --- a/src/main/resources/templates/editProfile.html +++ b/src/main/resources/templates/editProfile.html @@ -64,28 +64,4 @@ -

<%= Page.EditProfile.Keys.Title|l10n|html>

- -

<%= Page.EditProfile.Keys.Description.RequestKey|l10n|html>

-

<%= Page.EditProfile.Keys.Description.InsertKey|l10n|html>

-

<%= Page.EditProfile.Keys.Description.Summary|l10n|html>

- -
- - -
-
- - -
- -

<%= Page.EditProfile.Backup.Title|l10n|html>

- -

<%= Page.EditProfile.Backup.Description|l10n|html>

- -
- - -
- <%include include/tail.html> -- 2.7.4