Remove backup and key display.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 5 Nov 2010 14:48:10 +0000 (15:48 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 5 Nov 2010 14:48:10 +0000 (15:48 +0100)
src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java [deleted file]
src/main/java/net/pterodactylus/sone/web/WebInterface.java
src/main/resources/templates/backup.xml [deleted file]
src/main/resources/templates/editProfile.html

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 (file)
index cca5df1..0000000
+++ /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 <http://www.gnu.org/licenses/>.
- */
-
-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 <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
-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;
-       }
-
-}
index 725b47b..c0d903a 100644 (file)
@@ -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 (file)
index 5591e7c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<sone>
-
-       <id><% currentSone.id|xml></id>
-       <time><% currentSone.time|xml></time>
-       <request-uri><% currentSone.requestUri|xml></request-uri>
-       <insert-uri><% currentSone.insertUri|xml></insert-uri>
-
-       <profile>
-               <first-name><% currentSone.profile.firstName|xml></first-name>
-               <middle-name><% currentSone.profile.middleName|xml></middle-name>
-               <last-name><% currentSone.profile.lastName|xml></last-name>
-               <birth-day><% currentSone.profile.birthDay|xml></birth-day>
-               <birth-month><% currentSone.profile.birthMonth|xml></birth-month>
-               <birth-year><% currentSone.profile.birthYear|xml></birth-year>
-       </profile>
-
-       <posts>
-               <%foreach currentSone.posts post>
-               <post>
-                       <id><% post.id|xml></id>
-                       <time><% post.time></time>
-                       <text><% post.text|xml></text>
-               </post>
-               <%/foreach>
-       </posts>
-
-       <replies>
-               <%foreach currentSone.replies reply>
-               <reply>
-                       <id><% reply.id></id>
-                       <post-id><% reply.post.id|xml></post-id>
-                       <time><% reply.time></time>
-                       <text><% reply.text|xml></text>
-               </reply>
-               <%/foreach>
-       </replies>
-
-       <post-likes>
-               <%foreach currentSone.likedPostIds postId>
-               <post-like><% postId|xml></post-like>
-               <%/foreach>
-       </post-likes>
-
-       <reply-likes>
-               <%foreach currentSone.likedReplyIds replyId>
-               <reply-like><% replyId|xml></reply-like>
-               <%/foreach>
-       </reply-likes>
-
-       <friends>
-               <%foreach currentSone.friends friend>
-               <friend>
-                       <sone-id><% friend.id|xml></sone-id>
-                       <sone-key><% friend.requestUri|xml></sone-key>
-                       <sone-name><% friend.name|xml></sone-name>
-               </friend>
-               <%/foreach>
-       </friends>
-
-</sone>
index 0760525..edc3b38 100644 (file)
 
        </form>
 
-       <h1><%= Page.EditProfile.Keys.Title|l10n|html></h1>
-
-       <p><%= Page.EditProfile.Keys.Description.RequestKey|l10n|html></p>
-       <p><%= Page.EditProfile.Keys.Description.InsertKey|l10n|html></p>
-       <p><%= Page.EditProfile.Keys.Description.Summary|l10n|html></p>
-
-       <div>
-               <label><%= Page.EditProfile.Label.RequestKey|l10n|html></label>
-               <input type="text" class="key" readonly="readonly" value="<% currentSone.requestUri|html>" />
-       </div>
-       <div>
-               <label><%= Page.EditProfile.Label.InsertKey|l10n|html></label>
-               <input type="text" class="key" readonly="readonly" value="<% currentSone.insertUri|html>" />
-       </div>
-
-       <h1><%= Page.EditProfile.Backup.Title|l10n|html></h1>
-
-       <p><%= Page.EditProfile.Backup.Description|l10n|html></p>
-
-       <form action="backupProfile.html" method="post">
-               <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-               <button type="submit"><%= Page.EditProfile.Backup.Button.DownloadBackup|l10n|html></button>
-       </form>
-
 <%include include/tail.html>