From 51a11886c23411bd3a40adcf06c3333ff10e4cef Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Sat, 5 Jul 2008 05:56:53 +0000 Subject: [PATCH] some fixes for the appearance actions git-svn-id: https://svn.apache.org/repos/asf/archiva/branches@674155 13f79535-47bb-0310-9956-ffa450edef68 --- .../appearance/AbstractAppearanceAction.java | 21 ++++++++++++++++++ .../appearance/OrganisationInfoAction.java | 22 +------------------ .../src/main/resources/xwork.xml | 4 ++-- .../webapp/WEB-INF/jsp/admin/appearance.jsp | 7 +++++- .../WEB-INF/jsp/admin/editAppearance.jsp | 8 +++---- .../WEB-INF/jsp/components/companyLogo.jsp | 1 - 6 files changed, 34 insertions(+), 29 deletions(-) diff --git a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java index b76e2e45b..75117e0ad 100644 --- a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java +++ b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java @@ -20,8 +20,12 @@ package org.apache.maven.archiva.web.action.admin.appearance; */ import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.OrganisationInformation; import org.codehaus.plexus.xwork.action.PlexusActionSupport; +import com.opensymphony.xwork.Preparable; + /** * AbstractAppearanceAction * @@ -30,6 +34,7 @@ import org.codehaus.plexus.xwork.action.PlexusActionSupport; */ public abstract class AbstractAppearanceAction extends PlexusActionSupport + implements Preparable { /** * Archiva Application Configuration @@ -72,4 +77,20 @@ public abstract class AbstractAppearanceAction { this.organisationUrl = organisationUrl; } + + public void prepare() + throws Exception + { + Configuration config = configuration.getConfiguration(); + if (config != null) + { + OrganisationInformation orgInfo = config.getOrganisationInfo(); + if (orgInfo != null) + { + setOrganisationLogo(orgInfo.getLogoLocation()); + setOrganisationName(orgInfo.getName()); + setOrganisationUrl(orgInfo.getUrl()); + } + } + } } diff --git a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java index 2378027a4..bcacf1ea4 100644 --- a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java +++ b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java @@ -19,9 +19,6 @@ package org.apache.maven.archiva.web.action.admin.appearance; * under the License. */ -import org.apache.maven.archiva.configuration.Configuration; -import org.apache.maven.archiva.configuration.OrganisationInformation; - /** * Stores the organisation information for displaying on the page. * @@ -30,21 +27,4 @@ import org.apache.maven.archiva.configuration.OrganisationInformation; public class OrganisationInfoAction extends AbstractAppearanceAction { - @Override - public String execute() - throws Exception - { - Configuration config = configuration.getConfiguration(); - if (config != null) - { - OrganisationInformation orgInfo = config.getOrganisationInfo(); - if (orgInfo != null) - { - setOrganisationLogo(orgInfo.getLogoLocation()); - setOrganisationName(orgInfo.getName()); - setOrganisationUrl(orgInfo.getUrl()); - } - } - return SUCCESS; - } -} \ No newline at end of file +} diff --git a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml index 7abfee65b..21d0363f6 100644 --- a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml +++ b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml @@ -432,8 +432,8 @@ - - /WEB-INF/jsp/admin/appearance.jsp + + /WEB-INF/jsp/admin/appearance.jsp diff --git a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp index 9468ffcd2..d2b24e83a 100644 --- a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp +++ b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp @@ -19,7 +19,6 @@ <%@ taglib prefix="ww" uri="/webwork" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - @@ -58,6 +57,12 @@ ${organisationLogo} + +   + + + + diff --git a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp index f651c6b09..bf0dd543c 100644 --- a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp +++ b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp @@ -36,11 +36,11 @@ - - - + + + - \ No newline at end of file + diff --git a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp index 308104272..5627e2631 100644 --- a/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp +++ b/archiva-MRM-829/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp @@ -19,7 +19,6 @@ <%@ taglib uri="/webwork" prefix="ww" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - -- 2.39.5