]> source.dussan.org Git - archiva.git/commitdiff
some fixes for the appearance actions
authorBrett Porter <brett@apache.org>
Sat, 5 Jul 2008 05:56:53 +0000 (05:56 +0000)
committerBrett Porter <brett@apache.org>
Sat, 5 Jul 2008 05:56:53 +0000 (05:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-829@674155 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp

index b76e2e45bd0a12d447fa1c6fa35e4401e3317b4f..75117e0adf072eff72c50e56e9bafd727f000748 100644 (file)
@@ -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());
+            }
+        }
+    }
 }
index 2378027a4c10873d6549b0b010a2cd55ae7a3a47..bcacf1ea49bedff1228425ec0b5deabf8ddd078e 100644 (file)
@@ -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
+}
index 7abfee65b7c61ca919974a02be975fc13ef72557..21d0363f665d6be196f37e531652c2aa02d174a8 100644 (file)
 
     <!-- .\ CONFIGURATION \.___________________________________________ -->
 
-    <action name="configureAppearance" class="organisationInfo" method="input">
-      <result name="input">/WEB-INF/jsp/admin/appearance.jsp</result>
+    <action name="configureAppearance" class="organisationInfo">
+      <result name="success">/WEB-INF/jsp/admin/appearance.jsp</result>
     </action>
 
     <action name="editAppearance" class="editOrganisationInfo" method="input">
index 9468ffcd2d809485bb554c4bf49aa2719d86fa9e..d2b24e83a3254aad28bf46be8f513b6ed95df8f8 100644 (file)
@@ -19,7 +19,6 @@
 
 <%@ taglib prefix="ww" uri="/webwork" %>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<ww:set name="organisationInfo" value="organisationInfo"/>
 
 <html>
 <head>
             <code>${organisationLogo}</code>
           </td>
         </tr>
+        <tr>
+          <th>&nbsp;</th>
+          <td>
+      <img src="${organisationLogo}" title="${organisationName}" border="0" alt=""/>
+          </td>
+        </tr>
       </table>
 </body>
 </html>
index f651c6b094019e7ff23dc29e3bea3dea3f978874..bf0dd543c84a4b6672c60c51362de092422c7f84 100644 (file)
 <ww:set name="editOrganisationInfo" value="editOrganisationInfo"/>
 <ww:actionmessage/>
 <ww:form method="post" action="saveAppearance" namespace="/admin" validate="true" theme="xhtml">
-    <ww:textfield name="organisationName" value="${organisationName}" label="Name"/>
-    <ww:textfield name="organisationUrl" value="${organisationUrl}" label="URL"/>
-    <ww:textfield name="organisationLogo" value="${organisationLogo}" label="Logo URL"/>
+    <ww:textfield name="organisationName" value="${organisationName}" label="Name" size="50" />
+    <ww:textfield name="organisationUrl" value="${organisationUrl}" label="URL" size="50"/>
+    <ww:textfield name="organisationLogo" value="${organisationLogo}" label="Logo URL" size="50" />
   <ww:submit value="Save"/>
 </ww:form>
 </body>
 
-</html>
\ No newline at end of file
+</html>
index 30810427233e81c1544fa709dc240f8f8c080557..5627e26313051aeda9c3c2f6361bcf20668e58d3 100644 (file)
@@ -19,7 +19,6 @@
 
 <%@ taglib uri="/webwork" prefix="ww" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<ww:set name="organisationInfo" value="organisationInfo"/>
 <c:if test="${!empty(organisationLogo)}">
   <ww:set name="organisationUrl" value="organisationUrl"/>
   <c:choose>