continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r698087 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ java/org/apache/maven/continuum/web/action/admin/ resources/ resources/localization/ resources/org/apache/maven/continuum/web/action/admin/...
Date Tue, 23 Sep 2008 03:46:45 GMT
Author: ctan
Date: Mon Sep 22 20:46:45 2008
New Revision: 698087

URL: http://svn.apache.org/viewvc?rev=698087&view=rev
Log:
[CONTINUUM-1886]
- releaseOutputDirectory is not required anymore
- will be send to configuration page if release button is clicked ( for m2 projects only )

Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction-configuration-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java?rev=698087&r1=698086&r2=698087&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
Mon Sep 22 20:46:45 2008
@@ -55,6 +55,8 @@
 
     private String projectGroupName = "";
 
+    protected static final String REQUIRES_CONFIGURATION = "releaseOutputDir-required";
+
     public String promptReleaseGoal()
         throws Exception
     {
@@ -67,6 +69,12 @@
             return REQUIRES_AUTHORIZATION;
         }
 
+        // check if releaseOutputDirectory is already set
+        if ( getContinuum().getConfiguration().getReleaseOutputDirectory() == null )
+        {
+            return REQUIRES_CONFIGURATION;
+        }
+        
         project = getContinuum().getProjectWithAllDetails( projectId );
 
         String releaseId = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId()
);

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java?rev=698087&r1=698086&r2=698087&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
Mon Sep 22 20:46:45 2008
@@ -57,6 +57,8 @@
     
     private String releaseOutputDirectory;
 
+    private boolean requireReleaseOutput;
+
     public void prepare()
     {
         ConfigurationService configuration = getContinuum().getConfiguration();
@@ -94,10 +96,18 @@
         {
             releaseOutputDirectory = releaseOutputDirectoryFile.getAbsolutePath();
         }
+        
+        String requireRelease = ServletActionContext.getRequest().getParameter( "requireReleaseOutput"
);
+        setRequireReleaseOutput( new Boolean( requireRelease ) );
     }
 
     public String input()
     {
+        if ( isRequireReleaseOutput() )
+        {
+            addActionError( "configuration.releaseOutputDirectory.required" );
+        }
+        
         return INPUT;
     }
 
@@ -123,7 +133,19 @@
 
         configuration.setInitialized( true );
 
-        configuration.setReleaseOutputDirectory( new File( releaseOutputDirectory ) );
+        if ( StringUtils.isNotEmpty( releaseOutputDirectory ) )
+        {
+            configuration.setReleaseOutputDirectory( new File( releaseOutputDirectory ) );
+        }
+        else if ( isRequireReleaseOutput() )
+        {
+            addActionError( "configuration.releaseOutputDirectory.required" );
+            return ERROR;
+        }
+        else
+        {
+            configuration.setReleaseOutputDirectory( null );
+        }
 
         configuration.store();
 
@@ -189,4 +211,14 @@
     {
         this.releaseOutputDirectory = releaseOutputDirectory;
     }
+
+    public boolean isRequireReleaseOutput()
+    {
+        return requireReleaseOutput;
+    }
+    
+    public void setRequireReleaseOutput( boolean requireReleaseOutput )
+    {
+        this.requireReleaseOutput = requireReleaseOutput;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=698087&r1=698086&r2=698087&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Mon Sep 22 20:46:45 2008
@@ -237,6 +237,7 @@
 configuration.companyUrl.message = Enter the URL of the official company website
 configuration.releaseOutputDirectory.label = Release Output Directory
 configuration.releaseOutputDirectory.message = Enter the release output directory of the
Continuum web application
+configuration.releaseOutputDirectory.required = You must define a release output directory
 
 # ----------------------------------------------------------------------
 # Page: Add Project

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction-configuration-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction-configuration-validation.xml?rev=698087&r1=698086&r2=698087&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction-configuration-validation.xml
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction-configuration-validation.xml
Mon Sep 22 20:46:45 2008
@@ -40,9 +40,4 @@
       <message key="configuration.baseUrl.invalid"/>
     </field-validator>
   </field>
-  <field name="releaseOutputDirectory">
-    <field-validator type="requiredstring">
-      <message key="configuration.releaseOutputDirectory.required"/>
-    </field-validator>
-  </field>
 </validators>

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction.properties?rev=698087&r1=698086&r2=698087&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/ConfigurationAction.properties
Mon Sep 22 20:46:45 2008
@@ -20,5 +20,4 @@
 configuration.workingDirectory.required = You must define a working directory.
 configuration.buildOutputDirectory.required = You must define a build output directory.
 configuration.baseUrl.required = You must define a URL.
-configuration.baseUrl.invalid = You must define a valid URL.
-configuration.releaseOutputDirectory.required = You must define a release output directory.
\ No newline at end of file
+configuration.baseUrl.invalid = You must define a valid URL.
\ No newline at end of file

Modified: continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=698087&r1=698086&r2=698087&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Mon Sep 22 20:46:45 2008
@@ -442,6 +442,12 @@
     -->
     <action name="releasePromptGoal" class="releaseProject" method="promptReleaseGoal">
       <result name="success">/WEB-INF/jsp/releaseProject.jsp</result>
+      <result name="releaseOutputDir-required" type="redirect-action">
+        <param name="actionName">configuration</param>
+        <param name="namespace">/admin</param>
+        <param name="method">input</param>
+        <param name="requireReleaseOutput">true</param>
+      </result>
     </action>
 
     <action name="releaseProject" class="releaseProject">
@@ -560,6 +566,7 @@
       <interceptor-ref name="unconfiguredContinuumStack"/>
       <result name="input">/WEB-INF/jsp/admin/configurationEdit.jsp</result>
       <result name="success">/WEB-INF/jsp/admin/configuration.jsp</result>
+      <result name="error">/WEB-INF/jsp/admin/configurationEdit.jsp</result>
     </action>
 
     <action name="configureAppearance" class="configureAppearance" method="input">

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp?rev=698087&r1=698086&r2=698087&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
Mon Sep 22 20:46:45 2008
@@ -19,6 +19,7 @@
 
 <%@ taglib uri="/webwork" prefix="ww" %>
 <%@ taglib uri="continuum" prefix="c1" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
 <html>
 <ww:i18n name="localization.Continuum">
   <head>
@@ -35,12 +36,13 @@
 
     <ww:form action="configuration!save" method="post">
 
-      <ww:if test="hasActionErrors()">
-        <h3>Action Error</h3>
-      </ww:if>
-      <p>
-        <ww:actionerror/>
-      </p>
+      <c:if test="${!empty actionErrors}">
+        <div class="errormessage">
+          <c:forEach items="${actionErrors}" var="actionError">
+            <p><ww:text name="${actionError}"/></p>
+          </c:forEach>
+        </div>
+      </c:if>
 
       <div class="axial">
 
@@ -62,7 +64,7 @@
             </ww:textfield>
 
             <ww:textfield label="%{getText('configuration.releaseOutputDirectory.label')}"
name="releaseOutputDirectory"
-                          required="true">
+            			  required="${requireReleaseOutput}">
               <ww:param name="desc"><p>
                 <ww:text name="configuration.releaseOutputDirectory.message"/>
               </ww:param>
@@ -81,6 +83,7 @@
               </p></ww:param>
             </ww:textfield>
 
+            <ww:hidden name="requireReleaseOutput"/>
           </tbody>
         </table>
         <div class="functnbar3">



Mime
View raw message