]> source.dussan.org Git - archiva.git/commitdiff
MRM-829 - Current work
authorJames William Dumay <jdumay@apache.org>
Wed, 2 Jul 2008 06:29:02 +0000 (06:29 +0000)
committerJames William Dumay <jdumay@apache.org>
Wed, 2 Jul 2008 06:29:02 +0000 (06:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-829@673294 13f79535-47bb-0310-9956-ffa450edef68

14 files changed:
archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
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/CompanyInfoAction.java [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/ConfigureAppearanceAction.java [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditPomAction.java [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance-validation.xml
archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance.properties
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/admin/editPom.jsp [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp

index 1455d9f71b3ffa0557e979fae2343f9b1ebd4f1f..b7523ef1329b9cab662751d961947562643a4a2b 100644 (file)
             The webapp configuration.
           </description>
         </field>
+        <field>
+          <name>organisationInfo</name>
+          <version>1.1.0+</version>
+          <association>
+            <type>OrganisationInformation</type>
+            <multiplicity>1</multiplicity>
+          </association>
+          <description>
+            The organisation info.
+          </description>
+        </field>  
       </fields>
       <codeSegments>
         <codeSegment>
 
     -->
 
+    <class>
+      <name>OrganisationInformation</name>
+      <version>1.1.0+</version>
+      <description>
+        The organisation information settings.
+      </description>
+      <fields>
+        <field>
+          <name>name</name>
+          <description>name of the organisation</description>
+          <version>1.1.0+</version>
+          <association>
+            <type>String</type>
+          </association>
+        </field>
+        <field>
+          <name>url</name>
+          <description>name of the organisation</description>
+          <version>1.1.0+</version>
+          <association>
+            <type>String</type>
+          </association>
+        </field>
+        <field>
+          <name>logoLocation</name>
+          <description>name of the organisation</description>
+          <version>1.1.0+</version>
+          <association>
+            <type>String</type>
+          </association>
+        </field>
+      </fields>
+    </class>
+
     <class>
       <name>WebappConfiguration</name>
       <version>1.0.0+</version>
index 8fcaeb5c002f392f87cab7f0f5203e09fe97607d..b76e2e45bd0a12d447fa1c6fa35e4401e3317b4f 100644 (file)
@@ -19,15 +19,9 @@ package org.apache.maven.archiva.web.action.admin.appearance;
  * under the License.
  */
 
-import org.apache.commons.lang.StringUtils;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.codehaus.plexus.xwork.action.PlexusActionSupport;
 
-import java.io.File;
-import java.util.Map;
-
 /**
  * AbstractAppearanceAction 
  *
@@ -38,33 +32,44 @@ public abstract class AbstractAppearanceAction
     extends PlexusActionSupport
 {
     /**
-     * @plexus.requirement role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
-     */
-    private Map<String, ArtifactRepositoryLayout> repositoryLayouts;
-
-    /**
+     * Archiva Application Configuration
      * @plexus.requirement
      */
-    private ArtifactRepositoryFactory repoFactory;
+    protected ArchivaConfiguration configuration;
+    
+    private String organisationLogo;
+
+    private String organisationUrl;
 
-    protected ArtifactRepository createLocalRepository()
+    private String organisationName;
+    
+    public String getOrganisationLogo() 
     {
-        String id = "archiva-local-repo";
-        String layout = "default";
-        String directory = System.getProperty( "user.home" ) + "/.m2/archiva";
+        return organisationLogo;
+    }
 
-        ArtifactRepositoryLayout repositoryLayout = (ArtifactRepositoryLayout) repositoryLayouts.get( layout );
-        File repository = new File( directory );
-        repository.mkdirs();
+    public String getOrganisationName() 
+    {
+        return organisationName;
+    }
 
-        String repoDir = repository.toURI().toString();
-        //workaround for spaces non converted by PathUtils in wagon
-        //TODO: remove it when PathUtils will be fixed
-        if ( repoDir.indexOf( "%20" ) >= 0 )
-        {
-            repoDir = StringUtils.replace( repoDir, "%20", " " );
-        }
+    public String getOrganisationUrl() 
+    {
+        return organisationUrl;
+    }
+
+    public void setOrganisationLogo(String organisationLogo) 
+    {
+        this.organisationLogo = organisationLogo;
+    }
 
-        return repoFactory.createArtifactRepository( id, repoDir, repositoryLayout, null, null );
+    public void setOrganisationName(String organisationName) 
+    {
+        this.organisationName = organisationName;
+    }
+
+    public void setOrganisationUrl(String organisationUrl) 
+    {
+        this.organisationUrl = organisationUrl;
     }
 }
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/CompanyInfoAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/CompanyInfoAction.java
deleted file mode 100644 (file)
index c682f81..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.apache.maven.archiva.web.action.admin.appearance;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.model.Model;
-import org.apache.maven.shared.app.company.CompanyPomHandler;
-import org.apache.maven.shared.app.configuration.MavenAppConfiguration;
-
-/**
- * Stores the company information for displaying on the page.
- *
- * @plexus.component role="com.opensymphony.xwork.Action" role-hint="companyInfo"
- */
-public class CompanyInfoAction
-    extends AbstractAppearanceAction
-{
-    private String companyLogo;
-
-    private String companyUrl;
-
-    private String companyName;
-
-    /**
-     * @plexus.requirement
-     */
-    private CompanyPomHandler handler;
-
-    /**
-     * @plexus.requirement
-     */
-    private MavenAppConfiguration appConfigurationStore;
-
-    public String execute()
-        throws Exception
-    {
-        Model model = handler.getCompanyPomModel( appConfigurationStore.getConfiguration().getCompanyPom(),
-                                                  createLocalRepository() );
-
-        if ( model != null )
-        {
-            if ( model.getOrganization() != null )
-            {
-                companyName = model.getOrganization().getName();
-                companyUrl = model.getOrganization().getUrl();
-            }
-
-            companyLogo = model.getProperties().getProperty( "organization.logo" );
-        }
-
-        return SUCCESS;
-    }
-
-    public String getCompanyLogo()
-    {
-        return companyLogo;
-    }
-
-    public String getCompanyUrl()
-    {
-        return companyUrl;
-    }
-
-    public String getCompanyName()
-    {
-        return companyName;
-    }
-}
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/ConfigureAppearanceAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/ConfigureAppearanceAction.java
deleted file mode 100644 (file)
index 093bc6f..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-package org.apache.maven.archiva.web.action.admin.appearance;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import com.opensymphony.xwork.ModelDriven;
-import com.opensymphony.xwork.Preparable;
-
-import org.apache.maven.archiva.security.ArchivaRoleConstants;
-import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
-import org.apache.maven.model.Model;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.maven.shared.app.company.CompanyPomHandler;
-import org.apache.maven.shared.app.configuration.Configuration;
-import org.apache.maven.shared.app.configuration.MavenAppConfiguration;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.xwork.interceptor.SecureAction;
-import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
-import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException;
-import org.codehaus.plexus.registry.RegistryException;
-
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:brett@apache.org">Brett Porter</a>
- * @version $Id: ConfigurationAction.java 480950 2006-11-30 14:58:35Z evenisse $
- * @plexus.component role="com.opensymphony.xwork.Action"
- *                   role-hint="configureAppearance"
- */
-public class ConfigureAppearanceAction
-    extends AbstractAppearanceAction
-    implements ModelDriven, SecureAction, Preparable
-{
-    /**
-     * @plexus.requirement
-     */
-    private MavenAppConfiguration appConfigurationStore;
-
-    /**
-     * The configuration.
-     */
-    private Configuration configuration;
-
-    private Model companyModel;
-
-    /**
-     * @plexus.requirement
-     */
-    private CompanyPomHandler companyPomHandler;
-
-    public String execute()
-        throws IOException, RegistryException
-    {
-        appConfigurationStore.save( configuration );
-
-        return SUCCESS;
-    }
-
-    public Object getModel()
-    {
-        return configuration;
-    }
-
-    public void prepare()
-        throws ProjectBuildingException, ArtifactMetadataRetrievalException
-    {
-        configuration = appConfigurationStore.getConfiguration();
-
-        companyModel = companyPomHandler.getCompanyPomModel( configuration.getCompanyPom(), createLocalRepository() );
-    }
-
-    public SecureActionBundle getSecureActionBundle()
-        throws SecureActionException
-    {
-        SecureActionBundle bundle = new SecureActionBundle();
-        bundle.setRequiresAuthentication( true );
-        bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL );
-
-        return bundle;
-    }
-
-    public Model getCompanyModel()
-    {
-        return companyModel;
-    }
-}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java
new file mode 100644 (file)
index 0000000..1304b50
--- /dev/null
@@ -0,0 +1,74 @@
+package org.apache.maven.archiva.web.action.admin.appearance;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.codehaus.plexus.redback.xwork.interceptor.SecureAction;
+
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;
+import org.apache.maven.archiva.configuration.OrganisationInformation;
+import org.apache.maven.archiva.security.ArchivaRoleConstants;
+import org.codehaus.plexus.redback.rbac.Resource;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException;
+import org.codehaus.plexus.registry.RegistryException;
+
+/**
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @version $Id: ConfigurationAction.java 480950 2006-11-30 14:58:35Z evenisse $
+ * 
+ * @plexus.component role="com.opensymphony.xwork.Action"
+ *                   role-hint="editOrganisationInfo"
+ */
+public class EditOrganisationInfoAction
+    extends AbstractAppearanceAction
+    implements SecureAction
+{
+    @Override
+    public String execute()
+        throws RegistryException, IndeterminateConfigurationException
+    {
+        Configuration config = configuration.getConfiguration();
+        if (config != null)
+        {
+            OrganisationInformation orgInfo = config.getOrganisationInfo();
+            if (orgInfo == null)
+            {
+                config.setOrganisationInfo(orgInfo);
+            }
+            
+            orgInfo.setLogoLocation(getOrganisationLogo());
+            orgInfo.setName(getOrganisationName());
+            orgInfo.setUrl(getOrganisationUrl());
+            
+            configuration.save(config);
+        }
+        return SUCCESS;
+    }
+    
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL );
+        return bundle;
+    }
+}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditPomAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditPomAction.java
deleted file mode 100644 (file)
index 874eded..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.apache.maven.archiva.web.action.admin.appearance;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import com.opensymphony.xwork.ModelDriven;
-import com.opensymphony.xwork.Preparable;
-
-import org.apache.maven.archiva.security.ArchivaRoleConstants;
-import org.apache.maven.artifact.installer.ArtifactInstallationException;
-import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
-import org.apache.maven.model.Model;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.maven.shared.app.company.CompanyPomHandler;
-import org.apache.maven.shared.app.configuration.CompanyPom;
-import org.apache.maven.shared.app.configuration.Configuration;
-import org.apache.maven.shared.app.configuration.MavenAppConfiguration;
-import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.redback.xwork.interceptor.SecureAction;
-import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
-import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException;
-
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:brett@apache.org">Brett Porter</a>
- * @version $Id: ConfigurationAction.java 480950 2006-11-30 14:58:35Z evenisse $
- * 
- * @plexus.component role="com.opensymphony.xwork.Action"
- *                   role-hint="editPom"
- */
-public class EditPomAction
-    extends AbstractAppearanceAction
-    implements ModelDriven, SecureAction, Preparable
-{
-    /**
-     * @plexus.requirement
-     */
-     private MavenAppConfiguration appConfigurationStore;
-
-    /**
-     * The configuration.
-     */
-    private Configuration configuration;
-
-    /**
-     * @plexus.requirement
-     */
-     private CompanyPomHandler companyPomHandler;
-
-     private Model companyModel;
-
-    public String execute()
-        throws IOException, ArtifactInstallationException
-    {
-        // TODO: hack for passed in String[]
-        String[] logo = (String[]) companyModel.getProperties().get( "organization.logo" );
-        if ( logo != null )
-        {
-            companyModel.getProperties().put( "organization.logo", logo[0] );
-        }
-
-        companyPomHandler.save( companyModel, createLocalRepository() );
-
-        return SUCCESS;
-    }
-
-    public Object getModel()
-    {
-        return companyModel;
-    }
-
-    public void prepare()
-        throws ProjectBuildingException, ArtifactMetadataRetrievalException
-    {
-        configuration = appConfigurationStore.getConfiguration();
-
-        CompanyPom companyPom = configuration.getCompanyPom();
-        companyModel = companyPomHandler.getCompanyPomModel( companyPom, createLocalRepository() );
-
-        if ( companyModel == null )
-        {
-            companyModel = new Model();
-            companyModel.setModelVersion( "4.0.0" );
-            companyModel.setPackaging( "pom" );
-
-            if ( companyPom != null )
-            {
-                companyModel.setGroupId( companyPom.getGroupId() );
-                companyModel.setArtifactId( companyPom.getArtifactId() );
-            }
-        }
-    }
-
-    public SecureActionBundle getSecureActionBundle()
-        throws SecureActionException
-    {
-        SecureActionBundle bundle = new SecureActionBundle();
-        bundle.setRequiresAuthentication( true );
-        bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL );
-
-        return bundle;
-    }
-
-    public Model getCompanyModel()
-    {
-        return companyModel;
-    }
-}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java
new file mode 100644 (file)
index 0000000..2378027
--- /dev/null
@@ -0,0 +1,50 @@
+package org.apache.maven.archiva.web.action.admin.appearance;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * 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.
+ *
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="organisationInfo"
+ */
+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 0628a0dcc73b8b1aabd692ddefc0e5ba5302fd19..64c011f1f481474c6d67e0409d7ffc43daf29b56 100644 (file)
     "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
 
 <validators>
-  <field name="companyPom.groupId">
-    <field-validator type="requiredstring">
-      <message key="appearance.groupId.required"/>
+  <field name="organisationUrl">
+    <field-validator type="url">
+      <message key="appearance.organisation.url"/>
     </field-validator>
   </field>
-  <field name="companyPom.artifactId">
-    <field-validator type="requiredstring">
-      <message key="appearance.artifactId.required"/>
+  <field name="organisationLogo">
+    <field-validator type="url">
+      <message key="appearance.organisation.logourl"/>
     </field-validator>
   </field>
 </validators>
\ No newline at end of file
index bfcaf5bcfec51d68ec625d78d8ceb2978abcad12..2084ccd4ab233d7e3df299ef1d606b08f60acbda 100644 (file)
@@ -17,5 +17,5 @@
 # under the License.
 #
 
-appearance.groupId.required = You must define a group identifier.
-appearance.artifactId.required = You must define an artifact identifier.
\ No newline at end of file
+appearance.organisation.url = You must define an organisation url."
+appearance.organisation.logourl = You must define an organisation logo url."
\ No newline at end of file
index c85744f25112f774e630ad3aac55cfe15b8dcede..3dda8324c7cf41a7ee46aaec665c4c5e0000818a 100644 (file)
 
   <package name="components" namespace="/components" extends="webwork-default">
     <default-interceptor-ref name="basicStack"/>
-    <action name="companyInfo" class="companyInfo">
+    <action name="companyInfo" class="organisationInfo">
       <result>/WEB-INF/jsp/components/companyLogo.jsp</result>
     </action>
   </package>
 
     <!-- The following are needed by the maven-app-configuration-web artifact -->
 
-    <action name="configureAppearance" class="configureAppearance" method="input">
+    <action name="configureAppearance" class="organisationInfo" method="input">
       <result name="input">/WEB-INF/jsp/admin/appearance.jsp</result>
     </action>
 
-    <action name="editAppearance" class="configureAppearance" method="input">
+    <action name="editAppearance" class="editOrganisationInfo" method="input">
       <result name="input">/WEB-INF/jsp/admin/editAppearance.jsp</result>
     </action>
 
-    <action name="saveAppearance" class="configureAppearance">
+    <action name="saveAppearance" class="editOrganisationInfo">
       <result name="input">/WEB-INF/jsp/admin/editAppearance.jsp</result>
       <result type="redirect-action">
         <param name="actionName">configureAppearance</param>
       </result>
     </action>
 
-    <action name="editCompanyPom" class="editPom" method="input">
-      <result name="input">/WEB-INF/jsp/admin/editPom.jsp</result>
-    </action>
-
-    <action name="saveCompanyPom" class="editPom">
-      <result name="input">/WEB-INF/jsp/admin/editPom.jsp</result>
-      <result type="redirect-action">
-        <param name="actionName">configureAppearance</param>
-        <param name="namespace">/admin</param>
-      </result>
-    </action>
-
     <!-- .\ LEGACY SUPPORT \.__________________________________________ -->
 
     <action name="legacyArtifactPath" class="legacyArtifactPathAction" method="input">
index dfebffbc9582cd0c193455051bd755133ae2440f..d1e15602c2cb44cee63976b4c2e4c42047c591eb 100644 (file)
 <div style="float: right">
   <a href="<ww:url action='editAppearance' />">Edit</a>
 </div>
-<h2>Company Details</h2>
+<h2>Organisation Details</h2>
 
 <p>
-  The logo in the top right of the screen is controlled by your selected 'company POM'.
+  The logo in the top right of the screen is controlled by the following settings.
+  <a href="<ww:url action='editAppearance' />">Change your appearence</a>
 </p>
 
-<ww:set name="companyPom" value="companyPom"/>
-
-<c:if test="${empty(companyPom.groupId) || empty(companyPom.artifactId)}">
-  <p>
-    You have not yet specified a company POM. <a href="<ww:url action='editAppearance' />">Select a Company POM</a>
-  </p>
-</c:if>
-
-<c:if test="${!empty(companyPom.groupId) && !empty(companyPom.artifactId)}">
-  <p>
-    Your selected company POM is below. If you would like to change the organization name, url or logo, you can
-    <a href="<ww:url action='editCompanyPom'/>">edit the POM</a>.
-  </p>
-
-  <ww:set name="companyModel" value="companyModel"/>
-  <table>
-    <ww:label name="companyPom.groupId" label="Group ID"/>
-    <ww:label name="companyPom.artifactId" label="Artifact ID"/>
-    <c:if test="${companyModel != null}">
-      <ww:label name="companyModel.version" label="Version"/>
-    </c:if>
-  </table>
-
-  <div style="float: right">
-    <a href="<ww:url action='editCompanyPom' />">Edit Company POM</a>
-  </div>
-  <h3>POM Information</h3>
-
-  <c:choose>
-    <c:when test="${companyModel != null}">
-      <table>
-        <tr>
-          <th>Name</th>
-          <td>${companyModel.organization.name}</td>
-        </tr>
-        <tr>
-          <th>URL</th>
-          <td><a href="${companyModel.organization.url}">
-            <code>${companyModel.organization.url}</code>
-          </a></td>
-        </tr>
-        <tr>
-          <th>Logo URL</th>
-          <td>
-            <code>${companyModel.properties['organization.logo']}</code>
-          </td>
-        </tr>
-      </table>
-    </c:when>
-    <c:otherwise>
-      Company POM '${companyPom.groupId}:${companyPom.artifactId}' doesn't exist.
-      <a href="<ww:url action='editCompanyPom' />">Create company POM</a>
-    </c:otherwise>
-  </c:choose>
-</c:if>
 </body>
 </html>
index 9061a3137e262913dc84aa754b5cc0743039c479..23ac0ae9a9aa8c8b52684c0cab9e2e88dffc52b6 100644 (file)
@@ -27,7 +27,7 @@
 <body>
 <h1>Appearance</h1>
 
-<h2>Company Details</h2>
+<h2>Organisation Details</h2>
 
 <p>
   Enter the details of the company super POM below. If it exists, the organization name, URL and logo will be read
 </p>
 
 <ww:actionmessage/>
-<ww:form method="post" action="saveAppearance" namespace="/admin" validate="true" theme="xhtml">
-  <ww:textfield name="companyPom.groupId" label="Group ID"/>
-  <ww:textfield name="companyPom.artifactId" label="Artifact ID"/>
+<ww:form method="post" action="editAppearance" namespace="/admin" validate="true" theme="xhtml">
+  <ww:textfield name="editAppearance.organisationName" label="Organisation Name"/>
+  <ww:textfield name="editAppearance.organisationUrl" label="Organisation Url"/>
+  <ww:textfield name="editAppearance.organisationLogo" label="Orgnaisation Logo"/>
   <ww:submit value="Save"/>
 </ww:form>
 </body>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editPom.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editPom.jsp
deleted file mode 100644 (file)
index 7887ea2..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-
-<%@ taglib prefix="ww" uri="/webwork" %>
-<html>
-<head>
-  <title>Edit Company POM</title>
-  <ww:head/>
-</head>
-
-<body>
-<h1>Company POM</h1>
-
-<ww:actionmessage/>
-<ww:form method="post" action="saveCompanyPom" namespace="/admin" validate="true" theme="xhtml">
-  <ww:label name="companyModel.groupId" label="Group ID"/>
-  <ww:label name="companyModel.artifactId" label="Artifact ID"/>
-  <tr>
-    <td>Version</td>
-    <td>
-      <ww:property value="companyModel.version"/>
-      <i>(The version will automatically be incremented when you save this form)</i>
-    </td>
-  </tr>
-  <tr>
-    <td></td>
-    <td><h2>Organization</h2></td>
-  </tr>
-  <ww:textfield name="companyModel.organization.name" size="40" label="Name"/>
-  <ww:textfield name="companyModel.organization.url" size="70" label="URL"/>
-  <%-- TODO: how to get it to be a string, not a String[]? --%>
-  <ww:textfield name="companyModel.properties['organization.logo']" size="70" label="Logo URL"/>
-  <ww:submit value="Save"/>
-</ww:form>
-
-</body>
-</html>
\ No newline at end of file
index 1a1815a3fc73e391cbba97290852a226061a2911..41b188038b9da604482577ce2526ca98c8ff7db6 100644 (file)
@@ -19,7 +19,7 @@
 
 <%@ taglib uri="/webwork" prefix="ww" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<ww:set name="companyLogo" value="companyLogo"/>
+<ww:set name="organisationInfo" value="organisationInfo"/>
 <c:if test="${!empty(companyLogo)}">
   <ww:set name="companyUrl" value="companyUrl"/>
   <c:choose>