Enhance javadoc.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / EditAlbumPage.java
index eaf8bf6..8e3a3e9 100644 (file)
 package net.pterodactylus.sone.web;
 
 import net.pterodactylus.sone.data.Album;
-import net.pterodactylus.sone.web.page.Page.Request.Method;
+import net.pterodactylus.sone.web.page.FreenetRequest;
 import net.pterodactylus.util.template.Template;
 import net.pterodactylus.util.template.TemplateContext;
+import net.pterodactylus.util.web.Method;
 
 /**
- * TODO
+ * Page that lets the user edit the name and description of an album.
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
 public class EditAlbumPage extends SoneTemplatePage {
 
        /**
-        * TODO
+        * Creates a new “edit album” page.
         *
         * @param template
+        *            The template to render
         * @param webInterface
+        *            The Sone web interface
         */
        public EditAlbumPage(Template template, WebInterface webInterface) {
                super("editAlbum.html", template, "Page.EditAlbum.Title", webInterface, true);
@@ -43,7 +46,7 @@ public class EditAlbumPage extends SoneTemplatePage {
         * {@inheritDoc}
         */
        @Override
-       protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException {
+       protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
                super.processTemplate(request, templateContext);
                if (request.getMethod() == Method.POST) {
                        String albumId = request.getHttpRequest().getPartAsStringFailsafe("album", 36);
@@ -61,7 +64,7 @@ public class EditAlbumPage extends SoneTemplatePage {
                        }
                        String description = request.getHttpRequest().getPartAsStringFailsafe("description", 1000).trim();
                        album.setTitle(title).setDescription(description);
-                       webInterface.getCore().saveSone(album.getSone());
+                       webInterface.getCore().touchConfiguration();
                        throw new RedirectException("imageBrowser.html?album=" + album.getId());
                }
        }