*/
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
*
*/
public abstract class AbstractAppearanceAction
extends PlexusActionSupport
+ implements Preparable
{
/**
* Archiva Application Configuration
{
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());
+ }
+ }
+ }
}
* 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.
*
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
+}
<!-- .\ 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">
<%@ 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> </th>
+ <td>
+ <img src="${organisationLogo}" title="${organisationName}" border="0" alt=""/>
+ </td>
+ </tr>
</table>
</body>
</html>
<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>
<%@ 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>