From 82186635a3d6111935a4768b21300ebf0b7465d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 28 Jul 2012 01:33:23 +0200 Subject: [PATCH] Use new method in base class. --- .../demoscenemusic/page/admin/EditArtistPage.java | 32 ++-------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/page/admin/EditArtistPage.java b/src/main/java/net/pterodactylus/demoscenemusic/page/admin/EditArtistPage.java index 09ba5be..8c141fa 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/page/admin/EditArtistPage.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/page/admin/EditArtistPage.java @@ -17,10 +17,6 @@ package net.pterodactylus.demoscenemusic.page.admin; -import java.util.ArrayList; -import java.util.List; -import java.util.Map.Entry; - import net.pterodactylus.demoscenemusic.core.Core; import net.pterodactylus.demoscenemusic.data.Artist; import net.pterodactylus.demoscenemusic.page.ServletRequest; @@ -73,32 +69,8 @@ public class EditArtistPage extends AdminBasePage { String name = request.getServletRequest().getParameter("name"); artist.setName(name); - /* check if properties were changed. */ - List propertiesToDelete = new ArrayList(); - for (Entry property : artist.getProperties()) { - if (request.getServletRequest().getParameter("delete." + property.getKey()) != null) { - propertiesToDelete.add(property.getKey()); - continue; - } - String value = request.getServletRequest().getParameter("value." + property.getKey()).trim(); - artist.getProperties().set(property.getKey(), value); - } - - /* check if properties are deleted. */ - if (!propertiesToDelete.isEmpty()) { - for (String propertyToDelete : propertiesToDelete) { - artist.getProperties().remove(propertyToDelete); - } - } - - /* check for a new property. */ - if ("true".equals(request.getServletRequest().getParameter("new-property"))) { - String property = request.getServletRequest().getParameter("property").trim(); - String value = request.getServletRequest().getParameter("value").trim(); - if ((property.length() > 0) && (value.length() > 0)) { - artist.getProperties().set(property, value); - } - } + /* process property changes. */ + processProperties(request, artist); getCore().getDataManager().saveArtist(artist); throw new RedirectException("admin.edit-artist?id=" + artist.getId()); -- 2.7.4